Cloud Gaming V1 API - Class Google::Cloud::Gaming::V1::GameServerClustersService::Client (v0.5.0)

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

Client for the GameServerClustersService service.

The game server cluster maps to Kubernetes clusters running Agones and is used to manage fleets within clusters.

Inherits

  • Object

Methods

.configure

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

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

#configure

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

Configure the GameServerClustersService 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_cluster

def create_game_server_cluster(request, options = nil) -> ::Gapic::Operation
def create_game_server_cluster(parent: nil, game_server_cluster_id: nil, game_server_cluster: nil) -> ::Gapic::Operation

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

Overloads
def create_game_server_cluster(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_game_server_cluster via a request object, either of type CreateGameServerClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Gaming::V1::CreateGameServerClusterRequest, ::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_cluster(parent: nil, game_server_cluster_id: nil, game_server_cluster: nil) -> ::Gapic::Operation
Pass arguments to create_game_server_cluster 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}/realms/{realm-id}.
  • game_server_cluster_id (::String) — Required. The ID of the game server cluster resource to be created.
  • game_server_cluster (::Google::Cloud::Gaming::V1::GameServerCluster, ::Hash) — Required. The game server cluster 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::GameServerClustersService::Client.new

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

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

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

Deletes a single game server cluster.

Overloads
def delete_game_server_cluster(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_game_server_cluster via a request object, either of type DeleteGameServerClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Gaming::V1::DeleteGameServerClusterRequest, ::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_cluster(name: nil) -> ::Gapic::Operation
Pass arguments to delete_game_server_cluster 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 cluster to delete, in the following form: projects/{project}/locations/{location}/gameServerClusters/{cluster}.
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::GameServerClustersService::Client.new

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

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

#get_game_server_cluster

def get_game_server_cluster(request, options = nil) -> ::Google::Cloud::Gaming::V1::GameServerCluster
def get_game_server_cluster(name: nil, view: nil) -> ::Google::Cloud::Gaming::V1::GameServerCluster

Gets details of a single game server cluster.

Overloads
def get_game_server_cluster(request, options = nil) -> ::Google::Cloud::Gaming::V1::GameServerCluster
Pass arguments to get_game_server_cluster via a request object, either of type Google::Cloud::Gaming::V1::GetGameServerClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Gaming::V1::GetGameServerClusterRequest, ::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_cluster(name: nil, view: nil) -> ::Google::Cloud::Gaming::V1::GameServerCluster
Pass arguments to get_game_server_cluster 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) — Required. The name of the game server cluster to retrieve, in the following form: projects/{project}/locations/{location}/realms/{realm-id}/gameServerClusters/{cluster}.
  • view (::Google::Cloud::Gaming::V1::GameServerClusterView) — Optional. View for the returned GameServerCluster objects. When FULL is specified, the cluster_state field is also returned in the GameServerCluster object, which includes the state of the referenced Kubernetes cluster such as versions and provider info. The default/unset value is GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED, same as BASIC, which does not return the cluster_state field.
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::GameServerClustersService::Client.new

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

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

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

#initialize

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

Create a new GameServerClustersService client object.

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

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

#list_game_server_clusters

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

Lists game server clusters in a given project and location.

Overloads
def list_game_server_clusters(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Gaming::V1::GameServerCluster>
Pass arguments to list_game_server_clusters via a request object, either of type ListGameServerClustersRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Gaming::V1::ListGameServerClustersRequest, ::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_clusters(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil, view: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Gaming::V1::GameServerCluster>
Pass arguments to list_game_server_clusters 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}/realms/{realm}".
  • 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 GameServerClusters 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.
  • view (::Google::Cloud::Gaming::V1::GameServerClusterView) — Optional. View for the returned GameServerCluster objects. When FULL is specified, the cluster_state field is also returned in the GameServerCluster object, which includes the state of the referenced Kubernetes cluster such as versions and provider info. The default/unset value is GAME_SERVER_CLUSTER_VIEW_UNSPECIFIED, same as BASIC, which does not return the cluster_state field.
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::GameServerClustersService::Client.new

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

# Call the list_game_server_clusters method.
result = client.list_game_server_clusters 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::GameServerCluster.
  p response
end

#operations_client

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

Get the associated client for long-running operations.

#preview_create_game_server_cluster

def preview_create_game_server_cluster(request, options = nil) -> ::Google::Cloud::Gaming::V1::PreviewCreateGameServerClusterResponse
def preview_create_game_server_cluster(parent: nil, game_server_cluster_id: nil, game_server_cluster: nil, preview_time: nil, view: nil) -> ::Google::Cloud::Gaming::V1::PreviewCreateGameServerClusterResponse

Previews creation of a new game server cluster in a given project and location.

Overloads
def preview_create_game_server_cluster(request, options = nil) -> ::Google::Cloud::Gaming::V1::PreviewCreateGameServerClusterResponse
Pass arguments to preview_create_game_server_cluster via a request object, either of type PreviewCreateGameServerClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Gaming::V1::PreviewCreateGameServerClusterRequest, ::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_create_game_server_cluster(parent: nil, game_server_cluster_id: nil, game_server_cluster: nil, preview_time: nil, view: nil) -> ::Google::Cloud::Gaming::V1::PreviewCreateGameServerClusterResponse
Pass arguments to preview_create_game_server_cluster 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}/realms/{realm}.
  • game_server_cluster_id (::String) — Required. The ID of the game server cluster resource to be created.
  • game_server_cluster (::Google::Cloud::Gaming::V1::GameServerCluster, ::Hash) — Required. The game server cluster resource to be created.
  • preview_time (::Google::Protobuf::Timestamp, ::Hash) — Optional. The target timestamp to compute the preview.
  • view (::Google::Cloud::Gaming::V1::GameServerClusterView) — Optional. This field is deprecated, preview will always return KubernetesClusterState.
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::GameServerClustersService::Client.new

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

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

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

#preview_delete_game_server_cluster

def preview_delete_game_server_cluster(request, options = nil) -> ::Google::Cloud::Gaming::V1::PreviewDeleteGameServerClusterResponse
def preview_delete_game_server_cluster(name: nil, preview_time: nil) -> ::Google::Cloud::Gaming::V1::PreviewDeleteGameServerClusterResponse

Previews deletion of a single game server cluster.

Overloads
def preview_delete_game_server_cluster(request, options = nil) -> ::Google::Cloud::Gaming::V1::PreviewDeleteGameServerClusterResponse
Pass arguments to preview_delete_game_server_cluster via a request object, either of type PreviewDeleteGameServerClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Gaming::V1::PreviewDeleteGameServerClusterRequest, ::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_delete_game_server_cluster(name: nil, preview_time: nil) -> ::Google::Cloud::Gaming::V1::PreviewDeleteGameServerClusterResponse
Pass arguments to preview_delete_game_server_cluster 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) — Required. The name of the game server cluster to delete, in the following form: projects/{project}/locations/{location}/gameServerClusters/{cluster}.
  • preview_time (::Google::Protobuf::Timestamp, ::Hash) — Optional. The target timestamp to compute the preview.
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::GameServerClustersService::Client.new

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

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

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

#preview_update_game_server_cluster

def preview_update_game_server_cluster(request, options = nil) -> ::Google::Cloud::Gaming::V1::PreviewUpdateGameServerClusterResponse
def preview_update_game_server_cluster(game_server_cluster: nil, update_mask: nil, preview_time: nil) -> ::Google::Cloud::Gaming::V1::PreviewUpdateGameServerClusterResponse

Previews updating a GameServerCluster.

Overloads
def preview_update_game_server_cluster(request, options = nil) -> ::Google::Cloud::Gaming::V1::PreviewUpdateGameServerClusterResponse
Pass arguments to preview_update_game_server_cluster via a request object, either of type PreviewUpdateGameServerClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Gaming::V1::PreviewUpdateGameServerClusterRequest, ::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_update_game_server_cluster(game_server_cluster: nil, update_mask: nil, preview_time: nil) -> ::Google::Cloud::Gaming::V1::PreviewUpdateGameServerClusterResponse
Pass arguments to preview_update_game_server_cluster 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_cluster (::Google::Cloud::Gaming::V1::GameServerCluster, ::Hash) — Required. The game server cluster 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
  • preview_time (::Google::Protobuf::Timestamp, ::Hash) — Optional. The target timestamp to compute the preview.
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::GameServerClustersService::Client.new

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

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

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

#update_game_server_cluster

def update_game_server_cluster(request, options = nil) -> ::Gapic::Operation
def update_game_server_cluster(game_server_cluster: nil, update_mask: nil) -> ::Gapic::Operation

Patches a single game server cluster.

Overloads
def update_game_server_cluster(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_game_server_cluster via a request object, either of type UpdateGameServerClusterRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::Gaming::V1::UpdateGameServerClusterRequest, ::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_cluster(game_server_cluster: nil, update_mask: nil) -> ::Gapic::Operation
Pass arguments to update_game_server_cluster 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_cluster (::Google::Cloud::Gaming::V1::GameServerCluster, ::Hash) — Required. The game server cluster 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::GameServerClustersService::Client.new

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

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