Class: Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/api_hub/v1/api_hub_plugin/rest/client.rb

Overview

REST client for the ApiHubPlugin service.

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

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#attribute_path, #location_path, #plugin_instance_path, #plugin_path, #service_account_path

Constructor Details

#initialize {|config| ... } ⇒ Client

Create a new ApiHubPlugin REST client object.

Examples:


# Create a client using the default configuration
client = ::Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::Client.new

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

Yields:

  • (config)

    Configure the ApiHubPlugin client.

Yield Parameters:



136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/google/cloud/api_hub/v1/api_hub_plugin/rest/client.rb', line 136

def initialize
  # Create the configuration object
  @config = Configuration.new Client.configure

  # Yield the configuration if needed
  yield @config if block_given?

  # Create credentials
  credentials = @config.credentials
  # Use self-signed JWT if the endpoint is unchanged from default,
  # but only if the default endpoint does not have a region prefix.
  enable_self_signed_jwt = @config.endpoint.nil? ||
                           (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
                           !@config.endpoint.split(".").first.include?("-"))
  credentials ||= Credentials.default scope: @config.scope,
                                      enable_self_signed_jwt: enable_self_signed_jwt
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
    credentials = Credentials.new credentials, scope: @config.scope
  end

  @quota_project_id = @config.quota_project
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id

  @operations_client = ::Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::Operations.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
    config.universe_domain = @config.universe_domain
  end

  @api_hub_plugin_stub = ::Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::ServiceStub.new(
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    credentials: credentials,
    logger: @config.logger
  )

  @api_hub_plugin_stub.logger(stub: true)&.info do |entry|
    entry.set_system_name
    entry.set_service
    entry.message = "Created client for #{entry.service}"
    entry.set_credentials_fields credentials
    entry.set "customEndpoint", @config.endpoint if @config.endpoint
    entry.set "defaultTimeout", @config.timeout if @config.timeout
    entry.set "quotaProject", @quota_project_id if @quota_project_id
  end

  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @api_hub_plugin_stub.endpoint
    config.universe_domain = @api_hub_plugin_stub.universe_domain
    config.bindings_override = @config.bindings_override
    config.logger = @api_hub_plugin_stub.logger if config.respond_to? :logger=
  end
end

Instance Attribute Details

#location_clientGoogle::Cloud::Location::Locations::Rest::Client (readonly)

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

Returns:

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


206
207
208
# File 'lib/google/cloud/api_hub/v1/api_hub_plugin/rest/client.rb', line 206

def location_client
  @location_client
end

#operations_client::Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::Operations (readonly)

Get the associated client for long-running operations.



199
200
201
# File 'lib/google/cloud/api_hub/v1/api_hub_plugin/rest/client.rb', line 199

def operations_client
  @operations_client
end

Class Method Details

.configure {|config| ... } ⇒ Client::Configuration

Configure the ApiHubPlugin Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all ApiHubPlugin clients
::Google::Cloud::ApiHub::V1::ApiHubPlugin::Rest::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/google/cloud/api_hub/v1/api_hub_plugin/rest/client.rb', line 65

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "ApiHub", "V1"]
    parent_config = while namespace.any?
                      parent_name = namespace.join "::"
                      parent_const = const_get parent_name
                      break parent_const.configure if parent_const.respond_to? :configure
                      namespace.pop
                    end
    default_config = Client::Configuration.new parent_config

    default_config.rpcs.get_plugin.timeout = 60.0
    default_config.rpcs.get_plugin.retry_policy = {
      initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
    }

    default_config.rpcs.enable_plugin.timeout = 60.0

    default_config.rpcs.disable_plugin.timeout = 60.0

    default_config
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

#configure {|config| ... } ⇒ Client::Configuration

Configure the ApiHubPlugin 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 configure.

See Configuration for a description of the configuration fields.

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



106
107
108
109
# File 'lib/google/cloud/api_hub/v1/api_hub_plugin/rest/client.rb', line 106

def configure
  yield @config if block_given?
  @config
end

#create_plugin(request, options = nil) ⇒ ::Google::Cloud::ApiHub::V1::Plugin #create_plugin(parent: nil, plugin_id: nil, plugin: nil) ⇒ ::Google::Cloud::ApiHub::V1::Plugin

Create an API Hub plugin resource in the API hub. Once a plugin is created, it can be used to create plugin instances.

Examples:

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::ApiHubPlugin::Rest::Client.new

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

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

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

Overloads:

  • #create_plugin(request, options = nil) ⇒ ::Google::Cloud::ApiHub::V1::Plugin

    Pass arguments to create_plugin via a request object, either of type CreatePluginRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ApiHub::V1::CreatePluginRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #create_plugin(parent: nil, plugin_id: nil, plugin: nil) ⇒ ::Google::Cloud::ApiHub::V1::Plugin

    Pass arguments to create_plugin 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) (defaults to: nil)

      Required. The parent resource where this plugin will be created. Format: projects/{project}/locations/{location}.

    • plugin_id (::String) (defaults to: nil)

      Optional. The ID to use for the Plugin resource, which will become the final component of the Plugin's resource name. This field is optional.

      • If provided, the same will be used. The service will throw an error if the specified id is already used by another Plugin resource in the API hub instance.
      • If not provided, a system generated id will be used.

      This value should be 4-63 characters, overall resource name which will be of format projects/{project}/locations/{location}/plugins/{plugin}, its length is limited to 1000 characters and valid characters are /[a-z][A-Z][0-9]-_/.

    • plugin (::Google::Cloud::ApiHub::V1::Plugin, ::Hash) (defaults to: nil)

      Required. The plugin to create.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
# File 'lib/google/cloud/api_hub/v1/api_hub_plugin/rest/client.rb', line 519

def create_plugin request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::CreatePluginRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_plugin..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_plugin.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_plugin.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @api_hub_plugin_stub.create_plugin request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_plugin_instance(request, options = nil) ⇒ ::Gapic::Operation #create_plugin_instance(parent: nil, plugin_instance_id: nil, plugin_instance: nil) ⇒ ::Gapic::Operation

Creates a Plugin instance in the API hub.

Examples:

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::ApiHubPlugin::Rest::Client.new

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

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

Overloads:

  • #create_plugin_instance(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_plugin_instance via a request object, either of type CreatePluginInstanceRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ApiHub::V1::CreatePluginInstanceRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #create_plugin_instance(parent: nil, plugin_instance_id: nil, plugin_instance: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_plugin_instance 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) (defaults to: nil)

      Required. The parent of the plugin instance resource. Format: projects/{project}/locations/{location}/plugins/{plugin}

    • plugin_instance_id (::String) (defaults to: nil)

      Optional. The ID to use for the plugin instance, which will become the final component of the plugin instance's resource name. This field is optional.

      • If provided, the same will be used. The service will throw an error if the specified id is already used by another plugin instance in the plugin resource.
      • If not provided, a system generated id will be used.

      This value should be 4-63 characters, and valid characters are /[a-z][A-Z][0-9]-_/.

    • plugin_instance (::Google::Cloud::ApiHub::V1::PluginInstance, ::Hash) (defaults to: nil)

      Required. The plugin instance to create.

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.



828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
# File 'lib/google/cloud/api_hub/v1/api_hub_plugin/rest/client.rb', line 828

def create_plugin_instance request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::CreatePluginInstanceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.create_plugin_instance..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.create_plugin_instance.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_plugin_instance.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @api_hub_plugin_stub.create_plugin_instance request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_plugin(request, options = nil) ⇒ ::Gapic::Operation #delete_plugin(name: nil) ⇒ ::Gapic::Operation

Delete a Plugin in API hub. Note, only user owned plugins can be deleted via this method.

Examples:

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::ApiHubPlugin::Rest::Client.new

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

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

Overloads:

  • #delete_plugin(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_plugin via a request object, either of type DeletePluginRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ApiHub::V1::DeletePluginRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_plugin(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_plugin 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) (defaults to: nil)

      Required. The name of the Plugin resource to delete. Format: projects/{project}/locations/{location}/plugins/{plugin}

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.



726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
# File 'lib/google/cloud/api_hub/v1/api_hub_plugin/rest/client.rb', line 726

def delete_plugin request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::DeletePluginRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_plugin..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_plugin.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_plugin.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @api_hub_plugin_stub.delete_plugin request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#delete_plugin_instance(request, options = nil) ⇒ ::Gapic::Operation #delete_plugin_instance(name: nil) ⇒ ::Gapic::Operation

Deletes a plugin instance in the API hub.

Examples:

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::ApiHubPlugin::Rest::Client.new

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

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

Overloads:

  • #delete_plugin_instance(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_plugin_instance via a request object, either of type DeletePluginInstanceRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ApiHub::V1::DeletePluginInstanceRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #delete_plugin_instance(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_plugin_instance 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) (defaults to: nil)

      Required. The name of the plugin instance to delete. Format: projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}.

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.



1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
# File 'lib/google/cloud/api_hub/v1/api_hub_plugin/rest/client.rb', line 1497

def delete_plugin_instance request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::DeletePluginInstanceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.delete_plugin_instance..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.delete_plugin_instance.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_plugin_instance.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @api_hub_plugin_stub.delete_plugin_instance request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#disable_plugin(request, options = nil) ⇒ ::Google::Cloud::ApiHub::V1::Plugin #disable_plugin(name: nil) ⇒ ::Google::Cloud::ApiHub::V1::Plugin

Disables a plugin. The state of the plugin after disabling is DISABLED

Examples:

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::ApiHubPlugin::Rest::Client.new

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

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

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

Overloads:

  • #disable_plugin(request, options = nil) ⇒ ::Google::Cloud::ApiHub::V1::Plugin

    Pass arguments to disable_plugin via a request object, either of type DisablePluginRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ApiHub::V1::DisablePluginRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #disable_plugin(name: nil) ⇒ ::Google::Cloud::ApiHub::V1::Plugin

    Pass arguments to disable_plugin 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) (defaults to: nil)

      Required. The name of the plugin to disable. Format: projects/{project}/locations/{location}/plugins/{plugin}.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
# File 'lib/google/cloud/api_hub/v1/api_hub_plugin/rest/client.rb', line 423

def disable_plugin request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::DisablePluginRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.disable_plugin..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.disable_plugin.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.disable_plugin.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @api_hub_plugin_stub.disable_plugin request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#disable_plugin_instance_action(request, options = nil) ⇒ ::Gapic::Operation #disable_plugin_instance_action(name: nil, action_id: nil) ⇒ ::Gapic::Operation

Disables a plugin instance in the API hub.

Examples:

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::ApiHubPlugin::Rest::Client.new

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

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

Overloads:

  • #disable_plugin_instance_action(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to disable_plugin_instance_action via a request object, either of type DisablePluginInstanceActionRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ApiHub::V1::DisablePluginInstanceActionRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #disable_plugin_instance_action(name: nil, action_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to disable_plugin_instance_action 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) (defaults to: nil)

      Required. The name of the plugin instance to disable. Format: projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}

    • action_id (::String) (defaults to: nil)

      Required. The action id to disable.

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.



1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
# File 'lib/google/cloud/api_hub/v1/api_hub_plugin/rest/client.rb', line 1311

def disable_plugin_instance_action request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::DisablePluginInstanceActionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.disable_plugin_instance_action..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.disable_plugin_instance_action.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.disable_plugin_instance_action.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @api_hub_plugin_stub.disable_plugin_instance_action request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#enable_plugin(request, options = nil) ⇒ ::Google::Cloud::ApiHub::V1::Plugin #enable_plugin(name: nil) ⇒ ::Google::Cloud::ApiHub::V1::Plugin

Enables a plugin. The state of the plugin after enabling is ENABLED

Examples:

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::ApiHubPlugin::Rest::Client.new

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

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

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

Overloads:

  • #enable_plugin(request, options = nil) ⇒ ::Google::Cloud::ApiHub::V1::Plugin

    Pass arguments to enable_plugin via a request object, either of type EnablePluginRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ApiHub::V1::EnablePluginRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #enable_plugin(name: nil) ⇒ ::Google::Cloud::ApiHub::V1::Plugin

    Pass arguments to enable_plugin 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) (defaults to: nil)

      Required. The name of the plugin to enable. Format: projects/{project}/locations/{location}/plugins/{plugin}.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
# File 'lib/google/cloud/api_hub/v1/api_hub_plugin/rest/client.rb', line 343

def enable_plugin request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::EnablePluginRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.enable_plugin..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.enable_plugin.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.enable_plugin.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @api_hub_plugin_stub.enable_plugin request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#enable_plugin_instance_action(request, options = nil) ⇒ ::Gapic::Operation #enable_plugin_instance_action(name: nil, action_id: nil) ⇒ ::Gapic::Operation

Enables a plugin instance in the API hub.

Examples:

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::ApiHubPlugin::Rest::Client.new

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

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

Overloads:

  • #enable_plugin_instance_action(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to enable_plugin_instance_action via a request object, either of type EnablePluginInstanceActionRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ApiHub::V1::EnablePluginInstanceActionRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #enable_plugin_instance_action(name: nil, action_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to enable_plugin_instance_action 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) (defaults to: nil)

      Required. The name of the plugin instance to enable. Format: projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}

    • action_id (::String) (defaults to: nil)

      Required. The action id to enable.

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.



1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
# File 'lib/google/cloud/api_hub/v1/api_hub_plugin/rest/client.rb', line 1220

def enable_plugin_instance_action request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::EnablePluginInstanceActionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.enable_plugin_instance_action..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.enable_plugin_instance_action.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.enable_plugin_instance_action.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @api_hub_plugin_stub.enable_plugin_instance_action request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#execute_plugin_instance_action(request, options = nil) ⇒ ::Gapic::Operation #execute_plugin_instance_action(name: nil, action_execution_detail: nil) ⇒ ::Gapic::Operation

Executes a plugin instance in the API hub.

Examples:

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::ApiHubPlugin::Rest::Client.new

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

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

Overloads:

  • #execute_plugin_instance_action(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to execute_plugin_instance_action via a request object, either of type ExecutePluginInstanceActionRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ApiHub::V1::ExecutePluginInstanceActionRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #execute_plugin_instance_action(name: nil, action_execution_detail: nil) ⇒ ::Gapic::Operation

    Pass arguments to execute_plugin_instance_action 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) (defaults to: nil)

      Required. The name of the plugin instance to execute. Format: projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}

    • action_execution_detail (::Google::Cloud::ApiHub::V1::ActionExecutionDetail, ::Hash) (defaults to: nil)

      Required. The execution details for the action to execute.

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.



919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
# File 'lib/google/cloud/api_hub/v1/api_hub_plugin/rest/client.rb', line 919

def execute_plugin_instance_action request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::ExecutePluginInstanceActionRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.execute_plugin_instance_action..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.execute_plugin_instance_action.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.execute_plugin_instance_action.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @api_hub_plugin_stub.execute_plugin_instance_action request, options do |result, operation|
    result = ::Gapic::Operation.new result, @operations_client, options: options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_plugin(request, options = nil) ⇒ ::Google::Cloud::ApiHub::V1::Plugin #get_plugin(name: nil) ⇒ ::Google::Cloud::ApiHub::V1::Plugin

Get an API Hub plugin.

Examples:

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::ApiHubPlugin::Rest::Client.new

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

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

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

Overloads:

  • #get_plugin(request, options = nil) ⇒ ::Google::Cloud::ApiHub::V1::Plugin

    Pass arguments to get_plugin via a request object, either of type GetPluginRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ApiHub::V1::GetPluginRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_plugin(name: nil) ⇒ ::Google::Cloud::ApiHub::V1::Plugin

    Pass arguments to get_plugin 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) (defaults to: nil)

      Required. The name of the plugin to retrieve. Format: projects/{project}/locations/{location}/plugins/{plugin}.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
# File 'lib/google/cloud/api_hub/v1/api_hub_plugin/rest/client.rb', line 263

def get_plugin request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::GetPluginRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_plugin..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_plugin.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_plugin.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @api_hub_plugin_stub.get_plugin request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_plugin_instance(request, options = nil) ⇒ ::Google::Cloud::ApiHub::V1::PluginInstance #get_plugin_instance(name: nil) ⇒ ::Google::Cloud::ApiHub::V1::PluginInstance

Get an API Hub plugin instance.

Examples:

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::ApiHubPlugin::Rest::Client.new

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

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

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

Overloads:

  • #get_plugin_instance(request, options = nil) ⇒ ::Google::Cloud::ApiHub::V1::PluginInstance

    Pass arguments to get_plugin_instance via a request object, either of type GetPluginInstanceRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ApiHub::V1::GetPluginInstanceRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #get_plugin_instance(name: nil) ⇒ ::Google::Cloud::ApiHub::V1::PluginInstance

    Pass arguments to get_plugin_instance 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) (defaults to: nil)

      Required. The name of the plugin instance to retrieve. Format: projects/{project}/locations/{location}/plugins/{plugin}/instances/{instance}

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
# File 'lib/google/cloud/api_hub/v1/api_hub_plugin/rest/client.rb', line 1001

def get_plugin_instance request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::GetPluginInstanceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.get_plugin_instance..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.get_plugin_instance.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_plugin_instance.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @api_hub_plugin_stub.get_plugin_instance request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_plugin_instances(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApiHub::V1::PluginInstance> #list_plugin_instances(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApiHub::V1::PluginInstance>

List all the plugins in a given project and location. - can be used as wildcard value for {plugin_id}

Examples:

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::ApiHubPlugin::Rest::Client.new

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

# Call the list_plugin_instances method.
result = client.list_plugin_instances 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::PluginInstance.
  p item
end

Overloads:

  • #list_plugin_instances(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApiHub::V1::PluginInstance>

    Pass arguments to list_plugin_instances via a request object, either of type ListPluginInstancesRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ApiHub::V1::ListPluginInstancesRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_plugin_instances(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApiHub::V1::PluginInstance>

    Pass arguments to list_plugin_instances 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) (defaults to: nil)

      Required. The parent resource where this plugin will be created. Format: projects/{project}/locations/{location}/plugins/{plugin}. To list plugin instances for multiple plugins, use the - character instead of the plugin ID.

    • filter (::String) (defaults to: nil)

      Optional. An expression that filters the list of plugin instances.

      A filter expression consists of a field name, a comparison operator, and a value for filtering. The value must be a string. The comparison operator must be one of: <, > or =. Filters are not case sensitive.

      The following fields in the PluginInstances are eligible for filtering:

      • state - The state of the Plugin Instance. Allowed comparison operators: =.

      A filter function is also supported in the filter string. The filter function is id(name). The id(name) function returns the id of the resource name. For example, id(name) = \"plugin-instance-1\" is equivalent to name = \"projects/test-project-id/locations/test-location-id/plugins/plugin-1/instances/plugin-instance-1\" provided the parent is projects/test-project-id/locations/test-location-id/plugins/plugin-1.

      Expressions are combined with either AND logic operator or OR logical operator but not both of them together i.e. only one of the AND or OR operator can be used throughout the filter string and both the operators cannot be used together. No other logical operators are supported. At most three filter fields are allowed in the filter string and if provided more than that then INVALID_ARGUMENT error is returned by the API. Here are a few examples:

      • state = ENABLED - The plugin instance is in enabled state.
    • page_size (::Integer) (defaults to: nil)

      Optional. The maximum number of hub plugins to return. The service may return fewer than this value. If unspecified, at most 50 hub plugins will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.

    • page_token (::String) (defaults to: nil)

      Optional. A page token, received from a previous ListPluginInstances call. Provide this to retrieve the subsequent page.

      When paginating, all other parameters provided to ListPluginInstances 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.



1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
# File 'lib/google/cloud/api_hub/v1/api_hub_plugin/rest/client.rb', line 1129

def list_plugin_instances request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::ListPluginInstancesRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_plugin_instances..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_plugin_instances.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_plugin_instances.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @api_hub_plugin_stub.list_plugin_instances request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @api_hub_plugin_stub, :list_plugin_instances, "plugin_instances", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_plugins(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApiHub::V1::Plugin> #list_plugins(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApiHub::V1::Plugin>

List all the plugins in a given project and location.

Examples:

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::ApiHubPlugin::Rest::Client.new

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

# Call the list_plugins method.
result = client.list_plugins 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::Plugin.
  p item
end

Overloads:

  • #list_plugins(request, options = nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApiHub::V1::Plugin>

    Pass arguments to list_plugins via a request object, either of type ListPluginsRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ApiHub::V1::ListPluginsRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #list_plugins(parent: nil, filter: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::Rest::PagedEnumerable<::Google::Cloud::ApiHub::V1::Plugin>

    Pass arguments to list_plugins 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) (defaults to: nil)

      Required. The parent resource where this plugin will be created. Format: projects/{project}/locations/{location}.

    • filter (::String) (defaults to: nil)

      Optional. An expression that filters the list of plugins.

      A filter expression consists of a field name, a comparison operator, and a value for filtering. The value must be a string. The comparison operator must be one of: <, > or =. Filters are not case sensitive.

      The following fields in the Plugins are eligible for filtering:

      • plugin_category - The category of the Plugin. Allowed comparison operators: =.

      Expressions are combined with either AND logic operator or OR logical operator but not both of them together i.e. only one of the AND or OR operator can be used throughout the filter string and both the operators cannot be used together. No other logical operators are supported. At most three filter fields are allowed in the filter string and if provided more than that then INVALID_ARGUMENT error is returned by the API. Here are a few examples:

      • plugin_category = ON_RAMP - The plugin is of category on ramp.
    • page_size (::Integer) (defaults to: nil)

      Optional. The maximum number of hub plugins to return. The service may return fewer than this value. If unspecified, at most 50 hub plugins will be returned. The maximum value is 1000; values above 1000 will be coerced to 1000.

    • page_token (::String) (defaults to: nil)

      Optional. A page token, received from a previous ListPlugins call. Provide this to retrieve the subsequent page.

      When paginating, all other parameters (except page_size) provided to ListPlugins 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.



637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
# File 'lib/google/cloud/api_hub/v1/api_hub_plugin/rest/client.rb', line 637

def list_plugins request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::ListPluginsRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.list_plugins..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.list_plugins.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_plugins.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @api_hub_plugin_stub.list_plugins request, options do |result, operation|
    result = ::Gapic::Rest::PagedEnumerable.new @api_hub_plugin_stub, :list_plugins, "plugins", request, result, options
    yield result, operation if block_given?
    throw :response, result
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end

#loggerLogger

The logger used for request/response debug logging.

Returns:

  • (Logger)


213
214
215
# File 'lib/google/cloud/api_hub/v1/api_hub_plugin/rest/client.rb', line 213

def logger
  @api_hub_plugin_stub.logger
end

#universe_domainString

The effective universe domain

Returns:

  • (String)


116
117
118
# File 'lib/google/cloud/api_hub/v1/api_hub_plugin/rest/client.rb', line 116

def universe_domain
  @api_hub_plugin_stub.universe_domain
end

#update_plugin_instance(request, options = nil) ⇒ ::Google::Cloud::ApiHub::V1::PluginInstance #update_plugin_instance(plugin_instance: nil, update_mask: nil) ⇒ ::Google::Cloud::ApiHub::V1::PluginInstance

Updates a plugin instance in the API hub. The following fields in the plugin_instance can be updated currently:

  • display_name
  • [schedule_cron_expression][PluginInstance.actions.schedule_cron_expression]

The update_mask should be used to specify the fields being updated.

To update the auth_config and additional_config of the plugin instance, use the [ApplyPluginInstanceConfig][google.cloud.apihub.v1.ApiHubPlugin.ApplyPluginInstanceConfig] method.

Examples:

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::ApiHubPlugin::Rest::Client.new

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

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

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

Overloads:

  • #update_plugin_instance(request, options = nil) ⇒ ::Google::Cloud::ApiHub::V1::PluginInstance

    Pass arguments to update_plugin_instance via a request object, either of type UpdatePluginInstanceRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ApiHub::V1::UpdatePluginInstanceRequest, ::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) (defaults to: nil)

      Overrides the default settings for this call, e.g, timeout, retries etc. Optional.

  • #update_plugin_instance(plugin_instance: nil, update_mask: nil) ⇒ ::Google::Cloud::ApiHub::V1::PluginInstance

    Pass arguments to update_plugin_instance 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:

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

  • (::Google::Cloud::Error)

    if the REST call is aborted.



1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
# File 'lib/google/cloud/api_hub/v1/api_hub_plugin/rest/client.rb', line 1410

def update_plugin_instance request, options = nil
  raise ::ArgumentError, "request must be provided" if request.nil?

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ApiHub::V1::UpdatePluginInstanceRequest

  # Converts hash and nil to an options object
  options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h

  # Customize the options with defaults
   = @config.rpcs.update_plugin_instance..to_h

  # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::ApiHub::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  options.apply_defaults timeout:      @config.rpcs.update_plugin_instance.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_plugin_instance.retry_policy

  options.apply_defaults timeout:      @config.timeout,
                         metadata:     @config.,
                         retry_policy: @config.retry_policy

  @api_hub_plugin_stub.update_plugin_instance request, options do |result, operation|
    yield result, operation if block_given?
  end
rescue ::Gapic::Rest::Error => e
  raise ::Google::Cloud::Error.from_error(e)
end