Service Management V1 API - Class Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::Client (v0.6.1)

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

REST 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::Rest::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
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#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
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#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
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#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
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#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
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#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
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#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
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#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
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#initialize

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

Create a new ServiceManager REST 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::Rest::Client.new

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

#list_service_configs

def list_service_configs(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Api::Service>
def list_service_configs(service_name: nil, page_token: nil, page_size: nil) -> ::Gapic::Rest::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::Rest::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::Rest::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
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Rest::PagedEnumerable<::Google::Api::Service>)
  • operation (::Gapic::Rest::TransportOperation)
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#list_service_rollouts

def list_service_rollouts(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::Rollout>
def list_service_rollouts(service_name: nil, page_token: nil, page_size: nil, filter: nil) -> ::Gapic::Rest::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::Rest::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::Rest::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: -- To limit the results to only those in status (google.api.servicemanagement.v1.RolloutStatus) 'SUCCESS', use filter='status=SUCCESS' -- To limit the results to those in status (google.api.servicemanagement.v1.RolloutStatus) 'CANCELLED' or 'FAILED', use filter='status=CANCELLED OR status=FAILED'
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#list_services

def list_services(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::ManagedService>
def list_services(producer_project_id: nil, page_size: nil, page_token: nil, consumer_id: nil) -> ::Gapic::Rest::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::Rest::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::Rest::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 100.
  • 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
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#operations_client

def operations_client() -> ::Google::Cloud::ServiceManagement::V1::ServiceManager::Rest::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
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.

#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
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.