-
Notifications
You must be signed in to change notification settings - Fork 598
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
1 parent
fc9471b
commit 2745e24
Showing
18 changed files
with
10,965 additions
and
854 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
485 changes: 458 additions & 27 deletions
485
packages/google-cloud-deploy/protos/google/cloud/deploy/v1/cloud_deploy.proto
Large diffs are not rendered by default.
Oops, something went wrong.
1,972 changes: 1,853 additions & 119 deletions
1,972
packages/google-cloud-deploy/protos/protos.d.ts
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 93 additions & 0 deletions
93
packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_custom_target_type.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
// Copyright 2023 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
// ** This file is automatically generated by gapic-generator-typescript. ** | ||
// ** https://github.com/googleapis/gapic-generator-typescript ** | ||
// ** All changes to this file may be overwritten. ** | ||
|
||
|
||
|
||
'use strict'; | ||
|
||
function main(parent, customTargetTypeId, customTargetType) { | ||
// [START clouddeploy_v1_generated_CloudDeploy_CreateCustomTargetType_async] | ||
/** | ||
* This snippet has been automatically generated and should be regarded as a code template only. | ||
* It will require modifications to work. | ||
* It may require correct/in-range values for request initialization. | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. The parent collection in which the `CustomTargetType` should be | ||
* created in. Format should be | ||
* `projects/{project_id}/locations/{location_name}`. | ||
*/ | ||
// const parent = 'abc123' | ||
/** | ||
* Required. ID of the `CustomTargetType`. | ||
*/ | ||
// const customTargetTypeId = 'abc123' | ||
/** | ||
* Required. The `CustomTargetType` to create. | ||
*/ | ||
// const customTargetType = {} | ||
/** | ||
* Optional. A request ID to identify requests. Specify a unique request ID | ||
* so that if you must retry your request, the server will know to ignore | ||
* the request if it has already been completed. The server will guarantee | ||
* that for at least 60 minutes since the first request. | ||
* For example, consider a situation where you make an initial request and the | ||
* request times out. If you make the request again with the same request ID, | ||
* the server can check if original operation with the same request ID was | ||
* received, and if so, will ignore the second request. This prevents clients | ||
* from accidentally creating duplicate commitments. | ||
* The request ID must be a valid UUID with the exception that zero UUID is | ||
* not supported (00000000-0000-0000-0000-000000000000). | ||
*/ | ||
// const requestId = 'abc123' | ||
/** | ||
* Optional. If set to true, the request is validated and the user is provided | ||
* with an expected result, but no actual change is made. | ||
*/ | ||
// const validateOnly = true | ||
|
||
// Imports the Deploy library | ||
const {CloudDeployClient} = require('@google-cloud/deploy').v1; | ||
|
||
// Instantiates a client | ||
const deployClient = new CloudDeployClient(); | ||
|
||
async function callCreateCustomTargetType() { | ||
// Construct request | ||
const request = { | ||
parent, | ||
customTargetTypeId, | ||
customTargetType, | ||
}; | ||
|
||
// Run request | ||
const [operation] = await deployClient.createCustomTargetType(request); | ||
const [response] = await operation.promise(); | ||
console.log(response); | ||
} | ||
|
||
callCreateCustomTargetType(); | ||
// [END clouddeploy_v1_generated_CloudDeploy_CreateCustomTargetType_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
93 changes: 93 additions & 0 deletions
93
packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_custom_target_type.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
// Copyright 2023 Google LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// https://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
// ** This file is automatically generated by gapic-generator-typescript. ** | ||
// ** https://github.com/googleapis/gapic-generator-typescript ** | ||
// ** All changes to this file may be overwritten. ** | ||
|
||
|
||
|
||
'use strict'; | ||
|
||
function main(name) { | ||
// [START clouddeploy_v1_generated_CloudDeploy_DeleteCustomTargetType_async] | ||
/** | ||
* This snippet has been automatically generated and should be regarded as a code template only. | ||
* It will require modifications to work. | ||
* It may require correct/in-range values for request initialization. | ||
* TODO(developer): Uncomment these variables before running the sample. | ||
*/ | ||
/** | ||
* Required. The name of the `CustomTargetType` to delete. Format must be | ||
* `projects/{project_id}/locations/{location_name}/customTargetTypes/{custom_target_type}`. | ||
*/ | ||
// const name = 'abc123' | ||
/** | ||
* Optional. A request ID to identify requests. Specify a unique request ID | ||
* so that if you must retry your request, the server will know to ignore | ||
* the request if it has already been completed. The server will guarantee | ||
* that for at least 60 minutes after the first request. | ||
* For example, consider a situation where you make an initial request and the | ||
* request times out. If you make the request again with the same request ID, | ||
* the server can check if original operation with the same request ID was | ||
* received, and if so, will ignore the second request. This prevents clients | ||
* from accidentally creating duplicate commitments. | ||
* The request ID must be a valid UUID with the exception that zero UUID is | ||
* not supported (00000000-0000-0000-0000-000000000000). | ||
*/ | ||
// const requestId = 'abc123' | ||
/** | ||
* Optional. If set to true, then deleting an already deleted or non-existing | ||
* `CustomTargetType` will succeed. | ||
*/ | ||
// const allowMissing = true | ||
/** | ||
* Optional. If set to true, the request is validated but no actual change is | ||
* made. | ||
*/ | ||
// const validateOnly = true | ||
/** | ||
* Optional. This checksum is computed by the server based on the value of | ||
* other fields, and may be sent on update and delete requests to ensure the | ||
* client has an up-to-date value before proceeding. | ||
*/ | ||
// const etag = 'abc123' | ||
|
||
// Imports the Deploy library | ||
const {CloudDeployClient} = require('@google-cloud/deploy').v1; | ||
|
||
// Instantiates a client | ||
const deployClient = new CloudDeployClient(); | ||
|
||
async function callDeleteCustomTargetType() { | ||
// Construct request | ||
const request = { | ||
name, | ||
}; | ||
|
||
// Run request | ||
const [operation] = await deployClient.deleteCustomTargetType(request); | ||
const [response] = await operation.promise(); | ||
console.log(response); | ||
} | ||
|
||
callDeleteCustomTargetType(); | ||
// [END clouddeploy_v1_generated_CloudDeploy_DeleteCustomTargetType_async] | ||
} | ||
|
||
process.on('unhandledRejection', err => { | ||
console.error(err.message); | ||
process.exitCode = 1; | ||
}); | ||
main(...process.argv.slice(2)); |
Oops, something went wrong.