Skip to content

Commit cfe9a27

Browse files
feat: [deploy] added support for deploy policies (#5549)
* feat: added support for deploy policies feat: added support for configuring a proxy_url to a Kubernetes server docs: small corrections to Cloud Deploy API documentation PiperOrigin-RevId: 652560914 Source-Link: googleapis/googleapis@b0c32da Source-Link: googleapis/googleapis-gen@d8a10c3 Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRlcGxveS8uT3dsQm90LnlhbWwiLCJoIjoiZDhhMTBjMzhlZDRjNDYyMDQwNDRiN2IwMWIzYmFhZWU3Njk3NWY2MyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md --------- Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 9bd3923 commit cfe9a27

25 files changed

Lines changed: 14878 additions & 3271 deletions

packages/google-cloud-deploy/README.md

Lines changed: 5 additions & 0 deletions
Large diffs are not rendered by default.

packages/google-cloud-deploy/protos/google/cloud/deploy/v1/cloud_deploy.proto

Lines changed: 563 additions & 5 deletions
Large diffs are not rendered by default.

packages/google-cloud-deploy/protos/protos.d.ts

Lines changed: 2564 additions & 542 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/google-cloud-deploy/protos/protos.js

Lines changed: 7317 additions & 1905 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/google-cloud-deploy/protos/protos.json

Lines changed: 673 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/google-cloud-deploy/samples/README.md

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,21 @@
2020
* [Cloud_deploy.create_automation](#cloud_deploy.create_automation)
2121
* [Cloud_deploy.create_custom_target_type](#cloud_deploy.create_custom_target_type)
2222
* [Cloud_deploy.create_delivery_pipeline](#cloud_deploy.create_delivery_pipeline)
23+
* [Cloud_deploy.create_deploy_policy](#cloud_deploy.create_deploy_policy)
2324
* [Cloud_deploy.create_release](#cloud_deploy.create_release)
2425
* [Cloud_deploy.create_rollout](#cloud_deploy.create_rollout)
2526
* [Cloud_deploy.create_target](#cloud_deploy.create_target)
2627
* [Cloud_deploy.delete_automation](#cloud_deploy.delete_automation)
2728
* [Cloud_deploy.delete_custom_target_type](#cloud_deploy.delete_custom_target_type)
2829
* [Cloud_deploy.delete_delivery_pipeline](#cloud_deploy.delete_delivery_pipeline)
30+
* [Cloud_deploy.delete_deploy_policy](#cloud_deploy.delete_deploy_policy)
2931
* [Cloud_deploy.delete_target](#cloud_deploy.delete_target)
3032
* [Cloud_deploy.get_automation](#cloud_deploy.get_automation)
3133
* [Cloud_deploy.get_automation_run](#cloud_deploy.get_automation_run)
3234
* [Cloud_deploy.get_config](#cloud_deploy.get_config)
3335
* [Cloud_deploy.get_custom_target_type](#cloud_deploy.get_custom_target_type)
3436
* [Cloud_deploy.get_delivery_pipeline](#cloud_deploy.get_delivery_pipeline)
37+
* [Cloud_deploy.get_deploy_policy](#cloud_deploy.get_deploy_policy)
3538
* [Cloud_deploy.get_job_run](#cloud_deploy.get_job_run)
3639
* [Cloud_deploy.get_release](#cloud_deploy.get_release)
3740
* [Cloud_deploy.get_rollout](#cloud_deploy.get_rollout)
@@ -41,6 +44,7 @@
4144
* [Cloud_deploy.list_automations](#cloud_deploy.list_automations)
4245
* [Cloud_deploy.list_custom_target_types](#cloud_deploy.list_custom_target_types)
4346
* [Cloud_deploy.list_delivery_pipelines](#cloud_deploy.list_delivery_pipelines)
47+
* [Cloud_deploy.list_deploy_policies](#cloud_deploy.list_deploy_policies)
4448
* [Cloud_deploy.list_job_runs](#cloud_deploy.list_job_runs)
4549
* [Cloud_deploy.list_releases](#cloud_deploy.list_releases)
4650
* [Cloud_deploy.list_rollouts](#cloud_deploy.list_rollouts)
@@ -51,6 +55,7 @@
5155
* [Cloud_deploy.update_automation](#cloud_deploy.update_automation)
5256
* [Cloud_deploy.update_custom_target_type](#cloud_deploy.update_custom_target_type)
5357
* [Cloud_deploy.update_delivery_pipeline](#cloud_deploy.update_delivery_pipeline)
58+
* [Cloud_deploy.update_deploy_policy](#cloud_deploy.update_deploy_policy)
5459
* [Cloud_deploy.update_target](#cloud_deploy.update_target)
5560
* [Quickstart](#quickstart)
5661

@@ -205,6 +210,23 @@ __Usage:__
205210

206211

207212

213+
### Cloud_deploy.create_deploy_policy
214+
215+
View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_deploy_policy.js).
216+
217+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_deploy_policy.js,samples/README.md)
218+
219+
__Usage:__
220+
221+
222+
`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_deploy_policy.js`
223+
224+
225+
-----
226+
227+
228+
229+
208230
### Cloud_deploy.create_release
209231

210232
View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_release.js).
@@ -307,6 +329,23 @@ __Usage:__
307329

308330

309331

332+
### Cloud_deploy.delete_deploy_policy
333+
334+
View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_deploy_policy.js).
335+
336+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_deploy_policy.js,samples/README.md)
337+
338+
__Usage:__
339+
340+
341+
`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_deploy_policy.js`
342+
343+
344+
-----
345+
346+
347+
348+
310349
### Cloud_deploy.delete_target
311350

312351
View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_target.js).
@@ -409,6 +448,23 @@ __Usage:__
409448

410449

411450

451+
### Cloud_deploy.get_deploy_policy
452+
453+
View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_deploy_policy.js).
454+
455+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_deploy_policy.js,samples/README.md)
456+
457+
__Usage:__
458+
459+
460+
`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_deploy_policy.js`
461+
462+
463+
-----
464+
465+
466+
467+
412468
### Cloud_deploy.get_job_run
413469

414470
View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_job_run.js).
@@ -562,6 +618,23 @@ __Usage:__
562618

563619

564620

621+
### Cloud_deploy.list_deploy_policies
622+
623+
View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_deploy_policies.js).
624+
625+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_deploy_policies.js,samples/README.md)
626+
627+
__Usage:__
628+
629+
630+
`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_deploy_policies.js`
631+
632+
633+
-----
634+
635+
636+
637+
565638
### Cloud_deploy.list_job_runs
566639

567640
View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_job_runs.js).
@@ -732,6 +805,23 @@ __Usage:__
732805

733806

734807

808+
### Cloud_deploy.update_deploy_policy
809+
810+
View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_deploy_policy.js).
811+
812+
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_deploy_policy.js,samples/README.md)
813+
814+
__Usage:__
815+
816+
817+
`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_deploy_policy.js`
818+
819+
820+
-----
821+
822+
823+
824+
735825
### Cloud_deploy.update_target
736826

737827
View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_target.js).

packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.advance_rollout.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ function main(name, phaseId) {
3737
* Required. The phase ID to advance the `Rollout` to.
3838
*/
3939
// const phaseId = 'abc123'
40+
/**
41+
* Optional. Deploy policies to override. Format is
42+
* `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
43+
*/
44+
// const overrideDeployPolicy = ['abc','def']
4045

4146
// Imports the Deploy library
4247
const {CloudDeployClient} = require('@google-cloud/deploy').v1;

packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.approve_rollout.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,11 @@ function main(name, approved) {
3737
* Required. True = approve; false = reject
3838
*/
3939
// const approved = true
40+
/**
41+
* Optional. Deploy policies to override. Format is
42+
* `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
43+
*/
44+
// const overrideDeployPolicy = ['abc','def']
4045

4146
// Imports the Deploy library
4247
const {CloudDeployClient} = require('@google-cloud/deploy').v1;

packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.cancel_rollout.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ function main(name) {
3333
* `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`.
3434
*/
3535
// const name = 'abc123'
36+
/**
37+
* Optional. Deploy policies to override. Format is
38+
* `projects/{project}/locations/{location}/deployPolicies/{deployPolicy}`.
39+
*/
40+
// const overrideDeployPolicy = ['abc','def']
3641

3742
// Imports the Deploy library
3843
const {CloudDeployClient} = require('@google-cloud/deploy').v1;
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
// Copyright 2024 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// https://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
//
15+
// ** This file is automatically generated by gapic-generator-typescript. **
16+
// ** https://github.com/googleapis/gapic-generator-typescript **
17+
// ** All changes to this file may be overwritten. **
18+
19+
20+
21+
'use strict';
22+
23+
function main(parent, deployPolicyId, deployPolicy) {
24+
// [START clouddeploy_v1_generated_CloudDeploy_CreateDeployPolicy_async]
25+
/**
26+
* This snippet has been automatically generated and should be regarded as a code template only.
27+
* It will require modifications to work.
28+
* It may require correct/in-range values for request initialization.
29+
* TODO(developer): Uncomment these variables before running the sample.
30+
*/
31+
/**
32+
* Required. The parent collection in which the `DeployPolicy` should be
33+
* created. Format should be
34+
* `projects/{project_id}/locations/{location_name}`.
35+
*/
36+
// const parent = 'abc123'
37+
/**
38+
* Required. ID of the `DeployPolicy`.
39+
*/
40+
// const deployPolicyId = 'abc123'
41+
/**
42+
* Required. The `DeployPolicy` to create.
43+
*/
44+
// const deployPolicy = {}
45+
/**
46+
* Optional. A request ID to identify requests. Specify a unique request ID
47+
* so that if you must retry your request, the server knows to ignore the
48+
* request if it has already been completed. The server guarantees that for
49+
* at least 60 minutes after the first request.
50+
* For example, consider a situation where you make an initial request and the
51+
* request times out. If you make the request again with the same request ID,
52+
* the server can check if original operation with the same request ID was
53+
* received, and if so, will ignore the second request. This prevents clients
54+
* from accidentally creating duplicate commitments.
55+
* The request ID must be a valid UUID with the exception that zero UUID is
56+
* not supported (00000000-0000-0000-0000-000000000000).
57+
*/
58+
// const requestId = 'abc123'
59+
/**
60+
* Optional. If set to true, the request is validated and the user is provided
61+
* with an expected result, but no actual change is made.
62+
*/
63+
// const validateOnly = true
64+
65+
// Imports the Deploy library
66+
const {CloudDeployClient} = require('@google-cloud/deploy').v1;
67+
68+
// Instantiates a client
69+
const deployClient = new CloudDeployClient();
70+
71+
async function callCreateDeployPolicy() {
72+
// Construct request
73+
const request = {
74+
parent,
75+
deployPolicyId,
76+
deployPolicy,
77+
};
78+
79+
// Run request
80+
const [operation] = await deployClient.createDeployPolicy(request);
81+
const [response] = await operation.promise();
82+
console.log(response);
83+
}
84+
85+
callCreateDeployPolicy();
86+
// [END clouddeploy_v1_generated_CloudDeploy_CreateDeployPolicy_async]
87+
}
88+
89+
process.on('unhandledRejection', err => {
90+
console.error(err.message);
91+
process.exitCode = 1;
92+
});
93+
main(...process.argv.slice(2));

0 commit comments

Comments
 (0)