Skip to content

Commit 2745e24

Browse files
feat: [deploy] Add custom target type support (#4860)
* feat: Add custom target type support feat: Add revision tagging for one of the Cloud Run deployment strategies docs: Fixed a number of comments. PiperOrigin-RevId: 587671915 Source-Link: googleapis/googleapis@1523043 Source-Link: googleapis/googleapis-gen@d0ab47d Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWRlcGxveS8uT3dsQm90LnlhbWwiLCJoIjoiZDBhYjQ3ZGU1ODc0MWRiYTdhMmE0MzAwZjEwYmQyYjg1M2YwYTZjZiJ9 * 🦉 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 fc9471b commit 2745e24

18 files changed

Lines changed: 10965 additions & 854 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: 458 additions & 27 deletions
Large diffs are not rendered by default.

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

Lines changed: 1853 additions & 119 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: 4580 additions & 173 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: 601 additions & 4 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
@@ -18,16 +18,19 @@
1818
* [Cloud_deploy.cancel_automation_run](#cloud_deploy.cancel_automation_run)
1919
* [Cloud_deploy.cancel_rollout](#cloud_deploy.cancel_rollout)
2020
* [Cloud_deploy.create_automation](#cloud_deploy.create_automation)
21+
* [Cloud_deploy.create_custom_target_type](#cloud_deploy.create_custom_target_type)
2122
* [Cloud_deploy.create_delivery_pipeline](#cloud_deploy.create_delivery_pipeline)
2223
* [Cloud_deploy.create_release](#cloud_deploy.create_release)
2324
* [Cloud_deploy.create_rollout](#cloud_deploy.create_rollout)
2425
* [Cloud_deploy.create_target](#cloud_deploy.create_target)
2526
* [Cloud_deploy.delete_automation](#cloud_deploy.delete_automation)
27+
* [Cloud_deploy.delete_custom_target_type](#cloud_deploy.delete_custom_target_type)
2628
* [Cloud_deploy.delete_delivery_pipeline](#cloud_deploy.delete_delivery_pipeline)
2729
* [Cloud_deploy.delete_target](#cloud_deploy.delete_target)
2830
* [Cloud_deploy.get_automation](#cloud_deploy.get_automation)
2931
* [Cloud_deploy.get_automation_run](#cloud_deploy.get_automation_run)
3032
* [Cloud_deploy.get_config](#cloud_deploy.get_config)
33+
* [Cloud_deploy.get_custom_target_type](#cloud_deploy.get_custom_target_type)
3134
* [Cloud_deploy.get_delivery_pipeline](#cloud_deploy.get_delivery_pipeline)
3235
* [Cloud_deploy.get_job_run](#cloud_deploy.get_job_run)
3336
* [Cloud_deploy.get_release](#cloud_deploy.get_release)
@@ -36,6 +39,7 @@
3639
* [Cloud_deploy.ignore_job](#cloud_deploy.ignore_job)
3740
* [Cloud_deploy.list_automation_runs](#cloud_deploy.list_automation_runs)
3841
* [Cloud_deploy.list_automations](#cloud_deploy.list_automations)
42+
* [Cloud_deploy.list_custom_target_types](#cloud_deploy.list_custom_target_types)
3943
* [Cloud_deploy.list_delivery_pipelines](#cloud_deploy.list_delivery_pipelines)
4044
* [Cloud_deploy.list_job_runs](#cloud_deploy.list_job_runs)
4145
* [Cloud_deploy.list_releases](#cloud_deploy.list_releases)
@@ -45,6 +49,7 @@
4549
* [Cloud_deploy.rollback_target](#cloud_deploy.rollback_target)
4650
* [Cloud_deploy.terminate_job_run](#cloud_deploy.terminate_job_run)
4751
* [Cloud_deploy.update_automation](#cloud_deploy.update_automation)
52+
* [Cloud_deploy.update_custom_target_type](#cloud_deploy.update_custom_target_type)
4853
* [Cloud_deploy.update_delivery_pipeline](#cloud_deploy.update_delivery_pipeline)
4954
* [Cloud_deploy.update_target](#cloud_deploy.update_target)
5055
* [Quickstart](#quickstart)
@@ -166,6 +171,23 @@ __Usage:__
166171

167172

168173

174+
### Cloud_deploy.create_custom_target_type
175+
176+
View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_custom_target_type.js).
177+
178+
[![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_custom_target_type.js,samples/README.md)
179+
180+
__Usage:__
181+
182+
183+
`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_custom_target_type.js`
184+
185+
186+
-----
187+
188+
189+
190+
169191
### Cloud_deploy.create_delivery_pipeline
170192

171193
View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_delivery_pipeline.js).
@@ -251,6 +273,23 @@ __Usage:__
251273

252274

253275

276+
### Cloud_deploy.delete_custom_target_type
277+
278+
View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_custom_target_type.js).
279+
280+
[![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_custom_target_type.js,samples/README.md)
281+
282+
__Usage:__
283+
284+
285+
`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_custom_target_type.js`
286+
287+
288+
-----
289+
290+
291+
292+
254293
### Cloud_deploy.delete_delivery_pipeline
255294

256295
View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_delivery_pipeline.js).
@@ -336,6 +375,23 @@ __Usage:__
336375

337376

338377

378+
### Cloud_deploy.get_custom_target_type
379+
380+
View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_custom_target_type.js).
381+
382+
[![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_custom_target_type.js,samples/README.md)
383+
384+
__Usage:__
385+
386+
387+
`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_custom_target_type.js`
388+
389+
390+
-----
391+
392+
393+
394+
339395
### Cloud_deploy.get_delivery_pipeline
340396

341397
View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_delivery_pipeline.js).
@@ -472,6 +528,23 @@ __Usage:__
472528

473529

474530

531+
### Cloud_deploy.list_custom_target_types
532+
533+
View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_custom_target_types.js).
534+
535+
[![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_custom_target_types.js,samples/README.md)
536+
537+
__Usage:__
538+
539+
540+
`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_custom_target_types.js`
541+
542+
543+
-----
544+
545+
546+
547+
475548
### Cloud_deploy.list_delivery_pipelines
476549

477550
View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_delivery_pipelines.js).
@@ -625,6 +698,23 @@ __Usage:__
625698

626699

627700

701+
### Cloud_deploy.update_custom_target_type
702+
703+
View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_custom_target_type.js).
704+
705+
[![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_custom_target_type.js,samples/README.md)
706+
707+
__Usage:__
708+
709+
710+
`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_custom_target_type.js`
711+
712+
713+
-----
714+
715+
716+
717+
628718
### Cloud_deploy.update_delivery_pipeline
629719

630720
View the [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_delivery_pipeline.js).
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
// Copyright 2023 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, customTargetTypeId, customTargetType) {
24+
// [START clouddeploy_v1_generated_CloudDeploy_CreateCustomTargetType_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 `CustomTargetType` should be
33+
* created in. Format should be
34+
* `projects/{project_id}/locations/{location_name}`.
35+
*/
36+
// const parent = 'abc123'
37+
/**
38+
* Required. ID of the `CustomTargetType`.
39+
*/
40+
// const customTargetTypeId = 'abc123'
41+
/**
42+
* Required. The `CustomTargetType` to create.
43+
*/
44+
// const customTargetType = {}
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 will know to ignore
48+
* the request if it has already been completed. The server will guarantee
49+
* that for at least 60 minutes since 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 callCreateCustomTargetType() {
72+
// Construct request
73+
const request = {
74+
parent,
75+
customTargetTypeId,
76+
customTargetType,
77+
};
78+
79+
// Run request
80+
const [operation] = await deployClient.createCustomTargetType(request);
81+
const [response] = await operation.promise();
82+
console.log(response);
83+
}
84+
85+
callCreateCustomTargetType();
86+
// [END clouddeploy_v1_generated_CloudDeploy_CreateCustomTargetType_async]
87+
}
88+
89+
process.on('unhandledRejection', err => {
90+
console.error(err.message);
91+
process.exitCode = 1;
92+
});
93+
main(...process.argv.slice(2));
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
// Copyright 2023 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(name) {
24+
// [START clouddeploy_v1_generated_CloudDeploy_DeleteCustomTargetType_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 name of the `CustomTargetType` to delete. Format must be
33+
* `projects/{project_id}/locations/{location_name}/customTargetTypes/{custom_target_type}`.
34+
*/
35+
// const name = 'abc123'
36+
/**
37+
* Optional. A request ID to identify requests. Specify a unique request ID
38+
* so that if you must retry your request, the server will know to ignore
39+
* the request if it has already been completed. The server will guarantee
40+
* that for at least 60 minutes after the first request.
41+
* For example, consider a situation where you make an initial request and the
42+
* request times out. If you make the request again with the same request ID,
43+
* the server can check if original operation with the same request ID was
44+
* received, and if so, will ignore the second request. This prevents clients
45+
* from accidentally creating duplicate commitments.
46+
* The request ID must be a valid UUID with the exception that zero UUID is
47+
* not supported (00000000-0000-0000-0000-000000000000).
48+
*/
49+
// const requestId = 'abc123'
50+
/**
51+
* Optional. If set to true, then deleting an already deleted or non-existing
52+
* `CustomTargetType` will succeed.
53+
*/
54+
// const allowMissing = true
55+
/**
56+
* Optional. If set to true, the request is validated but no actual change is
57+
* made.
58+
*/
59+
// const validateOnly = true
60+
/**
61+
* Optional. This checksum is computed by the server based on the value of
62+
* other fields, and may be sent on update and delete requests to ensure the
63+
* client has an up-to-date value before proceeding.
64+
*/
65+
// const etag = 'abc123'
66+
67+
// Imports the Deploy library
68+
const {CloudDeployClient} = require('@google-cloud/deploy').v1;
69+
70+
// Instantiates a client
71+
const deployClient = new CloudDeployClient();
72+
73+
async function callDeleteCustomTargetType() {
74+
// Construct request
75+
const request = {
76+
name,
77+
};
78+
79+
// Run request
80+
const [operation] = await deployClient.deleteCustomTargetType(request);
81+
const [response] = await operation.promise();
82+
console.log(response);
83+
}
84+
85+
callDeleteCustomTargetType();
86+
// [END clouddeploy_v1_generated_CloudDeploy_DeleteCustomTargetType_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)