google-cloud-orchestration-airflow-service-v1 0.8.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a83d1c7f7236b009e1afb6acdd1966ee048ab9ef08dd3dd96642084d69c73d3f
4
- data.tar.gz: b18f02313e2eadd27b12ca3a4890a148f6d6645409b61d0a4dbd8d870e8eece1
3
+ metadata.gz: 6fa37b6b906a9aca9796ee7204429312880aa29c3f10375afada9c44be02f37d
4
+ data.tar.gz: 1a212b35a9366d12c8240b4a77522151d600455fb1583869313ee13f43088b6e
5
5
  SHA512:
6
- metadata.gz: 895d3d84ad12e8e54c1ba3c778b8c498080ef160f4eb97dfd9bb6553f8a8c1fe07d3a5adac53bb176f251a7e8be04692e88ea57d283991b41a6898f014867bd5
7
- data.tar.gz: cb5b3fa3ad08cbdbeeaa81fd98800b3903ce0c8c03ebb65cc279e6f6df17d48de5c52444617b841dbcfbe7ea97fc187c71c6a8f1b3ac6ccf93d7861062e3e2b4
6
+ metadata.gz: 1fa8434f7a642a9de928e550df38c1c06ab5f2f6b83a76d4d5b768addc2ccea3a68d329396436d21a06d8aaed8d81f9d0af3ec434c81a58b3323f6e4e56e2152
7
+ data.tar.gz: d220e2af35343651a70c27498a001d3ff3d9304d50dc63fc5661fb8de3473bafb47792c7d98eed59b6c67809367ed9b8d75719814425328b55b2c763e8b4e1ec
data/AUTHENTICATION.md CHANGED
@@ -1,149 +1,122 @@
1
1
  # Authentication
2
2
 
3
- In general, the google-cloud-orchestration-airflow-service-v1 library uses
4
- [Service Account](https://cloud.google.com/iam/docs/creating-managing-service-accounts)
5
- credentials to connect to Google Cloud services. When running within
6
- [Google Cloud Platform environments](#google-cloud-platform-environments) the
7
- credentials will be discovered automatically. When running on other
8
- environments, the Service Account credentials can be specified by providing the
9
- path to the
10
- [JSON keyfile](https://cloud.google.com/iam/docs/managing-service-account-keys)
11
- for the account (or the JSON itself) in
12
- [environment variables](#environment-variables). Additionally, Cloud SDK
13
- credentials can also be discovered automatically, but this is only recommended
14
- during development.
3
+ The recommended way to authenticate to the google-cloud-orchestration-airflow-service-v1 library is to use
4
+ [Application Default Credentials (ADC)](https://cloud.google.com/docs/authentication/application-default-credentials).
5
+ To review all of your authentication options, see [Credentials lookup](#credential-lookup).
15
6
 
16
7
  ## Quickstart
17
8
 
18
- 1. [Create a service account and credentials](#creating-a-service-account).
19
- 2. Set the [environment variable](#environment-variables).
9
+ The following example shows how to set up authentication for a local development
10
+ environment with your user credentials.
20
11
 
21
- ```sh
22
- export GOOGLE_CLOUD_CREDENTIALS=path/to/keyfile.json
23
- ```
24
-
25
- 3. Initialize the client.
12
+ **NOTE:** This method is _not_ recommended for running in production. User credentials
13
+ should be used only during development.
26
14
 
27
- ```ruby
28
- require "google/cloud/orchestration/airflow/service/v1"
15
+ 1. [Download and install the Google Cloud CLI](https://cloud.google.com/sdk).
16
+ 2. Set up a local ADC file with your user credentials:
29
17
 
30
- client = ::Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new
18
+ ```sh
19
+ gcloud auth application-default login
31
20
  ```
32
21
 
33
- ## Credential Lookup
34
-
35
- The google-cloud-orchestration-airflow-service-v1 library aims to make authentication
36
- as simple as possible, and provides several mechanisms to configure your system
37
- without requiring **Service Account Credentials** directly in code.
38
-
39
- **Credentials** are discovered in the following order:
40
-
41
- 1. Specify credentials in method arguments
42
- 2. Specify credentials in configuration
43
- 3. Discover credentials path in environment variables
44
- 4. Discover credentials JSON in environment variables
45
- 5. Discover credentials file in the Cloud SDK's path
46
- 6. Discover GCP credentials
47
-
48
- ### Google Cloud Platform environments
22
+ 3. Write code as if already authenticated.
49
23
 
50
- When running on Google Cloud Platform (GCP), including Google Compute Engine
51
- (GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud
52
- Functions (GCF) and Cloud Run, **Credentials** are discovered automatically.
53
- Code should be written as if already authenticated.
24
+ For more information about setting up authentication for a local development environment, see
25
+ [Set up Application Default Credentials](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-dev).
54
26
 
55
- ### Environment Variables
27
+ ## Credential Lookup
56
28
 
57
- The **Credentials JSON** can be placed in environment variables instead of
58
- declaring them directly in code. Each service has its own environment variable,
59
- allowing for different service accounts to be used for different services. (See
60
- the READMEs for the individual service gems for details.) The path to the
61
- **Credentials JSON** file can be stored in the environment variable, or the
62
- **Credentials JSON** itself can be stored for environments such as Docker
63
- containers where writing files is difficult or not encouraged.
29
+ The google-cloud-orchestration-airflow-service-v1 library provides several mechanisms to configure your system.
30
+ Generally, using Application Default Credentials to facilitate automatic
31
+ credentials discovery is the easist method. But if you need to explicitly specify
32
+ credentials, there are several methods available to you.
64
33
 
65
- The environment variables that google-cloud-orchestration-airflow-service-v1
66
- checks for credentials are configured on the service Credentials class (such as
67
- {::Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Credentials}):
34
+ Credentials are accepted in the following ways, in the following order or precedence:
68
35
 
69
- * `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
70
- * `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
71
- * `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
36
+ 1. Credentials specified in method arguments
37
+ 2. Credentials specified in configuration
38
+ 3. Credentials pointed to or included in environment variables
39
+ 4. Credentials found in local ADC file
40
+ 5. Credentials returned by the metadata server for the attached service account (GCP)
72
41
 
73
- ```ruby
74
- require "google/cloud/orchestration/airflow/service/v1"
75
-
76
- ENV["GOOGLE_CLOUD_CREDENTIALS"] = "path/to/keyfile.json"
42
+ ### Configuration
77
43
 
78
- client = ::Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new
79
- ```
44
+ You can configure a path to a JSON credentials file, either for an individual client object or
45
+ globally, for all client objects. The JSON file can contain credentials created for
46
+ [workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation),
47
+ [workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a
48
+ [service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key).
80
49
 
81
- ### Configuration
50
+ Note: Service account keys are a security risk if not managed correctly. You should
51
+ [choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree)
52
+ whenever possible.
82
53
 
83
- The path to the **Credentials JSON** file can be configured instead of storing
84
- it in an environment variable. Either on an individual client initialization:
54
+ To configure a credentials file for an individual client initialization:
85
55
 
86
56
  ```ruby
87
57
  require "google/cloud/orchestration/airflow/service/v1"
88
58
 
89
59
  client = ::Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new do |config|
90
- config.credentials = "path/to/keyfile.json"
60
+ config.credentials = "path/to/credentialfile.json"
91
61
  end
92
62
  ```
93
63
 
94
- Or globally for all clients:
64
+ To configure a credentials file globally for all clients:
95
65
 
96
66
  ```ruby
97
67
  require "google/cloud/orchestration/airflow/service/v1"
98
68
 
99
69
  ::Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.configure do |config|
100
- config.credentials = "path/to/keyfile.json"
70
+ config.credentials = "path/to/credentialfile.json"
101
71
  end
102
72
 
103
73
  client = ::Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new
104
74
  ```
105
75
 
106
- ### Cloud SDK
76
+ ### Environment Variables
107
77
 
108
- This option allows for an easy way to authenticate during development. If
109
- credentials are not provided in code or in environment variables, then Cloud SDK
110
- credentials are discovered.
78
+ You can also use an environment variable to provide a JSON credentials file.
79
+ The environment variable can contain a path to the credentials file or, for
80
+ environments such as Docker containers where writing files is not encouraged,
81
+ you can include the credentials file itself.
111
82
 
112
- To configure your system for this, simply:
83
+ The JSON file can contain credentials created for
84
+ [workload identity federation](https://cloud.google.com/iam/docs/workload-identity-federation),
85
+ [workforce identity federation](https://cloud.google.com/iam/docs/workforce-identity-federation), or a
86
+ [service account key](https://cloud.google.com/docs/authentication/provide-credentials-adc#local-key).
113
87
 
114
- 1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
115
- 2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
116
- 3. Write code as if already authenticated.
88
+ Note: Service account keys are a security risk if not managed correctly. You should
89
+ [choose a more secure alternative to service account keys](https://cloud.google.com/docs/authentication#auth-decision-tree)
90
+ whenever possible.
91
+
92
+ The environment variables that google-cloud-orchestration-airflow-service-v1
93
+ checks for credentials are:
117
94
 
118
- **NOTE:** This is _not_ recommended for running in production. The Cloud SDK
119
- *should* only be used during development.
95
+ * `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
96
+ * `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
120
97
 
121
- ## Creating a Service Account
98
+ ```ruby
99
+ require "google/cloud/orchestration/airflow/service/v1"
122
100
 
123
- Google Cloud requires **Service Account Credentials** to
124
- connect to the APIs. You will use the **JSON key file** to
125
- connect to most services with google-cloud-orchestration-airflow-service-v1.
101
+ ENV["GOOGLE_APPLICATION_CREDENTIALS"] = "path/to/credentialfile.json"
126
102
 
127
- If you are not running this client within
128
- [Google Cloud Platform environments](#google-cloud-platform-environments), you
129
- need a Google Developers service account.
103
+ client = ::Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Client.new
104
+ ```
130
105
 
131
- 1. Visit the [Google Cloud Console](https://console.cloud.google.com/project).
132
- 2. Create a new project or click on an existing project.
133
- 3. Activate the menu in the upper left and select **APIs & Services**. From
134
- here, you will enable the APIs that your application requires.
106
+ ### Local ADC file
135
107
 
136
- *Note: You may need to enable billing in order to use these services.*
108
+ You can set up a local ADC file with your user credentials for authentication during
109
+ development. If credentials are not provided in code or in environment variables,
110
+ then the local ADC credentials are discovered.
137
111
 
138
- 4. Select **Credentials** from the side navigation.
112
+ Follow the steps in [Quickstart](#quickstart) to set up a local ADC file.
139
113
 
140
- Find the "Create credentials" drop down near the top of the page, and select
141
- "Service account" to be guided through downloading a new JSON key file.
114
+ ### Google Cloud Platform environments
142
115
 
143
- If you want to re-use an existing service account, you can easily generate a
144
- new key file. Just select the account you wish to re-use, click the pencil
145
- tool on the right side to edit the service account, select the **Keys** tab,
146
- and then select **Add Key**.
116
+ When running on Google Cloud Platform (GCP), including Google Compute Engine
117
+ (GCE), Google Kubernetes Engine (GKE), Google App Engine (GAE), Google Cloud
118
+ Functions (GCF) and Cloud Run, credentials are retrieved from the attached
119
+ service account automatically. Code should be written as if already authenticated.
147
120
 
148
- The key file you download will be used by this library to authenticate API
149
- requests and should be stored in a secure location.
121
+ For more information, see
122
+ [Set up ADC for Google Cloud services](https://cloud.google.com/docs/authentication/provide-credentials-adc#attached-sa).
@@ -32,6 +32,9 @@ module Google
32
32
  # Managed Apache Airflow Environments.
33
33
  #
34
34
  class Client
35
+ # @private
36
+ DEFAULT_ENDPOINT_TEMPLATE = "composer.$UNIVERSE_DOMAIN$"
37
+
35
38
  include Paths
36
39
 
37
40
  # @private
@@ -92,6 +95,15 @@ module Google
92
95
  @config
93
96
  end
94
97
 
98
+ ##
99
+ # The effective universe domain
100
+ #
101
+ # @return [String]
102
+ #
103
+ def universe_domain
104
+ @environments_stub.universe_domain
105
+ end
106
+
95
107
  ##
96
108
  # Create a new Environments client object.
97
109
  #
@@ -125,8 +137,9 @@ module Google
125
137
  credentials = @config.credentials
126
138
  # Use self-signed JWT if the endpoint is unchanged from default,
127
139
  # but only if the default endpoint does not have a region prefix.
128
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
129
- !@config.endpoint.split(".").first.include?("-")
140
+ enable_self_signed_jwt = @config.endpoint.nil? ||
141
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
142
+ !@config.endpoint.split(".").first.include?("-"))
130
143
  credentials ||= Credentials.default scope: @config.scope,
131
144
  enable_self_signed_jwt: enable_self_signed_jwt
132
145
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -139,12 +152,15 @@ module Google
139
152
  config.credentials = credentials
140
153
  config.quota_project = @quota_project_id
141
154
  config.endpoint = @config.endpoint
155
+ config.universe_domain = @config.universe_domain
142
156
  end
143
157
 
144
158
  @environments_stub = ::Gapic::ServiceStub.new(
145
159
  ::Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Stub,
146
- credentials: credentials,
147
- endpoint: @config.endpoint,
160
+ credentials: credentials,
161
+ endpoint: @config.endpoint,
162
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
163
+ universe_domain: @config.universe_domain,
148
164
  channel_args: @config.channel_args,
149
165
  interceptors: @config.interceptors,
150
166
  channel_pool_config: @config.channel_pool
@@ -1458,9 +1474,9 @@ module Google
1458
1474
  # end
1459
1475
  #
1460
1476
  # @!attribute [rw] endpoint
1461
- # The hostname or hostname:port of the service endpoint.
1462
- # Defaults to `"composer.googleapis.com"`.
1463
- # @return [::String]
1477
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1478
+ # nil, indicating to use the default endpoint in the current universe domain.
1479
+ # @return [::String,nil]
1464
1480
  # @!attribute [rw] credentials
1465
1481
  # Credentials to send with calls. You may provide any of the following types:
1466
1482
  # * (`String`) The path to a service account key file in JSON format
@@ -1506,13 +1522,20 @@ module Google
1506
1522
  # @!attribute [rw] quota_project
1507
1523
  # A separate project against which to charge quota.
1508
1524
  # @return [::String]
1525
+ # @!attribute [rw] universe_domain
1526
+ # The universe domain within which to make requests. This determines the
1527
+ # default endpoint URL. The default value of nil uses the environment
1528
+ # universe (usually the default "googleapis.com" universe).
1529
+ # @return [::String,nil]
1509
1530
  #
1510
1531
  class Configuration
1511
1532
  extend ::Gapic::Config
1512
1533
 
1534
+ # @private
1535
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1513
1536
  DEFAULT_ENDPOINT = "composer.googleapis.com"
1514
1537
 
1515
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1538
+ config_attr :endpoint, nil, ::String, nil
1516
1539
  config_attr :credentials, nil do |value|
1517
1540
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1518
1541
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -1527,6 +1550,7 @@ module Google
1527
1550
  config_attr :metadata, nil, ::Hash, nil
1528
1551
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1529
1552
  config_attr :quota_project, nil, ::String, nil
1553
+ config_attr :universe_domain, nil, ::String, nil
1530
1554
 
1531
1555
  # @private
1532
1556
  def initialize parent_config = nil
@@ -28,6 +28,9 @@ module Google
28
28
  module Environments
29
29
  # Service that implements Longrunning Operations API.
30
30
  class Operations
31
+ # @private
32
+ DEFAULT_ENDPOINT_TEMPLATE = "composer.$UNIVERSE_DOMAIN$"
33
+
31
34
  # @private
32
35
  attr_reader :operations_stub
33
36
 
@@ -62,6 +65,15 @@ module Google
62
65
  @config
63
66
  end
64
67
 
68
+ ##
69
+ # The effective universe domain
70
+ #
71
+ # @return [String]
72
+ #
73
+ def universe_domain
74
+ @operations_stub.universe_domain
75
+ end
76
+
65
77
  ##
66
78
  # Create a new Operations client object.
67
79
  #
@@ -92,8 +104,10 @@ module Google
92
104
 
93
105
  @operations_stub = ::Gapic::ServiceStub.new(
94
106
  ::Google::Longrunning::Operations::Stub,
95
- credentials: credentials,
96
- endpoint: @config.endpoint,
107
+ credentials: credentials,
108
+ endpoint: @config.endpoint,
109
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
110
+ universe_domain: @config.universe_domain,
97
111
  channel_args: @config.channel_args,
98
112
  interceptors: @config.interceptors,
99
113
  channel_pool_config: @config.channel_pool
@@ -615,9 +629,9 @@ module Google
615
629
  # end
616
630
  #
617
631
  # @!attribute [rw] endpoint
618
- # The hostname or hostname:port of the service endpoint.
619
- # Defaults to `"composer.googleapis.com"`.
620
- # @return [::String]
632
+ # A custom service endpoint, as a hostname or hostname:port. The default is
633
+ # nil, indicating to use the default endpoint in the current universe domain.
634
+ # @return [::String,nil]
621
635
  # @!attribute [rw] credentials
622
636
  # Credentials to send with calls. You may provide any of the following types:
623
637
  # * (`String`) The path to a service account key file in JSON format
@@ -663,13 +677,20 @@ module Google
663
677
  # @!attribute [rw] quota_project
664
678
  # A separate project against which to charge quota.
665
679
  # @return [::String]
680
+ # @!attribute [rw] universe_domain
681
+ # The universe domain within which to make requests. This determines the
682
+ # default endpoint URL. The default value of nil uses the environment
683
+ # universe (usually the default "googleapis.com" universe).
684
+ # @return [::String,nil]
666
685
  #
667
686
  class Configuration
668
687
  extend ::Gapic::Config
669
688
 
689
+ # @private
690
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
670
691
  DEFAULT_ENDPOINT = "composer.googleapis.com"
671
692
 
672
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
693
+ config_attr :endpoint, nil, ::String, nil
673
694
  config_attr :credentials, nil do |value|
674
695
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
675
696
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -684,6 +705,7 @@ module Google
684
705
  config_attr :metadata, nil, ::Hash, nil
685
706
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
686
707
  config_attr :quota_project, nil, ::String, nil
708
+ config_attr :universe_domain, nil, ::String, nil
687
709
 
688
710
  # @private
689
711
  def initialize parent_config = nil
@@ -34,6 +34,9 @@ module Google
34
34
  # Managed Apache Airflow Environments.
35
35
  #
36
36
  class Client
37
+ # @private
38
+ DEFAULT_ENDPOINT_TEMPLATE = "composer.$UNIVERSE_DOMAIN$"
39
+
37
40
  include Paths
38
41
 
39
42
  # @private
@@ -94,6 +97,15 @@ module Google
94
97
  @config
95
98
  end
96
99
 
100
+ ##
101
+ # The effective universe domain
102
+ #
103
+ # @return [String]
104
+ #
105
+ def universe_domain
106
+ @environments_stub.universe_domain
107
+ end
108
+
97
109
  ##
98
110
  # Create a new Environments REST client object.
99
111
  #
@@ -121,8 +133,9 @@ module Google
121
133
  credentials = @config.credentials
122
134
  # Use self-signed JWT if the endpoint is unchanged from default,
123
135
  # but only if the default endpoint does not have a region prefix.
124
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
125
- !@config.endpoint.split(".").first.include?("-")
136
+ enable_self_signed_jwt = @config.endpoint.nil? ||
137
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
138
+ !@config.endpoint.split(".").first.include?("-"))
126
139
  credentials ||= Credentials.default scope: @config.scope,
127
140
  enable_self_signed_jwt: enable_self_signed_jwt
128
141
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -136,9 +149,15 @@ module Google
136
149
  config.credentials = credentials
137
150
  config.quota_project = @quota_project_id
138
151
  config.endpoint = @config.endpoint
152
+ config.universe_domain = @config.universe_domain
139
153
  end
140
154
 
141
- @environments_stub = ::Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
155
+ @environments_stub = ::Google::Cloud::Orchestration::Airflow::Service::V1::Environments::Rest::ServiceStub.new(
156
+ endpoint: @config.endpoint,
157
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
158
+ universe_domain: @config.universe_domain,
159
+ credentials: credentials
160
+ )
142
161
  end
143
162
 
144
163
  ##
@@ -1364,9 +1383,9 @@ module Google
1364
1383
  # end
1365
1384
  #
1366
1385
  # @!attribute [rw] endpoint
1367
- # The hostname or hostname:port of the service endpoint.
1368
- # Defaults to `"composer.googleapis.com"`.
1369
- # @return [::String]
1386
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1387
+ # nil, indicating to use the default endpoint in the current universe domain.
1388
+ # @return [::String,nil]
1370
1389
  # @!attribute [rw] credentials
1371
1390
  # Credentials to send with calls. You may provide any of the following types:
1372
1391
  # * (`String`) The path to a service account key file in JSON format
@@ -1403,13 +1422,20 @@ module Google
1403
1422
  # @!attribute [rw] quota_project
1404
1423
  # A separate project against which to charge quota.
1405
1424
  # @return [::String]
1425
+ # @!attribute [rw] universe_domain
1426
+ # The universe domain within which to make requests. This determines the
1427
+ # default endpoint URL. The default value of nil uses the environment
1428
+ # universe (usually the default "googleapis.com" universe).
1429
+ # @return [::String,nil]
1406
1430
  #
1407
1431
  class Configuration
1408
1432
  extend ::Gapic::Config
1409
1433
 
1434
+ # @private
1435
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1410
1436
  DEFAULT_ENDPOINT = "composer.googleapis.com"
1411
1437
 
1412
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1438
+ config_attr :endpoint, nil, ::String, nil
1413
1439
  config_attr :credentials, nil do |value|
1414
1440
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1415
1441
  allowed.any? { |klass| klass === value }
@@ -1421,6 +1447,7 @@ module Google
1421
1447
  config_attr :metadata, nil, ::Hash, nil
1422
1448
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1423
1449
  config_attr :quota_project, nil, ::String, nil
1450
+ config_attr :universe_domain, nil, ::String, nil
1424
1451
 
1425
1452
  # @private
1426
1453
  def initialize parent_config = nil
@@ -28,6 +28,9 @@ module Google
28
28
  module Rest
29
29
  # Service that implements Longrunning Operations API.
30
30
  class Operations
31
+ # @private
32
+ DEFAULT_ENDPOINT_TEMPLATE = "composer.$UNIVERSE_DOMAIN$"
33
+
31
34
  # @private
32
35
  attr_reader :operations_stub
33
36
 
@@ -62,6 +65,15 @@ module Google
62
65
  @config
63
66
  end
64
67
 
68
+ ##
69
+ # The effective universe domain
70
+ #
71
+ # @return [String]
72
+ #
73
+ def universe_domain
74
+ @operations_stub.universe_domain
75
+ end
76
+
65
77
  ##
66
78
  # Create a new Operations client object.
67
79
  #
@@ -86,8 +98,10 @@ module Google
86
98
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
87
99
 
88
100
  @operations_stub = OperationsServiceStub.new(
89
- endpoint: @config.endpoint,
90
- credentials: credentials
101
+ endpoint: @config.endpoint,
102
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
103
+ universe_domain: @config.universe_domain,
104
+ credentials: credentials
91
105
  )
92
106
 
93
107
  # Used by an LRO wrapper for some methods of this service
@@ -480,9 +494,9 @@ module Google
480
494
  # end
481
495
  #
482
496
  # @!attribute [rw] endpoint
483
- # The hostname or hostname:port of the service endpoint.
484
- # Defaults to `"composer.googleapis.com"`.
485
- # @return [::String]
497
+ # A custom service endpoint, as a hostname or hostname:port. The default is
498
+ # nil, indicating to use the default endpoint in the current universe domain.
499
+ # @return [::String,nil]
486
500
  # @!attribute [rw] credentials
487
501
  # Credentials to send with calls. You may provide any of the following types:
488
502
  # * (`String`) The path to a service account key file in JSON format
@@ -519,13 +533,20 @@ module Google
519
533
  # @!attribute [rw] quota_project
520
534
  # A separate project against which to charge quota.
521
535
  # @return [::String]
536
+ # @!attribute [rw] universe_domain
537
+ # The universe domain within which to make requests. This determines the
538
+ # default endpoint URL. The default value of nil uses the environment
539
+ # universe (usually the default "googleapis.com" universe).
540
+ # @return [::String,nil]
522
541
  #
523
542
  class Configuration
524
543
  extend ::Gapic::Config
525
544
 
545
+ # @private
546
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
526
547
  DEFAULT_ENDPOINT = "composer.googleapis.com"
527
548
 
528
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
549
+ config_attr :endpoint, nil, ::String, nil
529
550
  config_attr :credentials, nil do |value|
530
551
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
531
552
  allowed.any? { |klass| klass === value }
@@ -537,6 +558,7 @@ module Google
537
558
  config_attr :metadata, nil, ::Hash, nil
538
559
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
539
560
  config_attr :quota_project, nil, ::String, nil
561
+ config_attr :universe_domain, nil, ::String, nil
540
562
 
541
563
  # @private
542
564
  def initialize parent_config = nil
@@ -619,12 +641,15 @@ module Google
619
641
  # Service stub contains baseline method implementations
620
642
  # including transcoding, making the REST call, and deserialing the response.
621
643
  class OperationsServiceStub
622
- def initialize endpoint:, credentials:
644
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
623
645
  # These require statements are intentionally placed here to initialize
624
646
  # the REST modules only when it's required.
625
647
  require "gapic/rest"
626
648
 
627
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials
649
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
650
+ endpoint_template: endpoint_template,
651
+ universe_domain: universe_domain,
652
+ credentials: credentials
628
653
  end
629
654
 
630
655
  ##
@@ -32,16 +32,28 @@ module Google
32
32
  # including transcoding, making the REST call, and deserialing the response.
33
33
  #
34
34
  class ServiceStub
35
- def initialize endpoint:, credentials:
35
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
36
36
  # These require statements are intentionally placed here to initialize
37
37
  # the REST modules only when it's required.
38
38
  require "gapic/rest"
39
39
 
40
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
40
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
41
+ endpoint_template: endpoint_template,
42
+ universe_domain: universe_domain,
43
+ credentials: credentials,
41
44
  numeric_enums: true,
42
45
  raise_faraday_errors: false
43
46
  end
44
47
 
48
+ ##
49
+ # The effective universe domain
50
+ #
51
+ # @return [String]
52
+ #
53
+ def universe_domain
54
+ @client_stub.universe_domain
55
+ end
56
+
45
57
  ##
46
58
  # Baseline implementation for the create_environment REST call
47
59
  #
@@ -32,6 +32,9 @@ module Google
32
32
  # Readonly service to query available ImageVersions.
33
33
  #
34
34
  class Client
35
+ # @private
36
+ DEFAULT_ENDPOINT_TEMPLATE = "composer.$UNIVERSE_DOMAIN$"
37
+
35
38
  # @private
36
39
  attr_reader :image_versions_stub
37
40
 
@@ -90,6 +93,15 @@ module Google
90
93
  @config
91
94
  end
92
95
 
96
+ ##
97
+ # The effective universe domain
98
+ #
99
+ # @return [String]
100
+ #
101
+ def universe_domain
102
+ @image_versions_stub.universe_domain
103
+ end
104
+
93
105
  ##
94
106
  # Create a new ImageVersions client object.
95
107
  #
@@ -123,8 +135,9 @@ module Google
123
135
  credentials = @config.credentials
124
136
  # Use self-signed JWT if the endpoint is unchanged from default,
125
137
  # but only if the default endpoint does not have a region prefix.
126
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
127
- !@config.endpoint.split(".").first.include?("-")
138
+ enable_self_signed_jwt = @config.endpoint.nil? ||
139
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
140
+ !@config.endpoint.split(".").first.include?("-"))
128
141
  credentials ||= Credentials.default scope: @config.scope,
129
142
  enable_self_signed_jwt: enable_self_signed_jwt
130
143
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -135,8 +148,10 @@ module Google
135
148
 
136
149
  @image_versions_stub = ::Gapic::ServiceStub.new(
137
150
  ::Google::Cloud::Orchestration::Airflow::Service::V1::ImageVersions::Stub,
138
- credentials: credentials,
139
- endpoint: @config.endpoint,
151
+ credentials: credentials,
152
+ endpoint: @config.endpoint,
153
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
154
+ universe_domain: @config.universe_domain,
140
155
  channel_args: @config.channel_args,
141
156
  interceptors: @config.interceptors,
142
157
  channel_pool_config: @config.channel_pool
@@ -272,9 +287,9 @@ module Google
272
287
  # end
273
288
  #
274
289
  # @!attribute [rw] endpoint
275
- # The hostname or hostname:port of the service endpoint.
276
- # Defaults to `"composer.googleapis.com"`.
277
- # @return [::String]
290
+ # A custom service endpoint, as a hostname or hostname:port. The default is
291
+ # nil, indicating to use the default endpoint in the current universe domain.
292
+ # @return [::String,nil]
278
293
  # @!attribute [rw] credentials
279
294
  # Credentials to send with calls. You may provide any of the following types:
280
295
  # * (`String`) The path to a service account key file in JSON format
@@ -320,13 +335,20 @@ module Google
320
335
  # @!attribute [rw] quota_project
321
336
  # A separate project against which to charge quota.
322
337
  # @return [::String]
338
+ # @!attribute [rw] universe_domain
339
+ # The universe domain within which to make requests. This determines the
340
+ # default endpoint URL. The default value of nil uses the environment
341
+ # universe (usually the default "googleapis.com" universe).
342
+ # @return [::String,nil]
323
343
  #
324
344
  class Configuration
325
345
  extend ::Gapic::Config
326
346
 
347
+ # @private
348
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
327
349
  DEFAULT_ENDPOINT = "composer.googleapis.com"
328
350
 
329
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
351
+ config_attr :endpoint, nil, ::String, nil
330
352
  config_attr :credentials, nil do |value|
331
353
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
332
354
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -341,6 +363,7 @@ module Google
341
363
  config_attr :metadata, nil, ::Hash, nil
342
364
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
343
365
  config_attr :quota_project, nil, ::String, nil
366
+ config_attr :universe_domain, nil, ::String, nil
344
367
 
345
368
  # @private
346
369
  def initialize parent_config = nil
@@ -34,6 +34,9 @@ module Google
34
34
  # Readonly service to query available ImageVersions.
35
35
  #
36
36
  class Client
37
+ # @private
38
+ DEFAULT_ENDPOINT_TEMPLATE = "composer.$UNIVERSE_DOMAIN$"
39
+
37
40
  # @private
38
41
  attr_reader :image_versions_stub
39
42
 
@@ -92,6 +95,15 @@ module Google
92
95
  @config
93
96
  end
94
97
 
98
+ ##
99
+ # The effective universe domain
100
+ #
101
+ # @return [String]
102
+ #
103
+ def universe_domain
104
+ @image_versions_stub.universe_domain
105
+ end
106
+
95
107
  ##
96
108
  # Create a new ImageVersions REST client object.
97
109
  #
@@ -119,8 +131,9 @@ module Google
119
131
  credentials = @config.credentials
120
132
  # Use self-signed JWT if the endpoint is unchanged from default,
121
133
  # but only if the default endpoint does not have a region prefix.
122
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
123
- !@config.endpoint.split(".").first.include?("-")
134
+ enable_self_signed_jwt = @config.endpoint.nil? ||
135
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
136
+ !@config.endpoint.split(".").first.include?("-"))
124
137
  credentials ||= Credentials.default scope: @config.scope,
125
138
  enable_self_signed_jwt: enable_self_signed_jwt
126
139
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -130,7 +143,12 @@ module Google
130
143
  @quota_project_id = @config.quota_project
131
144
  @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
132
145
 
133
- @image_versions_stub = ::Google::Cloud::Orchestration::Airflow::Service::V1::ImageVersions::Rest::ServiceStub.new endpoint: @config.endpoint, credentials: credentials
146
+ @image_versions_stub = ::Google::Cloud::Orchestration::Airflow::Service::V1::ImageVersions::Rest::ServiceStub.new(
147
+ endpoint: @config.endpoint,
148
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
149
+ universe_domain: @config.universe_domain,
150
+ credentials: credentials
151
+ )
134
152
  end
135
153
 
136
154
  # Service calls
@@ -255,9 +273,9 @@ module Google
255
273
  # end
256
274
  #
257
275
  # @!attribute [rw] endpoint
258
- # The hostname or hostname:port of the service endpoint.
259
- # Defaults to `"composer.googleapis.com"`.
260
- # @return [::String]
276
+ # A custom service endpoint, as a hostname or hostname:port. The default is
277
+ # nil, indicating to use the default endpoint in the current universe domain.
278
+ # @return [::String,nil]
261
279
  # @!attribute [rw] credentials
262
280
  # Credentials to send with calls. You may provide any of the following types:
263
281
  # * (`String`) The path to a service account key file in JSON format
@@ -294,13 +312,20 @@ module Google
294
312
  # @!attribute [rw] quota_project
295
313
  # A separate project against which to charge quota.
296
314
  # @return [::String]
315
+ # @!attribute [rw] universe_domain
316
+ # The universe domain within which to make requests. This determines the
317
+ # default endpoint URL. The default value of nil uses the environment
318
+ # universe (usually the default "googleapis.com" universe).
319
+ # @return [::String,nil]
297
320
  #
298
321
  class Configuration
299
322
  extend ::Gapic::Config
300
323
 
324
+ # @private
325
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
301
326
  DEFAULT_ENDPOINT = "composer.googleapis.com"
302
327
 
303
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
328
+ config_attr :endpoint, nil, ::String, nil
304
329
  config_attr :credentials, nil do |value|
305
330
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
306
331
  allowed.any? { |klass| klass === value }
@@ -312,6 +337,7 @@ module Google
312
337
  config_attr :metadata, nil, ::Hash, nil
313
338
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
314
339
  config_attr :quota_project, nil, ::String, nil
340
+ config_attr :universe_domain, nil, ::String, nil
315
341
 
316
342
  # @private
317
343
  def initialize parent_config = nil
@@ -32,16 +32,28 @@ module Google
32
32
  # including transcoding, making the REST call, and deserialing the response.
33
33
  #
34
34
  class ServiceStub
35
- def initialize endpoint:, credentials:
35
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
36
36
  # These require statements are intentionally placed here to initialize
37
37
  # the REST modules only when it's required.
38
38
  require "gapic/rest"
39
39
 
40
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
40
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
41
+ endpoint_template: endpoint_template,
42
+ universe_domain: universe_domain,
43
+ credentials: credentials,
41
44
  numeric_enums: true,
42
45
  raise_faraday_errors: false
43
46
  end
44
47
 
48
+ ##
49
+ # The effective universe domain
50
+ #
51
+ # @return [String]
52
+ #
53
+ def universe_domain
54
+ @client_stub.universe_domain
55
+ end
56
+
45
57
  ##
46
58
  # Baseline implementation for the list_image_versions REST call
47
59
  #
@@ -23,7 +23,7 @@ module Google
23
23
  module Airflow
24
24
  module Service
25
25
  module V1
26
- VERSION = "0.8.0"
26
+ VERSION = "0.9.0"
27
27
  end
28
28
  end
29
29
  end
@@ -21,6 +21,7 @@ module Google
21
21
  module Api
22
22
  # Required information for every language.
23
23
  # @!attribute [rw] reference_docs_uri
24
+ # @deprecated This field is deprecated and may be removed in the next major version update.
24
25
  # @return [::String]
25
26
  # Link to automatically generated reference documentation. Example:
26
27
  # https://cloud.google.com/nodejs/docs/reference/asset/latest
@@ -304,6 +305,19 @@ module Google
304
305
  # seconds: 360 # 6 minutes
305
306
  # total_poll_timeout:
306
307
  # seconds: 54000 # 90 minutes
308
+ # @!attribute [rw] auto_populated_fields
309
+ # @return [::Array<::String>]
310
+ # List of top-level fields of the request message, that should be
311
+ # automatically populated by the client libraries based on their
312
+ # (google.api.field_info).format. Currently supported format: UUID4.
313
+ #
314
+ # Example of a YAML configuration:
315
+ #
316
+ # publishing:
317
+ # method_settings:
318
+ # - selector: google.example.v1.ExampleService.CreateExample
319
+ # auto_populated_fields:
320
+ # - request_id
307
321
  class MethodSettings
308
322
  include ::Google::Protobuf::MessageExts
309
323
  extend ::Google::Protobuf::MessageExts::ClassMethods
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-orchestration-airflow-service-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-12 00:00:00.000000000 Z
11
+ date: 2024-01-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.20.0
19
+ version: 0.21.1
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 2.a
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 0.20.0
29
+ version: 0.21.1
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.a
@@ -231,7 +231,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
231
231
  - !ruby/object:Gem::Version
232
232
  version: '0'
233
233
  requirements: []
234
- rubygems_version: 3.4.19
234
+ rubygems_version: 3.5.3
235
235
  signing_key:
236
236
  specification_version: 4
237
237
  summary: Manages Apache Airflow environments on Google Cloud Platform.