Reference documentation and code samples for the Service Management V1 API class Google::Cloud::ServiceManagement::V1::ServiceManager::Client.
Client for the ServiceManager service.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::Configuration
Configure the ServiceManager Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# 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.
- (config) — Configure the Client client.
- config (Client::Configuration)
#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>
def create_service(request, options = nil) -> ::Gapic::Operation
create_service
via a request object, either of type
CreateServiceRequest or an equivalent Hash.
- 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
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).
- service (::Google::Cloud::ServiceManagement::V1::ManagedService, ::Hash) — Required. Initial values for the service resource.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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.
def create_service_config(request, options = nil) -> ::Google::Api::Service
create_service_config
via a request object, either of type
CreateServiceConfigRequest or an equivalent Hash.
- 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
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).
-
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.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Api::Service)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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>
def create_service_rollout(request, options = nil) -> ::Gapic::Operation
create_service_rollout
via a request object, either of type
CreateServiceRolloutRequest or an equivalent Hash.
- 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
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).
-
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.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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>
def delete_service(request, options = nil) -> ::Gapic::Operation
delete_service
via a request object, either of type
DeleteServiceRequest or an equivalent Hash.
- 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
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).
-
service_name (::String) — Required. The name of the service. See the
overview for naming requirements. For
example:
example.googleapis.com
.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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.
def generate_config_report(request, options = nil) -> ::Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse
generate_config_report
via a request object, either of type
GenerateConfigReportRequest or an equivalent Hash.
- 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
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).
- new_config (::Google::Protobuf::Any, ::Hash) — Required. Service configuration for which we want to generate the report. For this version of API, the supported types are google.api.servicemanagement.v1.ConfigRef, google.api.servicemanagement.v1.ConfigSource, and google.api.Service
- old_config (::Google::Protobuf::Any, ::Hash) — Optional. Service configuration against which the comparison will be done. For this version of API, the supported types are google.api.servicemanagement.v1.ConfigRef, google.api.servicemanagement.v1.ConfigSource, and google.api.Service
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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.
def get_service(request, options = nil) -> ::Google::Cloud::ServiceManagement::V1::ManagedService
get_service
via a request object, either of type
GetServiceRequest or an equivalent Hash.
- 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
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).
-
service_name (::String) — Required. The name of the service. See the
ServiceManager
overview for naming requirements. For example:example.googleapis.com
.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::ServiceManagement::V1::ManagedService)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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.
def get_service_config(request, options = nil) -> ::Google::Api::Service
get_service_config
via a request object, either of type
GetServiceConfigRequest or an equivalent Hash.
- 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
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).
-
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.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Api::Service)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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.
def get_service_rollout(request, options = nil) -> ::Google::Cloud::ServiceManagement::V1::Rollout
get_service_rollout
via a request object, either of type
GetServiceRolloutRequest or an equivalent Hash.
- 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
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).
-
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.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::ServiceManagement::V1::Rollout)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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
#initialize
def initialize() { |config| ... } -> Client
Create a new ServiceManager client object.
- (config) — Configure the ServiceManager client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# 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.
def list_service_configs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Api::Service>
list_service_configs
via a request object, either of type
ListServiceConfigsRequest or an equivalent Hash.
- 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>
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).
-
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.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Api::Service>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Api::Service>)
- (::Google::Cloud::Error) — if the RPC is aborted.
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.
def list_service_rollouts(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::Rollout>
list_service_rollouts
via a request object, either of type
ListServiceRolloutsRequest or an equivalent Hash.
- 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>
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).
-
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'
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::Rollout>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::Rollout>)
- (::Google::Cloud::Error) — if the RPC is aborted.
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.
def list_services(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::ManagedService>
list_services
via a request object, either of type
ListServicesRequest or an equivalent Hash.
- 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>
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).
- 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:
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::ManagedService>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::ManagedService>)
- (::Google::Cloud::Error) — if the RPC is aborted.
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
#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>
def submit_config_source(request, options = nil) -> ::Gapic::Operation
submit_config_source
via a request object, either of type
Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest or an equivalent Hash.
- 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
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).
-
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 theConfigSource
provided, but the generated config and the sources will NOT be persisted.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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>
def undelete_service(request, options = nil) -> ::Gapic::Operation
undelete_service
via a request object, either of type
UndeleteServiceRequest or an equivalent Hash.
- 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
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).
-
service_name (::String) — Required. The name of the service. See the
overview for naming requirements. For
example:
example.googleapis.com
.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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