App Engine Admin V1 API - Class Google::Cloud::AppEngine::V1::Versions::Client (v0.10.0)

Reference documentation and code samples for the App Engine Admin V1 API class Google::Cloud::AppEngine::V1::Versions::Client.

Client for the Versions service.

Manages versions of a service.

Inherits

  • Object

Methods

.configure

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

Configure the Versions Client class.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter
Example
# Modify the configuration for all Versions clients
::Google::Cloud::AppEngine::V1::Versions::Client.configure do |config|
  config.timeout = 10.0
end

#configure

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

Configure the Versions Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.

See Configuration for a description of the configuration fields.

Yields
  • (config) — Configure the Client client.
Yield Parameter

#create_version

def create_version(request, options = nil) -> ::Gapic::Operation
def create_version(parent: nil, version: nil) -> ::Gapic::Operation

Deploys code and resource files to a new version.

Overloads
def create_version(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_version via a request object, either of type CreateVersionRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AppEngine::V1::CreateVersionRequest, ::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_version(parent: nil, version: nil) -> ::Gapic::Operation
Pass arguments to create_version 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 resource to create this version under. Example: apps/myapp/services/default.
  • version (::Google::Cloud::AppEngine::V1::Version, ::Hash) — Application deployment configuration.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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::Versions::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AppEngine::V1::CreateVersionRequest.new

# Call the create_version method.
result = client.create_version 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_version

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

Deletes an existing Version resource.

Overloads
def delete_version(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_version via a request object, either of type DeleteVersionRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AppEngine::V1::DeleteVersionRequest, ::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_version(name: nil) -> ::Gapic::Operation
Pass arguments to delete_version 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/versions/v1.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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::Versions::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AppEngine::V1::DeleteVersionRequest.new

# Call the delete_version method.
result = client.delete_version 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_version

def get_version(request, options = nil) -> ::Google::Cloud::AppEngine::V1::Version
def get_version(name: nil, view: nil) -> ::Google::Cloud::AppEngine::V1::Version

Gets the specified Version resource. By default, only a BASIC_VIEW will be returned. Specify the FULL_VIEW parameter to get the full resource.

Overloads
def get_version(request, options = nil) -> ::Google::Cloud::AppEngine::V1::Version
Pass arguments to get_version via a request object, either of type GetVersionRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AppEngine::V1::GetVersionRequest, ::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_version(name: nil, view: nil) -> ::Google::Cloud::AppEngine::V1::Version
Pass arguments to get_version 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 requested. Example: apps/myapp/services/default/versions/v1.
  • view (::Google::Cloud::AppEngine::V1::VersionView) — Controls the set of fields returned in the Get response.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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::Versions::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AppEngine::V1::GetVersionRequest.new

# Call the get_version method.
result = client.get_version request

# The returned object is of type Google::Cloud::AppEngine::V1::Version.
p result

#initialize

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

Create a new Versions client object.

Yields
  • (config) — Configure the Versions client.
Yield Parameter
Returns
  • (Client) — a new instance of Client
Example
# Create a client using the default configuration
client = ::Google::Cloud::AppEngine::V1::Versions::Client.new

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

#list_versions

def list_versions(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AppEngine::V1::Version>
def list_versions(parent: nil, view: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AppEngine::V1::Version>

Lists the versions of a service.

Overloads
def list_versions(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AppEngine::V1::Version>
Pass arguments to list_versions via a request object, either of type ListVersionsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AppEngine::V1::ListVersionsRequest, ::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_versions(parent: nil, view: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AppEngine::V1::Version>
Pass arguments to list_versions 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 Service resource. Example: apps/myapp/services/default.
  • view (::Google::Cloud::AppEngine::V1::VersionView) — Controls the set of fields returned in the List response.
  • page_size (::Integer) — Maximum results to return per page.
  • page_token (::String) — Continuation token for fetching the next page of results.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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::Versions::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AppEngine::V1::ListVersionsRequest.new

# Call the list_versions method.
result = client.list_versions 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::Version.
  p item
end

#operations_client

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

Get the associated client for long-running operations.

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)

#update_version

def update_version(request, options = nil) -> ::Gapic::Operation
def update_version(name: nil, version: nil, update_mask: nil) -> ::Gapic::Operation

Updates the specified Version resource. You can specify the following fields depending on the App Engine environment and type of scaling that the version resource uses:

Standard environment

automatic scaling in the standard environment:

basic scaling or manual scaling in the standard environment:

Flexible environment

automatic scaling in the flexible environment:

manual scaling in the flexible environment:

Overloads
def update_version(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_version via a request object, either of type UpdateVersionRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::AppEngine::V1::UpdateVersionRequest, ::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_version(name: nil, version: nil, update_mask: nil) -> ::Gapic::Operation
Pass arguments to update_version 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/versions/1.
  • version (::Google::Cloud::AppEngine::V1::Version, ::Hash) — A Version containing the updated resource. Only fields set in the field mask will be updated.
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Standard field mask for the set of fields to be updated.
Yields
  • (response, operation) — Access the result along with the RPC operation
Yield Parameters
  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the RPC is aborted.
Example

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::Versions::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::AppEngine::V1::UpdateVersionRequest.new

# Call the update_version method.
result = client.update_version 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