API hub V1 API - Class Google::Cloud::ApiHub::V1::ApiHubAddon::Rest::Client (v1.3.0)

Reference documentation and code samples for the API hub V1 API class Google::Cloud::ApiHub::V1::ApiHubAddon::Rest::Client.

REST client for the ApiHubAddon service.

This service is used for managing addons inside the API Hub.

Inherits

  • Object

Methods

.configure

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

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

#configure

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

Configure the ApiHubAddon 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

#get_addon

def get_addon(request, options = nil) -> ::Google::Cloud::ApiHub::V1::Addon
def get_addon(name: nil) -> ::Google::Cloud::ApiHub::V1::Addon

Get an addon.

Overloads
def get_addon(request, options = nil) -> ::Google::Cloud::ApiHub::V1::Addon
Pass arguments to get_addon via a request object, either of type GetAddonRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ApiHub::V1::GetAddonRequest, ::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_addon(name: nil) -> ::Google::Cloud::ApiHub::V1::Addon
Pass arguments to get_addon 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 addon to get. Format: projects/{project}/locations/{location}/addons/{addon}.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/api_hub/v1"

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

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

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

# The returned object is of type Google::Cloud::ApiHub::V1::Addon.
p result

#initialize

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

Create a new ApiHubAddon REST client object.

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

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

#list_addons

def list_addons(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApiHub::V1::Addon>
def list_addons(parent: nil, filter: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApiHub::V1::Addon>

List addons.

Overloads
def list_addons(request, options = nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApiHub::V1::Addon>
Pass arguments to list_addons via a request object, either of type ListAddonsRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ApiHub::V1::ListAddonsRequest, ::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_addons(parent: nil, filter: nil, page_size: nil, page_token: nil) -> ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApiHub::V1::Addon>
Pass arguments to list_addons 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 where this addon will be created. Format: projects/{project}/locations/{location}.
  • filter (::String) — Optional. An expression that filters the list of addons. The only supported filter is plugin_instance_name. It can be used to filter addons that are enabled for a given plugin instance. The format of the filter is plugin_instance_name = "projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}".
  • page_size (::Integer) — Optional. The maximum number of hub addons to return. The service may return fewer than this value. If unspecified, at most 50 hub addons will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.
  • page_token (::String) — Optional. A page token, received from a previous ListAddons call. Provide this to retrieve the subsequent page.

    When paginating, all other parameters (except page_size) provided to ListAddons must match the call that provided the page token.

Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
Returns
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/api_hub/v1"

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

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

# Call the list_addons method.
result = client.list_addons 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::ApiHub::V1::Addon.
  p item
end

#location_client

def location_client() -> Google::Cloud::Location::Locations::Rest::Client

Get the associated client for mix-in of the Locations.

Returns
  • (Google::Cloud::Location::Locations::Rest::Client)

#logger

def logger() -> Logger

The logger used for request/response debug logging.

Returns
  • (Logger)

#manage_addon_config

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

Manage addon config. This RPC is used for managing the config of the addon. Calling this RPC moves the addon into an updating state until the long-running operation succeeds.

Overloads
def manage_addon_config(request, options = nil) -> ::Gapic::Operation
Pass arguments to manage_addon_config via a request object, either of type ManageAddonConfigRequest or an equivalent Hash.
Parameters
  • request (::Google::Cloud::ApiHub::V1::ManageAddonConfigRequest, ::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 manage_addon_config(name: nil, config: nil) -> ::Gapic::Operation
Pass arguments to manage_addon_config 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 addon for which the config is to be managed. Format: projects/{project}/locations/{location}/addons/{addon}.
  • config (::Google::Cloud::ApiHub::V1::AddonConfig, ::Hash) — Required. The config of the addon to be managed. This config will replace the config present in the addon. The type of the config should match the config type already present in the addon.
Yields
  • (result, operation) — Access the result along with the TransportOperation object
Yield Parameters
  • result (::Gapic::Operation)
  • operation (::Gapic::Rest::TransportOperation)
Returns
  • (::Gapic::Operation)
Raises
  • (::Google::Cloud::Error) — if the REST call is aborted.
Example

Basic example

require "google/cloud/api_hub/v1"

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

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

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

#operations_client

def operations_client() -> ::Google::Cloud::ApiHub::V1::ApiHubAddon::Rest::Operations

Get the associated client for long-running operations.

#universe_domain

def universe_domain() -> String

The effective universe domain

Returns
  • (String)