Class: Google::Cloud::Config::V1::Config::Rest::Client

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

Overview

REST client for the Config service.

Infrastructure Manager is a managed service that automates the deployment and management of Google Cloud infrastructure resources.

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#deployment_path, #location_path, #resource_path, #revision_path, #service_account_path, #worker_pool_path

Constructor Details

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

Create a new Config REST client object.

Examples:


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

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

Yields:

  • (config)

    Configure the Config client.

Yield Parameters:



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
# File 'lib/google/cloud/config/v1/config/rest/client.rb', line 114

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 == 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::Config::V1::Config::Rest::Operations.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
  end

  @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
    config.bindings_override = @config.bindings_override
  end

  @iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
    config.bindings_override = @config.bindings_override
  end

  @config_stub = ::Google::Cloud::Config::V1::Config::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
end

Instance Attribute Details

#iam_policy_clientGoogle::Iam::V1::IAMPolicy::Rest::Client (readonly)

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

Returns:

  • (Google::Iam::V1::IAMPolicy::Rest::Client)


178
179
180
# File 'lib/google/cloud/config/v1/config/rest/client.rb', line 178

def iam_policy_client
  @iam_policy_client
end

#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)


171
172
173
# File 'lib/google/cloud/config/v1/config/rest/client.rb', line 171

def location_client
  @location_client
end

#operations_client::Google::Cloud::Config::V1::Config::Rest::Operations (readonly)

Get the associated client for long-running operations.



164
165
166
# File 'lib/google/cloud/config/v1/config/rest/client.rb', line 164

def operations_client
  @operations_client
end

Class Method Details

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

Configure the Config Client class.

See Configuration for a description of the configuration fields.

Examples:


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

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/google/cloud/config/v1/config/rest/client.rb', line 61

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "Config", "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
  end
  yield @configure if block_given?
  @configure
end

Instance Method Details

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

Configure the Config 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:



93
94
95
96
# File 'lib/google/cloud/config/v1/config/rest/client.rb', line 93

def configure
  yield @config if block_given?
  @config
end

#create_deployment(request, options = nil) ⇒ ::Gapic::Operation #create_deployment(parent: nil, deployment_id: nil, deployment: nil, request_id: nil) ⇒ ::Gapic::Operation

Creates a Deployment.

Examples:

Basic example

require "google/cloud/config/v1"

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

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

# Call the create_deployment method.
result = client.create_deployment 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_deployment(request, options = nil) ⇒ ::Gapic::Operation

    Pass arguments to create_deployment via a request object, either of type Google::Cloud::Config::V1::CreateDeploymentRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::Config::V1::CreateDeploymentRequest, ::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_deployment(parent: nil, deployment_id: nil, deployment: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_deployment 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 in whose context the Deployment is created. The parent value is in the format: 'projects/{project_id}/locations/{location}'.

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

      Required. The Deployment ID.

    • deployment (::Google::Cloud::Config::V1::Deployment, ::Hash) (defaults to: nil)

      Required. Deployment resource to be created.

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

      Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

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

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

Yields:

  • (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.



447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
# File 'lib/google/cloud/config/v1/config/rest/client.rb', line 447

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::CreateDeploymentRequest

  # 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_deployment..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Config::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

#delete_deployment(request, options = nil) ⇒ ::Gapic::Operation #delete_deployment(name: nil, request_id: nil, force: nil, delete_policy: nil) ⇒ ::Gapic::Operation

Deletes a Deployment.

Examples:

Basic example

require "google/cloud/config/v1"

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

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

# Call the delete_deployment method.
result = client.delete_deployment 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_deployment(request, options = nil) ⇒ ::Gapic::Operation

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

    Parameters:

    • request (::Google::Cloud::Config::V1::DeleteDeploymentRequest, ::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_deployment(name: nil, request_id: nil, force: nil, delete_policy: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_deployment 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 Deployment in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'.

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

      Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes after the first request.

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

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

    • force (::Boolean) (defaults to: nil)

      Optional. If set to true, any revisions for this deployment will also be deleted. (Otherwise, the request will only work if the deployment has no revisions.)

    • delete_policy (::Google::Cloud::Config::V1::DeleteDeploymentRequest::DeletePolicy) (defaults to: nil)

      Optional. Policy on how resources actuated by the deployment should be deleted. If unspecified, the default behavior is to delete the underlying resources.

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.



667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
# File 'lib/google/cloud/config/v1/config/rest/client.rb', line 667

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::DeleteDeploymentRequest

  # 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_deployment..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Config::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

#delete_statefile(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_statefile(name: nil, lock_id: nil) ⇒ ::Google::Protobuf::Empty

Deletes Terraform state file in a given deployment.

Examples:

Basic example

require "google/cloud/config/v1"

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

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

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

# The returned object is of type Google::Protobuf::Empty.
p result

Overloads:

  • #delete_statefile(request, options = nil) ⇒ ::Google::Protobuf::Empty

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

    Parameters:

    • request (::Google::Cloud::Config::V1::DeleteStatefileRequest, ::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_statefile(name: nil, lock_id: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_statefile 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 deployment in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'.

    • lock_id (::Integer) (defaults to: nil)

      Required. Lock ID of the lock file to verify that the user who is deleting the state file previously locked the Deployment.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
# File 'lib/google/cloud/config/v1/config/rest/client.rb', line 1381

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::DeleteStatefileRequest

  # 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_statefile..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Config::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

#export_deployment_statefile(request, options = nil) ⇒ ::Google::Cloud::Config::V1::Statefile #export_deployment_statefile(parent: nil, draft: nil) ⇒ ::Google::Cloud::Config::V1::Statefile

Exports Terraform state file from a given deployment.

Examples:

Basic example

require "google/cloud/config/v1"

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

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

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

# The returned object is of type Google::Cloud::Config::V1::Statefile.
p result

Overloads:

  • #export_deployment_statefile(request, options = nil) ⇒ ::Google::Cloud::Config::V1::Statefile

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

    Parameters:

    • request (::Google::Cloud::Config::V1::ExportDeploymentStatefileRequest, ::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.

  • #export_deployment_statefile(parent: nil, draft: nil) ⇒ ::Google::Cloud::Config::V1::Statefile

    Pass arguments to export_deployment_statefile 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 in whose context the statefile is listed. The parent value is in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'.

    • draft (::Boolean) (defaults to: nil)

      Optional. If this flag is set to true, the exported deployment state file will be the draft state. This will enable the draft file to be validated before copying it over to the working state on unlock.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



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
1165
1166
# File 'lib/google/cloud/config/v1/config/rest/client.rb', line 1133

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::ExportDeploymentStatefileRequest

  # 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.export_deployment_statefile..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Config::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

#export_lock_info(request, options = nil) ⇒ ::Google::Cloud::Config::V1::LockInfo #export_lock_info(name: nil) ⇒ ::Google::Cloud::Config::V1::LockInfo

Exports the lock info on a locked deployment.

Examples:

Basic example

require "google/cloud/config/v1"

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

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

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

# The returned object is of type Google::Cloud::Config::V1::LockInfo.
p result

Overloads:

  • #export_lock_info(request, options = nil) ⇒ ::Google::Cloud::Config::V1::LockInfo

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

    Parameters:

    • request (::Google::Cloud::Config::V1::ExportLockInfoRequest, ::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.

  • #export_lock_info(name: nil) ⇒ ::Google::Cloud::Config::V1::LockInfo

    Pass arguments to export_lock_info 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 deployment in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
# File 'lib/google/cloud/config/v1/config/rest/client.rb', line 1636

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::ExportLockInfoRequest

  # 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.export_lock_info..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Config::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

#export_revision_statefile(request, options = nil) ⇒ ::Google::Cloud::Config::V1::Statefile #export_revision_statefile(parent: nil) ⇒ ::Google::Cloud::Config::V1::Statefile

Exports Terraform state file from a given revision.

Examples:

Basic example

require "google/cloud/config/v1"

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

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

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

# The returned object is of type Google::Cloud::Config::V1::Statefile.
p result

Overloads:

  • #export_revision_statefile(request, options = nil) ⇒ ::Google::Cloud::Config::V1::Statefile

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

    Parameters:

    • request (::Google::Cloud::Config::V1::ExportRevisionStatefileRequest, ::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.

  • #export_revision_statefile(parent: nil) ⇒ ::Google::Cloud::Config::V1::Statefile

    Pass arguments to export_revision_statefile 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 in whose context the statefile is listed. The parent value is in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



1213
1214
1215
1216
1217
1218
1219
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
# File 'lib/google/cloud/config/v1/config/rest/client.rb', line 1213

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::ExportRevisionStatefileRequest

  # 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.export_revision_statefile..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Config::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

#get_deployment(request, options = nil) ⇒ ::Google::Cloud::Config::V1::Deployment #get_deployment(name: nil) ⇒ ::Google::Cloud::Config::V1::Deployment

Gets details about a Deployment.

Examples:

Basic example

require "google/cloud/config/v1"

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

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

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

# The returned object is of type Google::Cloud::Config::V1::Deployment.
p result

Overloads:

  • #get_deployment(request, options = nil) ⇒ ::Google::Cloud::Config::V1::Deployment

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

    Parameters:

    • request (::Google::Cloud::Config::V1::GetDeploymentRequest, ::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_deployment(name: nil) ⇒ ::Google::Cloud::Config::V1::Deployment

    Pass arguments to get_deployment 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 deployment. Format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



342
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
# File 'lib/google/cloud/config/v1/config/rest/client.rb', line 342

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::GetDeploymentRequest

  # 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_deployment..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Config::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

#get_resource(request, options = nil) ⇒ ::Google::Cloud::Config::V1::Resource #get_resource(name: nil) ⇒ ::Google::Cloud::Config::V1::Resource

Gets details about a Resource deployed by Infra Manager.

Examples:

Basic example

require "google/cloud/config/v1"

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

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

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

# The returned object is of type Google::Cloud::Config::V1::Resource.
p result

Overloads:

  • #get_resource(request, options = nil) ⇒ ::Google::Cloud::Config::V1::Resource

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

    Parameters:

    • request (::Google::Cloud::Config::V1::GetResourceRequest, ::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_resource(name: nil) ⇒ ::Google::Cloud::Config::V1::Resource

    Pass arguments to get_resource 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 Resource in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}/resource/{resource}'.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
# File 'lib/google/cloud/config/v1/config/rest/client.rb', line 942

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::GetResourceRequest

  # 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_resource..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Config::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

#get_revision(request, options = nil) ⇒ ::Google::Cloud::Config::V1::Revision #get_revision(name: nil) ⇒ ::Google::Cloud::Config::V1::Revision

Gets details about a Revision.

Examples:

Basic example

require "google/cloud/config/v1"

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

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

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

# The returned object is of type Google::Cloud::Config::V1::Revision.
p result

Overloads:

  • #get_revision(request, options = nil) ⇒ ::Google::Cloud::Config::V1::Revision

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

    Parameters:

    • request (::Google::Cloud::Config::V1::GetRevisionRequest, ::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_revision(name: nil) ⇒ ::Google::Cloud::Config::V1::Revision

    Pass arguments to get_revision 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 Revision in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
# File 'lib/google/cloud/config/v1/config/rest/client.rb', line 862

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::GetRevisionRequest

  # 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_revision..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Config::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

#import_statefile(request, options = nil) ⇒ ::Google::Cloud::Config::V1::Statefile #import_statefile(parent: nil, lock_id: nil, skip_draft: nil) ⇒ ::Google::Cloud::Config::V1::Statefile

Imports Terraform state file in a given deployment. The state file does not take effect until the Deployment has been unlocked.

Examples:

Basic example

require "google/cloud/config/v1"

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

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

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

# The returned object is of type Google::Cloud::Config::V1::Statefile.
p result

Overloads:

  • #import_statefile(request, options = nil) ⇒ ::Google::Cloud::Config::V1::Statefile

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

    Parameters:

    • request (::Google::Cloud::Config::V1::ImportStatefileRequest, ::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.

  • #import_statefile(parent: nil, lock_id: nil, skip_draft: nil) ⇒ ::Google::Cloud::Config::V1::Statefile

    Pass arguments to import_statefile 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 in whose context the statefile is listed. The parent value is in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'.

    • lock_id (::Integer) (defaults to: nil)

      Required. Lock ID of the lock file to verify that the user who is importing the state file previously locked the Deployment.

    • skip_draft (::Boolean) (defaults to: nil)

      Optional.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
# File 'lib/google/cloud/config/v1/config/rest/client.rb', line 1299

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::ImportStatefileRequest

  # 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.import_statefile..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Config::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

#list_deployments(request, options = nil) ⇒ ::Google::Cloud::Config::V1::ListDeploymentsResponse #list_deployments(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Google::Cloud::Config::V1::ListDeploymentsResponse

Lists Deployments in a given project and location.

Examples:

Basic example

require "google/cloud/config/v1"

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

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

# Call the list_deployments method.
result = client.list_deployments 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::Config::V1::Deployment.
  p item
end

Overloads:

  • #list_deployments(request, options = nil) ⇒ ::Google::Cloud::Config::V1::ListDeploymentsResponse

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

    Parameters:

    • request (::Google::Cloud::Config::V1::ListDeploymentsRequest, ::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_deployments(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Google::Cloud::Config::V1::ListDeploymentsResponse

    Pass arguments to list_deployments 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 in whose context the Deployments are listed. The parent value is in the format: 'projects/{project_id}/locations/{location}'.

    • page_size (::Integer) (defaults to: nil)

      When requesting a page of resources, 'page_size' specifies number of resources to return. If unspecified or set to 0, all resources will be returned.

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

      Token returned by previous call to 'ListDeployments' which specifies the position in the list from where to continue listing the resources.

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

      Lists the Deployments that match the filter expression. A filter expression filters the resources listed in the response. The expression must be of the form '{field} {operator} {value}' where operators: '<', '>', '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS operator which is roughly synonymous with equality). {field} can refer to a proto or JSON field, or a synthetic field. Field names can be camelCase or snake_case.

      Examples:

      • Filter by name: name = "projects/foo/locations/us-central1/deployments/bar

      • Filter by labels:

        • Resources that have a key called 'foo' labels.foo:*
        • Resources that have a key called 'foo' whose value is 'bar' labels.foo = bar
      • Filter by state:

        • Deployments in CREATING state. state=CREATING
    • order_by (::String) (defaults to: nil)

      Field to use to sort the list.

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/config/v1/config/rest/client.rb', line 263

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::ListDeploymentsRequest

  # 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_deployments..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Config::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

#list_resources(request, options = nil) ⇒ ::Google::Cloud::Config::V1::ListResourcesResponse #list_resources(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Google::Cloud::Config::V1::ListResourcesResponse

Lists Resources in a given revision.

Examples:

Basic example

require "google/cloud/config/v1"

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

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

# Call the list_resources method.
result = client.list_resources 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::Config::V1::Resource.
  p item
end

Overloads:

  • #list_resources(request, options = nil) ⇒ ::Google::Cloud::Config::V1::ListResourcesResponse

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

    Parameters:

    • request (::Google::Cloud::Config::V1::ListResourcesRequest, ::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_resources(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Google::Cloud::Config::V1::ListResourcesResponse

    Pass arguments to list_resources 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 in whose context the Resources are listed. The parent value is in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}/revisions/{revision}'.

    • page_size (::Integer) (defaults to: nil)

      When requesting a page of resources, 'page_size' specifies number of resources to return. If unspecified or set to 0, all resources will be returned.

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

      Token returned by previous call to 'ListResources' which specifies the position in the list from where to continue listing the resources.

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

      Lists the Resources that match the filter expression. A filter expression filters the resources listed in the response. The expression must be of the form '{field} {operator} {value}' where operators: '<', '>', '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS operator which is roughly synonymous with equality). {field} can refer to a proto or JSON field, or a synthetic field. Field names can be camelCase or snake_case.

      Examples:

      • Filter by name: name = "projects/foo/locations/us-central1/deployments/dep/revisions/bar/resources/baz
    • order_by (::String) (defaults to: nil)

      Field to use to sort the list.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
# File 'lib/google/cloud/config/v1/config/rest/client.rb', line 1049

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::ListResourcesRequest

  # 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_resources..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Config::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

#list_revisions(request, options = nil) ⇒ ::Google::Cloud::Config::V1::ListRevisionsResponse #list_revisions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Google::Cloud::Config::V1::ListRevisionsResponse

Lists Revisions of a deployment.

Examples:

Basic example

require "google/cloud/config/v1"

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

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

# Call the list_revisions method.
result = client.list_revisions 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::Config::V1::Revision.
  p item
end

Overloads:

  • #list_revisions(request, options = nil) ⇒ ::Google::Cloud::Config::V1::ListRevisionsResponse

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

    Parameters:

    • request (::Google::Cloud::Config::V1::ListRevisionsRequest, ::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_revisions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Google::Cloud::Config::V1::ListRevisionsResponse

    Pass arguments to list_revisions 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 in whose context the Revisions are listed. The parent value is in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'.

    • page_size (::Integer) (defaults to: nil)

      When requesting a page of resources, page_size specifies number of resources to return. If unspecified or set to 0, all resources will be returned.

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

      Token returned by previous call to 'ListRevisions' which specifies the position in the list from where to continue listing the resources.

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

      Lists the Revisions that match the filter expression. A filter expression filters the resources listed in the response. The expression must be of the form '{field} {operator} {value}' where operators: '<', '>', '<=', '>=', '!=', '=', ':' are supported (colon ':' represents a HAS operator which is roughly synonymous with equality). {field} can refer to a proto or JSON field, or a synthetic field. Field names can be camelCase or snake_case.

      Examples:

      • Filter by name: name = "projects/foo/locations/us-central1/deployments/dep/revisions/bar

      • Filter by labels:

        • Resources that have a key called 'foo' labels.foo:*
        • Resources that have a key called 'foo' whose value is 'bar' labels.foo = bar
      • Filter by state:

        • Revisions in CREATING state. state=CREATING
    • order_by (::String) (defaults to: nil)

      Field to use to sort the list.

Yields:

  • (result, operation)

    Access the result along with the TransportOperation object

Yield Parameters:

Returns:

Raises:

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

    if the REST call is aborted.



783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
# File 'lib/google/cloud/config/v1/config/rest/client.rb', line 783

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::ListRevisionsRequest

  # 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_revisions..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Config::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

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

Locks a deployment.

Examples:

Basic example

require "google/cloud/config/v1"

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

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

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

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

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

    Parameters:

    • request (::Google::Cloud::Config::V1::LockDeploymentRequest, ::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.

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

    Pass arguments to lock_deployment 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 deployment in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'.

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.



1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
# File 'lib/google/cloud/config/v1/config/rest/client.rb', line 1467

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::LockDeploymentRequest

  # 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.lock_deployment..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Config::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

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

Unlocks a locked deployment.

Examples:

Basic example

require "google/cloud/config/v1"

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

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

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

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

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

    Parameters:

    • request (::Google::Cloud::Config::V1::UnlockDeploymentRequest, ::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.

  • #unlock_deployment(name: nil, lock_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to unlock_deployment 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 deployment in the format: 'projects/{project_id}/locations/{location}/deployments/{deployment}'.

    • lock_id (::Integer) (defaults to: nil)

      Required. Lock ID of the lock file to be unlocked.

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.



1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
# File 'lib/google/cloud/config/v1/config/rest/client.rb', line 1556

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::UnlockDeploymentRequest

  # 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.unlock_deployment..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Config::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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

#update_deployment(request, options = nil) ⇒ ::Gapic::Operation #update_deployment(update_mask: nil, deployment: nil, request_id: nil) ⇒ ::Gapic::Operation

Updates a Deployment.

Examples:

Basic example

require "google/cloud/config/v1"

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

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

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

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

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

    Parameters:

    • request (::Google::Cloud::Config::V1::UpdateDeploymentRequest, ::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_deployment(update_mask: nil, deployment: nil, request_id: nil) ⇒ ::Gapic::Operation

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

      Optional. Field mask used to specify the fields to be overwritten in the Deployment resource by the update.

      The fields specified in the update_mask are relative to the resource, not the full request. A field will be overwritten if it is in the mask. If the user does not provide a mask then all fields will be overwritten.

    • deployment (::Google::Cloud::Config::V1::Deployment, ::Hash) (defaults to: nil)

      Required. Deployment to update.

      The deployment's name field is used to identify the resource to be updated. Format: projects/{project}/locations/{location}/deployments/{deployment}

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

      Optional. An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed. The server will guarantee that for at least 60 minutes since the first request.

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

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

Yields:

  • (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.



558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
# File 'lib/google/cloud/config/v1/config/rest/client.rb', line 558

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Config::V1::UpdateDeploymentRequest

  # 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_deployment..to_h

  # Set x-goog-api-client and x-goog-user-project 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::Config::V1::VERSION,
    transports_version_send: [:rest]

  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

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

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

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