Class: Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client

Inherits:
Object
  • Object
show all
Includes:
Paths
Defined in:
lib/google/cloud/orchestration/airflow/service/v1/environments/client.rb

Overview

Client for the Environments service.

Managed Apache Airflow Environments.

Defined Under Namespace

Classes: Configuration

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Paths

#environment_path, #user_workloads_config_map_path, #user_workloads_secret_path

Constructor Details

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

Create a new Environments client object.

Examples:


# Create a client using the default configuration
client = ::Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new

# Create a client using a custom configuration
client = ::Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Environments client.

Yield Parameters:



123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# File 'lib/google/cloud/orchestration/airflow/service/v1/environments/client.rb', line 123

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/orchestration/airflow/service/v1/environments_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

  @environments_stub = ::Gapic::ServiceStub.new(
    ::Google::Cloud::Orchestration::Airflow::Service::V1::Environments::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
  )
end

Instance Attribute Details

#operations_client::Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Operations (readonly)

Get the associated client for long-running operations.



175
176
177
# File 'lib/google/cloud/orchestration/airflow/service/v1/environments/client.rb', line 175

def operations_client
  @operations_client
end

Class Method Details

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

Configure the Environments Client class.

See Configuration for a description of the configuration fields.

Examples:


# Modify the configuration for all Environments clients
::Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.configure do |config|
  config.timeout = 10.0
end

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



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

def self.configure
  @configure ||= begin
    namespace = ["Google", "Cloud", "Orchestration", "Airflow", "Service", "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 Environments Client instance.

The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on configure.

See Configuration for a description of the configuration fields.

Yields:

  • (config)

    Configure the Client client.

Yield Parameters:

Returns:



93
94
95
96
# File 'lib/google/cloud/orchestration/airflow/service/v1/environments/client.rb', line 93

def configure
  yield @config if block_given?
  @config
end

#create_environment(request, options = nil) ⇒ ::Gapic::Operation #create_environment(parent: nil, environment: nil) ⇒ ::Gapic::Operation

Create a new environment.

Examples:

Basic example

require "google/cloud/orchestration/airflow/service/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Orchestration::Airflow::Service::V1::CreateEnvironmentRequest.new

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

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

    Parameters:

    • request (::Google::Cloud::Orchestration::Airflow::Service::V1::CreateEnvironmentRequest, ::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_environment(parent: nil, environment: nil) ⇒ ::Gapic::Operation

    Pass arguments to create_environment via keyword arguments. Note that at least one keyword argument is required. To specify no parameters, or to keep all the default parameter values, pass an empty Hash as a request object (see above).

    Parameters:

Yields:

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



233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
# File 'lib/google/cloud/orchestration/airflow/service/v1/environments/client.rb', line 233

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Orchestration::Airflow::Service::V1::CreateEnvironmentRequest

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

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Orchestration::Airflow::Service::V1::VERSION
  [:"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_environment.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_environment.retry_policy

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

  @environments_stub.call_rpc :create_environment, 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_user_workloads_config_map(request, options = nil) ⇒ ::Google::Cloud::Orchestration::Airflow::Service::V1::UserWorkloadsConfigMap #create_user_workloads_config_map(parent: nil, user_workloads_config_map: nil) ⇒ ::Google::Cloud::Orchestration::Airflow::Service::V1::UserWorkloadsConfigMap

Creates a user workloads ConfigMap.

This method is supported for Cloud Composer environments in versions composer-3..-airflow-..* and newer.

Examples:

Basic example

require "google/cloud/orchestration/airflow/service/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Orchestration::Airflow::Service::V1::CreateUserWorkloadsConfigMapRequest.new

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

# The returned object is of type Google::Cloud::Orchestration::Airflow::Service::V1::UserWorkloadsConfigMap.
p result

Overloads:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
# File 'lib/google/cloud/orchestration/airflow/service/v1/environments/client.rb', line 1669

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Orchestration::Airflow::Service::V1::CreateUserWorkloadsConfigMapRequest

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

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Orchestration::Airflow::Service::V1::VERSION
  [:"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_user_workloads_config_map.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_user_workloads_config_map.retry_policy

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

  @environments_stub.call_rpc :create_user_workloads_config_map, 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

#create_user_workloads_secret(request, options = nil) ⇒ ::Google::Cloud::Orchestration::Airflow::Service::V1::UserWorkloadsSecret #create_user_workloads_secret(parent: nil, user_workloads_secret: nil) ⇒ ::Google::Cloud::Orchestration::Airflow::Service::V1::UserWorkloadsSecret

Creates a user workloads Secret.

This method is supported for Cloud Composer environments in versions composer-3..-airflow-..* and newer.

Examples:

Basic example

require "google/cloud/orchestration/airflow/service/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Orchestration::Airflow::Service::V1::CreateUserWorkloadsSecretRequest.new

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

# The returned object is of type Google::Cloud::Orchestration::Airflow::Service::V1::UserWorkloadsSecret.
p result

Overloads:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
# File 'lib/google/cloud/orchestration/airflow/service/v1/environments/client.rb', line 1212

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Orchestration::Airflow::Service::V1::CreateUserWorkloadsSecretRequest

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

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Orchestration::Airflow::Service::V1::VERSION
  [:"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_user_workloads_secret.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.create_user_workloads_secret.retry_policy

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

  @environments_stub.call_rpc :create_user_workloads_secret, 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

#database_failover(request, options = nil) ⇒ ::Gapic::Operation #database_failover(environment: nil) ⇒ ::Gapic::Operation

Triggers database failover (only for highly resilient environments).

Examples:

Basic example

require "google/cloud/orchestration/airflow/service/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Orchestration::Airflow::Service::V1::DatabaseFailoverRequest.new

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

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

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

    Parameters:

    • request (::Google::Cloud::Orchestration::Airflow::Service::V1::DatabaseFailoverRequest, ::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.

  • #database_failover(environment: nil) ⇒ ::Gapic::Operation

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

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

      Target environment: "projects/{projectId}/locations/{locationId}/environments/{environmentId}"

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.



2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
# File 'lib/google/cloud/orchestration/airflow/service/v1/environments/client.rb', line 2339

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Orchestration::Airflow::Service::V1::DatabaseFailoverRequest

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

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Orchestration::Airflow::Service::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.environment
    header_params["environment"] = request.environment
  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.database_failover.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.database_failover.retry_policy

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

  @environments_stub.call_rpc :database_failover, 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_environment(request, options = nil) ⇒ ::Gapic::Operation #delete_environment(name: nil) ⇒ ::Gapic::Operation

Delete an environment.

Examples:

Basic example

require "google/cloud/orchestration/airflow/service/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Orchestration::Airflow::Service::V1::DeleteEnvironmentRequest.new

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

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

    Parameters:

    • request (::Google::Cloud::Orchestration::Airflow::Service::V1::DeleteEnvironmentRequest, ::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_environment(name: nil) ⇒ ::Gapic::Operation

    Pass arguments to delete_environment 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)

      The environment to delete, in the form: "projects/{projectId}/locations/{locationId}/environments/{environmentId}"

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.



729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
# File 'lib/google/cloud/orchestration/airflow/service/v1/environments/client.rb', line 729

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Orchestration::Airflow::Service::V1::DeleteEnvironmentRequest

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

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Orchestration::Airflow::Service::V1::VERSION
  [:"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_environment.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_environment.retry_policy

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

  @environments_stub.call_rpc :delete_environment, 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_user_workloads_config_map(request, options = nil) ⇒ ::Google::Protobuf::Empty #delete_user_workloads_config_map(name: nil) ⇒ ::Google::Protobuf::Empty

Deletes a user workloads ConfigMap.

This method is supported for Cloud Composer environments in versions composer-3..-airflow-..* and newer.

Examples:

Basic example

require "google/cloud/orchestration/airflow/service/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Orchestration::Airflow::Service::V1::DeleteUserWorkloadsConfigMapRequest.new

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

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

Overloads:

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

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

    Parameters:

  • #delete_user_workloads_config_map(name: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_user_workloads_config_map 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 ConfigMap to delete, in the form: "projects/{projectId}/locations/{locationId}/environments/{environmentId}/userWorkloadsConfigMaps/{userWorkloadsConfigMapId}"

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
# File 'lib/google/cloud/orchestration/airflow/service/v1/environments/client.rb', line 2034

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Orchestration::Airflow::Service::V1::DeleteUserWorkloadsConfigMapRequest

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

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Orchestration::Airflow::Service::V1::VERSION
  [:"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_user_workloads_config_map.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_user_workloads_config_map.retry_policy

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

  @environments_stub.call_rpc :delete_user_workloads_config_map, 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

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

Deletes a user workloads Secret.

This method is supported for Cloud Composer environments in versions composer-3..-airflow-..* and newer.

Examples:

Basic example

require "google/cloud/orchestration/airflow/service/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Orchestration::Airflow::Service::V1::DeleteUserWorkloadsSecretRequest.new

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

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

Overloads:

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

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

    Parameters:

  • #delete_user_workloads_secret(name: nil) ⇒ ::Google::Protobuf::Empty

    Pass arguments to delete_user_workloads_secret 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 Secret to delete, in the form: "projects/{projectId}/locations/{locationId}/environments/{environmentId}/userWorkloadsSecrets/{userWorkloadsSecretId}"

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
# File 'lib/google/cloud/orchestration/airflow/service/v1/environments/client.rb', line 1578

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Orchestration::Airflow::Service::V1::DeleteUserWorkloadsSecretRequest

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

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Orchestration::Airflow::Service::V1::VERSION
  [:"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_user_workloads_secret.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.delete_user_workloads_secret.retry_policy

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

  @environments_stub.call_rpc :delete_user_workloads_secret, 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

#execute_airflow_command(request, options = nil) ⇒ ::Google::Cloud::Orchestration::Airflow::Service::V1::ExecuteAirflowCommandResponse #execute_airflow_command(environment: nil, command: nil, subcommand: nil, parameters: nil) ⇒ ::Google::Cloud::Orchestration::Airflow::Service::V1::ExecuteAirflowCommandResponse

Executes Airflow CLI command.

Examples:

Basic example

require "google/cloud/orchestration/airflow/service/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Orchestration::Airflow::Service::V1::ExecuteAirflowCommandRequest.new

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

# The returned object is of type Google::Cloud::Orchestration::Airflow::Service::V1::ExecuteAirflowCommandResponse.
p result

Overloads:

  • #execute_airflow_command(request, options = nil) ⇒ ::Google::Cloud::Orchestration::Airflow::Service::V1::ExecuteAirflowCommandResponse

    Pass arguments to execute_airflow_command via a request object, either of type Google::Cloud::Orchestration::Airflow::Service::V1::ExecuteAirflowCommandRequest or an equivalent Hash.

    Parameters:

  • #execute_airflow_command(environment: nil, command: nil, subcommand: nil, parameters: nil) ⇒ ::Google::Cloud::Orchestration::Airflow::Service::V1::ExecuteAirflowCommandResponse

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

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

      The resource name of the environment in the form: "projects/{projectId}/locations/{locationId}/environments/{environmentId}".

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

      Airflow command.

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

      Airflow subcommand.

    • parameters (::Array<::String>) (defaults to: nil)

      Parameters for the Airflow command/subcommand as an array of arguments. It may contain positional arguments like ["my-dag-id"], key-value parameters like ["--foo=bar"] or ["--foo","bar"], or other flags like ["-f"].

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



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

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Orchestration::Airflow::Service::V1::ExecuteAirflowCommandRequest

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

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

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Orchestration::Airflow::Service::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.environment
    header_params["environment"] = request.environment
  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.execute_airflow_command.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.execute_airflow_command.retry_policy

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

  @environments_stub.call_rpc :execute_airflow_command, 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

#fetch_database_properties(request, options = nil) ⇒ ::Google::Cloud::Orchestration::Airflow::Service::V1::FetchDatabasePropertiesResponse #fetch_database_properties(environment: nil) ⇒ ::Google::Cloud::Orchestration::Airflow::Service::V1::FetchDatabasePropertiesResponse

Fetches database properties.

Examples:

Basic example

require "google/cloud/orchestration/airflow/service/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Orchestration::Airflow::Service::V1::FetchDatabasePropertiesRequest.new

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

# The returned object is of type Google::Cloud::Orchestration::Airflow::Service::V1::FetchDatabasePropertiesResponse.
p result

Overloads:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



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
2465
# File 'lib/google/cloud/orchestration/airflow/service/v1/environments/client.rb', line 2426

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Orchestration::Airflow::Service::V1::FetchDatabasePropertiesRequest

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

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Orchestration::Airflow::Service::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.environment
    header_params["environment"] = request.environment
  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.fetch_database_properties.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.fetch_database_properties.retry_policy

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

  @environments_stub.call_rpc :fetch_database_properties, 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_environment(request, options = nil) ⇒ ::Google::Cloud::Orchestration::Airflow::Service::V1::Environment #get_environment(name: nil) ⇒ ::Google::Cloud::Orchestration::Airflow::Service::V1::Environment

Get an existing environment.

Examples:

Basic example

require "google/cloud/orchestration/airflow/service/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Orchestration::Airflow::Service::V1::GetEnvironmentRequest.new

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

# The returned object is of type Google::Cloud::Orchestration::Airflow::Service::V1::Environment.
p result

Overloads:

  • #get_environment(request, options = nil) ⇒ ::Google::Cloud::Orchestration::Airflow::Service::V1::Environment

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

    Parameters:

    • request (::Google::Cloud::Orchestration::Airflow::Service::V1::GetEnvironmentRequest, ::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_environment(name: nil) ⇒ ::Google::Cloud::Orchestration::Airflow::Service::V1::Environment

    Pass arguments to get_environment 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)

      The resource name of the environment to get, in the form: "projects/{projectId}/locations/{locationId}/environments/{environmentId}"

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
# File 'lib/google/cloud/orchestration/airflow/service/v1/environments/client.rb', line 320

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Orchestration::Airflow::Service::V1::GetEnvironmentRequest

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

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Orchestration::Airflow::Service::V1::VERSION
  [:"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_environment.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_environment.retry_policy

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

  @environments_stub.call_rpc :get_environment, 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_user_workloads_config_map(request, options = nil) ⇒ ::Google::Cloud::Orchestration::Airflow::Service::V1::UserWorkloadsConfigMap #get_user_workloads_config_map(name: nil) ⇒ ::Google::Cloud::Orchestration::Airflow::Service::V1::UserWorkloadsConfigMap

Gets an existing user workloads ConfigMap.

This method is supported for Cloud Composer environments in versions composer-3..-airflow-..* and newer.

Examples:

Basic example

require "google/cloud/orchestration/airflow/service/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Orchestration::Airflow::Service::V1::GetUserWorkloadsConfigMapRequest.new

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

# The returned object is of type Google::Cloud::Orchestration::Airflow::Service::V1::UserWorkloadsConfigMap.
p result

Overloads:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
# File 'lib/google/cloud/orchestration/airflow/service/v1/environments/client.rb', line 1758

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Orchestration::Airflow::Service::V1::GetUserWorkloadsConfigMapRequest

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

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Orchestration::Airflow::Service::V1::VERSION
  [:"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_user_workloads_config_map.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_user_workloads_config_map.retry_policy

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

  @environments_stub.call_rpc :get_user_workloads_config_map, 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_user_workloads_secret(request, options = nil) ⇒ ::Google::Cloud::Orchestration::Airflow::Service::V1::UserWorkloadsSecret #get_user_workloads_secret(name: nil) ⇒ ::Google::Cloud::Orchestration::Airflow::Service::V1::UserWorkloadsSecret

Gets an existing user workloads Secret. Values of the "data" field in the response are cleared.

This method is supported for Cloud Composer environments in versions composer-3..-airflow-..* and newer.

Examples:

Basic example

require "google/cloud/orchestration/airflow/service/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Orchestration::Airflow::Service::V1::GetUserWorkloadsSecretRequest.new

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

# The returned object is of type Google::Cloud::Orchestration::Airflow::Service::V1::UserWorkloadsSecret.
p result

Overloads:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
# File 'lib/google/cloud/orchestration/airflow/service/v1/environments/client.rb', line 1302

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Orchestration::Airflow::Service::V1::GetUserWorkloadsSecretRequest

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

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Orchestration::Airflow::Service::V1::VERSION
  [:"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_user_workloads_secret.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.get_user_workloads_secret.retry_policy

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

  @environments_stub.call_rpc :get_user_workloads_secret, 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_environments(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Orchestration::Airflow::Service::V1::Environment> #list_environments(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Orchestration::Airflow::Service::V1::Environment>

List environments.

Examples:

Basic example

require "google/cloud/orchestration/airflow/service/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Orchestration::Airflow::Service::V1::ListEnvironmentsRequest.new

# Call the list_environments method.
result = client.list_environments 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::Orchestration::Airflow::Service::V1::Environment.
  p item
end

Overloads:

  • #list_environments(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Orchestration::Airflow::Service::V1::Environment>

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

    Parameters:

    • request (::Google::Cloud::Orchestration::Airflow::Service::V1::ListEnvironmentsRequest, ::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_environments(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Orchestration::Airflow::Service::V1::Environment>

    Pass arguments to list_environments 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)

      List environments in the given project and location, in the form: "projects/{projectId}/locations/{locationId}"

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

      The maximum number of environments to return.

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

      The next_page_token value returned from a previous List request, if any.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
# File 'lib/google/cloud/orchestration/airflow/service/v1/environments/client.rb', line 414

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Orchestration::Airflow::Service::V1::ListEnvironmentsRequest

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

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Orchestration::Airflow::Service::V1::VERSION
  [:"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_environments.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_environments.retry_policy

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

  @environments_stub.call_rpc :list_environments, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @environments_stub, :list_environments, 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_user_workloads_config_maps(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Orchestration::Airflow::Service::V1::UserWorkloadsConfigMap> #list_user_workloads_config_maps(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Orchestration::Airflow::Service::V1::UserWorkloadsConfigMap>

Lists user workloads ConfigMaps.

This method is supported for Cloud Composer environments in versions composer-3..-airflow-..* and newer.

Examples:

Basic example

require "google/cloud/orchestration/airflow/service/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Orchestration::Airflow::Service::V1::ListUserWorkloadsConfigMapsRequest.new

# Call the list_user_workloads_config_maps method.
result = client.list_user_workloads_config_maps 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::Orchestration::Airflow::Service::V1::UserWorkloadsConfigMap.
  p item
end

Overloads:

  • #list_user_workloads_config_maps(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Orchestration::Airflow::Service::V1::UserWorkloadsConfigMap>

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

    Parameters:

  • #list_user_workloads_config_maps(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Orchestration::Airflow::Service::V1::UserWorkloadsConfigMap>

    Pass arguments to list_user_workloads_config_maps 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. List ConfigMaps in the given environment, in the form: "projects/{projectId}/locations/{locationId}/environments/{environmentId}"

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

      Optional. The maximum number of ConfigMaps to return.

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

      Optional. The next_page_token value returned from a previous List request, if any.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
# File 'lib/google/cloud/orchestration/airflow/service/v1/environments/client.rb', line 1856

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Orchestration::Airflow::Service::V1::ListUserWorkloadsConfigMapsRequest

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

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Orchestration::Airflow::Service::V1::VERSION
  [:"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_user_workloads_config_maps.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_user_workloads_config_maps.retry_policy

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

  @environments_stub.call_rpc :list_user_workloads_config_maps, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @environments_stub, :list_user_workloads_config_maps, 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_user_workloads_secrets(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Orchestration::Airflow::Service::V1::UserWorkloadsSecret> #list_user_workloads_secrets(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Orchestration::Airflow::Service::V1::UserWorkloadsSecret>

Lists user workloads Secrets.

This method is supported for Cloud Composer environments in versions composer-3..-airflow-..* and newer.

Examples:

Basic example

require "google/cloud/orchestration/airflow/service/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Orchestration::Airflow::Service::V1::ListUserWorkloadsSecretsRequest.new

# Call the list_user_workloads_secrets method.
result = client.list_user_workloads_secrets 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::Orchestration::Airflow::Service::V1::UserWorkloadsSecret.
  p item
end

Overloads:

  • #list_user_workloads_secrets(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Orchestration::Airflow::Service::V1::UserWorkloadsSecret>

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

    Parameters:

  • #list_user_workloads_secrets(parent: nil, page_size: nil, page_token: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Orchestration::Airflow::Service::V1::UserWorkloadsSecret>

    Pass arguments to list_user_workloads_secrets 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. List Secrets in the given environment, in the form: "projects/{projectId}/locations/{locationId}/environments/{environmentId}"

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

      Optional. The maximum number of Secrets to return.

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

      Optional. The next_page_token value returned from a previous List request, if any.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
# File 'lib/google/cloud/orchestration/airflow/service/v1/environments/client.rb', line 1400

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Orchestration::Airflow::Service::V1::ListUserWorkloadsSecretsRequest

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

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Orchestration::Airflow::Service::V1::VERSION
  [:"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_user_workloads_secrets.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_user_workloads_secrets.retry_policy

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

  @environments_stub.call_rpc :list_user_workloads_secrets, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @environments_stub, :list_user_workloads_secrets, 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_workloads(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Orchestration::Airflow::Service::V1::ListWorkloadsResponse::ComposerWorkload> #list_workloads(parent: nil, page_size: nil, page_token: nil, filter: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Orchestration::Airflow::Service::V1::ListWorkloadsResponse::ComposerWorkload>

Lists workloads in a Cloud Composer environment. Workload is a unit that runs a single Composer component.

This method is supported for Cloud Composer environments in versions composer-3..-airflow-..* and newer.

Examples:

Basic example

require "google/cloud/orchestration/airflow/service/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Orchestration::Airflow::Service::V1::ListWorkloadsRequest.new

# Call the list_workloads method.
result = client.list_workloads 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::Orchestration::Airflow::Service::V1::ListWorkloadsResponse::ComposerWorkload.
  p item
end

Overloads:

  • #list_workloads(request, options = nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Orchestration::Airflow::Service::V1::ListWorkloadsResponse::ComposerWorkload>

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

    Parameters:

    • request (::Google::Cloud::Orchestration::Airflow::Service::V1::ListWorkloadsRequest, ::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_workloads(parent: nil, page_size: nil, page_token: nil, filter: nil) ⇒ ::Gapic::PagedEnumerable<::Google::Cloud::Orchestration::Airflow::Service::V1::ListWorkloadsResponse::ComposerWorkload>

    Pass arguments to list_workloads 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 environment name to get workloads for, in the form: "projects/{projectId}/locations/{locationId}/environments/{environmentId}"

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

      Optional. The maximum number of environments to return.

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

      Optional. The next_page_token value returned from a previous List request, if any.

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

      Optional. The list filter. Currently only supports equality on the type field. The value of a field specified in the filter expression must be one ComposerWorkloadType enum option. It's possible to get multiple types using "OR" operator, e.g.: "type=SCHEDULER OR type=CELERY_WORKER". If not specified, all items are returned.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
# File 'lib/google/cloud/orchestration/airflow/service/v1/environments/client.rb', line 1120

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Orchestration::Airflow::Service::V1::ListWorkloadsRequest

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

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Orchestration::Airflow::Service::V1::VERSION
  [:"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_workloads.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.list_workloads.retry_policy

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

  @environments_stub.call_rpc :list_workloads, request, options: options do |response, operation|
    response = ::Gapic::PagedEnumerable.new @environments_stub, :list_workloads, 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

#load_snapshot(request, options = nil) ⇒ ::Gapic::Operation #load_snapshot(environment: nil, snapshot_path: nil, skip_pypi_packages_installation: nil, skip_environment_variables_setting: nil, skip_airflow_overrides_setting: nil, skip_gcs_data_copying: nil) ⇒ ::Gapic::Operation

Loads a snapshot of a Cloud Composer environment.

As a result of this operation, a snapshot of environment's specified in LoadSnapshotRequest is loaded into the environment.

Examples:

Basic example

require "google/cloud/orchestration/airflow/service/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Orchestration::Airflow::Service::V1::LoadSnapshotRequest.new

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

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

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

    Parameters:

    • request (::Google::Cloud::Orchestration::Airflow::Service::V1::LoadSnapshotRequest, ::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.

  • #load_snapshot(environment: nil, snapshot_path: nil, skip_pypi_packages_installation: nil, skip_environment_variables_setting: nil, skip_airflow_overrides_setting: nil, skip_gcs_data_copying: nil) ⇒ ::Gapic::Operation

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

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

      The resource name of the target environment in the form: "projects/{projectId}/locations/{locationId}/environments/{environmentId}"

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

      A Cloud Storage path to a snapshot to load, e.g.: "gs://my-bucket/snapshots/project_location_environment_timestamp".

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

      Whether or not to skip installing Pypi packages when loading the environment's state.

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

      Whether or not to skip setting environment variables when loading the environment's state.

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

      Whether or not to skip setting Airflow overrides when loading the environment's state.

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

      Whether or not to skip copying Cloud Storage data when loading the environment's state.

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.



2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
# File 'lib/google/cloud/orchestration/airflow/service/v1/environments/client.rb', line 2245

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Orchestration::Airflow::Service::V1::LoadSnapshotRequest

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

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Orchestration::Airflow::Service::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.environment
    header_params["environment"] = request.environment
  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.load_snapshot.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.load_snapshot.retry_policy

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

  @environments_stub.call_rpc :load_snapshot, 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

#poll_airflow_command(request, options = nil) ⇒ ::Google::Cloud::Orchestration::Airflow::Service::V1::PollAirflowCommandResponse #poll_airflow_command(environment: nil, execution_id: nil, pod: nil, pod_namespace: nil, next_line_number: nil) ⇒ ::Google::Cloud::Orchestration::Airflow::Service::V1::PollAirflowCommandResponse

Polls Airflow CLI command execution and fetches logs.

Examples:

Basic example

require "google/cloud/orchestration/airflow/service/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Orchestration::Airflow::Service::V1::PollAirflowCommandRequest.new

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

# The returned object is of type Google::Cloud::Orchestration::Airflow::Service::V1::PollAirflowCommandResponse.
p result

Overloads:

  • #poll_airflow_command(request, options = nil) ⇒ ::Google::Cloud::Orchestration::Airflow::Service::V1::PollAirflowCommandResponse

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

    Parameters:

    • request (::Google::Cloud::Orchestration::Airflow::Service::V1::PollAirflowCommandRequest, ::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.

  • #poll_airflow_command(environment: nil, execution_id: nil, pod: nil, pod_namespace: nil, next_line_number: nil) ⇒ ::Google::Cloud::Orchestration::Airflow::Service::V1::PollAirflowCommandResponse

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

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

      The resource name of the environment in the form: "projects/{projectId}/locations/{locationId}/environments/{environmentId}"

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

      The unique ID of the command execution.

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

      The name of the pod where the command is executed.

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

      The namespace of the pod where the command is executed.

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

      Line number from which new logs should be fetched.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
# File 'lib/google/cloud/orchestration/airflow/service/v1/environments/client.rb', line 1014

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Orchestration::Airflow::Service::V1::PollAirflowCommandRequest

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

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Orchestration::Airflow::Service::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.environment
    header_params["environment"] = request.environment
  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.poll_airflow_command.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.poll_airflow_command.retry_policy

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

  @environments_stub.call_rpc :poll_airflow_command, 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

#save_snapshot(request, options = nil) ⇒ ::Gapic::Operation #save_snapshot(environment: nil, snapshot_location: nil) ⇒ ::Gapic::Operation

Creates a snapshots of a Cloud Composer environment.

As a result of this operation, snapshot of environment's state is stored in a location specified in the SaveSnapshotRequest.

Examples:

Basic example

require "google/cloud/orchestration/airflow/service/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Orchestration::Airflow::Service::V1::SaveSnapshotRequest.new

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

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

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

    Parameters:

    • request (::Google::Cloud::Orchestration::Airflow::Service::V1::SaveSnapshotRequest, ::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.

  • #save_snapshot(environment: nil, snapshot_location: nil) ⇒ ::Gapic::Operation

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

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

      The resource name of the source environment in the form: "projects/{projectId}/locations/{locationId}/environments/{environmentId}"

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

      Location in a Cloud Storage where the snapshot is going to be stored, e.g.: "gs://my-bucket/snapshots".

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.



2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
# File 'lib/google/cloud/orchestration/airflow/service/v1/environments/client.rb', line 2133

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Orchestration::Airflow::Service::V1::SaveSnapshotRequest

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

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Orchestration::Airflow::Service::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.environment
    header_params["environment"] = request.environment
  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.save_snapshot.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.save_snapshot.retry_policy

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

  @environments_stub.call_rpc :save_snapshot, 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

#stop_airflow_command(request, options = nil) ⇒ ::Google::Cloud::Orchestration::Airflow::Service::V1::StopAirflowCommandResponse #stop_airflow_command(environment: nil, execution_id: nil, pod: nil, pod_namespace: nil, force: nil) ⇒ ::Google::Cloud::Orchestration::Airflow::Service::V1::StopAirflowCommandResponse

Stops Airflow CLI command execution.

Examples:

Basic example

require "google/cloud/orchestration/airflow/service/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Orchestration::Airflow::Service::V1::StopAirflowCommandRequest.new

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

# The returned object is of type Google::Cloud::Orchestration::Airflow::Service::V1::StopAirflowCommandResponse.
p result

Overloads:

  • #stop_airflow_command(request, options = nil) ⇒ ::Google::Cloud::Orchestration::Airflow::Service::V1::StopAirflowCommandResponse

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

    Parameters:

    • request (::Google::Cloud::Orchestration::Airflow::Service::V1::StopAirflowCommandRequest, ::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.

  • #stop_airflow_command(environment: nil, execution_id: nil, pod: nil, pod_namespace: nil, force: nil) ⇒ ::Google::Cloud::Orchestration::Airflow::Service::V1::StopAirflowCommandResponse

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

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

      The resource name of the environment in the form: "projects/{projectId}/locations/{locationId}/environments/{environmentId}".

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

      The unique ID of the command execution.

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

      The name of the pod where the command is executed.

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

      The namespace of the pod where the command is executed.

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

      If true, the execution is terminated forcefully (SIGKILL). If false, the execution is stopped gracefully, giving it time for cleanup.

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
# File 'lib/google/cloud/orchestration/airflow/service/v1/environments/client.rb', line 920

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Orchestration::Airflow::Service::V1::StopAirflowCommandRequest

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

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Orchestration::Airflow::Service::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.environment
    header_params["environment"] = request.environment
  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.stop_airflow_command.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.stop_airflow_command.retry_policy

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

  @environments_stub.call_rpc :stop_airflow_command, 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

#universe_domainString

The effective universe domain

Returns:

  • (String)


103
104
105
# File 'lib/google/cloud/orchestration/airflow/service/v1/environments/client.rb', line 103

def universe_domain
  @environments_stub.universe_domain
end

#update_environment(request, options = nil) ⇒ ::Gapic::Operation #update_environment(name: nil, environment: nil, update_mask: nil) ⇒ ::Gapic::Operation

Update an environment.

Examples:

Basic example

require "google/cloud/orchestration/airflow/service/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Orchestration::Airflow::Service::V1::UpdateEnvironmentRequest.new

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

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

    Parameters:

    • request (::Google::Cloud::Orchestration::Airflow::Service::V1::UpdateEnvironmentRequest, ::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_environment(name: nil, environment: nil, update_mask: nil) ⇒ ::Gapic::Operation

    Pass arguments to update_environment 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)

      The relative resource name of the environment to update, in the form: "projects/{projectId}/locations/{locationId}/environments/{environmentId}"

    • environment (::Google::Cloud::Orchestration::Airflow::Service::V1::Environment, ::Hash) (defaults to: nil)

      A patch environment. Fields specified by the updateMask will be copied from the patch environment into the environment under update.

    • update_mask (::Google::Protobuf::FieldMask, ::Hash) (defaults to: nil)

      Required. A comma-separated list of paths, relative to Environment, of fields to update. For example, to set the version of scikit-learn to install in the environment to 0.19.0 and to remove an existing installation of numpy, the updateMask parameter would include the following two paths values: "config.softwareConfig.pypiPackages.scikit-learn" and "config.softwareConfig.pypiPackages.numpy". The included patch environment would specify the scikit-learn version as follows:

      {
        "config":{
          "softwareConfig":{
            "pypiPackages":{
              "scikit-learn":"==0.19.0"
            }
          }
        }
      }
      

      Note that in the above example, any existing PyPI packages other than scikit-learn and numpy will be unaffected.

      Only one update type may be included in a single request's updateMask. For example, one cannot update both the PyPI packages and labels in the same request. However, it is possible to update multiple members of a map field simultaneously in the same request. For example, to set the labels "label1" and "label2" while clearing "label3" (assuming it already exists), one can provide the paths "labels.label1", "labels.label2", and "labels.label3" and populate the patch environment as follows:

      {
        "labels":{
          "label1":"new-label1-value"
          "label2":"new-label2-value"
        }
      }
      

      Note that in the above example, any existing labels that are not included in the updateMask will be unaffected.

      It is also possible to replace an entire map field by providing the map field's path in the updateMask. The new value of the field will be that which is provided in the patch environment. For example, to delete all pre-existing user-specified PyPI packages and install botocore at version 1.7.14, the updateMask would contain the path "config.softwareConfig.pypiPackages", and the patch environment would be the following:

      {
        "config":{
          "softwareConfig":{
            "pypiPackages":{
              "botocore":"==1.7.14"
            }
          }
        }
      }
      

      Note: Only the following fields can be updated:

      • config.softwareConfig.pypiPackages
        • Replace all custom custom PyPI packages. If a replacement package map is not included in environment, all custom PyPI packages are cleared. It is an error to provide both this mask and a mask specifying an individual package.
      • config.softwareConfig.pypiPackages.packagename
        • Update the custom PyPI package packagename, preserving other packages. To delete the package, include it in updateMask, and omit the mapping for it in environment.config.softwareConfig.pypiPackages. It is an error to provide both a mask of this form and the config.softwareConfig.pypiPackages mask.
      • labels
        • Replace all environment labels. If a replacement labels map is not included in environment, all labels are cleared. It is an error to provide both this mask and a mask specifying one or more individual labels.
      • labels.labelName
        • Set the label named labelName, while preserving other labels. To delete the label, include it in updateMask and omit its mapping in environment.labels. It is an error to provide both a mask of this form and the labels mask.
      • config.nodeCount
        • Horizontally scale the number of nodes in the environment. An integer greater than or equal to 3 must be provided in the config.nodeCount field. Supported for Cloud Composer environments in versions composer-1..-airflow-..*.
      • config.webServerNetworkAccessControl
        • Replace the environment's current WebServerNetworkAccessControl.
      • config.softwareConfig.airflowConfigOverrides
        • Replace all Apache Airflow config overrides. If a replacement config overrides map is not included in environment, all config overrides are cleared. It is an error to provide both this mask and a mask specifying one or more individual config overrides.
      • config.softwareConfig.airflowConfigOverrides.section-name
        • Override the Apache Airflow config property name in the section named section, preserving other properties. To delete the property override, include it in updateMask and omit its mapping in environment.config.softwareConfig.airflowConfigOverrides. It is an error to provide both a mask of this form and the config.softwareConfig.airflowConfigOverrides mask.
      • config.softwareConfig.envVariables
        • Replace all environment variables. If a replacement environment variable map is not included in environment, all custom environment variables are cleared.
      • config.softwareConfig.schedulerCount
        • Horizontally scale the number of schedulers in Airflow. A positive integer not greater than the number of nodes must be provided in the config.softwareConfig.schedulerCount field. Supported for Cloud Composer environments in versions composer-1..-airflow-2...
      • config.databaseConfig.machineType
        • Cloud SQL machine type used by Airflow database. It has to be one of: db-n1-standard-2, db-n1-standard-4, db-n1-standard-8 or db-n1-standard-16. Supported for Cloud Composer environments in versions composer-1..-airflow-..*.
      • config.webServerConfig.machineType
        • Machine type on which Airflow web server is running. It has to be one of: composer-n1-webserver-2, composer-n1-webserver-4 or composer-n1-webserver-8. Supported for Cloud Composer environments in versions composer-1..-airflow-..*.

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.



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

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Orchestration::Airflow::Service::V1::UpdateEnvironmentRequest

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

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Orchestration::Airflow::Service::V1::VERSION
  [:"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.update_environment.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_environment.retry_policy

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

  @environments_stub.call_rpc :update_environment, 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_user_workloads_config_map(request, options = nil) ⇒ ::Google::Cloud::Orchestration::Airflow::Service::V1::UserWorkloadsConfigMap #update_user_workloads_config_map(user_workloads_config_map: nil) ⇒ ::Google::Cloud::Orchestration::Airflow::Service::V1::UserWorkloadsConfigMap

Updates a user workloads ConfigMap.

This method is supported for Cloud Composer environments in versions composer-3..-airflow-..* and newer.

Examples:

Basic example

require "google/cloud/orchestration/airflow/service/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Orchestration::Airflow::Service::V1::UpdateUserWorkloadsConfigMapRequest.new

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

# The returned object is of type Google::Cloud::Orchestration::Airflow::Service::V1::UserWorkloadsConfigMap.
p result

Overloads:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
# File 'lib/google/cloud/orchestration/airflow/service/v1/environments/client.rb', line 1945

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Orchestration::Airflow::Service::V1::UpdateUserWorkloadsConfigMapRequest

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

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Orchestration::Airflow::Service::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.user_workloads_config_map&.name
    header_params["user_workloads_config_map.name"] = request.user_workloads_config_map.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_user_workloads_config_map.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_user_workloads_config_map.retry_policy

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

  @environments_stub.call_rpc :update_user_workloads_config_map, 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

#update_user_workloads_secret(request, options = nil) ⇒ ::Google::Cloud::Orchestration::Airflow::Service::V1::UserWorkloadsSecret #update_user_workloads_secret(user_workloads_secret: nil) ⇒ ::Google::Cloud::Orchestration::Airflow::Service::V1::UserWorkloadsSecret

Updates a user workloads Secret.

This method is supported for Cloud Composer environments in versions composer-3..-airflow-..* and newer.

Examples:

Basic example

require "google/cloud/orchestration/airflow/service/v1"

# Create a client object. The client can be reused for multiple calls.
client = Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new

# Create a request. To set request fields, pass in keyword arguments.
request = Google::Cloud::Orchestration::Airflow::Service::V1::UpdateUserWorkloadsSecretRequest.new

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

# The returned object is of type Google::Cloud::Orchestration::Airflow::Service::V1::UserWorkloadsSecret.
p result

Overloads:

Yields:

  • (response, operation)

    Access the result along with the RPC operation

Yield Parameters:

Returns:

Raises:

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

    if the RPC is aborted.



1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
# File 'lib/google/cloud/orchestration/airflow/service/v1/environments/client.rb', line 1489

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

  request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Orchestration::Airflow::Service::V1::UpdateUserWorkloadsSecretRequest

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

  # Set x-goog-api-client and x-goog-user-project headers
  [:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
    lib_name: @config.lib_name, lib_version: @config.lib_version,
    gapic_version: ::Google::Cloud::Orchestration::Airflow::Service::V1::VERSION
  [:"x-goog-user-project"] = @quota_project_id if @quota_project_id

  header_params = {}
  if request.user_workloads_secret&.name
    header_params["user_workloads_secret.name"] = request.user_workloads_secret.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_user_workloads_secret.timeout,
                         metadata:     ,
                         retry_policy: @config.rpcs.update_user_workloads_secret.retry_policy

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

  @environments_stub.call_rpc :update_user_workloads_secret, 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