# App Engine Admin V1 API - Class Google::Cloud::AppEngine::V1::Services::Rest::Client (v1.8.0)

1.8.0 (latest) 1.7.0 1.6.0 1.5.1 1.4.0 1.3.0 1.2.1 1.1.0 1.0.1 0.10.0 0.9.2 0.8.0 0.7.0 0.6.1 0.5.0 0.4.0 0.3.6 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.


<br />

Manages services of an application.

## Inherits

- Object

## Methods

### .configure

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

Configure the Services Client class.


<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_engine-v1/latest/Google-Cloud-AppEngine-V1-Services-Rest-Client-Configuration "Google::Cloud::AppEngine::V1::Services::Rest::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_engine-v1/latest/Google-Cloud-AppEngine-V1-Services-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_engine-v1/latest/Google-Cloud-AppEngine-V1-Services-Rest-Client-Configuration))
**Example**

```ruby
# 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::Configuration

Configure 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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_engine-v1/latest/Google-Cloud-AppEngine-V1-Services-Rest-Client#Google__Cloud__AppEngine__V1__Services__Rest__Client_configure_class_ "Google::Cloud::AppEngine::V1::Services::Rest::Client.configure (method)").

<br />

See [Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_engine-v1/latest/Google-Cloud-AppEngine-V1-Services-Rest-Client-Configuration "Google::Cloud::AppEngine::V1::Services::Rest::Client::Configuration (class)")
for a description of the configuration fields.
**Yields**

- (config) --- Configure the Client client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_engine-v1/latest/Google-Cloud-AppEngine-V1-Services-Rest-Client-Configuration))
**Returns**

- ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_engine-v1/latest/Google-Cloud-AppEngine-V1-Services-Rest-Client-Configuration))

### #delete_service

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

Deletes the specified service and all enclosed versions.
**Overloads**

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

Pass arguments to `delete_service` via a request object, either of type [DeleteServiceRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_engine-v1/latest/Google-Cloud-AppEngine-V1-DeleteServiceRequest "Google::Cloud::AppEngine::V1::DeleteServiceRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::AppEngine::V1::DeleteServiceRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_engine-v1/latest/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::Operation

Pass arguments to `delete_service` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Name of the resource requested. Example: `apps/myapp/services/default`.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Operation)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
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::Service

Gets the current configuration of the specified service.
**Overloads**

    def get_service(request, options = nil) -> ::Google::Cloud::AppEngine::V1::Service

Pass arguments to `get_service` via a request object, either of type [GetServiceRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_engine-v1/latest/Google-Cloud-AppEngine-V1-GetServiceRequest "Google::Cloud::AppEngine::V1::GetServiceRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::AppEngine::V1::GetServiceRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_engine-v1/latest/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::Service

Pass arguments to `get_service` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameter**

- **name** (::String) --- Name of the resource requested. Example: `apps/myapp/services/default`.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** ([::Google::Cloud::AppEngine::V1::Service](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_engine-v1/latest/Google-Cloud-AppEngine-V1-Service))
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- ([::Google::Cloud::AppEngine::V1::Service](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_engine-v1/latest/Google-Cloud-AppEngine-V1-Service))
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
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| ... } -> Client

Create a new Services REST client object.
**Yields**

- (config) --- Configure the Services client.
**Yield Parameter**

- **config** ([Client::Configuration](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_engine-v1/latest/Google-Cloud-AppEngine-V1-Services-Rest-Client-Configuration))
**Returns**

- ([Client](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_engine-v1/latest/Google-Cloud-AppEngine-V1-Services-Rest-Client)) --- a new instance of Client
**Example**

```ruby
# 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.
**Overloads**

    def list_services(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::AppEngine::V1::Service>

Pass arguments to `list_services` via a request object, either of type [ListServicesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_engine-v1/latest/Google-Cloud-AppEngine-V1-ListServicesRequest "Google::Cloud::AppEngine::V1::ListServicesRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::AppEngine::V1::ListServicesRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_engine-v1/latest/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>

Pass arguments to `list_services` via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above). **Parameters**

- **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.
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::AppEngine::V1::Service](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_engine-v1/latest/Google-Cloud-AppEngine-V1-Service)\>)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Rest::PagedEnumerable\<[::Google::Cloud::AppEngine::V1::Service](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_engine-v1/latest/Google-Cloud-AppEngine-V1-Service)\>)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
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() -> Logger

The logger used for request/response debug logging.
**Returns**

- (Logger)

### #operations_client

    def operations_client() -> ::Google::Cloud::AppEngine::V1::Services::Rest::Operations

Get the associated client for long-running operations.
**Returns**

- ([::Google::Cloud::AppEngine::V1::Services::Rest::Operations](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_engine-v1/latest/Google-Cloud-AppEngine-V1-Services-Rest-Operations))

### #universe_domain

    def universe_domain() -> String

The effective universe domain
**Returns**

- (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::Operation

Updates the configuration of the specified service.
**Overloads**

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

Pass arguments to `update_service` via a request object, either of type [UpdateServiceRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_engine-v1/latest/Google-Cloud-AppEngine-V1-UpdateServiceRequest "Google::Cloud::AppEngine::V1::UpdateServiceRequest (class)") or an equivalent Hash. **Parameters**

- **request** ([::Google::Cloud::AppEngine::V1::UpdateServiceRequest](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_engine-v1/latest/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::Operation

Pass arguments to `update_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). **Parameters**

- **name** (::String) --- Name of the resource to update. Example: `apps/myapp/services/default`.
- **service** ([::Google::Cloud::AppEngine::V1::Service](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_engine-v1/latest/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](https://docs.cloud.google.com/ruby/docs/reference/google-cloud-app_engine-v1/latest/Google-Protobuf-FieldMask), ::Hash) --- Required. Standard field mask for the set of fields to be updated.
- **migrate_traffic** (::Boolean) --- Set to `true` to 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](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#InboundServiceType) and [automatic scaling](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services.versions#AutomaticScaling). You must specify the [`shardBy`](https://cloud.google.com/appengine/docs/admin-api/reference/rest/v1/apps.services#ShardBy) field in the Service resource. Gradual traffic migration is not supported in the App Engine flexible environment. For examples, see [Migrating and Splitting Traffic](https://cloud.google.com/appengine/docs/admin-api/migrating-splitting-traffic).
**Yields**

- (result, operation) --- Access the result along with the TransportOperation object
**Yield Parameters**

- **result** (::Gapic::Operation)
- **operation** (::Gapic::Rest::TransportOperation)
**Returns**

- (::Gapic::Operation)
**Raises**

- (::Google::Cloud::Error) --- if the REST call is aborted.
**Example**

Basic example

```ruby
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
```