google-cloud-run-v2 0.11.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/AUTHENTICATION.md +72 -99
  3. data/lib/google/cloud/run/v2/condition_pb.rb +1 -1
  4. data/lib/google/cloud/run/v2/execution_pb.rb +2 -1
  5. data/lib/google/cloud/run/v2/execution_services_pb.rb +2 -0
  6. data/lib/google/cloud/run/v2/executions/client.rb +148 -14
  7. data/lib/google/cloud/run/v2/executions/operations.rb +28 -6
  8. data/lib/google/cloud/run/v2/executions/rest/client.rb +143 -13
  9. data/lib/google/cloud/run/v2/executions/rest/operations.rb +33 -8
  10. data/lib/google/cloud/run/v2/executions/rest/service_stub.rb +74 -2
  11. data/lib/google/cloud/run/v2/job_pb.rb +8 -1
  12. data/lib/google/cloud/run/v2/jobs/client.rb +67 -21
  13. data/lib/google/cloud/run/v2/jobs/operations.rb +28 -6
  14. data/lib/google/cloud/run/v2/jobs/rest/client.rb +39 -8
  15. data/lib/google/cloud/run/v2/jobs/rest/operations.rb +33 -8
  16. data/lib/google/cloud/run/v2/jobs/rest/service_stub.rb +14 -2
  17. data/lib/google/cloud/run/v2/k8s.min_pb.rb +3 -1
  18. data/lib/google/cloud/run/v2/revisions/client.rb +33 -8
  19. data/lib/google/cloud/run/v2/revisions/operations.rb +28 -6
  20. data/lib/google/cloud/run/v2/revisions/rest/client.rb +35 -7
  21. data/lib/google/cloud/run/v2/revisions/rest/operations.rb +33 -8
  22. data/lib/google/cloud/run/v2/revisions/rest/service_stub.rb +14 -2
  23. data/lib/google/cloud/run/v2/services/client.rb +33 -8
  24. data/lib/google/cloud/run/v2/services/operations.rb +28 -6
  25. data/lib/google/cloud/run/v2/services/rest/client.rb +35 -7
  26. data/lib/google/cloud/run/v2/services/rest/operations.rb +33 -8
  27. data/lib/google/cloud/run/v2/services/rest/service_stub.rb +14 -2
  28. data/lib/google/cloud/run/v2/task_pb.rb +1 -1
  29. data/lib/google/cloud/run/v2/tasks/client.rb +32 -8
  30. data/lib/google/cloud/run/v2/tasks/rest/client.rb +34 -7
  31. data/lib/google/cloud/run/v2/tasks/rest/service_stub.rb +14 -2
  32. data/lib/google/cloud/run/v2/vendor_settings_pb.rb +3 -1
  33. data/lib/google/cloud/run/v2/version.rb +1 -1
  34. data/proto_docs/google/api/client.rb +14 -0
  35. data/proto_docs/google/cloud/run/v2/condition.rb +3 -0
  36. data/proto_docs/google/cloud/run/v2/execution.rb +26 -6
  37. data/proto_docs/google/cloud/run/v2/job.rb +42 -0
  38. data/proto_docs/google/cloud/run/v2/k8s.min.rb +44 -4
  39. data/proto_docs/google/cloud/run/v2/task.rb +7 -2
  40. data/proto_docs/google/cloud/run/v2/vendor_settings.rb +33 -5
  41. metadata +7 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b3a72140af8bcdf1af15abb18c107a4c25b1ca513dcf18cb5f450896c7491791
4
- data.tar.gz: b1f3f31c471e1057d014bc3d1a2371589eb5f9f123405235397245ad84d9df53
3
+ metadata.gz: e6124228a8f8c0512dca256e87a63f3f545d099380b9a22572a34252f9e2778c
4
+ data.tar.gz: 05b6a01545bb1734ae5b8006cfb1d95b81f048baa090424b31a815ee35445eb8
5
5
  SHA512:
6
- metadata.gz: a43efd3c4f10c1a273e89a1224b2f9330f37706e7f25676a61f599126c7413ce1e7f44d295f0668fea35ae089868b0f15d210a320840c61c7e48a7faf8d2e1a2
7
- data.tar.gz: 41b610e598584a0a03aa2f474e2cadddd415ff38ea93d1bc490ad5cda179fc75113d8a45154dc0bd53f952c81636adbea87bed85ae997b7014629eb4fe4b145b
6
+ metadata.gz: 69499b705eb3403a2697d65d334ad0b160ace933a48e009209e6b65ae1f5c074f6027f4f0abd76df63e397e3b1b2c3ca9cb4dd126ec23625cb31cb70487e9a66
7
+ data.tar.gz: 490968f10189161e22a9a388ded2d4c319674d6d1a631f92e31afa9a6b8b54bdfaf957bb8cade493c2b55be85515b86a0cecb296c529b89ed85eb33674d076d0
data/AUTHENTICATION.md CHANGED
@@ -1,149 +1,122 @@
1
1
  # Authentication
2
2
 
3
- In general, the google-cloud-run-v2 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-run-v2 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/run/v2"
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::Run::V2::Executions::Client.new
18
+ ```sh
19
+ gcloud auth application-default login
31
20
  ```
32
21
 
33
- ## Credential Lookup
34
-
35
- The google-cloud-run-v2 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-run-v2 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-run-v2
66
- checks for credentials are configured on the service Credentials class (such as
67
- {::Google::Cloud::Run::V2::Executions::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/run/v2"
75
-
76
- ENV["GOOGLE_CLOUD_CREDENTIALS"] = "path/to/keyfile.json"
42
+ ### Configuration
77
43
 
78
- client = ::Google::Cloud::Run::V2::Executions::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/run/v2"
88
58
 
89
59
  client = ::Google::Cloud::Run::V2::Executions::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/run/v2"
98
68
 
99
69
  ::Google::Cloud::Run::V2::Executions::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::Run::V2::Executions::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-run-v2
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/run/v2"
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-run-v2.
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::Run::V2::Executions::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).
@@ -7,7 +7,7 @@ require 'google/protobuf'
7
7
  require 'google/protobuf/timestamp_pb'
8
8
 
9
9
 
10
- descriptor_data = "\n#google/cloud/run/v2/condition.proto\x12\x13google.cloud.run.v2\x1a\x1fgoogle/protobuf/timestamp.proto\"\x90\x0c\n\tCondition\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x33\n\x05state\x18\x02 \x01(\x0e\x32$.google.cloud.run.v2.Condition.State\x12\x0f\n\x07message\x18\x03 \x01(\t\x12\x38\n\x14last_transition_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x39\n\x08severity\x18\x05 \x01(\x0e\x32\'.google.cloud.run.v2.Condition.Severity\x12=\n\x06reason\x18\x06 \x01(\x0e\x32+.google.cloud.run.v2.Condition.CommonReasonH\x00\x12H\n\x0frevision_reason\x18\t \x01(\x0e\x32-.google.cloud.run.v2.Condition.RevisionReasonH\x00\x12J\n\x10\x65xecution_reason\x18\x0b \x01(\x0e\x32..google.cloud.run.v2.Condition.ExecutionReasonH\x00\"\x7f\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x15\n\x11\x43ONDITION_PENDING\x10\x01\x12\x19\n\x15\x43ONDITION_RECONCILING\x10\x02\x12\x14\n\x10\x43ONDITION_FAILED\x10\x03\x12\x17\n\x13\x43ONDITION_SUCCEEDED\x10\x04\"F\n\x08Severity\x12\x18\n\x14SEVERITY_UNSPECIFIED\x10\x00\x12\t\n\x05\x45RROR\x10\x01\x12\x0b\n\x07WARNING\x10\x02\x12\x08\n\x04INFO\x10\x03\"\xb2\x03\n\x0c\x43ommonReason\x12\x1b\n\x17\x43OMMON_REASON_UNDEFINED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x13\n\x0fREVISION_FAILED\x10\x03\x12\x1e\n\x1aPROGRESS_DEADLINE_EXCEEDED\x10\x04\x12\x15\n\x11\x43ONTAINER_MISSING\x10\x06\x12\x1f\n\x1b\x43ONTAINER_PERMISSION_DENIED\x10\x07\x12 \n\x1c\x43ONTAINER_IMAGE_UNAUTHORIZED\x10\x08\x12.\n*CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED\x10\t\x12$\n ENCRYPTION_KEY_PERMISSION_DENIED\x10\n\x12\x1f\n\x1b\x45NCRYPTION_KEY_CHECK_FAILED\x10\x0b\x12\x1f\n\x1bSECRETS_ACCESS_CHECK_FAILED\x10\x0c\x12\x19\n\x15WAITING_FOR_OPERATION\x10\r\x12\x13\n\x0fIMMEDIATE_RETRY\x10\x0e\x12\x13\n\x0fPOSTPONED_RETRY\x10\x0f\x12\x0c\n\x08INTERNAL\x10\x10\"\xca\x02\n\x0eRevisionReason\x12\x1d\n\x19REVISION_REASON_UNDEFINED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0b\n\x07RESERVE\x10\x02\x12\x0b\n\x07RETIRED\x10\x03\x12\x0c\n\x08RETIRING\x10\x04\x12\x0e\n\nRECREATING\x10\x05\x12 \n\x1cHEALTH_CHECK_CONTAINER_ERROR\x10\x06\x12$\n CUSTOMIZED_PATH_RESPONSE_PENDING\x10\x07\x12!\n\x1dMIN_INSTANCES_NOT_PROVISIONED\x10\x08\x12!\n\x1d\x41\x43TIVE_REVISION_LIMIT_REACHED\x10\t\x12\x11\n\rNO_DEPLOYMENT\x10\n\x12\x18\n\x14HEALTH_CHECK_SKIPPED\x10\x0b\x12\x19\n\x15MIN_INSTANCES_WARMING\x10\x0c\"\x8e\x01\n\x0f\x45xecutionReason\x12\x1e\n\x1a\x45XECUTION_REASON_UNDEFINED\x10\x00\x12$\n JOB_STATUS_SERVICE_POLLING_ERROR\x10\x01\x12\x16\n\x12NON_ZERO_EXIT_CODE\x10\x02\x12\r\n\tCANCELLED\x10\x03\x12\x0e\n\nCANCELLING\x10\x04\x42\t\n\x07reasonsBV\n\x17\x63om.google.cloud.run.v2B\x0e\x43onditionProtoP\x01Z)cloud.google.com/go/run/apiv2/runpb;runpbb\x06proto3"
10
+ descriptor_data = "\n#google/cloud/run/v2/condition.proto\x12\x13google.cloud.run.v2\x1a\x1fgoogle/protobuf/timestamp.proto\"\x9d\x0c\n\tCondition\x12\x0c\n\x04type\x18\x01 \x01(\t\x12\x33\n\x05state\x18\x02 \x01(\x0e\x32$.google.cloud.run.v2.Condition.State\x12\x0f\n\x07message\x18\x03 \x01(\t\x12\x38\n\x14last_transition_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x39\n\x08severity\x18\x05 \x01(\x0e\x32\'.google.cloud.run.v2.Condition.Severity\x12=\n\x06reason\x18\x06 \x01(\x0e\x32+.google.cloud.run.v2.Condition.CommonReasonH\x00\x12H\n\x0frevision_reason\x18\t \x01(\x0e\x32-.google.cloud.run.v2.Condition.RevisionReasonH\x00\x12J\n\x10\x65xecution_reason\x18\x0b \x01(\x0e\x32..google.cloud.run.v2.Condition.ExecutionReasonH\x00\"\x7f\n\x05State\x12\x15\n\x11STATE_UNSPECIFIED\x10\x00\x12\x15\n\x11\x43ONDITION_PENDING\x10\x01\x12\x19\n\x15\x43ONDITION_RECONCILING\x10\x02\x12\x14\n\x10\x43ONDITION_FAILED\x10\x03\x12\x17\n\x13\x43ONDITION_SUCCEEDED\x10\x04\"F\n\x08Severity\x12\x18\n\x14SEVERITY_UNSPECIFIED\x10\x00\x12\t\n\x05\x45RROR\x10\x01\x12\x0b\n\x07WARNING\x10\x02\x12\x08\n\x04INFO\x10\x03\"\xb2\x03\n\x0c\x43ommonReason\x12\x1b\n\x17\x43OMMON_REASON_UNDEFINED\x10\x00\x12\x0b\n\x07UNKNOWN\x10\x01\x12\x13\n\x0fREVISION_FAILED\x10\x03\x12\x1e\n\x1aPROGRESS_DEADLINE_EXCEEDED\x10\x04\x12\x15\n\x11\x43ONTAINER_MISSING\x10\x06\x12\x1f\n\x1b\x43ONTAINER_PERMISSION_DENIED\x10\x07\x12 \n\x1c\x43ONTAINER_IMAGE_UNAUTHORIZED\x10\x08\x12.\n*CONTAINER_IMAGE_AUTHORIZATION_CHECK_FAILED\x10\t\x12$\n ENCRYPTION_KEY_PERMISSION_DENIED\x10\n\x12\x1f\n\x1b\x45NCRYPTION_KEY_CHECK_FAILED\x10\x0b\x12\x1f\n\x1bSECRETS_ACCESS_CHECK_FAILED\x10\x0c\x12\x19\n\x15WAITING_FOR_OPERATION\x10\r\x12\x13\n\x0fIMMEDIATE_RETRY\x10\x0e\x12\x13\n\x0fPOSTPONED_RETRY\x10\x0f\x12\x0c\n\x08INTERNAL\x10\x10\"\xca\x02\n\x0eRevisionReason\x12\x1d\n\x19REVISION_REASON_UNDEFINED\x10\x00\x12\x0b\n\x07PENDING\x10\x01\x12\x0b\n\x07RESERVE\x10\x02\x12\x0b\n\x07RETIRED\x10\x03\x12\x0c\n\x08RETIRING\x10\x04\x12\x0e\n\nRECREATING\x10\x05\x12 \n\x1cHEALTH_CHECK_CONTAINER_ERROR\x10\x06\x12$\n CUSTOMIZED_PATH_RESPONSE_PENDING\x10\x07\x12!\n\x1dMIN_INSTANCES_NOT_PROVISIONED\x10\x08\x12!\n\x1d\x41\x43TIVE_REVISION_LIMIT_REACHED\x10\t\x12\x11\n\rNO_DEPLOYMENT\x10\n\x12\x18\n\x14HEALTH_CHECK_SKIPPED\x10\x0b\x12\x19\n\x15MIN_INSTANCES_WARMING\x10\x0c\"\x9b\x01\n\x0f\x45xecutionReason\x12\x1e\n\x1a\x45XECUTION_REASON_UNDEFINED\x10\x00\x12$\n JOB_STATUS_SERVICE_POLLING_ERROR\x10\x01\x12\x16\n\x12NON_ZERO_EXIT_CODE\x10\x02\x12\r\n\tCANCELLED\x10\x03\x12\x0e\n\nCANCELLING\x10\x04\x12\x0b\n\x07\x44\x45LETED\x10\x05\x42\t\n\x07reasonsBV\n\x17\x63om.google.cloud.run.v2B\x0e\x43onditionProtoP\x01Z)cloud.google.com/go/run/apiv2/runpb;runpbb\x06proto3"
11
11
 
12
12
  pool = Google::Protobuf::DescriptorPool.generated_pool
13
13
 
@@ -15,7 +15,7 @@ require 'google/longrunning/operations_pb'
15
15
  require 'google/protobuf/timestamp_pb'
16
16
 
17
17
 
18
- descriptor_data = "\n#google/cloud/run/v2/execution.proto\x12\x13google.cloud.run.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1dgoogle/api/launch_stage.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/run/v2/condition.proto\x1a\'google/cloud/run/v2/task_template.proto\x1a#google/longrunning/operations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"I\n\x13GetExecutionRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1crun.googleapis.com/Execution\"\x8a\x01\n\x15ListExecutionsRequest\x12\x34\n\x06parent\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\x12\x1crun.googleapis.com/Execution\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x14\n\x0cshow_deleted\x18\x04 \x01(\x08\"e\n\x16ListExecutionsResponse\x12\x32\n\nexecutions\x18\x01 \x03(\x0b\x32\x1e.google.cloud.run.v2.Execution\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"q\n\x16\x44\x65leteExecutionRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1crun.googleapis.com/Execution\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x03 \x01(\t\"\x82\n\n\tExecution\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\ngeneration\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\x12?\n\x06labels\x18\x04 \x03(\x0b\x32*.google.cloud.run.v2.Execution.LabelsEntryB\x03\xe0\x41\x03\x12I\n\x0b\x61nnotations\x18\x05 \x03(\x0b\x32/.google.cloud.run.v2.Execution.AnnotationsEntryB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x33\n\nstart_time\x18\x16 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x38\n\x0f\x63ompletion_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12-\n\x0claunch_stage\x18\x0b \x01(\x0e\x32\x17.google.api.LaunchStage\x12+\n\x03job\x18\x0c \x01(\tB\x1e\xe0\x41\x03\xfa\x41\x18\n\x16run.googleapis.com/Job\x12\x18\n\x0bparallelism\x18\r \x01(\x05\x42\x03\xe0\x41\x03\x12\x17\n\ntask_count\x18\x0e \x01(\x05\x42\x03\xe0\x41\x03\x12\x38\n\x08template\x18\x0f \x01(\x0b\x32!.google.cloud.run.v2.TaskTemplateB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\x10 \x01(\x08\x42\x03\xe0\x41\x03\x12\x37\n\nconditions\x18\x11 \x03(\x0b\x32\x1e.google.cloud.run.v2.ConditionB\x03\xe0\x41\x03\x12 \n\x13observed_generation\x18\x12 \x01(\x03\x42\x03\xe0\x41\x03\x12\x1a\n\rrunning_count\x18\x13 \x01(\x05\x42\x03\xe0\x41\x03\x12\x1c\n\x0fsucceeded_count\x18\x14 \x01(\x05\x42\x03\xe0\x41\x03\x12\x19\n\x0c\x66\x61iled_count\x18\x15 \x01(\x05\x42\x03\xe0\x41\x03\x12\x1c\n\x0f\x63\x61ncelled_count\x18\x18 \x01(\x05\x42\x03\xe0\x41\x03\x12\x1a\n\rretried_count\x18\x19 \x01(\x05\x42\x03\xe0\x41\x03\x12\x14\n\x07log_uri\x18\x1a \x01(\tB\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzs\x18\x1b \x01(\x08\x42\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\x63 \x01(\tB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:o\xea\x41l\n\x1crun.googleapis.com/Execution\x12Iprojects/{project}/locations/{location}/jobs/{job}/executions/{execution}R\x01\x01\x32\xe8\x04\n\nExecutions\x12\x9e\x01\n\x0cGetExecution\x12(.google.cloud.run.v2.GetExecutionRequest\x1a\x1e.google.cloud.run.v2.Execution\"D\x82\xd3\xe4\x93\x02\x37\x12\x35/v2/{name=projects/*/locations/*/jobs/*/executions/*}\xda\x41\x04name\x12\xb1\x01\n\x0eListExecutions\x12*.google.cloud.run.v2.ListExecutionsRequest\x1a+.google.cloud.run.v2.ListExecutionsResponse\"F\x82\xd3\xe4\x93\x02\x37\x12\x35/v2/{parent=projects/*/locations/*/jobs/*}/executions\xda\x41\x06parent\x12\xbc\x01\n\x0f\x44\x65leteExecution\x12+.google.cloud.run.v2.DeleteExecutionRequest\x1a\x1d.google.longrunning.Operation\"]\x82\xd3\xe4\x93\x02\x37*5/v2/{name=projects/*/locations/*/jobs/*/executions/*}\xda\x41\x04name\xca\x41\x16\n\tExecution\x12\tExecution\x1a\x46\xca\x41\x12run.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBV\n\x17\x63om.google.cloud.run.v2B\x0e\x45xecutionProtoP\x01Z)cloud.google.com/go/run/apiv2/runpb;runpbb\x06proto3"
18
+ descriptor_data = "\n#google/cloud/run/v2/execution.proto\x12\x13google.cloud.run.v2\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x1dgoogle/api/launch_stage.proto\x1a\x19google/api/resource.proto\x1a#google/cloud/run/v2/condition.proto\x1a\'google/cloud/run/v2/task_template.proto\x1a#google/longrunning/operations.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"I\n\x13GetExecutionRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1crun.googleapis.com/Execution\"\x8a\x01\n\x15ListExecutionsRequest\x12\x34\n\x06parent\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\x12\x1crun.googleapis.com/Execution\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t\x12\x14\n\x0cshow_deleted\x18\x04 \x01(\x08\"e\n\x16ListExecutionsResponse\x12\x32\n\nexecutions\x18\x01 \x03(\x0b\x32\x1e.google.cloud.run.v2.Execution\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t\"q\n\x16\x44\x65leteExecutionRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1crun.googleapis.com/Execution\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x03 \x01(\t\"q\n\x16\x43\x61ncelExecutionRequest\x12\x32\n\x04name\x18\x01 \x01(\tB$\xe0\x41\x02\xfa\x41\x1e\n\x1crun.googleapis.com/Execution\x12\x15\n\rvalidate_only\x18\x02 \x01(\x08\x12\x0c\n\x04\x65tag\x18\x03 \x01(\t\"\x82\n\n\tExecution\x12\x11\n\x04name\x18\x01 \x01(\tB\x03\xe0\x41\x03\x12\x10\n\x03uid\x18\x02 \x01(\tB\x03\xe0\x41\x03\x12\x17\n\ngeneration\x18\x03 \x01(\x03\x42\x03\xe0\x41\x03\x12?\n\x06labels\x18\x04 \x03(\x0b\x32*.google.cloud.run.v2.Execution.LabelsEntryB\x03\xe0\x41\x03\x12I\n\x0b\x61nnotations\x18\x05 \x03(\x0b\x32/.google.cloud.run.v2.Execution.AnnotationsEntryB\x03\xe0\x41\x03\x12\x34\n\x0b\x63reate_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x33\n\nstart_time\x18\x16 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x38\n\x0f\x63ompletion_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0bupdate_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x64\x65lete_time\x18\t \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12\x34\n\x0b\x65xpire_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x03\xe0\x41\x03\x12-\n\x0claunch_stage\x18\x0b \x01(\x0e\x32\x17.google.api.LaunchStage\x12+\n\x03job\x18\x0c \x01(\tB\x1e\xe0\x41\x03\xfa\x41\x18\n\x16run.googleapis.com/Job\x12\x18\n\x0bparallelism\x18\r \x01(\x05\x42\x03\xe0\x41\x03\x12\x17\n\ntask_count\x18\x0e \x01(\x05\x42\x03\xe0\x41\x03\x12\x38\n\x08template\x18\x0f \x01(\x0b\x32!.google.cloud.run.v2.TaskTemplateB\x03\xe0\x41\x03\x12\x18\n\x0breconciling\x18\x10 \x01(\x08\x42\x03\xe0\x41\x03\x12\x37\n\nconditions\x18\x11 \x03(\x0b\x32\x1e.google.cloud.run.v2.ConditionB\x03\xe0\x41\x03\x12 \n\x13observed_generation\x18\x12 \x01(\x03\x42\x03\xe0\x41\x03\x12\x1a\n\rrunning_count\x18\x13 \x01(\x05\x42\x03\xe0\x41\x03\x12\x1c\n\x0fsucceeded_count\x18\x14 \x01(\x05\x42\x03\xe0\x41\x03\x12\x19\n\x0c\x66\x61iled_count\x18\x15 \x01(\x05\x42\x03\xe0\x41\x03\x12\x1c\n\x0f\x63\x61ncelled_count\x18\x18 \x01(\x05\x42\x03\xe0\x41\x03\x12\x1a\n\rretried_count\x18\x19 \x01(\x05\x42\x03\xe0\x41\x03\x12\x14\n\x07log_uri\x18\x1a \x01(\tB\x03\xe0\x41\x03\x12\x1a\n\rsatisfies_pzs\x18\x1b \x01(\x08\x42\x03\xe0\x41\x03\x12\x11\n\x04\x65tag\x18\x63 \x01(\tB\x03\xe0\x41\x03\x1a-\n\x0bLabelsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01\x1a\x32\n\x10\x41nnotationsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:o\xea\x41l\n\x1crun.googleapis.com/Execution\x12Iprojects/{project}/locations/{location}/jobs/{job}/executions/{execution}R\x01\x01\x32\xb1\x06\n\nExecutions\x12\x9e\x01\n\x0cGetExecution\x12(.google.cloud.run.v2.GetExecutionRequest\x1a\x1e.google.cloud.run.v2.Execution\"D\x82\xd3\xe4\x93\x02\x37\x12\x35/v2/{name=projects/*/locations/*/jobs/*/executions/*}\xda\x41\x04name\x12\xb1\x01\n\x0eListExecutions\x12*.google.cloud.run.v2.ListExecutionsRequest\x1a+.google.cloud.run.v2.ListExecutionsResponse\"F\x82\xd3\xe4\x93\x02\x37\x12\x35/v2/{parent=projects/*/locations/*/jobs/*}/executions\xda\x41\x06parent\x12\xbc\x01\n\x0f\x44\x65leteExecution\x12+.google.cloud.run.v2.DeleteExecutionRequest\x1a\x1d.google.longrunning.Operation\"]\x82\xd3\xe4\x93\x02\x37*5/v2/{name=projects/*/locations/*/jobs/*/executions/*}\xda\x41\x04name\xca\x41\x16\n\tExecution\x12\tExecution\x12\xc6\x01\n\x0f\x43\x61ncelExecution\x12+.google.cloud.run.v2.CancelExecutionRequest\x1a\x1d.google.longrunning.Operation\"g\x82\xd3\xe4\x93\x02\x41\"</v2/{name=projects/*/locations/*/jobs/*/executions/*}:cancel:\x01*\xda\x41\x04name\xca\x41\x16\n\tExecution\x12\tExecution\x1a\x46\xca\x41\x12run.googleapis.com\xd2\x41.https://www.googleapis.com/auth/cloud-platformBV\n\x17\x63om.google.cloud.run.v2B\x0e\x45xecutionProtoP\x01Z)cloud.google.com/go/run/apiv2/runpb;runpbb\x06proto3"
19
19
 
20
20
  pool = Google::Protobuf::DescriptorPool.generated_pool
21
21
 
@@ -52,6 +52,7 @@ module Google
52
52
  ListExecutionsRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.ListExecutionsRequest").msgclass
53
53
  ListExecutionsResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.ListExecutionsResponse").msgclass
54
54
  DeleteExecutionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.DeleteExecutionRequest").msgclass
55
+ CancelExecutionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.CancelExecutionRequest").msgclass
55
56
  Execution = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.cloud.run.v2.Execution").msgclass
56
57
  end
57
58
  end
@@ -39,6 +39,8 @@ module Google
39
39
  rpc :ListExecutions, ::Google::Cloud::Run::V2::ListExecutionsRequest, ::Google::Cloud::Run::V2::ListExecutionsResponse
40
40
  # Deletes an Execution.
41
41
  rpc :DeleteExecution, ::Google::Cloud::Run::V2::DeleteExecutionRequest, ::Google::Longrunning::Operation
42
+ # Cancels an Execution.
43
+ rpc :CancelExecution, ::Google::Cloud::Run::V2::CancelExecutionRequest, ::Google::Longrunning::Operation
42
44
  end
43
45
 
44
46
  Stub = Service.rpc_stub_class
@@ -31,6 +31,9 @@ module Google
31
31
  # Cloud Run Execution Control Plane API.
32
32
  #
33
33
  class Client
34
+ # @private
35
+ DEFAULT_ENDPOINT_TEMPLATE = "run.$UNIVERSE_DOMAIN$"
36
+
34
37
  include Paths
35
38
 
36
39
  # @private
@@ -91,6 +94,15 @@ module Google
91
94
  @config
92
95
  end
93
96
 
97
+ ##
98
+ # The effective universe domain
99
+ #
100
+ # @return [String]
101
+ #
102
+ def universe_domain
103
+ @executions_stub.universe_domain
104
+ end
105
+
94
106
  ##
95
107
  # Create a new Executions client object.
96
108
  #
@@ -124,8 +136,9 @@ module Google
124
136
  credentials = @config.credentials
125
137
  # Use self-signed JWT if the endpoint is unchanged from default,
126
138
  # but only if the default endpoint does not have a region prefix.
127
- enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
128
- !@config.endpoint.split(".").first.include?("-")
139
+ enable_self_signed_jwt = @config.endpoint.nil? ||
140
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
141
+ !@config.endpoint.split(".").first.include?("-"))
129
142
  credentials ||= Credentials.default scope: @config.scope,
130
143
  enable_self_signed_jwt: enable_self_signed_jwt
131
144
  if credentials.is_a?(::String) || credentials.is_a?(::Hash)
@@ -138,18 +151,22 @@ module Google
138
151
  config.credentials = credentials
139
152
  config.quota_project = @quota_project_id
140
153
  config.endpoint = @config.endpoint
154
+ config.universe_domain = @config.universe_domain
141
155
  end
142
156
 
143
157
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
144
158
  config.credentials = credentials
145
159
  config.quota_project = @quota_project_id
146
160
  config.endpoint = @config.endpoint
161
+ config.universe_domain = @config.universe_domain
147
162
  end
148
163
 
149
164
  @executions_stub = ::Gapic::ServiceStub.new(
150
165
  ::Google::Cloud::Run::V2::Executions::Stub,
151
- credentials: credentials,
152
- endpoint: @config.endpoint,
166
+ credentials: credentials,
167
+ endpoint: @config.endpoint,
168
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
169
+ universe_domain: @config.universe_domain,
153
170
  channel_args: @config.channel_args,
154
171
  interceptors: @config.interceptors,
155
172
  channel_pool_config: @config.channel_pool
@@ -193,8 +210,8 @@ module Google
193
210
  # @param name [::String]
194
211
  # Required. The full name of the Execution.
195
212
  # Format:
196
- # projects/\\{project}/locations/\\{location}/jobs/\\{job}/executions/\\{execution},
197
- # where \\{project} can be project id or number.
213
+ # `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`,
214
+ # where `{project}` can be project id or number.
198
215
  #
199
216
  # @yield [response, operation] Access the result along with the RPC operation
200
217
  # @yieldparam response [::Google::Cloud::Run::V2::Execution]
@@ -281,8 +298,8 @@ module Google
281
298
  # @param parent [::String]
282
299
  # Required. The Execution from which the Executions should be listed.
283
300
  # To list all Executions across Jobs, use "-" instead of Job name.
284
- # Format: projects/\\{project}/locations/\\{location}/jobs/\\{job}, where \\{project}
285
- # can be project id or number.
301
+ # Format: `projects/{project}/locations/{location}/jobs/{job}`, where
302
+ # `{project}` can be project id or number.
286
303
  # @param page_size [::Integer]
287
304
  # Maximum number of Executions to return in this call.
288
305
  # @param page_token [::String]
@@ -381,8 +398,8 @@ module Google
381
398
  # @param name [::String]
382
399
  # Required. The name of the Execution to delete.
383
400
  # Format:
384
- # projects/\\{project}/locations/\\{location}/jobs/\\{job}/executions/\\{execution},
385
- # where \\{project} can be project id or number.
401
+ # `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`,
402
+ # where `{project}` can be project id or number.
386
403
  # @param validate_only [::Boolean]
387
404
  # Indicates that the request should be validated without actually
388
405
  # deleting any resources.
@@ -462,6 +479,108 @@ module Google
462
479
  raise ::Google::Cloud::Error.from_error(e)
463
480
  end
464
481
 
482
+ ##
483
+ # Cancels an Execution.
484
+ #
485
+ # @overload cancel_execution(request, options = nil)
486
+ # Pass arguments to `cancel_execution` via a request object, either of type
487
+ # {::Google::Cloud::Run::V2::CancelExecutionRequest} or an equivalent Hash.
488
+ #
489
+ # @param request [::Google::Cloud::Run::V2::CancelExecutionRequest, ::Hash]
490
+ # A request object representing the call parameters. Required. To specify no
491
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
492
+ # @param options [::Gapic::CallOptions, ::Hash]
493
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
494
+ #
495
+ # @overload cancel_execution(name: nil, validate_only: nil, etag: nil)
496
+ # Pass arguments to `cancel_execution` via keyword arguments. Note that at
497
+ # least one keyword argument is required. To specify no parameters, or to keep all
498
+ # the default parameter values, pass an empty Hash as a request object (see above).
499
+ #
500
+ # @param name [::String]
501
+ # Required. The name of the Execution to cancel.
502
+ # Format:
503
+ # `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`,
504
+ # where `{project}` can be project id or number.
505
+ # @param validate_only [::Boolean]
506
+ # Indicates that the request should be validated without actually
507
+ # cancelling any resources.
508
+ # @param etag [::String]
509
+ # A system-generated fingerprint for this version of the resource.
510
+ # This may be used to detect modification conflict during updates.
511
+ #
512
+ # @yield [response, operation] Access the result along with the RPC operation
513
+ # @yieldparam response [::Gapic::Operation]
514
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
515
+ #
516
+ # @return [::Gapic::Operation]
517
+ #
518
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
519
+ #
520
+ # @example Basic example
521
+ # require "google/cloud/run/v2"
522
+ #
523
+ # # Create a client object. The client can be reused for multiple calls.
524
+ # client = Google::Cloud::Run::V2::Executions::Client.new
525
+ #
526
+ # # Create a request. To set request fields, pass in keyword arguments.
527
+ # request = Google::Cloud::Run::V2::CancelExecutionRequest.new
528
+ #
529
+ # # Call the cancel_execution method.
530
+ # result = client.cancel_execution request
531
+ #
532
+ # # The returned object is of type Gapic::Operation. You can use it to
533
+ # # check the status of an operation, cancel it, or wait for results.
534
+ # # Here is how to wait for a response.
535
+ # result.wait_until_done! timeout: 60
536
+ # if result.response?
537
+ # p result.response
538
+ # else
539
+ # puts "No response received."
540
+ # end
541
+ #
542
+ def cancel_execution request, options = nil
543
+ raise ::ArgumentError, "request must be provided" if request.nil?
544
+
545
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Run::V2::CancelExecutionRequest
546
+
547
+ # Converts hash and nil to an options object
548
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
549
+
550
+ # Customize the options with defaults
551
+ metadata = @config.rpcs.cancel_execution.metadata.to_h
552
+
553
+ # Set x-goog-api-client and x-goog-user-project headers
554
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
555
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
556
+ gapic_version: ::Google::Cloud::Run::V2::VERSION
557
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
558
+
559
+ header_params = {}
560
+ if request.name
561
+ header_params["name"] = request.name
562
+ end
563
+
564
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
565
+ metadata[:"x-goog-request-params"] ||= request_params_header
566
+
567
+ options.apply_defaults timeout: @config.rpcs.cancel_execution.timeout,
568
+ metadata: metadata,
569
+ retry_policy: @config.rpcs.cancel_execution.retry_policy
570
+
571
+ options.apply_defaults timeout: @config.timeout,
572
+ metadata: @config.metadata,
573
+ retry_policy: @config.retry_policy
574
+
575
+ @executions_stub.call_rpc :cancel_execution, request, options: options do |response, operation|
576
+ response = ::Gapic::Operation.new response, @operations_client, options: options
577
+ yield response, operation if block_given?
578
+ return response
579
+ end
580
+ rescue ::GRPC::BadStatus => e
581
+ raise ::Google::Cloud::Error.from_error(e)
582
+ end
583
+
465
584
  ##
466
585
  # Configuration class for the Executions API.
467
586
  #
@@ -492,9 +611,9 @@ module Google
492
611
  # end
493
612
  #
494
613
  # @!attribute [rw] endpoint
495
- # The hostname or hostname:port of the service endpoint.
496
- # Defaults to `"run.googleapis.com"`.
497
- # @return [::String]
614
+ # A custom service endpoint, as a hostname or hostname:port. The default is
615
+ # nil, indicating to use the default endpoint in the current universe domain.
616
+ # @return [::String,nil]
498
617
  # @!attribute [rw] credentials
499
618
  # Credentials to send with calls. You may provide any of the following types:
500
619
  # * (`String`) The path to a service account key file in JSON format
@@ -540,13 +659,20 @@ module Google
540
659
  # @!attribute [rw] quota_project
541
660
  # A separate project against which to charge quota.
542
661
  # @return [::String]
662
+ # @!attribute [rw] universe_domain
663
+ # The universe domain within which to make requests. This determines the
664
+ # default endpoint URL. The default value of nil uses the environment
665
+ # universe (usually the default "googleapis.com" universe).
666
+ # @return [::String,nil]
543
667
  #
544
668
  class Configuration
545
669
  extend ::Gapic::Config
546
670
 
671
+ # @private
672
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
547
673
  DEFAULT_ENDPOINT = "run.googleapis.com"
548
674
 
549
- config_attr :endpoint, DEFAULT_ENDPOINT, ::String
675
+ config_attr :endpoint, nil, ::String, nil
550
676
  config_attr :credentials, nil do |value|
551
677
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
552
678
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -561,6 +687,7 @@ module Google
561
687
  config_attr :metadata, nil, ::Hash, nil
562
688
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
563
689
  config_attr :quota_project, nil, ::String, nil
690
+ config_attr :universe_domain, nil, ::String, nil
564
691
 
565
692
  # @private
566
693
  def initialize parent_config = nil
@@ -622,6 +749,11 @@ module Google
622
749
  # @return [::Gapic::Config::Method]
623
750
  #
624
751
  attr_reader :delete_execution
752
+ ##
753
+ # RPC-specific configuration for `cancel_execution`
754
+ # @return [::Gapic::Config::Method]
755
+ #
756
+ attr_reader :cancel_execution
625
757
 
626
758
  # @private
627
759
  def initialize parent_rpcs = nil
@@ -631,6 +763,8 @@ module Google
631
763
  @list_executions = ::Gapic::Config::Method.new list_executions_config
632
764
  delete_execution_config = parent_rpcs.delete_execution if parent_rpcs.respond_to? :delete_execution
633
765
  @delete_execution = ::Gapic::Config::Method.new delete_execution_config
766
+ cancel_execution_config = parent_rpcs.cancel_execution if parent_rpcs.respond_to? :cancel_execution
767
+ @cancel_execution = ::Gapic::Config::Method.new cancel_execution_config
634
768
 
635
769
  yield self if block_given?
636
770
  end