Service Management V1 API - Class Google::Cloud::ServiceManagement::V1::ServiceManager::Client (v1.1.0)

Reference documentation and code samples for the Service Management V1 API class Google::Cloud::ServiceManagement::V1::ServiceManager::Client.

Client for the ServiceManager service.

Google Service Management API

Inherits

  • Object

Methods

.configure

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

Configure the ServiceManager 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 ServiceManager clients
::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.configure do |config|
  config.timeout = 10.0
end

#configure

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

Configure the ServiceManager 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_service

def create_service(request, options = nil) -> ::Gapic::Operation
def create_service(service: nil) -> ::Gapic::Operation

Creates a new managed service.

A managed service is immutable, and is subject to mandatory 30-day data retention. You cannot move a service or recreate it within 30 days after deletion.

One producer project can own no more than 500 services. For security and reliability purposes, a production service should be hosted in a dedicated producer project.

Operation<response: ManagedService>

Overloads
def create_service(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_service via a request object, either of type CreateServiceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ServiceManagement::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(service: nil) -> ::Gapic::Operation
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).
Parameter
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/service_management/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#create_service_config

def create_service_config(request, options = nil) -> ::Google::Api::Service
def create_service_config(service_name: nil, service_config: nil) -> ::Google::Api::Service

Creates a new service configuration (version) for a managed service. This method only stores the service configuration. To roll out the service configuration to backend systems please call CreateServiceRollout.

Only the 100 most recent service configurations and ones referenced by existing rollouts are kept for each service. The rest will be deleted eventually.

Overloads
def create_service_config(request, options = nil) -> ::Google::Api::Service
Pass arguments to create_service_config via a request object, either of type CreateServiceConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest, ::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_config(service_name: nil, service_config: nil) -> ::Google::Api::Service
Pass arguments to create_service_config 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
  • service_name (::String) — Required. The name of the service. See the overview for naming requirements. For example: example.googleapis.com.
  • service_config (::Google::Api::Service, ::Hash) — Required. The service configuration resource.
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_management/v1"

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

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

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

# The returned object is of type Google::Api::Service.
p result

#create_service_rollout

def create_service_rollout(request, options = nil) -> ::Gapic::Operation
def create_service_rollout(service_name: nil, rollout: nil) -> ::Gapic::Operation

Creates a new service configuration rollout. Based on rollout, the Google Service Management will roll out the service configurations to different backend services. For example, the logging configuration will be pushed to Google Cloud Logging.

Please note that any previous pending and running Rollouts and associated Operations will be automatically cancelled so that the latest Rollout will not be blocked by previous Rollouts.

Only the 100 most recent (in any state) and the last 10 successful (if not already part of the set of 100 most recent) rollouts are kept for each service. The rest will be deleted eventually.

Operation<response: Rollout>

Overloads
def create_service_rollout(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_service_rollout via a request object, either of type CreateServiceRolloutRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest, ::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_rollout(service_name: nil, rollout: nil) -> ::Gapic::Operation
Pass arguments to create_service_rollout 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
  • service_name (::String) — Required. The name of the service. See the overview for naming requirements. For example: example.googleapis.com.
  • rollout (::Google::Cloud::ServiceManagement::V1::Rollout, ::Hash) — Required. The rollout resource. The service_name field is output only.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/service_management/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#delete_service

def delete_service(request, options = nil) -> ::Gapic::Operation
def delete_service(service_name: nil) -> ::Gapic::Operation

Deletes a managed service. This method will change the service to the Soft-Delete state for 30 days. Within this period, service producers may call UndeleteService to restore the service. After 30 days, the service will be permanently deleted.

Operation<response: google.protobuf.Empty>

Overloads
def delete_service(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_service via a request object, either of type DeleteServiceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ServiceManagement::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(service_name: nil) -> ::Gapic::Operation
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
  • service_name (::String) — Required. The name of the service. See the overview for naming requirements. For example: example.googleapis.com.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/service_management/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#generate_config_report

def generate_config_report(request, options = nil) -> ::Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse
def generate_config_report(new_config: nil, old_config: nil) -> ::Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse

Generates and returns a report (errors, warnings and changes from existing configurations) associated with GenerateConfigReportRequest.new_value

If GenerateConfigReportRequest.old_value is specified, GenerateConfigReportRequest will contain a single ChangeReport based on the comparison between GenerateConfigReportRequest.new_value and GenerateConfigReportRequest.old_value. If GenerateConfigReportRequest.old_value is not specified, this method will compare GenerateConfigReportRequest.new_value with the last pushed service configuration.

Overloads
def generate_config_report(request, options = nil) -> ::Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse
Pass arguments to generate_config_report via a request object, either of type GenerateConfigReportRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest, ::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 generate_config_report(new_config: nil, old_config: nil) -> ::Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse
Pass arguments to generate_config_report 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_management/v1"

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

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

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

# The returned object is of type Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse.
p result

#get_service

def get_service(request, options = nil) -> ::Google::Cloud::ServiceManagement::V1::ManagedService
def get_service(service_name: nil) -> ::Google::Cloud::ServiceManagement::V1::ManagedService

Gets a managed service. Authentication is required unless the service is public.

Overloads
def get_service(request, options = nil) -> ::Google::Cloud::ServiceManagement::V1::ManagedService
Pass arguments to get_service via a request object, either of type GetServiceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ServiceManagement::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(service_name: nil) -> ::Google::Cloud::ServiceManagement::V1::ManagedService
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
  • service_name (::String) — Required. The name of the service. See the ServiceManager overview for naming requirements. For example: example.googleapis.com.
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_management/v1"

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

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

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

# The returned object is of type Google::Cloud::ServiceManagement::V1::ManagedService.
p result

#get_service_config

def get_service_config(request, options = nil) -> ::Google::Api::Service
def get_service_config(service_name: nil, config_id: nil, view: nil) -> ::Google::Api::Service

Gets a service configuration (version) for a managed service.

Overloads
def get_service_config(request, options = nil) -> ::Google::Api::Service
Pass arguments to get_service_config via a request object, either of type GetServiceConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest, ::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_config(service_name: nil, config_id: nil, view: nil) -> ::Google::Api::Service
Pass arguments to get_service_config 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
  • service_name (::String) — Required. The name of the service. See the overview for naming requirements. For example: example.googleapis.com.
  • config_id (::String) — Required. The id of the service configuration resource.

    This field must be specified for the server to return all fields, including SourceInfo.

  • view (::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest::ConfigView) — Specifies which parts of the Service Config should be returned in the response.
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_management/v1"

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

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

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

# The returned object is of type Google::Api::Service.
p result

#get_service_rollout

def get_service_rollout(request, options = nil) -> ::Google::Cloud::ServiceManagement::V1::Rollout
def get_service_rollout(service_name: nil, rollout_id: nil) -> ::Google::Cloud::ServiceManagement::V1::Rollout

Gets a service configuration rollout.

Overloads
def get_service_rollout(request, options = nil) -> ::Google::Cloud::ServiceManagement::V1::Rollout
Pass arguments to get_service_rollout via a request object, either of type GetServiceRolloutRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest, ::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_rollout(service_name: nil, rollout_id: nil) -> ::Google::Cloud::ServiceManagement::V1::Rollout
Pass arguments to get_service_rollout 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
  • service_name (::String) — Required. The name of the service. See the overview for naming requirements. For example: example.googleapis.com.
  • rollout_id (::String) — Required. The id of the rollout resource.
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_management/v1"

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

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

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

# The returned object is of type Google::Cloud::ServiceManagement::V1::Rollout.
p result

#iam_policy_client

def iam_policy_client() -> Google::Iam::V1::IAMPolicy::Client

Get the associated client for mix-in of the IAMPolicy.

Returns
  • (Google::Iam::V1::IAMPolicy::Client)

#initialize

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

Create a new ServiceManager client object.

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

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

#list_service_configs

def list_service_configs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Api::Service>
def list_service_configs(service_name: nil, page_token: nil, page_size: nil) -> ::Gapic::PagedEnumerable<::Google::Api::Service>

Lists the history of the service configuration for a managed service, from the newest to the oldest.

Overloads
def list_service_configs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Api::Service>
Pass arguments to list_service_configs via a request object, either of type ListServiceConfigsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest, ::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_service_configs(service_name: nil, page_token: nil, page_size: nil) -> ::Gapic::PagedEnumerable<::Google::Api::Service>
Pass arguments to list_service_configs 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
  • service_name (::String) — Required. The name of the service. See the overview for naming requirements. For example: example.googleapis.com.
  • page_token (::String) — The token of the page to retrieve.
  • page_size (::Integer) — The max number of items to include in the response list. Page size is 50 if not specified. Maximum value is 100.
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_management/v1"

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

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

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

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Api::Service.
  p item
end

#list_service_rollouts

def list_service_rollouts(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::Rollout>
def list_service_rollouts(service_name: nil, page_token: nil, page_size: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::Rollout>

Lists the history of the service configuration rollouts for a managed service, from the newest to the oldest.

Overloads
def list_service_rollouts(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::Rollout>
Pass arguments to list_service_rollouts via a request object, either of type ListServiceRolloutsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest, ::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_service_rollouts(service_name: nil, page_token: nil, page_size: nil, filter: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::Rollout>
Pass arguments to list_service_rollouts 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
  • service_name (::String) — Required. The name of the service. See the overview for naming requirements. For example: example.googleapis.com.
  • page_token (::String) — The token of the page to retrieve.
  • page_size (::Integer) — The max number of items to include in the response list. Page size is 50 if not specified. Maximum value is 100.
  • filter (::String) — Required. Use filter to return subset of rollouts. The following filters are supported:

    -- By [status] [google.api.servicemanagement.v1.Rollout.RolloutStatus]. For example, filter='status=SUCCESS'

    -- By [strategy] [google.api.servicemanagement.v1.Rollout.strategy]. For example, filter='strategy=TrafficPercentStrategy'

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_management/v1"

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

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

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

# The returned object is of type Gapic::PagedEnumerable. You can iterate
# over elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::ServiceManagement::V1::Rollout.
  p item
end

#list_services

def list_services(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::ManagedService>
def list_services(producer_project_id: nil, page_size: nil, page_token: nil, consumer_id: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::ManagedService>

Lists managed services.

Returns all public services. For authenticated users, also returns all services the calling user has "servicemanagement.services.get" permission for.

Overloads
def list_services(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::ManagedService>
Pass arguments to list_services via a request object, either of type ListServicesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ServiceManagement::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(producer_project_id: nil, page_size: nil, page_token: nil, consumer_id: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::ManagedService>
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
  • producer_project_id (::String) — Include services produced by the specified project.
  • page_size (::Integer) — The max number of items to include in the response list. Page size is 50 if not specified. Maximum value is 500.
  • page_token (::String) — Token identifying which result to start with; returned by a previous list call.
  • consumer_id (::String) —

    Include services consumed by the specified consumer.

    The Google Service Management implementation accepts the following forms:

    • project:
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_management/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ServiceManagement::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 elements, and API calls will be issued to fetch pages as needed.
result.each do |item|
  # Each element is of type ::Google::Cloud::ServiceManagement::V1::ManagedService.
  p item
end

#logger

def logger() -> Logger

The logger used for request/response debug logging.

Returns
  • (Logger)

#operations_client

def operations_client() -> ::Google::Cloud::ServiceManagement::V1::ServiceManager::Operations

Get the associated client for long-running operations.

#submit_config_source

def submit_config_source(request, options = nil) -> ::Gapic::Operation
def submit_config_source(service_name: nil, config_source: nil, validate_only: nil) -> ::Gapic::Operation

Creates a new service configuration (version) for a managed service based on user-supplied configuration source files (for example: OpenAPI Specification). This method stores the source configurations as well as the generated service configuration. To rollout the service configuration to other services, please call CreateServiceRollout.

Only the 100 most recent configuration sources and ones referenced by existing service configurtions are kept for each service. The rest will be deleted eventually.

Operation<response: SubmitConfigSourceResponse>

Overloads
def submit_config_source(request, options = nil) -> ::Gapic::Operation
Pass arguments to submit_config_source via a request object, either of type Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest, ::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 submit_config_source(service_name: nil, config_source: nil, validate_only: nil) -> ::Gapic::Operation
Pass arguments to submit_config_source 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
  • service_name (::String) — Required. The name of the service. See the overview for naming requirements. For example: example.googleapis.com.
  • config_source (::Google::Cloud::ServiceManagement::V1::ConfigSource, ::Hash) — Required. The source configuration for the service.
  • validate_only (::Boolean) — Optional. If set, this will result in the generation of a google.api.Service configuration based on the ConfigSource provided, but the generated config and the sources will NOT be persisted.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/service_management/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#undelete_service

def undelete_service(request, options = nil) -> ::Gapic::Operation
def undelete_service(service_name: nil) -> ::Gapic::Operation

Revives a previously deleted managed service. The method restores the service using the configuration at the time the service was deleted. The target service must exist and must have been deleted within the last 30 days.

Operation<response: UndeleteServiceResponse>

Overloads
def undelete_service(request, options = nil) -> ::Gapic::Operation
Pass arguments to undelete_service via a request object, either of type UndeleteServiceRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest, ::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 undelete_service(service_name: nil) -> ::Gapic::Operation
Pass arguments to undelete_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
  • service_name (::String) — Required. The name of the service. See the overview for naming requirements. For example: example.googleapis.com.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

Basic example

require "google/cloud/service_management/v1"

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

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

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

# The returned object is of type Gapic::Operation. You can use it to
# check the status of an operation, cancel it, or wait for results.
# Here is how to wait for a response.
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "No response received."
end

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)