Class: Google::Cloud::ConfigService::V1::Config::Client

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

Overview

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, #preview_path, #resource_path, #revision_path, #service_account_path, #terraform_version_path, #worker_pool_path

Constructor Details

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

Create a new Config client object.

Examples:


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

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

Yields:

  • (config)

    Configure the Config client.

Yield Parameters:



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

def initialize
  # These require statements are intentionally placed here to initialize
  # the gRPC module only when it's required.
  # See https://github.com/googleapis/toolkit/issues/446
  require "gapic/grpc"
  require "google/cloud/config/v1/config_services_pb"

  # 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 = Operations.new do |config|
    config.credentials = credentials
    config.quota_project = @quota_project_id
    config.endpoint = @config.endpoint
    config.universe_domain = @config.universe_domain
  end

  @config_stub = ::Gapic::ServiceStub.new(
    ::Google::Cloud::ConfigService::V1::Config::Stub,
    credentials: credentials,
    endpoint: @config.endpoint,
    endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
    universe_domain: @config.universe_domain,
    channel_args: @config.channel_args,
    interceptors: @config.interceptors,
    channel_pool_config: @config.channel_pool
  )

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

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

Instance Attribute Details

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

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

Returns:

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


207
208
209
# File 'lib/google/cloud/config_service/v1/config/client.rb', line 207

def iam_policy_client
  @iam_policy_client
end

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

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

Returns:

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


200
201
202
# File 'lib/google/cloud/config_service/v1/config/client.rb', line 200

def location_client
  @location_client
end

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

Get the associated client for long-running operations.



193
194
195
# File 'lib/google/cloud/config_service/v1/config/client.rb', line 193

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::ConfigService::V1::Config::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
# File 'lib/google/cloud/config_service/v1/config/client.rb', line 65

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "ConfigService", "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:



97
98
99
100
# File 'lib/google/cloud/config_service/v1/config/client.rb', line 97

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_service/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ConfigService::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::ConfigService::V1::CreateDeploymentRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ConfigService::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::ConfigService::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the RPC is aborted.



494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
# File 'lib/google/cloud/config_service/v1/config/client.rb', line 494

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigService::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, 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::ConfigService::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :create_deployment, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#create_preview(request, options = nil) ⇒ ::Gapic::Operation #create_preview(parent: nil, preview_id: nil, preview: nil, request_id: nil) ⇒ ::Gapic::Operation

Creates a Preview.

Examples:

Basic example

require "google/cloud/config_service/v1"

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

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

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

    Pass arguments to create_preview via a request object, either of type Google::Cloud::ConfigService::V1::CreatePreviewRequest or an equivalent Hash.

    Parameters:

    • request (::Google::Cloud::ConfigService::V1::CreatePreviewRequest, ::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_preview(parent: nil, preview_id: nil, preview: nil, request_id: nil) ⇒ ::Gapic::Operation

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

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

      Optional. The preview ID.

    • preview (::Google::Cloud::ConfigService::V1::Preview, ::Hash) (defaults to: nil)

      Required. Preview 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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the RPC is aborted.



1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
# File 'lib/google/cloud/config_service/v1/config/client.rb', line 1901

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigService::V1::CreatePreviewRequest

  # 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_preview..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::ConfigService::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @config_stub.call_rpc :create_preview, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => 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_service/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ConfigService::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::ConfigService::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::ConfigService::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the RPC is aborted.



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
762
763
764
765
766
767
768
769
770
771
# File 'lib/google/cloud/config_service/v1/config/client.rb', line 730

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigService::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, 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::ConfigService::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :delete_deployment, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Deletes a Preview.

Examples:

Basic example

require "google/cloud/config_service/v1"

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

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

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

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

    Parameters:

    • request (::Google::Cloud::ConfigService::V1::DeletePreviewRequest, ::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_preview(name: nil, request_id: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_preview 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 Preview in the format: 'projects/{project_id}/locations/{location}/previews/{preview}'.

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

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the RPC is aborted.



2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
# File 'lib/google/cloud/config_service/v1/config/client.rb', line 2222

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigService::V1::DeletePreviewRequest

  # 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_preview..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::ConfigService::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @config_stub.call_rpc :delete_preview, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => 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_service/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ConfigService::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::ConfigService::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
# File 'lib/google/cloud/config_service/v1/config/client.rb', line 1510

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigService::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, 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::ConfigService::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :delete_statefile, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Exports Terraform state file from a given deployment.

Examples:

Basic example

require "google/cloud/config_service/v1"

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

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

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

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

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::ConfigService::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::ConfigService::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
# File 'lib/google/cloud/config_service/v1/config/client.rb', line 1238

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigService::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, 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::ConfigService::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :export_deployment_statefile, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Exports the lock info on a locked deployment.

Examples:

Basic example

require "google/cloud/config_service/v1"

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

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

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

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

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::ConfigService::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::ConfigService::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
# File 'lib/google/cloud/config_service/v1/config/client.rb', line 1789

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigService::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, 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::ConfigService::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :export_lock_info, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#export_preview_result(request, options = nil) ⇒ ::Google::Cloud::ConfigService::V1::ExportPreviewResultResponse #export_preview_result(parent: nil) ⇒ ::Google::Cloud::ConfigService::V1::ExportPreviewResultResponse

Export Preview results.

Examples:

Basic example

require "google/cloud/config_service/v1"

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

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

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

# The returned object is of type Google::Cloud::ConfigService::V1::ExportPreviewResultResponse.
p result

Overloads:

  • #export_preview_result(request, options = nil) ⇒ ::Google::Cloud::ConfigService::V1::ExportPreviewResultResponse

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

    Parameters:

    • request (::Google::Cloud::ConfigService::V1::ExportPreviewResultRequest, ::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_preview_result(parent: nil) ⇒ ::Google::Cloud::ConfigService::V1::ExportPreviewResultResponse

    Pass arguments to export_preview_result 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 preview whose results should be exported. The preview value is in the format: 'projects/{project_id}/locations/{location}/previews/{preview}'.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
# File 'lib/google/cloud/config_service/v1/config/client.rb', line 2311

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigService::V1::ExportPreviewResultRequest

  # 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_preview_result..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::ConfigService::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @config_stub.call_rpc :export_preview_result, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Exports Terraform state file from a given revision.

Examples:

Basic example

require "google/cloud/config_service/v1"

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

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

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

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

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::ConfigService::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::ConfigService::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
# File 'lib/google/cloud/config_service/v1/config/client.rb', line 1326

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigService::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, 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::ConfigService::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :export_revision_statefile, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Gets details about a Deployment.

Examples:

Basic example

require "google/cloud/config_service/v1"

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

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

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

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

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::ConfigService::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::ConfigService::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
# File 'lib/google/cloud/config_service/v1/config/client.rb', line 381

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigService::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, 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::ConfigService::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :get_deployment, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_preview(request, options = nil) ⇒ ::Google::Cloud::ConfigService::V1::Preview #get_preview(name: nil) ⇒ ::Google::Cloud::ConfigService::V1::Preview

Gets details about a Preview.

Examples:

Basic example

require "google/cloud/config_service/v1"

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

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

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

# The returned object is of type Google::Cloud::ConfigService::V1::Preview.
p result

Overloads:

  • #get_preview(request, options = nil) ⇒ ::Google::Cloud::ConfigService::V1::Preview

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

    Parameters:

    • request (::Google::Cloud::ConfigService::V1::GetPreviewRequest, ::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_preview(name: nil) ⇒ ::Google::Cloud::ConfigService::V1::Preview

    Pass arguments to get_preview 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 preview. Format: 'projects/{project_id}/locations/{location}/previews/{preview}'.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
# File 'lib/google/cloud/config_service/v1/config/client.rb', line 1989

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigService::V1::GetPreviewRequest

  # 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_preview..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::ConfigService::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @config_stub.call_rpc :get_preview, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Gets details about a Resource deployed by Infra Manager.

Examples:

Basic example

require "google/cloud/config_service/v1"

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

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

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

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

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::ConfigService::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::ConfigService::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
# File 'lib/google/cloud/config_service/v1/config/client.rb', line 1030

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigService::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, 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::ConfigService::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :get_resource, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

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

Gets details about a Revision.

Examples:

Basic example

require "google/cloud/config_service/v1"

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

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

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

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

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::ConfigService::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::ConfigService::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC 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
976
977
978
979
980
981
982
# File 'lib/google/cloud/config_service/v1/config/client.rb', line 942

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigService::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, 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::ConfigService::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :get_revision, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#get_terraform_version(request, options = nil) ⇒ ::Google::Cloud::ConfigService::V1::TerraformVersion #get_terraform_version(name: nil) ⇒ ::Google::Cloud::ConfigService::V1::TerraformVersion

Gets details about a TerraformVersion.

Examples:

Basic example

require "google/cloud/config_service/v1"

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

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

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

# The returned object is of type Google::Cloud::ConfigService::V1::TerraformVersion.
p result

Overloads:

  • #get_terraform_version(request, options = nil) ⇒ ::Google::Cloud::ConfigService::V1::TerraformVersion

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

    Parameters:

    • request (::Google::Cloud::ConfigService::V1::GetTerraformVersionRequest, ::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_terraform_version(name: nil) ⇒ ::Google::Cloud::ConfigService::V1::TerraformVersion

    Pass arguments to get_terraform_version 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 TerraformVersion. Format: 'projects/{project_id}/locations/{location}/terraformVersions/{terraform_version}'

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
# File 'lib/google/cloud/config_service/v1/config/client.rb', line 2512

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigService::V1::GetTerraformVersionRequest

  # 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_terraform_version..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::ConfigService::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @config_stub.call_rpc :get_terraform_version, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#import_statefile(request, options = nil) ⇒ ::Google::Cloud::ConfigService::V1::Statefile #import_statefile(parent: nil, lock_id: nil, skip_draft: nil) ⇒ ::Google::Cloud::ConfigService::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_service/v1"

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

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

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

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

Overloads:

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

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

    Parameters:

    • request (::Google::Cloud::ConfigService::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::ConfigService::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
# File 'lib/google/cloud/config_service/v1/config/client.rb', line 1420

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigService::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, 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::ConfigService::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :import_statefile, request, options: options do |response, operation|
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_deployments(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ConfigService::V1::Deployment> #list_deployments(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ConfigService::V1::Deployment>

Lists Deployments in a given project and location.

Examples:

Basic example

require "google/cloud/config_service/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ConfigService::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::ConfigService::V1::Deployment.
  p item
end

Overloads:

  • #list_deployments(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ConfigService::V1::Deployment>

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

    Parameters:

    • request (::Google::Cloud::ConfigService::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) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ConfigService::V1::Deployment>

    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, at most 500 will be returned. The maximum value is 1000.

    • 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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
# File 'lib/google/cloud/config_service/v1/config/client.rb', line 293

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigService::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, 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::ConfigService::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :list_deployments, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @config_stub, :list_deployments, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_previews(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ConfigService::V1::Preview> #list_previews(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ConfigService::V1::Preview>

Lists Previews in a given project and location.

Examples:

Basic example

require "google/cloud/config_service/v1"

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

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

# Call the list_previews method.
result = client.list_previews 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::ConfigService::V1::Preview.
  p item
end

Overloads:

  • #list_previews(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ConfigService::V1::Preview>

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

    Parameters:

    • request (::Google::Cloud::ConfigService::V1::ListPreviewsRequest, ::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_previews(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ConfigService::V1::Preview>

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

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

      Optional. When requesting a page of resources, 'page_size' specifies number of resources to return. If unspecified, at most 500 will be returned. The maximum value is 1000.

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

      Optional. 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)

      Optional. 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)

      Optional. Field to use to sort the list.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
# File 'lib/google/cloud/config_service/v1/config/client.rb', line 2113

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigService::V1::ListPreviewsRequest

  # 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_previews..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::ConfigService::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @config_stub.call_rpc :list_previews, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @config_stub, :list_previews, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_resources(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ConfigService::V1::Resource> #list_resources(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ConfigService::V1::Resource>

Lists Resources in a given revision.

Examples:

Basic example

require "google/cloud/config_service/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ConfigService::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::ConfigService::V1::Resource.
  p item
end

Overloads:

  • #list_resources(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ConfigService::V1::Resource>

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

    Parameters:

    • request (::Google::Cloud::ConfigService::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) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ConfigService::V1::Resource>

    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, at most 500 will be returned. The maximum value is 1000.

    • 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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
# File 'lib/google/cloud/config_service/v1/config/client.rb', line 1145

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigService::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, 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::ConfigService::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :list_resources, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @config_stub, :list_resources, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_revisions(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ConfigService::V1::Revision> #list_revisions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ConfigService::V1::Revision>

Lists Revisions of a deployment.

Examples:

Basic example

require "google/cloud/config_service/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ConfigService::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::ConfigService::V1::Revision.
  p item
end

Overloads:

  • #list_revisions(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ConfigService::V1::Revision>

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

    Parameters:

    • request (::Google::Cloud::ConfigService::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) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ConfigService::V1::Revision>

    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, at most 500 will be returned. The maximum value is 1000.

    • 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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



854
855
856
857
858
859
860
861
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_service/v1/config/client.rb', line 854

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigService::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, 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::ConfigService::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :list_revisions, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @config_stub, :list_revisions, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#list_terraform_versions(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ConfigService::V1::TerraformVersion> #list_terraform_versions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ConfigService::V1::TerraformVersion>

Lists TerraformVersions in a given project and location.

Examples:

Basic example

require "google/cloud/config_service/v1"

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

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

# Call the list_terraform_versions method.
result = client.list_terraform_versions 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::ConfigService::V1::TerraformVersion.
  p item
end

Overloads:

  • #list_terraform_versions(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ConfigService::V1::TerraformVersion>

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

    Parameters:

    • request (::Google::Cloud::ConfigService::V1::ListTerraformVersionsRequest, ::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_terraform_versions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::ConfigService::V1::TerraformVersion>

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

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

      Optional. When requesting a page of resources, 'page_size' specifies number of resources to return. If unspecified, at most 500 will be returned. The maximum value is 1000.

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

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

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

      Optional. Lists the TerraformVersions 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.

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

      Optional. Field to use to sort the list.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
# File 'lib/google/cloud/config_service/v1/config/client.rb', line 2423

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigService::V1::ListTerraformVersionsRequest

  # 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_terraform_versions..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::ConfigService::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.parent
    header_params["parent"] = request.parent
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

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

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

  @config_stub.call_rpc :list_terraform_versions, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @config_stub, :list_terraform_versions, request, response, operation, options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => 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_service/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ConfigService::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::ConfigService::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the RPC is aborted.



1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
# File 'lib/google/cloud/config_service/v1/config/client.rb', line 1604

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigService::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, 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::ConfigService::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :lock_deployment, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end

#universe_domainString

The effective universe domain

Returns:

  • (String)


107
108
109
# File 'lib/google/cloud/config_service/v1/config/client.rb', line 107

def universe_domain
  @config_stub.universe_domain
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_service/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ConfigService::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::ConfigService::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the RPC is aborted.



1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
# File 'lib/google/cloud/config_service/v1/config/client.rb', line 1701

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigService::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, 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::ConfigService::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.name
    header_params["name"] = request.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :unlock_deployment, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => 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_service/v1"

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

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::ConfigService::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::ConfigService::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::ConfigService::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:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

  • response (::Gapic::Operation)
  • operation (::GRPC::ActiveCall::Operation)

Returns:

  • (::Gapic::Operation)

Raises:

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

    if the RPC is aborted.



613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
# File 'lib/google/cloud/config_service/v1/config/client.rb', line 613

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::ConfigService::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, 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::ConfigService::V1::VERSION
  [:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.deployment&.name
    header_params["deployment.name"] = request.deployment.name
  end

  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
  [:"x-goog-request-params"] ||= request_params_header

  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.call_rpc :update_deployment, request, options: options do |response, operation|
    response = ::Gapic::Operation.new response, @operations_client, options: options
    yield response, operation if block_given?
    return response
  end
rescue ::GRPC::BadStatus => e
  raise ::Google::Cloud::Error.from_error(e)
end