Reference documentation and code samples for the App Engine Admin V1 API class Google::Cloud::AppEngine::V1::Services::Rest::Client.
REST client for the Services service.
Manages services of an application.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::ConfigurationConfigure the Services Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all Services clients ::Google::Cloud::AppEngine::V1::Services::Rest::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::ConfigurationConfigure the Services 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)
#delete_service
def delete_service(request, options = nil) -> ::Gapic::Operation
def delete_service(name: nil) -> ::Gapic::OperationDeletes the specified service and all enclosed versions.
def delete_service(request, options = nil) -> ::Gapic::Operationdelete_service via a request object, either of type
DeleteServiceRequest or an equivalent Hash.
- request (::Google::Cloud::AppEngine::V1::DeleteServiceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def delete_service(name: nil) -> ::Gapic::Operationdelete_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).
-
name (::String) — Name of the resource requested. Example:
apps/myapp/services/default.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Operation)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/app_engine/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::AppEngine::V1::Services::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::AppEngine::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
#get_service
def get_service(request, options = nil) -> ::Google::Cloud::AppEngine::V1::Service
def get_service(name: nil) -> ::Google::Cloud::AppEngine::V1::ServiceGets the current configuration of the specified service.
def get_service(request, options = nil) -> ::Google::Cloud::AppEngine::V1::Serviceget_service via a request object, either of type
GetServiceRequest or an equivalent Hash.
- request (::Google::Cloud::AppEngine::V1::GetServiceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def get_service(name: nil) -> ::Google::Cloud::AppEngine::V1::Serviceget_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).
-
name (::String) — Name of the resource requested. Example:
apps/myapp/services/default.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Google::Cloud::AppEngine::V1::Service)
- operation (::Gapic::Rest::TransportOperation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/app_engine/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::AppEngine::V1::Services::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::AppEngine::V1::GetServiceRequest.new # Call the get_service method. result = client.get_service request # The returned object is of type Google::Cloud::AppEngine::V1::Service. p result
#initialize
def initialize() { |config| ... } -> ClientCreate a new Services REST client object.
- (config) — Configure the Services client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::AppEngine::V1::Services::Rest::Client.new # Create a client using a custom configuration client = ::Google::Cloud::AppEngine::V1::Services::Rest::Client.new do |config| config.timeout = 10.0 end
#list_services
def list_services(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AppEngine::V1::Service>
def list_services(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AppEngine::V1::Service>Lists all the services in the application.
def list_services(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AppEngine::V1::Service>list_services via a request object, either of type
ListServicesRequest or an equivalent Hash.
- request (::Google::Cloud::AppEngine::V1::ListServicesRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def list_services(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AppEngine::V1::Service>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).
-
parent (::String) — Name of the parent Application resource. Example:
apps/myapp. - page_size (::Integer) — Maximum results to return per page.
- page_token (::String) — Continuation token for fetching the next page of results.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Rest::PagedEnumerable<::Google::Cloud::AppEngine::V1::Service>)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Rest::PagedEnumerable<::Google::Cloud::AppEngine::V1::Service>)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/app_engine/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::AppEngine::V1::Services::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::AppEngine::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::AppEngine::V1::Service. p item end
#logger
def logger() -> LoggerThe logger used for request/response debug logging.
- (Logger)
#operations_client
def operations_client() -> ::Google::Cloud::AppEngine::V1::Services::Rest::OperationsGet the associated client for long-running operations.
#universe_domain
def universe_domain() -> StringThe effective universe domain
- (String)
#update_service
def update_service(request, options = nil) -> ::Gapic::Operation
def update_service(name: nil, service: nil, update_mask: nil, migrate_traffic: nil) -> ::Gapic::OperationUpdates the configuration of the specified service.
def update_service(request, options = nil) -> ::Gapic::Operationupdate_service via a request object, either of type
UpdateServiceRequest or an equivalent Hash.
- request (::Google::Cloud::AppEngine::V1::UpdateServiceRequest, ::Hash) — A request object representing the call parameters. Required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
def update_service(name: nil, service: nil, update_mask: nil, migrate_traffic: nil) -> ::Gapic::Operationupdate_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).
-
name (::String) — Name of the resource to update. Example:
apps/myapp/services/default. - service (::Google::Cloud::AppEngine::V1::Service, ::Hash) — A Service resource containing the updated service. Only fields set in the field mask will be updated.
- update_mask (::Google::Protobuf::FieldMask, ::Hash) — Required. Standard field mask for the set of fields to be updated.
-
migrate_traffic (::Boolean) — Set to
trueto gradually shift traffic to one or more versions that you specify. By default, traffic is shifted immediately. For gradual traffic migration, the target versions must be located within instances that are configured for both warmup requests and automatic scaling. You must specify theshardByfield in the Service resource. Gradual traffic migration is not supported in the App Engine flexible environment. For examples, see Migrating and Splitting Traffic.
- (result, operation) — Access the result along with the TransportOperation object
- result (::Gapic::Operation)
- operation (::Gapic::Rest::TransportOperation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the REST call is aborted.
Basic example
require "google/cloud/app_engine/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::AppEngine::V1::Services::Rest::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::AppEngine::V1::UpdateServiceRequest.new # Call the update_service method. result = client.update_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