Reference documentation and code samples for the App Engine Admin V1 API class Google::Cloud::AppEngine::V1::Instances::Client.
Client for the Instances service.
Manages instances of a version.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::Configuration
Configure the Instances Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all Instances clients ::Google::Cloud::AppEngine::V1::Instances::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::Configuration
Configure the Instances 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)
#debug_instance
def debug_instance(request, options = nil) -> ::Gapic::Operation
def debug_instance(name: nil, ssh_key: nil) -> ::Gapic::Operation
Enables debugging on a VM instance. This allows you to use the SSH command to connect to the virtual machine where the instance lives. While in "debug mode", the instance continues to serve live traffic. You should delete the instance when you are done debugging and then allow the system to take over and determine if another instance should be started.
Only applicable for instances in App Engine flexible environment.
def debug_instance(request, options = nil) -> ::Gapic::Operation
debug_instance
via a request object, either of type
DebugInstanceRequest or an equivalent Hash.
- request (::Google::Cloud::AppEngine::V1::DebugInstanceRequest, ::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 debug_instance(name: nil, ssh_key: nil) -> ::Gapic::Operation
debug_instance
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/versions/v1/instances/instance-1
. -
ssh_key (::String) — Public SSH key to add to the instance. Examples:
[USERNAME]:ssh-rsa [KEY_VALUE] [USERNAME]
[USERNAME]:ssh-rsa [KEY_VALUE] google-ssh {"userName":"[USERNAME]","expireOn":"[EXPIRE_TIME]"}
For more information, see Adding and Removing SSH Keys.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/app_engine/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::AppEngine::V1::Instances::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::AppEngine::V1::DebugInstanceRequest.new # Call the debug_instance method. result = client.debug_instance 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_instance
def delete_instance(request, options = nil) -> ::Gapic::Operation
def delete_instance(name: nil) -> ::Gapic::Operation
Stops a running instance.
The instance might be automatically recreated based on the scaling settings of the version. For more information, see "How Instances are Managed" (standard environment | flexible environment).
To ensure that instances are not re-created and avoid getting billed, you
can stop all instances within the target version by changing the serving
status of the version to STOPPED
with the
apps.services.versions.patch
method.
def delete_instance(request, options = nil) -> ::Gapic::Operation
delete_instance
via a request object, either of type
DeleteInstanceRequest or an equivalent Hash.
- request (::Google::Cloud::AppEngine::V1::DeleteInstanceRequest, ::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_instance(name: nil) -> ::Gapic::Operation
delete_instance
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/versions/v1/instances/instance-1
.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
Basic example
require "google/cloud/app_engine/v1" # Create a client object. The client can be reused for multiple calls. client = Google::Cloud::AppEngine::V1::Instances::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::AppEngine::V1::DeleteInstanceRequest.new # Call the delete_instance method. result = client.delete_instance 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_instance
def get_instance(request, options = nil) -> ::Google::Cloud::AppEngine::V1::Instance
def get_instance(name: nil) -> ::Google::Cloud::AppEngine::V1::Instance
Gets instance information.
def get_instance(request, options = nil) -> ::Google::Cloud::AppEngine::V1::Instance
get_instance
via a request object, either of type
GetInstanceRequest or an equivalent Hash.
- request (::Google::Cloud::AppEngine::V1::GetInstanceRequest, ::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_instance(name: nil) -> ::Google::Cloud::AppEngine::V1::Instance
get_instance
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/versions/v1/instances/instance-1
.
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::AppEngine::V1::Instance)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC 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::Instances::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::AppEngine::V1::GetInstanceRequest.new # Call the get_instance method. result = client.get_instance request # The returned object is of type Google::Cloud::AppEngine::V1::Instance. p result
#initialize
def initialize() { |config| ... } -> Client
Create a new Instances client object.
- (config) — Configure the Instances client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::AppEngine::V1::Instances::Client.new # Create a client using a custom configuration client = ::Google::Cloud::AppEngine::V1::Instances::Client.new do |config| config.timeout = 10.0 end
#list_instances
def list_instances(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AppEngine::V1::Instance>
def list_instances(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AppEngine::V1::Instance>
Lists the instances of a version.
Tip: To aggregate details about instances over time, see the Stackdriver Monitoring API.
def list_instances(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AppEngine::V1::Instance>
list_instances
via a request object, either of type
ListInstancesRequest or an equivalent Hash.
- request (::Google::Cloud::AppEngine::V1::ListInstancesRequest, ::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_instances(parent: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::AppEngine::V1::Instance>
list_instances
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 Version resource. Example:
apps/myapp/services/default/versions/v1
. - page_size (::Integer) — Maximum results to return per page.
- page_token (::String) — Continuation token for fetching the next page of results.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::AppEngine::V1::Instance>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::AppEngine::V1::Instance>)
- (::Google::Cloud::Error) — if the RPC 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::Instances::Client.new # Create a request. To set request fields, pass in keyword arguments. request = Google::Cloud::AppEngine::V1::ListInstancesRequest.new # Call the list_instances method. result = client.list_instances 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::Instance. p item end
#logger
def logger() -> Logger
The logger used for request/response debug logging.
- (Logger)
#operations_client
def operations_client() -> ::Google::Cloud::AppEngine::V1::Instances::Operations
Get the associated client for long-running operations.
#universe_domain
def universe_domain() -> String
The effective universe domain
- (String)