Cloud Gaming V1 API - Class Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client (v0.4.4)

Reference documentation and code samples for the Cloud Gaming V1 API class Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client.

Client for the GameServerDeploymentsService service.

The game server deployment is used to control the deployment of Agones fleets.

Inherits

  • Object

Methods

.configure

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

Configure the GameServerDeploymentsService 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 GameServerDeploymentsService clients
::Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client.configure do |config|
  config.timeout = 10.0
end

#configure

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

Configure the GameServerDeploymentsService 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_game_server_deployment

def create_game_server_deployment(request, options = nil) -> ::Gapic::Operation
def create_game_server_deployment(parent: nil, deployment_id: nil, game_server_deployment: nil) -> ::Gapic::Operation

Creates a new game server deployment in a given project and location.

Overloads
def create_game_server_deployment(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_game_server_deployment via a request object, either of type CreateGameServerDeploymentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Gaming::V1::CreateGameServerDeploymentRequest, ::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_game_server_deployment(parent: nil, deployment_id: nil, game_server_deployment: nil) -> ::Gapic::Operation
Pass arguments to create_game_server_deployment 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) — Required. The parent resource name, in the following form: projects/{project}/locations/{location}.
  • deployment_id (::String) — Required. The ID of the game server delpoyment resource to be created.
  • game_server_deployment (::Google::Cloud::Gaming::V1::GameServerDeployment, ::Hash) — Required. The game server delpoyment resource to be created.
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/gaming/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client.new

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end

#delete_game_server_deployment

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

Deletes a single game server deployment.

Overloads
def delete_game_server_deployment(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_game_server_deployment via a request object, either of type DeleteGameServerDeploymentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Gaming::V1::DeleteGameServerDeploymentRequest, ::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_game_server_deployment(name: nil) -> ::Gapic::Operation
Pass arguments to delete_game_server_deployment 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) — Required. The name of the game server delpoyment to delete, in the following form: projects/{project}/locations/{location}/gameServerDeployments/{deployment}.
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/gaming/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client.new

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end

#fetch_deployment_state

def fetch_deployment_state(request, options = nil) -> ::Google::Cloud::Gaming::V1::FetchDeploymentStateResponse
def fetch_deployment_state(name: nil) -> ::Google::Cloud::Gaming::V1::FetchDeploymentStateResponse

Retrieves information about the current state of the game server deployment. Gathers all the Agones fleets and Agones autoscalers, including fleets running an older version of the game server deployment.

Overloads
def fetch_deployment_state(request, options = nil) -> ::Google::Cloud::Gaming::V1::FetchDeploymentStateResponse
Pass arguments to fetch_deployment_state via a request object, either of type FetchDeploymentStateRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Gaming::V1::FetchDeploymentStateRequest, ::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 fetch_deployment_state(name: nil) -> ::Google::Cloud::Gaming::V1::FetchDeploymentStateResponse
Pass arguments to fetch_deployment_state 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) — Required. The name of the game server delpoyment, in the following form: projects/{project}/locations/{location}/gameServerDeployments/{deployment}.
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/gaming/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client.new

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

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

# The returned object is of type Google::Cloud::Gaming::V1::FetchDeploymentStateResponse.
p result

#get_game_server_deployment

def get_game_server_deployment(request, options = nil) -> ::Google::Cloud::Gaming::V1::GameServerDeployment
def get_game_server_deployment(name: nil) -> ::Google::Cloud::Gaming::V1::GameServerDeployment

Gets details of a single game server deployment.

Overloads
def get_game_server_deployment(request, options = nil) -> ::Google::Cloud::Gaming::V1::GameServerDeployment
Pass arguments to get_game_server_deployment via a request object, either of type Google::Cloud::Gaming::V1::GetGameServerDeploymentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Gaming::V1::GetGameServerDeploymentRequest, ::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_game_server_deployment(name: nil) -> ::Google::Cloud::Gaming::V1::GameServerDeployment
Pass arguments to get_game_server_deployment 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) — Required. The name of the game server delpoyment to retrieve, in the following form: projects/{project}/locations/{location}/gameServerDeployments/{deployment}.
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/gaming/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client.new

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

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

# The returned object is of type Google::Cloud::Gaming::V1::GameServerDeployment.
p result

#get_game_server_deployment_rollout

def get_game_server_deployment_rollout(request, options = nil) -> ::Google::Cloud::Gaming::V1::GameServerDeploymentRollout
def get_game_server_deployment_rollout(name: nil) -> ::Google::Cloud::Gaming::V1::GameServerDeploymentRollout

Gets details a single game server deployment rollout.

Overloads
def get_game_server_deployment_rollout(request, options = nil) -> ::Google::Cloud::Gaming::V1::GameServerDeploymentRollout
Pass arguments to get_game_server_deployment_rollout via a request object, either of type Google::Cloud::Gaming::V1::GetGameServerDeploymentRolloutRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Gaming::V1::GetGameServerDeploymentRolloutRequest, ::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_game_server_deployment_rollout(name: nil) -> ::Google::Cloud::Gaming::V1::GameServerDeploymentRollout
Pass arguments to get_game_server_deployment_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).
Parameter
  • name (::String) — Required. The name of the game server delpoyment to retrieve, in the following form: projects/{project}/locations/{location}/gameServerDeployments/{deployment}/rollout.
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/gaming/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client.new

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

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

# The returned object is of type Google::Cloud::Gaming::V1::GameServerDeploymentRollout.
p result

#initialize

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

Create a new GameServerDeploymentsService client object.

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

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

#list_game_server_deployments

def list_game_server_deployments(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Gaming::V1::GameServerDeployment>
def list_game_server_deployments(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Gaming::V1::GameServerDeployment>

Lists game server deployments in a given project and location.

Overloads
def list_game_server_deployments(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Gaming::V1::GameServerDeployment>
Pass arguments to list_game_server_deployments via a request object, either of type ListGameServerDeploymentsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Gaming::V1::ListGameServerDeploymentsRequest, ::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_game_server_deployments(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Gaming::V1::GameServerDeployment>
Pass arguments to list_game_server_deployments 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) — Required. The parent resource name, in the following form: projects/{project}/locations/{location}.
  • page_size (::Integer) — Optional. The maximum number of items to return. If unspecified, the server will pick an appropriate default. The server may return fewer items than requested. A caller should only rely on response's next_page_token to determine if there are more GameServerDeployments left to be queried.
  • page_token (::String) — Optional. The next_page_token value returned from a previous List request, if any.
  • filter (::String) — Optional. The filter to apply to list results.
  • order_by (::String) — Optional. Specifies the ordering of results following syntax at https://cloud.google.com/apis/design/design_patterns#sorting_order.
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/gaming/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client.new

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

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

# The returned object is of type Gapic::PagedEnumerable. You can
# iterate over all elements by calling #each, and the enumerable
# will lazily make API calls to fetch subsequent pages. Other
# methods are also available for managing paging directly.
result.each do |response|
  # Each element is of type ::Google::Cloud::Gaming::V1::GameServerDeployment.
  p response
end

#operations_client

def operations_client() -> ::Google::Cloud::Gaming::V1::GameServerDeploymentsService::Operations

Get the associated client for long-running operations.

#preview_game_server_deployment_rollout

def preview_game_server_deployment_rollout(request, options = nil) -> ::Google::Cloud::Gaming::V1::PreviewGameServerDeploymentRolloutResponse
def preview_game_server_deployment_rollout(rollout: nil, update_mask: nil, preview_time: nil) -> ::Google::Cloud::Gaming::V1::PreviewGameServerDeploymentRolloutResponse

Previews the game server deployment rollout. This API does not mutate the rollout resource.

Overloads
def preview_game_server_deployment_rollout(request, options = nil) -> ::Google::Cloud::Gaming::V1::PreviewGameServerDeploymentRolloutResponse
Pass arguments to preview_game_server_deployment_rollout via a request object, either of type PreviewGameServerDeploymentRolloutRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Gaming::V1::PreviewGameServerDeploymentRolloutRequest, ::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 preview_game_server_deployment_rollout(rollout: nil, update_mask: nil, preview_time: nil) -> ::Google::Cloud::Gaming::V1::PreviewGameServerDeploymentRolloutResponse
Pass arguments to preview_game_server_deployment_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).
Parameters
  • rollout (::Google::Cloud::Gaming::V1::GameServerDeploymentRollout, ::Hash) — Required. The game server deployment rollout to be updated. Only fields specified in update_mask are updated.
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Optional. Mask of fields to update. At least one path must be supplied in this field. For the FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
  • preview_time (::Google::Protobuf::Timestamp, ::Hash) — Optional. The target timestamp to compute the preview. Defaults to the immediately after the proposed rollout completes.
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/gaming/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client.new

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

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

# The returned object is of type Google::Cloud::Gaming::V1::PreviewGameServerDeploymentRolloutResponse.
p result

#update_game_server_deployment

def update_game_server_deployment(request, options = nil) -> ::Gapic::Operation
def update_game_server_deployment(game_server_deployment: nil, update_mask: nil) -> ::Gapic::Operation

Patches a game server deployment.

Overloads
def update_game_server_deployment(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_game_server_deployment via a request object, either of type UpdateGameServerDeploymentRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Gaming::V1::UpdateGameServerDeploymentRequest, ::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_game_server_deployment(game_server_deployment: nil, update_mask: nil) -> ::Gapic::Operation
Pass arguments to update_game_server_deployment 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
  • game_server_deployment (::Google::Cloud::Gaming::V1::GameServerDeployment, ::Hash) — Required. The game server delpoyment to be updated. Only fields specified in update_mask are updated.
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Required. Mask of fields to update. At least one path must be supplied in this field. For the FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
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/gaming/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client.new

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end

#update_game_server_deployment_rollout

def update_game_server_deployment_rollout(request, options = nil) -> ::Gapic::Operation
def update_game_server_deployment_rollout(rollout: nil, update_mask: nil) -> ::Gapic::Operation

Patches a single game server deployment rollout. The method will not return an error if the update does not affect any existing realms. For example - if the default_game_server_config is changed but all existing realms use the override, that is valid. Similarly, if a non existing realm is explicitly called out in game_server_config_overrides field, that will also not result in an error.

Overloads
def update_game_server_deployment_rollout(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_game_server_deployment_rollout via a request object, either of type UpdateGameServerDeploymentRolloutRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Gaming::V1::UpdateGameServerDeploymentRolloutRequest, ::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_game_server_deployment_rollout(rollout: nil, update_mask: nil) -> ::Gapic::Operation
Pass arguments to update_game_server_deployment_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).
Parameters
  • rollout (::Google::Cloud::Gaming::V1::GameServerDeploymentRollout, ::Hash) — Required. The game server delpoyment rollout to be updated. Only fields specified in update_mask are updated.
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Required. Mask of fields to update. At least one path must be supplied in this field. For the FieldMask definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask
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/gaming/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Gaming::V1::GameServerDeploymentsService::Client.new

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

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

# The returned object is of type Gapic::Operation. You can use this
# object to check the status of an operation, cancel it, or wait
# for results. Here is how to block until completion:
result.wait_until_done! timeout: 60
if result.response?
  p result.response
else
  puts "Error!"
end