This shows how to override the retry policies for container_v1::ClusterManagerClient:
auto options =
.
set<google::cloud::container_v1::
ClusterManagerConnectionIdempotencyPolicyOption>(
CustomIdempotencyPolicy().clone())
.set<google::cloud::container_v1::ClusterManagerRetryPolicyOption>(
ClusterManagerLimitedErrorCountRetryPolicy(3)
.clone())
.set<google::cloud::container_v1::ClusterManagerBackoffPolicyOption>(
std::chrono::milliseconds(200),
std::chrono::seconds(45),
2.0)
.clone());
auto connection =
connection,
std::chrono::minutes(5))
.clone()));
Options & set(ValueTypeT< T > v)
Google Kubernetes Engine Cluster Manager v1.
Definition: cluster_manager_client.h:62
Definition: cluster_manager_client.h:33
std::shared_ptr< ClusterManagerConnection > MakeClusterManagerConnection(Options options={})
A factory function to construct an object of type ClusterManagerConnection.
::google::cloud::internal::LimitedTimeRetryPolicy< container_v1_internal::ClusterManagerRetryTraits > ClusterManagerLimitedTimeRetryPolicy
Definition: cluster_manager_connection.h:43
google::cloud::internal::ExponentialBackoffPolicy ExponentialBackoffPolicy
Use with google::cloud::Options to configure the retry policy.
Definition: cluster_manager_options.h:39
Assuming you have created a custom idempotency policy. Such as:
ClusterManagerConnectionIdempotencyPolicy {
public:
~CustomIdempotencyPolicy() override = default;
std::unique_ptr<
clone() const override {
return std::make_unique<CustomIdempotencyPolicy>(*this);
}
};
Definition: cluster_manager_connection_idempotency_policy.h:33