Class GkeHubClient (2.15.1)

The GKE Hub service handles the registration of many Kubernetes clusters to Google Cloud, and the management of multi-cluster features over those clusters.

The GKE Hub service operates on the following resources:

GKE Hub is currently available in the global region and all regions in https://cloud.google.com/compute/docs/regions-zones. Feature is only available in global region while membership is global region and all the regions.

Membership management may be non-trivial: it is recommended to use one of the Google-provided client libraries or tools where possible when working with Membership resources.

Equality

Instances of this class created via copy-construction or copy-assignment always compare equal. Instances created with equal std::shared_ptr<*Connection> objects compare equal. Objects that compare equal share the same underlying resources.

Performance

Creating a new instance of this class is a relatively expensive operation, new objects establish new connections to the service. In contrast, copy-construction, move-construction, and the corresponding assignment operations are relatively efficient as the copies share all underlying resources.

Thread Safety

Concurrent access to different instances of this class, even if they compare equal, is guaranteed to work. Two or more threads operating on the same instance of this class is not guaranteed to work. Since copy-construction and move-construction is a relatively efficient operation, consider using such a copy when using this class from multiple threads.

Constructors

GkeHubClient(GkeHubClient const &)

Copy and move support

Parameter
Name Description
GkeHubClient const &

GkeHubClient(GkeHubClient &&)

Copy and move support

Parameter
Name Description
GkeHubClient &&

GkeHubClient(std::shared_ptr< GkeHubConnection >, Options)

Parameters
Name Description
connection std::shared_ptr< GkeHubConnection >
opts Options

Operators

operator=(GkeHubClient const &)

Copy and move support

Parameter
Name Description
GkeHubClient const &
Returns
Type Description
GkeHubClient &

operator=(GkeHubClient &&)

Copy and move support

Parameter
Name Description
GkeHubClient &&
Returns
Type Description
GkeHubClient &

Functions

ListMemberships(std::string const &, Options)

Lists Memberships in a given project and location.

Parameters
Name Description
parent std::string const &

Required. The parent (project and location) where the Memberships will be listed. Specified in the format projects/*/locations/*. projects/*/locations/- list memberships in all the regions.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::gkehub::v1::Membership >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.gkehub.v1.Membership, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListMemberships(google::cloud::gkehub::v1::ListMembershipsRequest, Options)

Lists Memberships in a given project and location.

Parameters
Name Description
request google::cloud::gkehub::v1::ListMembershipsRequest

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.gkehub.v1.ListMembershipsRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::gkehub::v1::Membership >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.gkehub.v1.Membership, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListFeatures(std::string const &, Options)

Lists Features in a given project and location.

Parameters
Name Description
parent std::string const &

Required. The parent (project and location) where the Features will be listed. Specified in the format projects/*/locations/*.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::gkehub::v1::Feature >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.gkehub.v1.Feature, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

ListFeatures(google::cloud::gkehub::v1::ListFeaturesRequest, Options)

Lists Features in a given project and location.

Parameters
Name Description
request google::cloud::gkehub::v1::ListFeaturesRequest

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.gkehub.v1.ListFeaturesRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StreamRange< google::cloud::gkehub::v1::Feature >

a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has begin() and end() member functions returning a iterator class meeting the input iterator requirements. The value type for this iterator is a StatusOr as the iteration may fail even after some values are retrieved successfully, for example, if there is a network disconnect. An empty set of results does not indicate an error, it indicates that there are no resources meeting the request criteria. On a successful iteration the StatusOr<T> contains elements of type google.cloud.gkehub.v1.Feature, or rather, the C++ class generated by Protobuf from that type. Please consult the Protobuf documentation for details on the Protobuf mapping rules.

GetMembership(std::string const &, Options)

Gets the details of a Membership.

Parameters
Name Description
name std::string const &

Required. The Membership resource name in the format projects/*/locations/*/memberships/*.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::gkehub::v1::Membership >

the result of the RPC. The response message type (google.cloud.gkehub.v1.Membership) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetMembership(google::cloud::gkehub::v1::GetMembershipRequest const &, Options)

Gets the details of a Membership.

Parameters
Name Description
request google::cloud::gkehub::v1::GetMembershipRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.gkehub.v1.GetMembershipRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::gkehub::v1::Membership >

the result of the RPC. The response message type (google.cloud.gkehub.v1.Membership) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetFeature(std::string const &, Options)

Gets details of a single Feature.

Parameters
Name Description
name std::string const &

Required. The Feature resource name in the format projects/*/locations/*/features/*

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::gkehub::v1::Feature >

the result of the RPC. The response message type (google.cloud.gkehub.v1.Feature) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

GetFeature(google::cloud::gkehub::v1::GetFeatureRequest const &, Options)

Gets details of a single Feature.

Parameters
Name Description
request google::cloud::gkehub::v1::GetFeatureRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.gkehub.v1.GetFeatureRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::gkehub::v1::Feature >

the result of the RPC. The response message type (google.cloud.gkehub.v1.Feature) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.

CreateMembership(std::string const &, google::cloud::gkehub::v1::Membership const &, std::string const &, Options)

Creates a new Membership.

This is currently only supported for GKE clusters on Google Cloud. To register other clusters, follow the instructions at https://cloud.google.com/anthos/multicluster-management/connect/registering-a-cluster.

Parameters
Name Description
parent std::string const &

Required. The parent (project and location) where the Memberships will be created. Specified in the format projects/*/locations/*.

resource google::cloud::gkehub::v1::Membership const &

Required. The membership to create.

membership_id std::string const &

Required. Client chosen ID for the membership. membership_id must be a valid RFC 1123 compliant DNS label:

  1. At most 63 characters in length
  2. It must consist of lower case alphanumeric characters or -
  3. It must start and end with an alphanumeric character
    Which can be expressed as the regex: [a-z0-9]([-a-z0-9]*[a-z0-9])?, with a maximum length of 63 characters.
opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::gkehub::v1::Membership > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.gkehub.v1.Membership proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

CreateMembership(google::cloud::gkehub::v1::CreateMembershipRequest const &, Options)

Creates a new Membership.

This is currently only supported for GKE clusters on Google Cloud. To register other clusters, follow the instructions at https://cloud.google.com/anthos/multicluster-management/connect/registering-a-cluster.

Parameters
Name Description
request google::cloud::gkehub::v1::CreateMembershipRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.gkehub.v1.CreateMembershipRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::gkehub::v1::Membership > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.gkehub.v1.Membership proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

CreateFeature(std::string const &, google::cloud::gkehub::v1::Feature const &, std::string const &, Options)

Adds a new Feature.

Parameters
Name Description
parent std::string const &

Required. The parent (project and location) where the Feature will be created. Specified in the format projects/*/locations/*.

resource google::cloud::gkehub::v1::Feature const &

The Feature resource to create.

feature_id std::string const &

The ID of the feature to create.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::gkehub::v1::Feature > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.gkehub.v1.Feature proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

CreateFeature(google::cloud::gkehub::v1::CreateFeatureRequest const &, Options)

Adds a new Feature.

Parameters
Name Description
request google::cloud::gkehub::v1::CreateFeatureRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.gkehub.v1.CreateFeatureRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::gkehub::v1::Feature > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.gkehub.v1.Feature proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

DeleteMembership(std::string const &, Options)

Removes a Membership.

This is currently only supported for GKE clusters on Google Cloud. To unregister other clusters, follow the instructions at https://cloud.google.com/anthos/multicluster-management/connect/unregistering-a-cluster.

Parameters
Name Description
name std::string const &

Required. The Membership resource name in the format projects/*/locations/*/memberships/*.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::gkehub::v1::OperationMetadata > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.gkehub.v1.OperationMetadata proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

DeleteMembership(google::cloud::gkehub::v1::DeleteMembershipRequest const &, Options)

Removes a Membership.

This is currently only supported for GKE clusters on Google Cloud. To unregister other clusters, follow the instructions at https://cloud.google.com/anthos/multicluster-management/connect/unregistering-a-cluster.

Parameters
Name Description
request google::cloud::gkehub::v1::DeleteMembershipRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.gkehub.v1.DeleteMembershipRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::gkehub::v1::OperationMetadata > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.gkehub.v1.OperationMetadata proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

DeleteFeature(std::string const &, Options)

Removes a Feature.

Parameters
Name Description
name std::string const &

Required. The Feature resource name in the format projects/*/locations/*/features/*.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::gkehub::v1::OperationMetadata > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.gkehub.v1.OperationMetadata proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

DeleteFeature(google::cloud::gkehub::v1::DeleteFeatureRequest const &, Options)

Removes a Feature.

Parameters
Name Description
request google::cloud::gkehub::v1::DeleteFeatureRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.gkehub.v1.DeleteFeatureRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::gkehub::v1::OperationMetadata > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.gkehub.v1.OperationMetadata proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

UpdateMembership(std::string const &, google::cloud::gkehub::v1::Membership const &, google::protobuf::FieldMask const &, Options)

Updates an existing Membership.

Parameters
Name Description
name std::string const &

Required. The Membership resource name in the format projects/*/locations/*/memberships/*.

resource google::cloud::gkehub::v1::Membership const &

Required. Only fields specified in update_mask are updated. If you specify a field in the update_mask but don't specify its value here that field will be deleted. If you are updating a map field, set the value of a key to null or empty string to delete the key from the map. It's not possible to update a key's value to the empty string. If you specify the update_mask to be a special path "*", fully replaces all user-modifiable fields to match resource.

update_mask google::protobuf::FieldMask const &

Required. Mask of fields to update.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::gkehub::v1::Membership > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.gkehub.v1.Membership proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

UpdateMembership(google::cloud::gkehub::v1::UpdateMembershipRequest const &, Options)

Updates an existing Membership.

Parameters
Name Description
request google::cloud::gkehub::v1::UpdateMembershipRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.gkehub.v1.UpdateMembershipRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::gkehub::v1::Membership > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.gkehub.v1.Membership proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

UpdateFeature(std::string const &, google::cloud::gkehub::v1::Feature const &, google::protobuf::FieldMask const &, Options)

Updates an existing Feature.

Parameters
Name Description
name std::string const &

Required. The Feature resource name in the format projects/*/locations/*/features/*.

resource google::cloud::gkehub::v1::Feature const &

Only fields specified in update_mask are updated. If you specify a field in the update_mask but don't specify its value here that field will be deleted. If you are updating a map field, set the value of a key to null or empty string to delete the key from the map. It's not possible to update a key's value to the empty string. If you specify the update_mask to be a special path "*", fully replaces all user-modifiable fields to match resource.

update_mask google::protobuf::FieldMask const &

Mask of fields to update.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::gkehub::v1::Feature > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.gkehub.v1.Feature proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

UpdateFeature(google::cloud::gkehub::v1::UpdateFeatureRequest const &, Options)

Updates an existing Feature.

Parameters
Name Description
request google::cloud::gkehub::v1::UpdateFeatureRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.gkehub.v1.UpdateFeatureRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
future< StatusOr< google::cloud::gkehub::v1::Feature > >

A future that becomes satisfied when the LRO (Long Running Operation) completes or the polling policy in effect for this call is exhausted. The future is satisfied with an error if the LRO completes with an error or the polling policy is exhausted. In this case the StatusOr returned by the future contains the error. If the LRO completes successfully the value of the future contains the LRO's result. For this RPC the result is a google.cloud.gkehub.v1.Feature proto message. The C++ class representing this message is created by Protobuf, using the Protobuf mapping rules.

GenerateConnectManifest(google::cloud::gkehub::v1::GenerateConnectManifestRequest const &, Options)

Generates the manifest for deployment of the GKE connect agent.

This method is used internally by Google-provided libraries. Most clients should not need to call this method directly.

Parameters
Name Description
request google::cloud::gkehub::v1::GenerateConnectManifestRequest const &

Unary RPCs, such as the one wrapped by this function, receive a single request proto message which includes all the inputs for the RPC. In this case, the proto message is a google.cloud.gkehub.v1.GenerateConnectManifestRequest. Proto messages are converted to C++ classes by Protobuf, using the Protobuf mapping rules.

opts Options

Optional. Override the class-level options, such as retry and backoff policies.

Returns
Type Description
StatusOr< google::cloud::gkehub::v1::GenerateConnectManifestResponse >

the result of the RPC. The response message type (google.cloud.gkehub.v1.GenerateConnectManifestResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the StatusOr contains the error details.