Service Directory V1 API - Class Google::Cloud::ServiceDirectory::V1::RegistrationService::Client (v0.4.0)

Reference documentation and code samples for the Service Directory V1 API class Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.

Client for the RegistrationService service.

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/.

Inherits

  • Object

Methods

.configure

def self.configure() { |config| ... } -> Client::Configuration

Configure the RegistrationService Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all RegistrationService clients
::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.configure do |config|
  config.timeout = 10.0
end

#configure

def configure() { |config| ... } -> Client::Configuration

Configure the RegistrationService Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#create_endpoint

def create_endpoint(request, options = nil) -> ::Google::Cloud::ServiceDirectory::V1::Endpoint
def create_endpoint(parent: nil, endpoint_id: nil, endpoint: nil) -> ::Google::Cloud::ServiceDirectory::V1::Endpoint

Creates a endpoint, and returns the new Endpoint.

Overloads
def create_endpoint(request, options = nil) -> ::Google::Cloud::ServiceDirectory::V1::Endpoint
Pass arguments to create_endpoint via a request object, either of type CreateEndpointRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_endpoint(parent: nil, endpoint_id: nil, endpoint: nil) -> ::Google::Cloud::ServiceDirectory::V1::Endpoint
Pass arguments to create_endpoint via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The resource name of the service that this endpoint provides.
  • endpoint_id (::String) — 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 [a-z](?:[-a-z0-9]{0,61}[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
  • endpoint (::Google::Cloud::ServiceDirectory::V1::Endpoint, ::Hash) — Required. A endpoint with initial fields set.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/service_directory/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ServiceDirectory::V1::CreateEndpointRequest.new

# Call the create_endpoint method.
result = client.create_endpoint request

# The returned object is of type Google::Cloud::ServiceDirectory::V1::Endpoint.
p result

#create_namespace

def create_namespace(request, options = nil) -> ::Google::Cloud::ServiceDirectory::V1::Namespace
def create_namespace(parent: nil, namespace_id: nil, namespace: nil) -> ::Google::Cloud::ServiceDirectory::V1::Namespace

Creates a namespace, and returns the new Namespace.

Overloads
def create_namespace(request, options = nil) -> ::Google::Cloud::ServiceDirectory::V1::Namespace
Pass arguments to create_namespace via a request object, either of type CreateNamespaceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_namespace(parent: nil, namespace_id: nil, namespace: nil) -> ::Google::Cloud::ServiceDirectory::V1::Namespace
Pass arguments to create_namespace via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The resource name of the project and location the namespace will be created in.
  • namespace_id (::String) — 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 [a-z](?:[-a-z0-9]{0,61}[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
  • namespace (::Google::Cloud::ServiceDirectory::V1::Namespace, ::Hash) — Required. A namespace with initial fields set.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/service_directory/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ServiceDirectory::V1::CreateNamespaceRequest.new

# Call the create_namespace method.
result = client.create_namespace request

# The returned object is of type Google::Cloud::ServiceDirectory::V1::Namespace.
p result

#create_service

def create_service(request, options = nil) -> ::Google::Cloud::ServiceDirectory::V1::Service
def create_service(parent: nil, service_id: nil, service: nil) -> ::Google::Cloud::ServiceDirectory::V1::Service

Creates a service, and returns the new Service.

Overloads
def create_service(request, options = nil) -> ::Google::Cloud::ServiceDirectory::V1::Service
Pass arguments to create_service via a request object, either of type CreateServiceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ServiceDirectory::V1::CreateServiceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_service(parent: nil, service_id: nil, service: nil) -> ::Google::Cloud::ServiceDirectory::V1::Service
Pass arguments to create_service via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The resource name of the namespace this service will belong to.
  • service_id (::String) — 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 [a-z](?:[-a-z0-9]{0,61}[a-z0-9])? which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
  • service (::Google::Cloud::ServiceDirectory::V1::Service, ::Hash) — Required. A service with initial fields set.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/service_directory/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ServiceDirectory::V1::CreateServiceRequest.new

# Call the create_service method.
result = client.create_service request

# The returned object is of type Google::Cloud::ServiceDirectory::V1::Service.
p result

#delete_endpoint

def delete_endpoint(request, options = nil) -> ::Google::Protobuf::Empty
def delete_endpoint(name: nil) -> ::Google::Protobuf::Empty

Deletes a endpoint.

Overloads
def delete_endpoint(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_endpoint via a request object, either of type DeleteEndpointRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_endpoint(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_endpoint via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The name of the endpoint to delete.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/service_directory/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ServiceDirectory::V1::DeleteEndpointRequest.new

# Call the delete_endpoint method.
result = client.delete_endpoint request

# The returned object is of type Google::Protobuf::Empty.
p result

#delete_namespace

def delete_namespace(request, options = nil) -> ::Google::Protobuf::Empty
def delete_namespace(name: nil) -> ::Google::Protobuf::Empty

Deletes a namespace. This also deletes all services and endpoints in the namespace.

Overloads
def delete_namespace(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_namespace via a request object, either of type DeleteNamespaceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_namespace(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_namespace via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The name of the namespace to delete.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/service_directory/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ServiceDirectory::V1::DeleteNamespaceRequest.new

# Call the delete_namespace method.
result = client.delete_namespace request

# The returned object is of type Google::Protobuf::Empty.
p result

#delete_service

def delete_service(request, options = nil) -> ::Google::Protobuf::Empty
def delete_service(name: nil) -> ::Google::Protobuf::Empty

Deletes a service. This also deletes all endpoints associated with the service.

Overloads
def delete_service(request, options = nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_service via a request object, either of type DeleteServiceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_service(name: nil) -> ::Google::Protobuf::Empty
Pass arguments to delete_service via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The name of the service to delete.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/service_directory/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ServiceDirectory::V1::DeleteServiceRequest.new

# Call the delete_service method.
result = client.delete_service request

# The returned object is of type Google::Protobuf::Empty.
p result

#get_endpoint

def get_endpoint(request, options = nil) -> ::Google::Cloud::ServiceDirectory::V1::Endpoint
def get_endpoint(name: nil) -> ::Google::Cloud::ServiceDirectory::V1::Endpoint

Gets a endpoint.

Overloads
def get_endpoint(request, options = nil) -> ::Google::Cloud::ServiceDirectory::V1::Endpoint
Pass arguments to get_endpoint via a request object, either of type GetEndpointRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ServiceDirectory::V1::GetEndpointRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_endpoint(name: nil) -> ::Google::Cloud::ServiceDirectory::V1::Endpoint
Pass arguments to get_endpoint via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The name of the endpoint to get.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/service_directory/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ServiceDirectory::V1::GetEndpointRequest.new

# Call the get_endpoint method.
result = client.get_endpoint request

# The returned object is of type Google::Cloud::ServiceDirectory::V1::Endpoint.
p result

#get_iam_policy

def get_iam_policy(request, options = nil) -> ::Google::Iam::V1::Policy
def get_iam_policy(resource: nil, options: nil) -> ::Google::Iam::V1::Policy

Gets the IAM Policy for a resource (namespace or service only).

Overloads
def get_iam_policy(request, options = nil) -> ::Google::Iam::V1::Policy
Pass arguments to get_iam_policy via a request object, either of type Iam::V1::GetIamPolicyRequest or an equivalent Hash.
Parameters
  • request (::Google::Iam::V1::GetIamPolicyRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_iam_policy(resource: nil, options: nil) -> ::Google::Iam::V1::Policy
Pass arguments to get_iam_policy via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • resource (::String) — REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.
  • options (::Google::Iam::V1::GetPolicyOptions, ::Hash) — OPTIONAL: A GetPolicyOptions object for specifying options to GetIamPolicy.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/service_directory/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Iam::V1::GetIamPolicyRequest.new

# Call the get_iam_policy method.
result = client.get_iam_policy request

# The returned object is of type Google::Iam::V1::Policy.
p result

#get_namespace

def get_namespace(request, options = nil) -> ::Google::Cloud::ServiceDirectory::V1::Namespace
def get_namespace(name: nil) -> ::Google::Cloud::ServiceDirectory::V1::Namespace

Gets a namespace.

Overloads
def get_namespace(request, options = nil) -> ::Google::Cloud::ServiceDirectory::V1::Namespace
Pass arguments to get_namespace via a request object, either of type GetNamespaceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_namespace(name: nil) -> ::Google::Cloud::ServiceDirectory::V1::Namespace
Pass arguments to get_namespace via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The name of the namespace to retrieve.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/service_directory/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ServiceDirectory::V1::GetNamespaceRequest.new

# Call the get_namespace method.
result = client.get_namespace request

# The returned object is of type Google::Cloud::ServiceDirectory::V1::Namespace.
p result

#get_service

def get_service(request, options = nil) -> ::Google::Cloud::ServiceDirectory::V1::Service
def get_service(name: nil) -> ::Google::Cloud::ServiceDirectory::V1::Service

Gets a service.

Overloads
def get_service(request, options = nil) -> ::Google::Cloud::ServiceDirectory::V1::Service
Pass arguments to get_service via a request object, either of type GetServiceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ServiceDirectory::V1::GetServiceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_service(name: nil) -> ::Google::Cloud::ServiceDirectory::V1::Service
Pass arguments to get_service via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameter
  • name (::String) — Required. The name of the service to get.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/service_directory/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ServiceDirectory::V1::GetServiceRequest.new

# Call the get_service method.
result = client.get_service request

# The returned object is of type Google::Cloud::ServiceDirectory::V1::Service.
p result

#initialize

def initialize() { |config| ... } -> Client

Create a new RegistrationService client object.

Yields
  • (config) — Configure the RegistrationService client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new do |config|
  config.timeout = 10.0
end

#list_endpoints

def list_endpoints(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Endpoint>
def list_endpoints(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Endpoint>

Lists all endpoints.

Overloads
def list_endpoints(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Endpoint>
Pass arguments to list_endpoints via a request object, either of type ListEndpointsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_endpoints(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Endpoint>
Pass arguments to list_endpoints via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The resource name of the service whose endpoints we'd like to list.
  • page_size (::Integer) — Optional. The maximum number of items to return.
  • page_token (::String) — Optional. The next_page_token value returned from a previous List request, if any.
  • filter (::String) —

    Optional. The filter to list result by.

    General filter string syntax:

    Examples of valid filters:

    • "metadata.owner" returns Endpoints that have a label with the key "owner" this is the same as "metadata:owner".
    • "metadata.protocol=gRPC" returns Endpoints that have key/value "protocol=gRPC".
    • "address=192.108.1.105" returns Endpoints that have this address.
    • "port>8080" returns Endpoints that have port number larger than 8080.
    • "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/my-service/endpoints/endpoint-c" returns Endpoints that have name that is alphabetically later than the string, so "endpoint-e" will be returned but "endpoint-a" will not be.
    • "metadata.owner!=sd AND metadata.foo=bar" returns Endpoints that have "owner" in label key but value is not "sd" AND have key/value foo=bar.
    • "doesnotexist.foo=bar" returns an empty list. Note that Endpoint doesn't have a field called "doesnotexist". Since the filter does not match any Endpoints, it returns no results.
  • order_by (::String) — Optional. The order to list result by.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/service_directory/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ServiceDirectory::V1::ListEndpointsRequest.new

# Call the list_endpoints method.
result = client.list_endpoints request

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::ServiceDirectory::V1::Endpoint.
  p response
end

#list_namespaces

def list_namespaces(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Namespace>
def list_namespaces(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Namespace>

Lists all namespaces.

Overloads
def list_namespaces(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Namespace>
Pass arguments to list_namespaces via a request object, either of type ListNamespacesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_namespaces(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Namespace>
Pass arguments to list_namespaces via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The resource name of the project and location whose namespaces we'd like to list.
  • page_size (::Integer) — Optional. The maximum number of items to return.
  • page_token (::String) — Optional. The next_page_token value returned from a previous List request, if any.
  • filter (::String) —

    Optional. The filter to list result by.

    General filter string syntax:

    Examples of valid filters:

    • "labels.owner" returns Namespaces that have a label with the key "owner" this is the same as "labels:owner".
    • "labels.protocol=gRPC" returns Namespaces that have key/value "protocol=gRPC".
    • "name>projects/my-project/locations/us-east/namespaces/namespace-c" returns Namespaces that have name that is alphabetically later than the string, so "namespace-e" will be returned but "namespace-a" will not be.
    • "labels.owner!=sd AND labels.foo=bar" returns Namespaces that have "owner" in label key but value is not "sd" AND have key/value foo=bar.
    • "doesnotexist.foo=bar" returns an empty list. Note that Namespace doesn't have a field called "doesnotexist". Since the filter does not match any Namespaces, it returns no results.
  • order_by (::String) — Optional. The order to list result by.

    General order by string syntax:

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/service_directory/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ServiceDirectory::V1::ListNamespacesRequest.new

# Call the list_namespaces method.
result = client.list_namespaces request

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::ServiceDirectory::V1::Namespace.
  p response
end

#list_services

def list_services(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Service>
def list_services(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Service>

Lists all services belonging to a namespace.

Overloads
def list_services(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Service>
Pass arguments to list_services via a request object, either of type ListServicesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ServiceDirectory::V1::ListServicesRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_services(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ServiceDirectory::V1::Service>
Pass arguments to list_services via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • parent (::String) — Required. The resource name of the namespace whose services we'd like to list.
  • page_size (::Integer) — Optional. The maximum number of items to return.
  • page_token (::String) — Optional. The next_page_token value returned from a previous List request, if any.
  • filter (::String) —

    Optional. The filter to list result by.

    General filter string syntax:

    Examples of valid filters:

    • "metadata.owner" returns Services that have a label with the key "owner" this is the same as "metadata:owner".
    • "metadata.protocol=gRPC" returns Services that have key/value "protocol=gRPC".
    • "name>projects/my-project/locations/us-east/namespaces/my-namespace/services/service-c" returns Services that have name that is alphabetically later than the string, so "service-e" will be returned but "service-a" will not be.
    • "metadata.owner!=sd AND metadata.foo=bar" returns Services that have "owner" in label key but value is not "sd" AND have key/value foo=bar.
    • "doesnotexist.foo=bar" returns an empty list. Note that Service doesn't have a field called "doesnotexist". Since the filter does not match any Services, it returns no results.
  • order_by (::String) — Optional. The order to list result by.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/service_directory/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ServiceDirectory::V1::ListServicesRequest.new

# Call the list_services method.
result = client.list_services request

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::ServiceDirectory::V1::Service.
  p response
end

#set_iam_policy

def set_iam_policy(request, options = nil) -> ::Google::Iam::V1::Policy
def set_iam_policy(resource: nil, policy: nil, update_mask: nil) -> ::Google::Iam::V1::Policy

Sets the IAM Policy for a resource (namespace or service only).

Overloads
def set_iam_policy(request, options = nil) -> ::Google::Iam::V1::Policy
Pass arguments to set_iam_policy via a request object, either of type Iam::V1::SetIamPolicyRequest or an equivalent Hash.
Parameters
  • request (::Google::Iam::V1::SetIamPolicyRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def set_iam_policy(resource: nil, policy: nil, update_mask: nil) -> ::Google::Iam::V1::Policy
Pass arguments to set_iam_policy via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • resource (::String) — REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.
  • policy (::Google::Iam::V1::Policy, ::Hash) — REQUIRED: The complete policy to be applied to the resource. The size of the policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud Platform services (such as Projects) might reject them.
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only the fields in the mask will be modified. If no mask is provided, the following default mask is used:

    paths: "bindings, etag"

Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/service_directory/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Iam::V1::SetIamPolicyRequest.new

# Call the set_iam_policy method.
result = client.set_iam_policy request

# The returned object is of type Google::Iam::V1::Policy.
p result

#test_iam_permissions

def test_iam_permissions(request, options = nil) -> ::Google::Iam::V1::TestIamPermissionsResponse
def test_iam_permissions(resource: nil, permissions: nil) -> ::Google::Iam::V1::TestIamPermissionsResponse

Tests IAM permissions for a resource (namespace or service only).

Overloads
def test_iam_permissions(request, options = nil) -> ::Google::Iam::V1::TestIamPermissionsResponse
Pass arguments to test_iam_permissions via a request object, either of type Iam::V1::TestIamPermissionsRequest or an equivalent Hash.
Parameters
  • request (::Google::Iam::V1::TestIamPermissionsRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def test_iam_permissions(resource: nil, permissions: nil) -> ::Google::Iam::V1::TestIamPermissionsResponse
Pass arguments to test_iam_permissions via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
  • resource (::String) — REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.
  • permissions (::Array<::String>) — The set of permissions to check for the resource. Permissions with wildcards (such as '' or 'storage.') are not allowed. For more information see IAM Overview.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/service_directory/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Iam::V1::TestIamPermissionsRequest.new

# Call the test_iam_permissions method.
result = client.test_iam_permissions request

# The returned object is of type Google::Iam::V1::TestIamPermissionsResponse.
p result

#update_endpoint

def update_endpoint(request, options = nil) -> ::Google::Cloud::ServiceDirectory::V1::Endpoint
def update_endpoint(endpoint: nil, update_mask: nil) -> ::Google::Cloud::ServiceDirectory::V1::Endpoint

Updates a endpoint.

Overloads
def update_endpoint(request, options = nil) -> ::Google::Cloud::ServiceDirectory::V1::Endpoint
Pass arguments to update_endpoint via a request object, either of type UpdateEndpointRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_endpoint(endpoint: nil, update_mask: nil) -> ::Google::Cloud::ServiceDirectory::V1::Endpoint
Pass arguments to update_endpoint via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/service_directory/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ServiceDirectory::V1::UpdateEndpointRequest.new

# Call the update_endpoint method.
result = client.update_endpoint request

# The returned object is of type Google::Cloud::ServiceDirectory::V1::Endpoint.
p result

#update_namespace

def update_namespace(request, options = nil) -> ::Google::Cloud::ServiceDirectory::V1::Namespace
def update_namespace(namespace: nil, update_mask: nil) -> ::Google::Cloud::ServiceDirectory::V1::Namespace

Updates a namespace.

Overloads
def update_namespace(request, options = nil) -> ::Google::Cloud::ServiceDirectory::V1::Namespace
Pass arguments to update_namespace via a request object, either of type UpdateNamespaceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_namespace(namespace: nil, update_mask: nil) -> ::Google::Cloud::ServiceDirectory::V1::Namespace
Pass arguments to update_namespace via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/service_directory/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ServiceDirectory::V1::UpdateNamespaceRequest.new

# Call the update_namespace method.
result = client.update_namespace request

# The returned object is of type Google::Cloud::ServiceDirectory::V1::Namespace.
p result

#update_service

def update_service(request, options = nil) -> ::Google::Cloud::ServiceDirectory::V1::Service
def update_service(service: nil, update_mask: nil) -> ::Google::Cloud::ServiceDirectory::V1::Service

Updates a service.

Overloads
def update_service(request, options = nil) -> ::Google::Cloud::ServiceDirectory::V1::Service
Pass arguments to update_service via a request object, either of type UpdateServiceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
  • options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_service(service: nil, update_mask: nil) -> ::Google::Cloud::ServiceDirectory::V1::Service
Pass arguments to update_service via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).
Parameters
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/service_directory/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::ServiceDirectory::V1::RegistrationService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ServiceDirectory::V1::UpdateServiceRequest.new

# Call the update_service method.
result = client.update_service request

# The returned object is of type Google::Cloud::ServiceDirectory::V1::Service.
p result