Network Connectivity V1 API - Class Google::Cloud::NetworkConnectivity::V1::HubService::Client (v0.2.0)

Reference documentation and code samples for the Network Connectivity V1 API class Google::Cloud::NetworkConnectivity::V1::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::V1::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 the specified project.

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::V1::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.
  • hub_id (::String) — Required. A unique identifier for the hub.
  • hub (::Google::Cloud::NetworkConnectivity::V1::Hub, ::Hash) — Required. The initial values for a new hub.
  • request_id (::String) — Optional. A unique request ID (optional). If you specify this ID, you can use it in cases when you need to retry your request. When you need to retry, this ID lets the server know that it can ignore the request if it has already been completed. The server guarantees that for at least 60 minutes after the first request.

    For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check to see whether the original operation was received. If it was, the server ignores the second request. This behavior prevents clients from mistakenly 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/v1"

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

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

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

#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 spoke in the specified 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::V1::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 resource.
  • spoke_id (::String) — Required. Unique id for the spoke to create.
  • spoke (::Google::Cloud::NetworkConnectivity::V1::Spoke, ::Hash) — Required. The initial values for a new spoke.
  • request_id (::String) — Optional. A unique request ID (optional). If you specify this ID, you can use it in cases when you need to retry your request. When you need to retry, this ID lets the server know that it can ignore the request if it has already been completed. The server guarantees that for at least 60 minutes after the first request.

    For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check to see whether the original operation was received. If it was, the server ignores the second request. This behavior prevents clients from mistakenly 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/v1"

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

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

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

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

Deletes the specified 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::V1::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. A unique request ID (optional). If you specify this ID, you can use it in cases when you need to retry your request. When you need to retry, this ID lets the server know that it can ignore the request if it has already been completed. The server guarantees that for at least 60 minutes after the first request.

    For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check to see whether the original operation was received. If it was, the server ignores the second request. This behavior prevents clients from mistakenly 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/v1"

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

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

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

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

Deletes the specified 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::V1::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. A unique request ID (optional). If you specify this ID, you can use it in cases when you need to retry your request. When you need to retry, this ID lets the server know that it can ignore the request if it has already been completed. The server guarantees that for at least 60 minutes after the first request.

    For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check to see whether the original operation was received. If it was, the server ignores the second request. This behavior prevents clients from mistakenly 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/v1"

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

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

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

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

Gets details about the specified hub.

Overloads
def get_hub(request, options = nil) -> ::Google::Cloud::NetworkConnectivity::V1::Hub
Pass arguments to get_hub via a request object, either of type GetHubRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkConnectivity::V1::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::V1::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. The 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/v1"

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

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

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

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

#get_spoke

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

Gets details about the specified spoke.

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

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

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

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

# The returned object is of type Google::Cloud::NetworkConnectivity::V1::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::V1::HubService::Client.new

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

#list_hubs

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

Lists hubs in a given project.

Overloads
def list_hubs(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::Hub>
Pass arguments to list_hubs via a request object, either of type ListHubsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkConnectivity::V1::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::V1::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) — An 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/v1"

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

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

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

#list_spokes

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

Lists the spokes in the specified project and location.

Overloads
def list_spokes(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::NetworkConnectivity::V1::Spoke>
Pass arguments to list_spokes via a request object, either of type ListSpokesRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::NetworkConnectivity::V1::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::V1::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 resource.
  • page_size (::Integer) — The maximum number of results per page that should be returned.
  • page_token (::String) — The page token.
  • filter (::String) — An 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/v1"

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

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

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

#operations_client

def operations_client() -> ::Google::Cloud::NetworkConnectivity::V1::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 description and/or labels of the specified 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::V1::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. In the case of an update to an existing hub, field mask is used to specify the fields to be overwritten. The fields specified in the update_mask are relative to the resource, not the full request. A field is overwritten if it is in the mask. If the user does not provide a mask, then all fields are overwritten.
  • hub (::Google::Cloud::NetworkConnectivity::V1::Hub, ::Hash) — Required. The state that the hub should be in after the update.
  • request_id (::String) — Optional. A unique request ID (optional). If you specify this ID, you can use it in cases when you need to retry your request. When you need to retry, this ID lets the server know that it can ignore the request if it has already been completed. The server guarantees that for at least 60 minutes after the first request.

    For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check to see whether the original operation was received. If it was, the server ignores the second request. This behavior prevents clients from mistakenly 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/v1"

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

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

# Call the update_hub method.
result = client.update_hub 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_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 the specified 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::V1::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. In the case of an update to an existing spoke, field mask is used to specify the fields to be overwritten. The fields specified in the update_mask are relative to the resource, not the full request. A field is overwritten if it is in the mask. If the user does not provide a mask, then all fields are overwritten.
  • spoke (::Google::Cloud::NetworkConnectivity::V1::Spoke, ::Hash) — Required. The state that the spoke should be in after the update.
  • request_id (::String) — Optional. A unique request ID (optional). If you specify this ID, you can use it in cases when you need to retry your request. When you need to retry, this ID lets the server know that it can ignore the request if it has already been completed. The server guarantees that for at least 60 minutes after the first request.

    For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check to see whether the original operation was received. If it was, the server ignores the second request. This behavior prevents clients from mistakenly 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/v1"

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

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

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