class Google::Cloud::ServiceManagement::V1::ServiceManager::Client
Client
for the ServiceManager
service.
[Google Service
Management API](cloud.google.com/service-management/overview)
Attributes
Get the associated client for long-running operations.
@return [::Google::Cloud::ServiceManagement::V1::ServiceManager::Operations]
@private
Public Class Methods
Configure the ServiceManager
Client
class.
See {::Google::Cloud::ServiceManagement::V1::ServiceManager::Client::Configuration} for a description of the configuration fields.
@example
# Modify the configuration for all ServiceManager clients ::Google::Cloud::ServiceManagement::V1::ServiceManager::Client.configure do |config| config.timeout = 10.0 end
@yield [config] Configure the Client
client. @yieldparam config [Client::Configuration]
@return [Client::Configuration]
# File lib/google/cloud/service_management/v1/service_manager/client.rb, line 54 def self.configure @configure ||= begin namespace = ["Google", "Cloud", "ServiceManagement", "V1"] parent_config = while namespace.any? parent_name = namespace.join "::" parent_const = const_get parent_name break parent_const.configure if parent_const.respond_to? :configure namespace.pop end default_config = Client::Configuration.new parent_config default_config end yield @configure if block_given? @configure end
Create a new ServiceManager
client object.
@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
@yield [config] Configure the ServiceManager
client. @yieldparam config [Client::Configuration]
# File lib/google/cloud/service_management/v1/service_manager/client.rb, line 107 def initialize # These require statements are intentionally placed here to initialize # the gRPC module only when it's required. # See https://github.com/googleapis/toolkit/issues/446 require "gapic/grpc" require "google/api/servicemanagement/v1/servicemanager_services_pb" # Create the configuration object @config = Configuration.new Client.configure # Yield the configuration if needed yield @config if block_given? # Create credentials credentials = @config.credentials # Use self-signed JWT if the endpoint is unchanged from default, # but only if the default endpoint does not have a region prefix. enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint && !@config.endpoint.split(".").first.include?("-") credentials ||= Credentials.default scope: @config.scope, enable_self_signed_jwt: enable_self_signed_jwt if credentials.is_a?(::String) || credentials.is_a?(::Hash) credentials = Credentials.new credentials, scope: @config.scope end @quota_project_id = @config.quota_project @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id @operations_client = Operations.new do |config| config.credentials = credentials config.endpoint = @config.endpoint end @service_manager_stub = ::Gapic::ServiceStub.new( ::Google::Cloud::ServiceManagement::V1::ServiceManager::Stub, credentials: credentials, endpoint: @config.endpoint, channel_args: @config.channel_args, interceptors: @config.interceptors ) end
Public Instance Methods
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 {::Google::Cloud::ServiceManagement::V1::ServiceManager::Client::Configuration} for a description of the configuration fields.
@yield [config] Configure the Client
client. @yieldparam config [Client::Configuration]
@return [Client::Configuration]
# File lib/google/cloud/service_management/v1/service_manager/client.rb, line 86 def configure yield @config if block_given? @config end
Creates a new managed service. Please note one producer project can own no more than 20 services.
Operation<response: ManagedService>
@overload create_service
(request, options = nil)
Pass arguments to `create_service` via a request object, either of type {::Google::Cloud::ServiceManagement::V1::CreateServiceRequest} or an equivalent Hash. @param 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. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload create_service
(service: nil)
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). @param service [::Google::Cloud::ServiceManagement::V1::ManagedService, ::Hash] Required. Initial values for the service resource.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::Operation]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/service_management/v1/service_manager/client.rb, line 342 def create_service request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::CreateServiceRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.create_service.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.create_service.timeout, metadata: metadata, retry_policy: @config.rpcs.create_service.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @service_manager_stub.call_rpc :create_service, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
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 {::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#create_service_rollout 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.
@overload create_service_config
(request, options = nil)
Pass arguments to `create_service_config` via a request object, either of type {::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest} or an equivalent Hash. @param 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. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload create_service_config
(service_name: nil, service_config: nil)
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). @param service_name [::String] Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview) for naming requirements. For example: `example.googleapis.com`. @param service_config [::Google::Api::Service, ::Hash] Required. The service configuration resource.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Api::Service] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Google::Api::Service]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/service_management/v1/service_manager/client.rb, line 719 def create_service_config request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::CreateServiceConfigRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.create_service_config.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "service_name" => request.service_name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.create_service_config.timeout, metadata: metadata, retry_policy: @config.rpcs.create_service_config.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @service_manager_stub.call_rpc :create_service_config, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
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>
@overload create_service_rollout
(request, options = nil)
Pass arguments to `create_service_rollout` via a request object, either of type {::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest} or an equivalent Hash. @param 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. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload create_service_rollout
(service_name: nil, rollout: nil)
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). @param service_name [::String] Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview) for naming requirements. For example: `example.googleapis.com`. @param rollout [::Google::Cloud::ServiceManagement::V1::Rollout, ::Hash] Required. The rollout resource. The `service_name` field is output only.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::Operation]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/service_management/v1/service_manager/client.rb, line 1048 def create_service_rollout request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::CreateServiceRolloutRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.create_service_rollout.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "service_name" => request.service_name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.create_service_rollout.timeout, metadata: metadata, retry_policy: @config.rpcs.create_service_rollout.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @service_manager_stub.call_rpc :create_service_rollout, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
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 {::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#undelete_service UndeleteService} to restore the service. After 30 days, the service will be permanently deleted.
Operation<response: google.protobuf.Empty>
@overload delete_service
(request, options = nil)
Pass arguments to `delete_service` via a request object, either of type {::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest} or an equivalent Hash. @param 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. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload delete_service
(service_name: nil)
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). @param service_name [::String] Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview) for naming requirements. For example: `example.googleapis.com`.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::Operation]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/service_management/v1/service_manager/client.rb, line 411 def delete_service request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::DeleteServiceRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.delete_service.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "service_name" => request.service_name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.delete_service.timeout, metadata: metadata, retry_policy: @config.rpcs.delete_service.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @service_manager_stub.call_rpc :delete_service, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Disables a {::Google::Cloud::ServiceManagement::V1::ManagedService service} for a project, so it can no longer be be used for the project. It prevents accidental usage that may cause unexpected billing charges or security leaks.
Operation<response: DisableServiceResponse>
@deprecated This method is deprecated and may be removed in the next major version update.
@overload disable_service
(request, options = nil)
Pass arguments to `disable_service` via a request object, either of type {::Google::Cloud::ServiceManagement::V1::DisableServiceRequest} or an equivalent Hash. @param request [::Google::Cloud::ServiceManagement::V1::DisableServiceRequest, ::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. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload disable_service
(service_name: nil, consumer_id: nil)
Pass arguments to `disable_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). @param service_name [::String] Required. Name of the service to disable. Specifying an unknown service name will cause the request to fail. @param consumer_id [::String] Required. The identity of consumer resource which service disablement will be applied to. The Google Service Management implementation accepts the following forms: - "project:<project_id>" Note: this is made compatible with google.api.servicecontrol.v1.Operation.consumer_id.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::Operation]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/service_management/v1/service_manager/client.rb, line 1303 def disable_service request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::DisableServiceRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.disable_service.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "service_name" => request.service_name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.disable_service.timeout, metadata: metadata, retry_policy: @config.rpcs.disable_service.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @service_manager_stub.call_rpc :disable_service, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Enables a {::Google::Cloud::ServiceManagement::V1::ManagedService service} for a project, so it can be used for the project. See [Cloud Auth Guide](cloud.google.com/docs/authentication) for more information.
Operation<response: EnableServiceResponse>
@deprecated This method is deprecated and may be removed in the next major version update.
@overload enable_service
(request, options = nil)
Pass arguments to `enable_service` via a request object, either of type {::Google::Cloud::ServiceManagement::V1::EnableServiceRequest} or an equivalent Hash. @param request [::Google::Cloud::ServiceManagement::V1::EnableServiceRequest, ::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. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload enable_service
(service_name: nil, consumer_id: nil)
Pass arguments to `enable_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). @param service_name [::String] Required. Name of the service to enable. Specifying an unknown service name will cause the request to fail. @param consumer_id [::String] Required. The identity of consumer resource which service enablement will be applied to. The Google Service Management implementation accepts the following forms: - "project:<project_id>" Note: this is made compatible with google.api.servicecontrol.v1.Operation.consumer_id.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::Operation]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/service_management/v1/service_manager/client.rb, line 1217 def enable_service request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::EnableServiceRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.enable_service.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "service_name" => request.service_name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.enable_service.timeout, metadata: metadata, retry_policy: @config.rpcs.enable_service.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @service_manager_stub.call_rpc :enable_service, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
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.
@overload generate_config_report
(request, options = nil)
Pass arguments to `generate_config_report` via a request object, either of type {::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest} or an equivalent Hash. @param 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. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload generate_config_report
(new_config: nil, old_config: nil)
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). @param 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::Cloud::ServiceManagement::V1::ConfigRef google.api.servicemanagement.v1.ConfigRef}, {::Google::Cloud::ServiceManagement::V1::ConfigSource google.api.servicemanagement.v1.ConfigSource}, and {::Google::Api::Service google.api.Service} @param 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::Cloud::ServiceManagement::V1::ConfigRef google.api.servicemanagement.v1.ConfigRef}, {::Google::Cloud::ServiceManagement::V1::ConfigSource google.api.servicemanagement.v1.ConfigSource}, and {::Google::Api::Service google.api.Service}
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Google::Cloud::ServiceManagement::V1::GenerateConfigReportResponse]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/service_management/v1/service_manager/client.rb, line 1137 def generate_config_report request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::GenerateConfigReportRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.generate_config_report.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.generate_config_report.timeout, metadata: metadata, retry_policy: @config.rpcs.generate_config_report.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @service_manager_stub.call_rpc :generate_config_report, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Gets a managed service. Authentication is required unless the service is public.
@overload get_service
(request, options = nil)
Pass arguments to `get_service` via a request object, either of type {::Google::Cloud::ServiceManagement::V1::GetServiceRequest} or an equivalent Hash. @param 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. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload get_service
(service_name: nil)
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). @param service_name [::String] Required. The name of the service. See the `ServiceManager` overview for naming requirements. For example: `example.googleapis.com`.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::ServiceManagement::V1::ManagedService] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Google::Cloud::ServiceManagement::V1::ManagedService]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/service_management/v1/service_manager/client.rb, line 271 def get_service request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::GetServiceRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.get_service.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "service_name" => request.service_name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_service.timeout, metadata: metadata, retry_policy: @config.rpcs.get_service.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @service_manager_stub.call_rpc :get_service, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Gets a service configuration (version) for a managed service.
@overload get_service_config
(request, options = nil)
Pass arguments to `get_service_config` via a request object, either of type {::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest} or an equivalent Hash. @param 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. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload get_service_config
(service_name: nil, config_id: nil, view: nil)
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). @param service_name [::String] Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview) for naming requirements. For example: `example.googleapis.com`. @param 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`. @param view [::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest::ConfigView] Specifies which parts of the Service Config should be returned in the response.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Api::Service] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Google::Api::Service]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/service_management/v1/service_manager/client.rb, line 640 def get_service_config request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::GetServiceConfigRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.get_service_config.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "service_name" => request.service_name, "config_id" => request.config_id } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_service_config.timeout, metadata: metadata, retry_policy: @config.rpcs.get_service_config.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @service_manager_stub.call_rpc :get_service_config, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Gets a service configuration {::Google::Cloud::ServiceManagement::V1::Rollout rollout}.
@overload get_service_rollout
(request, options = nil)
Pass arguments to `get_service_rollout` via a request object, either of type {::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest} or an equivalent Hash. @param 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. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload get_service_rollout
(service_name: nil, rollout_id: nil)
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). @param service_name [::String] Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview) for naming requirements. For example: `example.googleapis.com`. @param rollout_id [::String] Required. The id of the rollout resource.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Google::Cloud::ServiceManagement::V1::Rollout] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Google::Cloud::ServiceManagement::V1::Rollout]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/service_management/v1/service_manager/client.rb, line 963 def get_service_rollout request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::GetServiceRolloutRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.get_service_rollout.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "service_name" => request.service_name, "rollout_id" => request.rollout_id } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.get_service_rollout.timeout, metadata: metadata, retry_policy: @config.rpcs.get_service_rollout.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @service_manager_stub.call_rpc :get_service_rollout, request, options: options do |response, operation| yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Lists the history of the service configuration for a managed service, from the newest to the oldest.
@overload list_service_configs
(request, options = nil)
Pass arguments to `list_service_configs` via a request object, either of type {::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest} or an equivalent Hash. @param 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. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload list_service_configs
(service_name: nil, page_token: nil, page_size: nil)
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). @param service_name [::String] Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview) for naming requirements. For example: `example.googleapis.com`. @param page_token [::String] The token of the page to retrieve. @param 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.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Api::Service>] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::PagedEnumerable<::Google::Api::Service>]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/service_management/v1/service_manager/client.rb, line 562 def list_service_configs request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::ListServiceConfigsRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.list_service_configs.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "service_name" => request.service_name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_service_configs.timeout, metadata: metadata, retry_policy: @config.rpcs.list_service_configs.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @service_manager_stub.call_rpc :list_service_configs, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @service_manager_stub, :list_service_configs, request, response, operation, options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Lists the history of the service configuration rollouts for a managed service, from the newest to the oldest.
@overload list_service_rollouts
(request, options = nil)
Pass arguments to `list_service_rollouts` via a request object, either of type {::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest} or an equivalent Hash. @param 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. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload list_service_rollouts
(service_name: nil, page_token: nil, page_size: nil, filter: nil)
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). @param service_name [::String] Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview) for naming requirements. For example: `example.googleapis.com`. @param page_token [::String] The token of the page to retrieve. @param 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. @param 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'
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::Rollout>] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::Rollout>]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/service_management/v1/service_manager/client.rb, line 891 def list_service_rollouts request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.list_service_rollouts.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "service_name" => request.service_name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.list_service_rollouts.timeout, metadata: metadata, retry_policy: @config.rpcs.list_service_rollouts.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @service_manager_stub.call_rpc :list_service_rollouts, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @service_manager_stub, :list_service_rollouts, request, response, operation, options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
Lists managed services.
Returns all public services. For authenticated users, also returns all services the calling user has “servicemanagement.services.get” permission for.
BETA: If the caller specifies the `consumer_id`, it returns only the services enabled on the consumer. The `consumer_id` must have the format of “project:\{PROJECT-ID}”.
@overload list_services
(request, options = nil)
Pass arguments to `list_services` via a request object, either of type {::Google::Cloud::ServiceManagement::V1::ListServicesRequest} or an equivalent Hash. @param 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. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload list_services
(producer_project_id: nil, page_size: nil, page_token: nil, consumer_id: nil)
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). @param producer_project_id [::String] Include services produced by the specified project. @param 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. @param page_token [::String] Token identifying which result to start with; returned by a previous list call. @param consumer_id [::String] Include services consumed by the specified consumer. The Google Service Management implementation accepts the following forms: - project:<project_id>
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::ManagedService>] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::PagedEnumerable<::Google::Cloud::ServiceManagement::V1::ManagedService>]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/service_management/v1/service_manager/client.rb, line 206 def list_services request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::ListServicesRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.list_services.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id options.apply_defaults timeout: @config.rpcs.list_services.timeout, metadata: metadata, retry_policy: @config.rpcs.list_services.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @service_manager_stub.call_rpc :list_services, request, options: options do |response, operation| response = ::Gapic::PagedEnumerable.new @service_manager_stub, :list_services, request, response, operation, options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
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 {::Google::Cloud::ServiceManagement::V1::ServiceManager::Client#create_service_rollout 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>
@overload submit_config_source
(request, options = nil)
Pass arguments to `submit_config_source` via a request object, either of type {::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest} or an equivalent Hash. @param 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. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload submit_config_source
(service_name: nil, config_source: nil, validate_only: nil)
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). @param service_name [::String] Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview) for naming requirements. For example: `example.googleapis.com`. @param config_source [::Google::Cloud::ServiceManagement::V1::ConfigSource, ::Hash] Required. The source configuration for the service. @param 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.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::Operation]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/service_management/v1/service_manager/client.rb, line 806 def submit_config_source request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::SubmitConfigSourceRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.submit_config_source.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "service_name" => request.service_name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.submit_config_source.timeout, metadata: metadata, retry_policy: @config.rpcs.submit_config_source.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @service_manager_stub.call_rpc :submit_config_source, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end
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>
@overload undelete_service
(request, options = nil)
Pass arguments to `undelete_service` via a request object, either of type {::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest} or an equivalent Hash. @param 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. @param options [::Gapic::CallOptions, ::Hash] Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
@overload undelete_service
(service_name: nil)
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). @param service_name [::String] Required. The name of the service. See the [overview](https://cloud.google.com/service-management/overview) for naming requirements. For example: `example.googleapis.com`.
@yield [response, operation] Access the result along with the RPC operation @yieldparam response [::Gapic::Operation] @yieldparam operation [::GRPC::ActiveCall::Operation]
@return [::Gapic::Operation]
@raise [::Google::Cloud::Error] if the RPC is aborted.
# File lib/google/cloud/service_management/v1/service_manager/client.rb, line 486 def undelete_service request, options = nil raise ::ArgumentError, "request must be provided" if request.nil? request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ServiceManagement::V1::UndeleteServiceRequest # Converts hash and nil to an options object options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h # Customize the options with defaults metadata = @config.rpcs.undelete_service.metadata.to_h # Set x-goog-api-client and x-goog-user-project headers metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \ lib_name: @config.lib_name, lib_version: @config.lib_version, gapic_version: ::Google::Cloud::ServiceManagement::V1::VERSION metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id header_params = { "service_name" => request.service_name } request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&") metadata[:"x-goog-request-params"] ||= request_params_header options.apply_defaults timeout: @config.rpcs.undelete_service.timeout, metadata: metadata, retry_policy: @config.rpcs.undelete_service.retry_policy options.apply_defaults timeout: @config.timeout, metadata: @config.metadata, retry_policy: @config.retry_policy @service_manager_stub.call_rpc :undelete_service, request, options: options do |response, operation| response = ::Gapic::Operation.new response, @operations_client, options: options yield response, operation if block_given? return response end rescue ::GRPC::BadStatus => e raise ::Google::Cloud::Error.from_error(e) end