Skip to content

Commit 6ea26f5

Browse files
feat: [Config] adding DeploymentGroups, you can now manage deployment of multiple module root dependencies in a single DAG (#9088)
* feat: adding DeploymentGroups, you can now manage deployment of multiple module root dependencies in a single DAG PiperOrigin-RevId: 896570259 Source-Link: googleapis/googleapis@f5cb7af Source-Link: googleapis/googleapis-gen@f06ef78 Copy-Tag: eyJwIjoiQ29uZmlnLy5Pd2xCb3QueWFtbCIsImgiOiJmMDZlZjc4YTI2MjgxMDlmMzg1MmU5OWJlNmZlYjVmNjQzYWUyYjZiIn0= * 🦉 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 41f837c commit 6ea26f5

45 files changed

Lines changed: 6883 additions & 30 deletions

Some content is hidden

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

Config/metadata/V1/Config.php

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<?php
2+
/*
3+
* Copyright 2026 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 config_v1_generated_Config_CreateDeploymentGroup_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\OperationResponse;
28+
use Google\Cloud\Config\V1\Client\ConfigClient;
29+
use Google\Cloud\Config\V1\CreateDeploymentGroupRequest;
30+
use Google\Cloud\Config\V1\DeploymentGroup;
31+
use Google\Rpc\Status;
32+
33+
/**
34+
* Creates a [DeploymentGroup][google.cloud.config.v1.DeploymentGroup]
35+
* The newly created DeploymentGroup will be in the `CREATING` state
36+
* and can be retrieved via Get and List calls.
37+
*
38+
* @param string $formattedParent The parent in whose context the Deployment Group is created. The
39+
* parent value is in the format: 'projects/{project_id}/locations/{location}'
40+
* Please see {@see ConfigClient::locationName()} for help formatting this field.
41+
* @param string $deploymentGroupId The deployment group ID.
42+
*/
43+
function create_deployment_group_sample(string $formattedParent, string $deploymentGroupId): void
44+
{
45+
// Create a client.
46+
$configClient = new ConfigClient();
47+
48+
// Prepare the request message.
49+
$deploymentGroup = new DeploymentGroup();
50+
$request = (new CreateDeploymentGroupRequest())
51+
->setParent($formattedParent)
52+
->setDeploymentGroupId($deploymentGroupId)
53+
->setDeploymentGroup($deploymentGroup);
54+
55+
// Call the API and handle any network failures.
56+
try {
57+
/** @var OperationResponse $response */
58+
$response = $configClient->createDeploymentGroup($request);
59+
$response->pollUntilComplete();
60+
61+
if ($response->operationSucceeded()) {
62+
/** @var DeploymentGroup $result */
63+
$result = $response->getResult();
64+
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
65+
} else {
66+
/** @var Status $error */
67+
$error = $response->getError();
68+
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
69+
}
70+
} catch (ApiException $ex) {
71+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
72+
}
73+
}
74+
75+
/**
76+
* Helper to execute the sample.
77+
*
78+
* This sample has been automatically generated and should be regarded as a code
79+
* template only. It will require modifications to work:
80+
* - It may require correct/in-range values for request initialization.
81+
* - It may require specifying regional endpoints when creating the service client,
82+
* please see the apiEndpoint client configuration option for more details.
83+
*/
84+
function callSample(): void
85+
{
86+
$formattedParent = ConfigClient::locationName('[PROJECT]', '[LOCATION]');
87+
$deploymentGroupId = '[DEPLOYMENT_GROUP_ID]';
88+
89+
create_deployment_group_sample($formattedParent, $deploymentGroupId);
90+
}
91+
// [END config_v1_generated_Config_CreateDeploymentGroup_sync]
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<?php
2+
/*
3+
* Copyright 2026 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 config_v1_generated_Config_DeleteDeploymentGroup_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\OperationResponse;
28+
use Google\Cloud\Config\V1\Client\ConfigClient;
29+
use Google\Cloud\Config\V1\DeleteDeploymentGroupRequest;
30+
use Google\Cloud\Config\V1\DeploymentGroup;
31+
use Google\Rpc\Status;
32+
33+
/**
34+
* Deletes a [DeploymentGroup][google.cloud.config.v1.DeploymentGroup]
35+
*
36+
* @param string $formattedName The name of DeploymentGroup in the format
37+
* projects/{project_id}/locations/{location_id}/deploymentGroups/{deploymentGroup}
38+
* Please see {@see ConfigClient::deploymentGroupName()} for help formatting this field.
39+
*/
40+
function delete_deployment_group_sample(string $formattedName): void
41+
{
42+
// Create a client.
43+
$configClient = new ConfigClient();
44+
45+
// Prepare the request message.
46+
$request = (new DeleteDeploymentGroupRequest())
47+
->setName($formattedName);
48+
49+
// Call the API and handle any network failures.
50+
try {
51+
/** @var OperationResponse $response */
52+
$response = $configClient->deleteDeploymentGroup($request);
53+
$response->pollUntilComplete();
54+
55+
if ($response->operationSucceeded()) {
56+
/** @var DeploymentGroup $result */
57+
$result = $response->getResult();
58+
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
59+
} else {
60+
/** @var Status $error */
61+
$error = $response->getError();
62+
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
63+
}
64+
} catch (ApiException $ex) {
65+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
66+
}
67+
}
68+
69+
/**
70+
* Helper to execute the sample.
71+
*
72+
* This sample has been automatically generated and should be regarded as a code
73+
* template only. It will require modifications to work:
74+
* - It may require correct/in-range values for request initialization.
75+
* - It may require specifying regional endpoints when creating the service client,
76+
* please see the apiEndpoint client configuration option for more details.
77+
*/
78+
function callSample(): void
79+
{
80+
$formattedName = ConfigClient::deploymentGroupName('[PROJECT]', '[LOCATION]', '[DEPLOYMENT_GROUP]');
81+
82+
delete_deployment_group_sample($formattedName);
83+
}
84+
// [END config_v1_generated_Config_DeleteDeploymentGroup_sync]
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
<?php
2+
/*
3+
* Copyright 2026 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 config_v1_generated_Config_DeprovisionDeploymentGroup_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\OperationResponse;
28+
use Google\Cloud\Config\V1\Client\ConfigClient;
29+
use Google\Cloud\Config\V1\DeploymentGroup;
30+
use Google\Cloud\Config\V1\DeprovisionDeploymentGroupRequest;
31+
use Google\Rpc\Status;
32+
33+
/**
34+
* Deprovisions a deployment group.
35+
*
36+
* NOTE: As a first step of this operation, Infra Manager will
37+
* automatically delete any Deployments that were part of the
38+
* *last successful*
39+
* [DeploymentGroupRevision][google.cloud.config.v1.DeploymentGroupRevision]
40+
* but are *no longer* included in the *current*
41+
* [DeploymentGroup][google.cloud.config.v1.DeploymentGroup] definition (e.g.,
42+
* following an `UpdateDeploymentGroup` call), along with their actuated
43+
* resources.
44+
*
45+
* @param string $formattedName The name of the deployment group to deprovision.
46+
* Format:
47+
* 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}'. Please see
48+
* {@see ConfigClient::deploymentGroupName()} for help formatting this field.
49+
*/
50+
function deprovision_deployment_group_sample(string $formattedName): void
51+
{
52+
// Create a client.
53+
$configClient = new ConfigClient();
54+
55+
// Prepare the request message.
56+
$request = (new DeprovisionDeploymentGroupRequest())
57+
->setName($formattedName);
58+
59+
// Call the API and handle any network failures.
60+
try {
61+
/** @var OperationResponse $response */
62+
$response = $configClient->deprovisionDeploymentGroup($request);
63+
$response->pollUntilComplete();
64+
65+
if ($response->operationSucceeded()) {
66+
/** @var DeploymentGroup $result */
67+
$result = $response->getResult();
68+
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
69+
} else {
70+
/** @var Status $error */
71+
$error = $response->getError();
72+
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
73+
}
74+
} catch (ApiException $ex) {
75+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
76+
}
77+
}
78+
79+
/**
80+
* Helper to execute the sample.
81+
*
82+
* This sample has been automatically generated and should be regarded as a code
83+
* template only. It will require modifications to work:
84+
* - It may require correct/in-range values for request initialization.
85+
* - It may require specifying regional endpoints when creating the service client,
86+
* please see the apiEndpoint client configuration option for more details.
87+
*/
88+
function callSample(): void
89+
{
90+
$formattedName = ConfigClient::deploymentGroupName('[PROJECT]', '[LOCATION]', '[DEPLOYMENT_GROUP]');
91+
92+
deprovision_deployment_group_sample($formattedName);
93+
}
94+
// [END config_v1_generated_Config_DeprovisionDeploymentGroup_sync]
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<?php
2+
/*
3+
* Copyright 2026 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 config_v1_generated_Config_GetDeploymentGroup_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\Config\V1\Client\ConfigClient;
28+
use Google\Cloud\Config\V1\DeploymentGroup;
29+
use Google\Cloud\Config\V1\GetDeploymentGroupRequest;
30+
31+
/**
32+
* Get a DeploymentGroup for a given project and location.
33+
*
34+
* @param string $formattedName The name of the deployment group to retrieve.
35+
* Format:
36+
* 'projects/{project_id}/locations/{location}/deploymentGroups/{deployment_group}'. Please see
37+
* {@see ConfigClient::deploymentGroupName()} for help formatting this field.
38+
*/
39+
function get_deployment_group_sample(string $formattedName): void
40+
{
41+
// Create a client.
42+
$configClient = new ConfigClient();
43+
44+
// Prepare the request message.
45+
$request = (new GetDeploymentGroupRequest())
46+
->setName($formattedName);
47+
48+
// Call the API and handle any network failures.
49+
try {
50+
/** @var DeploymentGroup $response */
51+
$response = $configClient->getDeploymentGroup($request);
52+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
53+
} catch (ApiException $ex) {
54+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
55+
}
56+
}
57+
58+
/**
59+
* Helper to execute the sample.
60+
*
61+
* This sample has been automatically generated and should be regarded as a code
62+
* template only. It will require modifications to work:
63+
* - It may require correct/in-range values for request initialization.
64+
* - It may require specifying regional endpoints when creating the service client,
65+
* please see the apiEndpoint client configuration option for more details.
66+
*/
67+
function callSample(): void
68+
{
69+
$formattedName = ConfigClient::deploymentGroupName('[PROJECT]', '[LOCATION]', '[DEPLOYMENT_GROUP]');
70+
71+
get_deployment_group_sample($formattedName);
72+
}
73+
// [END config_v1_generated_Config_GetDeploymentGroup_sync]

0 commit comments

Comments
 (0)