Network Connectivity V1alpha1 API - Class Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client (v0.6.1)

Reference documentation and code samples for the Network Connectivity V1alpha1 API class Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.

Client for the HubService service.

Network Connectivity Center is a hub-and-spoke abstraction for network connectivity management in Google Cloud. It reduces operational complexity through a simple, centralized connectivity management model.

Inherits

  • Object

Methods

.configure

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

Configure the HubService 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 HubService clients
::Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.configure do |config|
  config.timeout = 10.0
end

#configure

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

Configure the HubService 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_hub

def create_hub(request, options = nil) -> ::Gapic::Operation
def create_hub(parent: nil, hub_id: nil, hub: nil, request_id: nil) -> ::Gapic::Operation

Creates a new Hub in a given project and location.

Overloads
def create_hub(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_hub via a request object, either of type CreateHubRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkConnectivity::V1alpha1::CreateHubRequest, ::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_hub(parent: nil, hub_id: nil, hub: nil, request_id: nil) -> ::Gapic::Operation
Pass arguments to create_hub 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's name of the Hub.
  • hub_id (::String) — Optional. Unique id for the Hub to create.
  • hub (::Google::Cloud::NetworkConnectivity::V1alpha1::Hub, ::Hash) — Required. Initial values for a new Hub.
  • request_id (::String) — Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

    For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

    The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

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/network_connectivity/v1alpha1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkConnectivity::V1alpha1::CreateHubRequest.new

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

#create_spoke

def create_spoke(request, options = nil) -> ::Gapic::Operation
def create_spoke(parent: nil, spoke_id: nil, spoke: nil, request_id: nil) -> ::Gapic::Operation

Creates a new Spoke in a given project and location.

Overloads
def create_spoke(request, options = nil) -> ::Gapic::Operation
Pass arguments to create_spoke via a request object, either of type CreateSpokeRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkConnectivity::V1alpha1::CreateSpokeRequest, ::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_spoke(parent: nil, spoke_id: nil, spoke: nil, request_id: nil) -> ::Gapic::Operation
Pass arguments to create_spoke 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's resource name of the Spoke.
  • spoke_id (::String) — Optional. Unique id for the Spoke to create.
  • spoke (::Google::Cloud::NetworkConnectivity::V1alpha1::Spoke, ::Hash) — Required. Initial values for a new Hub.
  • request_id (::String) — Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

    For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

    The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

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/network_connectivity/v1alpha1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkConnectivity::V1alpha1::CreateSpokeRequest.new

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

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

Deletes a single Hub.

Overloads
def delete_hub(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_hub via a request object, either of type DeleteHubRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkConnectivity::V1alpha1::DeleteHubRequest, ::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_hub(name: nil, request_id: nil) -> ::Gapic::Operation
Pass arguments to delete_hub 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 Hub to delete.
  • request_id (::String) — Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes after the first request.

    For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

    The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

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/network_connectivity/v1alpha1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkConnectivity::V1alpha1::DeleteHubRequest.new

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

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

Deletes a single Spoke.

Overloads
def delete_spoke(request, options = nil) -> ::Gapic::Operation
Pass arguments to delete_spoke via a request object, either of type DeleteSpokeRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkConnectivity::V1alpha1::DeleteSpokeRequest, ::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_spoke(name: nil, request_id: nil) -> ::Gapic::Operation
Pass arguments to delete_spoke 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 Spoke to delete.
  • request_id (::String) — Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes after the first request.

    For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

    The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

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/network_connectivity/v1alpha1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkConnectivity::V1alpha1::DeleteSpokeRequest.new

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

def get_hub(request, options = nil) -> ::Google::Cloud::NetworkConnectivity::V1alpha1::Hub
def get_hub(name: nil) -> ::Google::Cloud::NetworkConnectivity::V1alpha1::Hub

Gets details of a single Hub.

Overloads
def get_hub(request, options = nil) -> ::Google::Cloud::NetworkConnectivity::V1alpha1::Hub
Pass arguments to get_hub via a request object, either of type GetHubRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkConnectivity::V1alpha1::GetHubRequest, ::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_hub(name: nil) -> ::Google::Cloud::NetworkConnectivity::V1alpha1::Hub
Pass arguments to get_hub 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. Name of the Hub resource to get.
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/network_connectivity/v1alpha1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkConnectivity::V1alpha1::GetHubRequest.new

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

# The returned object is of type Google::Cloud::NetworkConnectivity::V1alpha1::Hub.
p result

#get_spoke

def get_spoke(request, options = nil) -> ::Google::Cloud::NetworkConnectivity::V1alpha1::Spoke
def get_spoke(name: nil) -> ::Google::Cloud::NetworkConnectivity::V1alpha1::Spoke

Gets details of a single Spoke.

Overloads
def get_spoke(request, options = nil) -> ::Google::Cloud::NetworkConnectivity::V1alpha1::Spoke
Pass arguments to get_spoke via a request object, either of type GetSpokeRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkConnectivity::V1alpha1::GetSpokeRequest, ::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_spoke(name: nil) -> ::Google::Cloud::NetworkConnectivity::V1alpha1::Spoke
Pass arguments to get_spoke 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 Spoke resource.
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/network_connectivity/v1alpha1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkConnectivity::V1alpha1::GetSpokeRequest.new

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

# The returned object is of type Google::Cloud::NetworkConnectivity::V1alpha1::Spoke.
p result

#initialize

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

Create a new HubService client object.

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

# Create a client using a custom configuration
client = ::Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new do |config|
  config.timeout = 10.0
end

#list_hubs

def list_hubs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1alpha1::Hub>
def list_hubs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1alpha1::Hub>

Lists Hubs in a given project and location.

Overloads
def list_hubs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1alpha1::Hub>
Pass arguments to list_hubs via a request object, either of type ListHubsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkConnectivity::V1alpha1::ListHubsRequest, ::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_hubs(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1alpha1::Hub>
Pass arguments to list_hubs 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's name.
  • page_size (::Integer) — The maximum number of results per page that should be returned.
  • page_token (::String) — The page token.
  • filter (::String) — A filter expression that filters the results listed in the response.
  • order_by (::String) — Sort the results by a certain 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/network_connectivity/v1alpha1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkConnectivity::V1alpha1::ListHubsRequest.new

# Call the list_hubs method.
result = client.list_hubs 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::NetworkConnectivity::V1alpha1::Hub.
  p item
end

#list_spokes

def list_spokes(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1alpha1::Spoke>
def list_spokes(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1alpha1::Spoke>

Lists Spokes in a given project and location.

Overloads
def list_spokes(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1alpha1::Spoke>
Pass arguments to list_spokes via a request object, either of type ListSpokesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkConnectivity::V1alpha1::ListSpokesRequest, ::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_spokes(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1alpha1::Spoke>
Pass arguments to list_spokes 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's resource name.
  • page_size (::Integer) — The maximum number of results per page that should be returned.
  • page_token (::String) — The page token.
  • filter (::String) — A filter expression that filters the results listed in the response.
  • order_by (::String) — Sort the results by a certain 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/network_connectivity/v1alpha1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkConnectivity::V1alpha1::ListSpokesRequest.new

# Call the list_spokes method.
result = client.list_spokes 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::NetworkConnectivity::V1alpha1::Spoke.
  p item
end

#operations_client

def operations_client() -> ::Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Operations

Get the associated client for long-running operations.

#update_hub

def update_hub(request, options = nil) -> ::Gapic::Operation
def update_hub(update_mask: nil, hub: nil, request_id: nil) -> ::Gapic::Operation

Updates the parameters of a single Hub.

Overloads
def update_hub(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_hub via a request object, either of type UpdateHubRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkConnectivity::V1alpha1::UpdateHubRequest, ::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_hub(update_mask: nil, hub: nil, request_id: nil) -> ::Gapic::Operation
Pass arguments to update_hub 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
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Optional. Field mask is used to specify the fields to be overwritten in the Hub resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.
  • hub (::Google::Cloud::NetworkConnectivity::V1alpha1::Hub, ::Hash) — Required. The state that the Hub should be in after the update.
  • request_id (::String) — Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

    For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

    The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

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/network_connectivity/v1alpha1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkConnectivity::V1alpha1::UpdateHubRequest.new

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

#update_spoke

def update_spoke(request, options = nil) -> ::Gapic::Operation
def update_spoke(update_mask: nil, spoke: nil, request_id: nil) -> ::Gapic::Operation

Updates the parameters of a single Spoke.

Overloads
def update_spoke(request, options = nil) -> ::Gapic::Operation
Pass arguments to update_spoke via a request object, either of type UpdateSpokeRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkConnectivity::V1alpha1::UpdateSpokeRequest, ::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_spoke(update_mask: nil, spoke: nil, request_id: nil) -> ::Gapic::Operation
Pass arguments to update_spoke 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
  • update_mask (::Google::Protobuf::FieldMask, ::Hash) — Optional. Field mask is used to specify the fields to be overwritten in the Spoke resource by the update. The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.
  • spoke (::Google::Cloud::NetworkConnectivity::V1alpha1::Spoke, ::Hash) — Required. The state that the Spoke should be in after the update.
  • request_id (::String) — Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

    For example, consider a situation where you make an initial request and t he request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.

    The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).

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/network_connectivity/v1alpha1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::NetworkConnectivity::V1alpha1::HubService::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::NetworkConnectivity::V1alpha1::UpdateSpokeRequest.new

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