Skip to content

Commit 7b2c7b9

Browse files
feat: add Automation API and Rollback API (googleapis#6767)
chore: update platform logs docs: small documentation updates PiperOrigin-RevId: 578872129 Source-Link: googleapis/googleapis@41d7a83 Source-Link: https://github.com/googleapis/googleapis-gen/commit/eb84145fc26cf1f77d65af9ad82a239dfddc16bd Copy-Tag: eyJwIjoiRGVwbG95Ly5Pd2xCb3QueWFtbCIsImgiOiJlYjg0MTQ1ZmMyNmNmMWY3N2Q2NWFmOWFkODJhMjM5ZGZkZGMxNmJkIn0=
1 parent 43b4687 commit 7b2c7b9

130 files changed

Lines changed: 12399 additions & 527 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Deploy/metadata/V1/AutomationPayload.php‎

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

‎Deploy/metadata/V1/AutomationrunPayload.php‎

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

‎Deploy/metadata/V1/CloudDeploy.php‎

9.22 KB
Binary file not shown.

‎Deploy/metadata/V1/ReleaseRenderPayload.php‎

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
1.32 KB
Binary file not shown.

‎Deploy/samples/V1/CloudDeployClient/abandon_release.php‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@
3232
* Abandons a Release in the Delivery Pipeline.
3333
*
3434
* @param string $formattedName Name of the Release. Format is
35-
* projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/
36-
* releases/{release}. Please see
35+
* `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}`. Please see
3736
* {@see CloudDeployClient::releaseName()} for help formatting this field.
3837
*/
3938
function abandon_release_sample(string $formattedName): void

‎Deploy/samples/V1/CloudDeployClient/advance_rollout.php‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@
3232
* Advances a Rollout in a given project and location.
3333
*
3434
* @param string $formattedName Name of the Rollout. Format is
35-
* projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/
36-
* releases/{release}/rollouts/{rollout}. Please see
35+
* `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. Please see
3736
* {@see CloudDeployClient::rolloutName()} for help formatting this field.
3837
* @param string $phaseId The phase ID to advance the `Rollout` to.
3938
*/

‎Deploy/samples/V1/CloudDeployClient/approve_rollout.php‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@
3232
* Approves a Rollout.
3333
*
3434
* @param string $formattedName Name of the Rollout. Format is
35-
* projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/
36-
* releases/{release}/rollouts/{rollout}. Please see
35+
* `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. Please see
3736
* {@see CloudDeployClient::rolloutName()} for help formatting this field.
3837
* @param bool $approved True = approve; false = reject
3938
*/
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<?php
2+
/*
3+
* Copyright 2023 Google LLC
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* https://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/*
19+
* GENERATED CODE WARNING
20+
* This file was automatically generated - do not edit!
21+
*/
22+
23+
require_once __DIR__ . '/../../../vendor/autoload.php';
24+
25+
// [START clouddeploy_v1_generated_CloudDeploy_CancelAutomationRun_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\Deploy\V1\CancelAutomationRunRequest;
28+
use Google\Cloud\Deploy\V1\CancelAutomationRunResponse;
29+
use Google\Cloud\Deploy\V1\Client\CloudDeployClient;
30+
31+
/**
32+
* Cancels an AutomationRun. The `state` of the `AutomationRun` after
33+
* cancelling is `CANCELLED`. `CancelAutomationRun` can be called on
34+
* AutomationRun in the state `IN_PROGRESS` and `PENDING`; AutomationRun
35+
* in a different state returns an `FAILED_PRECONDITION` error.
36+
*
37+
* @param string $formattedName Name of the `AutomationRun`. Format is
38+
* `projects/{project}/locations/{location}/deliveryPipelines/{delivery_pipeline}/automationRuns/{automation_run}`. Please see
39+
* {@see CloudDeployClient::automationRunName()} for help formatting this field.
40+
*/
41+
function cancel_automation_run_sample(string $formattedName): void
42+
{
43+
// Create a client.
44+
$cloudDeployClient = new CloudDeployClient();
45+
46+
// Prepare the request message.
47+
$request = (new CancelAutomationRunRequest())
48+
->setName($formattedName);
49+
50+
// Call the API and handle any network failures.
51+
try {
52+
/** @var CancelAutomationRunResponse $response */
53+
$response = $cloudDeployClient->cancelAutomationRun($request);
54+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
55+
} catch (ApiException $ex) {
56+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
57+
}
58+
}
59+
60+
/**
61+
* Helper to execute the sample.
62+
*
63+
* This sample has been automatically generated and should be regarded as a code
64+
* template only. It will require modifications to work:
65+
* - It may require correct/in-range values for request initialization.
66+
* - It may require specifying regional endpoints when creating the service client,
67+
* please see the apiEndpoint client configuration option for more details.
68+
*/
69+
function callSample(): void
70+
{
71+
$formattedName = CloudDeployClient::automationRunName(
72+
'[PROJECT]',
73+
'[LOCATION]',
74+
'[DELIVERY_PIPELINE]',
75+
'[AUTOMATION_RUN]'
76+
);
77+
78+
cancel_automation_run_sample($formattedName);
79+
}
80+
// [END clouddeploy_v1_generated_CloudDeploy_CancelAutomationRun_sync]

‎Deploy/samples/V1/CloudDeployClient/cancel_rollout.php‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@
3232
* Cancels a Rollout in a given project and location.
3333
*
3434
* @param string $formattedName Name of the Rollout. Format is
35-
* projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/
36-
* releases/{release}/rollouts/{rollout}. Please see
35+
* `projects/{project}/locations/{location}/deliveryPipelines/{deliveryPipeline}/releases/{release}/rollouts/{rollout}`. Please see
3736
* {@see CloudDeployClient::rolloutName()} for help formatting this field.
3837
*/
3938
function cancel_rollout_sample(string $formattedName): void

0 commit comments

Comments
 (0)