Service Directory API for registering services.
It defines the following resource model:
- The API has a collection of Namespace resources, named
projects/*/locations/*/namespaces/*
. - Each Namespace has a collection of Service resources, named
projects/*/locations/*/namespaces/*/services/*
. - Each Service has a collection of Endpoint resources, named
projects/*/locations/*/namespaces/*/services/*/endpoints/*
.
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
RegistrationServiceClient(RegistrationServiceClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
RegistrationServiceClient const &
|
RegistrationServiceClient(RegistrationServiceClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
RegistrationServiceClient &&
|
RegistrationServiceClient(std::shared_ptr< RegistrationServiceConnection >, Options)
Parameters | |
---|---|
Name | Description |
connection |
std::shared_ptr< RegistrationServiceConnection >
|
opts |
Options
|
Operators
operator=(RegistrationServiceClient const &)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
RegistrationServiceClient const &
|
Returns | |
---|---|
Type | Description |
RegistrationServiceClient & |
operator=(RegistrationServiceClient &&)
Copy and move support
Parameter | |
---|---|
Name | Description |
|
RegistrationServiceClient &&
|
Returns | |
---|---|
Type | Description |
RegistrationServiceClient & |
Functions
CreateNamespace(std::string const &, google::cloud::servicedirectory::v1::Namespace const &, std::string const &, Options)
Creates a namespace, and returns the new namespace.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The resource name of the project and location the namespace will be created in. |
namespace_ |
google::cloud::servicedirectory::v1::Namespace const &
Required. A namespace with initial fields set. |
namespace_id |
std::string const &
Required. The Resource ID must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::servicedirectory::v1::Namespace > |
the result of the RPC. The response message type (google.cloud.servicedirectory.v1.Namespace) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
CreateNamespace(google::cloud::servicedirectory::v1::CreateNamespaceRequest const &, Options)
Creates a namespace, and returns the new namespace.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::servicedirectory::v1::CreateNamespaceRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::servicedirectory::v1::Namespace > |
the result of the RPC. The response message type (google.cloud.servicedirectory.v1.Namespace) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListNamespaces(std::string const &, Options)
Lists all namespaces.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The resource name of the project and location whose namespaces you'd like to list. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::servicedirectory::v1::Namespace > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListNamespaces(google::cloud::servicedirectory::v1::ListNamespacesRequest, Options)
Lists all namespaces.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::servicedirectory::v1::ListNamespacesRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::servicedirectory::v1::Namespace > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
GetNamespace(std::string const &, Options)
Gets a namespace.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The name of the namespace to retrieve. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::servicedirectory::v1::Namespace > |
the result of the RPC. The response message type (google.cloud.servicedirectory.v1.Namespace) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetNamespace(google::cloud::servicedirectory::v1::GetNamespaceRequest const &, Options)
Gets a namespace.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::servicedirectory::v1::GetNamespaceRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::servicedirectory::v1::Namespace > |
the result of the RPC. The response message type (google.cloud.servicedirectory.v1.Namespace) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateNamespace(google::cloud::servicedirectory::v1::Namespace const &, google::protobuf::FieldMask const &, Options)
Updates a namespace.
Parameters | |
---|---|
Name | Description |
namespace_ |
google::cloud::servicedirectory::v1::Namespace const &
Required. The updated namespace. |
update_mask |
google::protobuf::FieldMask const &
Required. List of fields to be updated in this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::servicedirectory::v1::Namespace > |
the result of the RPC. The response message type (google.cloud.servicedirectory.v1.Namespace) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateNamespace(google::cloud::servicedirectory::v1::UpdateNamespaceRequest const &, Options)
Updates a namespace.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::servicedirectory::v1::UpdateNamespaceRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::servicedirectory::v1::Namespace > |
the result of the RPC. The response message type (google.cloud.servicedirectory.v1.Namespace) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
DeleteNamespace(std::string const &, Options)
Deletes a namespace.
This also deletes all services and endpoints in the namespace.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The name of the namespace to delete. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
DeleteNamespace(google::cloud::servicedirectory::v1::DeleteNamespaceRequest const &, Options)
Deletes a namespace.
This also deletes all services and endpoints in the namespace.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::servicedirectory::v1::DeleteNamespaceRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
CreateService(std::string const &, google::cloud::servicedirectory::v1::Service const &, std::string const &, Options)
Creates a service, and returns the new service.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The resource name of the namespace this service will belong to. |
service |
google::cloud::servicedirectory::v1::Service const &
Required. A service with initial fields set. |
service_id |
std::string const &
Required. The Resource ID must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::servicedirectory::v1::Service > |
the result of the RPC. The response message type (google.cloud.servicedirectory.v1.Service) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
CreateService(google::cloud::servicedirectory::v1::CreateServiceRequest const &, Options)
Creates a service, and returns the new service.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::servicedirectory::v1::CreateServiceRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::servicedirectory::v1::Service > |
the result of the RPC. The response message type (google.cloud.servicedirectory.v1.Service) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListServices(std::string const &, Options)
Lists all services belonging to a namespace.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The resource name of the namespace whose services you'd like to list. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::servicedirectory::v1::Service > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListServices(google::cloud::servicedirectory::v1::ListServicesRequest, Options)
Lists all services belonging to a namespace.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::servicedirectory::v1::ListServicesRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::servicedirectory::v1::Service > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
GetService(std::string const &, Options)
Gets a service.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The name of the service to get. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::servicedirectory::v1::Service > |
the result of the RPC. The response message type (google.cloud.servicedirectory.v1.Service) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetService(google::cloud::servicedirectory::v1::GetServiceRequest const &, Options)
Gets a service.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::servicedirectory::v1::GetServiceRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::servicedirectory::v1::Service > |
the result of the RPC. The response message type (google.cloud.servicedirectory.v1.Service) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateService(google::cloud::servicedirectory::v1::Service const &, google::protobuf::FieldMask const &, Options)
Updates a service.
Parameters | |
---|---|
Name | Description |
service |
google::cloud::servicedirectory::v1::Service const &
Required. The updated service. |
update_mask |
google::protobuf::FieldMask const &
Required. List of fields to be updated in this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::servicedirectory::v1::Service > |
the result of the RPC. The response message type (google.cloud.servicedirectory.v1.Service) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateService(google::cloud::servicedirectory::v1::UpdateServiceRequest const &, Options)
Updates a service.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::servicedirectory::v1::UpdateServiceRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::servicedirectory::v1::Service > |
the result of the RPC. The response message type (google.cloud.servicedirectory.v1.Service) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
DeleteService(std::string const &, Options)
Deletes a service.
This also deletes all endpoints associated with the service.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The name of the service to delete. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
DeleteService(google::cloud::servicedirectory::v1::DeleteServiceRequest const &, Options)
Deletes a service.
This also deletes all endpoints associated with the service.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::servicedirectory::v1::DeleteServiceRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
CreateEndpoint(std::string const &, google::cloud::servicedirectory::v1::Endpoint const &, std::string const &, Options)
Creates an endpoint, and returns the new endpoint.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The resource name of the service that this endpoint provides. |
endpoint |
google::cloud::servicedirectory::v1::Endpoint const &
Required. A endpoint with initial fields set. |
endpoint_id |
std::string const &
Required. The Resource ID must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::servicedirectory::v1::Endpoint > |
the result of the RPC. The response message type (google.cloud.servicedirectory.v1.Endpoint) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
CreateEndpoint(google::cloud::servicedirectory::v1::CreateEndpointRequest const &, Options)
Creates an endpoint, and returns the new endpoint.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::servicedirectory::v1::CreateEndpointRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::servicedirectory::v1::Endpoint > |
the result of the RPC. The response message type (google.cloud.servicedirectory.v1.Endpoint) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
ListEndpoints(std::string const &, Options)
Lists all endpoints.
Parameters | |
---|---|
Name | Description |
parent |
std::string const &
Required. The resource name of the service whose endpoints you'd like to list. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::servicedirectory::v1::Endpoint > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
ListEndpoints(google::cloud::servicedirectory::v1::ListEndpointsRequest, Options)
Lists all endpoints.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::servicedirectory::v1::ListEndpointsRequest
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StreamRange< google::cloud::servicedirectory::v1::Endpoint > |
a StreamRange to iterate of the results. See the documentation of this type for details. In brief, this class has |
GetEndpoint(std::string const &, Options)
Gets an endpoint.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The name of the endpoint to get. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::servicedirectory::v1::Endpoint > |
the result of the RPC. The response message type (google.cloud.servicedirectory.v1.Endpoint) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
GetEndpoint(google::cloud::servicedirectory::v1::GetEndpointRequest const &, Options)
Gets an endpoint.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::servicedirectory::v1::GetEndpointRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::servicedirectory::v1::Endpoint > |
the result of the RPC. The response message type (google.cloud.servicedirectory.v1.Endpoint) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateEndpoint(google::cloud::servicedirectory::v1::Endpoint const &, google::protobuf::FieldMask const &, Options)
Updates an endpoint.
Parameters | |
---|---|
Name | Description |
endpoint |
google::cloud::servicedirectory::v1::Endpoint const &
Required. The updated endpoint. |
update_mask |
google::protobuf::FieldMask const &
Required. List of fields to be updated in this request. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::servicedirectory::v1::Endpoint > |
the result of the RPC. The response message type (google.cloud.servicedirectory.v1.Endpoint) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
UpdateEndpoint(google::cloud::servicedirectory::v1::UpdateEndpointRequest const &, Options)
Updates an endpoint.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::servicedirectory::v1::UpdateEndpointRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::cloud::servicedirectory::v1::Endpoint > |
the result of the RPC. The response message type (google.cloud.servicedirectory.v1.Endpoint) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
DeleteEndpoint(std::string const &, Options)
Deletes an endpoint.
Parameters | |
---|---|
Name | Description |
name |
std::string const &
Required. The name of the endpoint to delete. |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
DeleteEndpoint(google::cloud::servicedirectory::v1::DeleteEndpointRequest const &, Options)
Deletes an endpoint.
Parameters | |
---|---|
Name | Description |
request |
google::cloud::servicedirectory::v1::DeleteEndpointRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
Status |
a |
GetIamPolicy(google::iam::v1::GetIamPolicyRequest const &, Options)
Gets the IAM Policy for a resource (namespace or service only).
Parameters | |
---|---|
Name | Description |
request |
google::iam::v1::GetIamPolicyRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::iam::v1::Policy > |
the result of the RPC. The response message type (google.iam.v1.Policy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
SetIamPolicy(google::iam::v1::SetIamPolicyRequest const &, Options)
Sets the IAM Policy for a resource (namespace or service only).
Parameters | |
---|---|
Name | Description |
request |
google::iam::v1::SetIamPolicyRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::iam::v1::Policy > |
the result of the RPC. The response message type (google.iam.v1.Policy) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |
TestIamPermissions(google::iam::v1::TestIamPermissionsRequest const &, Options)
Tests IAM permissions for a resource (namespace or service only).
Parameters | |
---|---|
Name | Description |
request |
google::iam::v1::TestIamPermissionsRequest const &
Unary RPCs, such as the one wrapped by this function, receive a single |
opts |
Options
Optional. Override the class-level options, such as retry and backoff policies. |
Returns | |
---|---|
Type | Description |
StatusOr< google::iam::v1::TestIamPermissionsResponse > |
the result of the RPC. The response message type (google.iam.v1.TestIamPermissionsResponse) is mapped to a C++ class using the Protobuf mapping rules. If the request fails, the |