Skip to content

Commit

Permalink
feat: [deploy] Add custom target type support (#4860)
Browse files Browse the repository at this point in the history
* 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
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Dec 5, 2023
1 parent fc9471b commit 2745e24
Show file tree
Hide file tree
Showing 18 changed files with 10,965 additions and 854 deletions.
5 changes: 5 additions & 0 deletions packages/google-cloud-deploy/README.md

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1,972 changes: 1,853 additions & 119 deletions packages/google-cloud-deploy/protos/protos.d.ts

Large diffs are not rendered by default.

4,753 changes: 4,580 additions & 173 deletions packages/google-cloud-deploy/protos/protos.js

Large diffs are not rendered by default.

605 changes: 601 additions & 4 deletions packages/google-cloud-deploy/protos/protos.json

Large diffs are not rendered by default.

90 changes: 90 additions & 0 deletions packages/google-cloud-deploy/samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,19 @@
* [Cloud_deploy.cancel_automation_run](#cloud_deploy.cancel_automation_run)
* [Cloud_deploy.cancel_rollout](#cloud_deploy.cancel_rollout)
* [Cloud_deploy.create_automation](#cloud_deploy.create_automation)
* [Cloud_deploy.create_custom_target_type](#cloud_deploy.create_custom_target_type)
* [Cloud_deploy.create_delivery_pipeline](#cloud_deploy.create_delivery_pipeline)
* [Cloud_deploy.create_release](#cloud_deploy.create_release)
* [Cloud_deploy.create_rollout](#cloud_deploy.create_rollout)
* [Cloud_deploy.create_target](#cloud_deploy.create_target)
* [Cloud_deploy.delete_automation](#cloud_deploy.delete_automation)
* [Cloud_deploy.delete_custom_target_type](#cloud_deploy.delete_custom_target_type)
* [Cloud_deploy.delete_delivery_pipeline](#cloud_deploy.delete_delivery_pipeline)
* [Cloud_deploy.delete_target](#cloud_deploy.delete_target)
* [Cloud_deploy.get_automation](#cloud_deploy.get_automation)
* [Cloud_deploy.get_automation_run](#cloud_deploy.get_automation_run)
* [Cloud_deploy.get_config](#cloud_deploy.get_config)
* [Cloud_deploy.get_custom_target_type](#cloud_deploy.get_custom_target_type)
* [Cloud_deploy.get_delivery_pipeline](#cloud_deploy.get_delivery_pipeline)
* [Cloud_deploy.get_job_run](#cloud_deploy.get_job_run)
* [Cloud_deploy.get_release](#cloud_deploy.get_release)
Expand All @@ -36,6 +39,7 @@
* [Cloud_deploy.ignore_job](#cloud_deploy.ignore_job)
* [Cloud_deploy.list_automation_runs](#cloud_deploy.list_automation_runs)
* [Cloud_deploy.list_automations](#cloud_deploy.list_automations)
* [Cloud_deploy.list_custom_target_types](#cloud_deploy.list_custom_target_types)
* [Cloud_deploy.list_delivery_pipelines](#cloud_deploy.list_delivery_pipelines)
* [Cloud_deploy.list_job_runs](#cloud_deploy.list_job_runs)
* [Cloud_deploy.list_releases](#cloud_deploy.list_releases)
Expand All @@ -45,6 +49,7 @@
* [Cloud_deploy.rollback_target](#cloud_deploy.rollback_target)
* [Cloud_deploy.terminate_job_run](#cloud_deploy.terminate_job_run)
* [Cloud_deploy.update_automation](#cloud_deploy.update_automation)
* [Cloud_deploy.update_custom_target_type](#cloud_deploy.update_custom_target_type)
* [Cloud_deploy.update_delivery_pipeline](#cloud_deploy.update_delivery_pipeline)
* [Cloud_deploy.update_target](#cloud_deploy.update_target)
* [Quickstart](#quickstart)
Expand Down Expand Up @@ -166,6 +171,23 @@ __Usage:__



### Cloud_deploy.create_custom_target_type

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).

[![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)

__Usage:__


`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.create_custom_target_type.js`


-----




### Cloud_deploy.create_delivery_pipeline

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).
Expand Down Expand Up @@ -251,6 +273,23 @@ __Usage:__



### Cloud_deploy.delete_custom_target_type

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).

[![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)

__Usage:__


`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.delete_custom_target_type.js`


-----




### Cloud_deploy.delete_delivery_pipeline

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).
Expand Down Expand Up @@ -336,6 +375,23 @@ __Usage:__



### Cloud_deploy.get_custom_target_type

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).

[![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)

__Usage:__


`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.get_custom_target_type.js`


-----




### Cloud_deploy.get_delivery_pipeline

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).
Expand Down Expand Up @@ -472,6 +528,23 @@ __Usage:__



### Cloud_deploy.list_custom_target_types

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).

[![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)

__Usage:__


`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.list_custom_target_types.js`


-----




### Cloud_deploy.list_delivery_pipelines

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).
Expand Down Expand Up @@ -625,6 +698,23 @@ __Usage:__



### Cloud_deploy.update_custom_target_type

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).

[![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)

__Usage:__


`node packages/google-cloud-deploy/samples/generated/v1/cloud_deploy.update_custom_target_type.js`


-----




### Cloud_deploy.update_delivery_pipeline

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).
Expand Down
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));
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));
Loading

0 comments on commit 2745e24

Please sign in to comment.