-
Notifications
You must be signed in to change notification settings - Fork 439
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Infrastructure Manager supports the deployment of infrastructur…
…e from Terraform configurations in a private Git repository (#7161) feat: Infrastructure Manager can validate and enforce quota limits, preventing infrastructure that exceeds quota limits from being deployed feat: Infrastructure manager supports the following versions of Terraform when creating a deployment: Terraform version 1.2.3, 1.3.10, 1.4.7, 1.5.7 docs: A comment for field `page_size` in message `.google.cloud.config.v1.ListDeploymentsRequest` is changed docs: A comment for field `page_size` in message `.google.cloud.config.v1.ListRevisionsRequest` is changed docs: A comment for field `page_size` in message `.google.cloud.config.v1.ListResourcesRequest` is changed docs: A comment for field `service_account` in message `.google.cloud.config.v1.Preview` is changed docs: A comment for field `page_size` in message `.google.cloud.config.v1.ListPreviewsRequest` is changed PiperOrigin-RevId: 616858321 Source-Link: googleapis/googleapis@7e02769 Source-Link: googleapis/googleapis-gen@d71ec59 Copy-Tag: eyJwIjoiQ29uZmlnLy5Pd2xCb3QueWFtbCIsImgiOiJkNzFlYzU5ZDFkNzQyODNjNTk5MjQ5NTVlMDNhMzM5MzA4MGJhYzNmIn0=
- Loading branch information
1 parent
a7f8970
commit 5541f21
Showing
25 changed files
with
1,716 additions
and
44 deletions.
There are no files selected for viewing
Binary file not shown.
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,77 @@ | ||
<?php | ||
/* | ||
* Copyright 2024 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. | ||
*/ | ||
|
||
/* | ||
* GENERATED CODE WARNING | ||
* This file was automatically generated - do not edit! | ||
*/ | ||
|
||
require_once __DIR__ . '/../../../vendor/autoload.php'; | ||
|
||
// [START config_v1_generated_Config_GetTerraformVersion_sync] | ||
use Google\ApiCore\ApiException; | ||
use Google\Cloud\Config\V1\Client\ConfigClient; | ||
use Google\Cloud\Config\V1\GetTerraformVersionRequest; | ||
use Google\Cloud\Config\V1\TerraformVersion; | ||
|
||
/** | ||
* Gets details about a | ||
* [TerraformVersion][google.cloud.config.v1.TerraformVersion]. | ||
* | ||
* @param string $formattedName The name of the TerraformVersion. Format: | ||
* 'projects/{project_id}/locations/{location}/terraformVersions/{terraform_version}' | ||
* Please see {@see ConfigClient::terraformVersionName()} for help formatting this field. | ||
*/ | ||
function get_terraform_version_sample(string $formattedName): void | ||
{ | ||
// Create a client. | ||
$configClient = new ConfigClient(); | ||
|
||
// Prepare the request message. | ||
$request = (new GetTerraformVersionRequest()) | ||
->setName($formattedName); | ||
|
||
// Call the API and handle any network failures. | ||
try { | ||
/** @var TerraformVersion $response */ | ||
$response = $configClient->getTerraformVersion($request); | ||
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString()); | ||
} catch (ApiException $ex) { | ||
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); | ||
} | ||
} | ||
|
||
/** | ||
* Helper to execute the sample. | ||
* | ||
* This sample 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. | ||
* - It may require specifying regional endpoints when creating the service client, | ||
* please see the apiEndpoint client configuration option for more details. | ||
*/ | ||
function callSample(): void | ||
{ | ||
$formattedName = ConfigClient::terraformVersionName( | ||
'[PROJECT]', | ||
'[LOCATION]', | ||
'[TERRAFORM_VERSION]' | ||
); | ||
|
||
get_terraform_version_sample($formattedName); | ||
} | ||
// [END config_v1_generated_Config_GetTerraformVersion_sync] |
79 changes: 79 additions & 0 deletions
79
Config/samples/V1/ConfigClient/list_terraform_versions.php
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,79 @@ | ||
<?php | ||
/* | ||
* Copyright 2024 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. | ||
*/ | ||
|
||
/* | ||
* GENERATED CODE WARNING | ||
* This file was automatically generated - do not edit! | ||
*/ | ||
|
||
require_once __DIR__ . '/../../../vendor/autoload.php'; | ||
|
||
// [START config_v1_generated_Config_ListTerraformVersions_sync] | ||
use Google\ApiCore\ApiException; | ||
use Google\ApiCore\PagedListResponse; | ||
use Google\Cloud\Config\V1\Client\ConfigClient; | ||
use Google\Cloud\Config\V1\ListTerraformVersionsRequest; | ||
use Google\Cloud\Config\V1\TerraformVersion; | ||
|
||
/** | ||
* Lists [TerraformVersion][google.cloud.config.v1.TerraformVersion]s in a | ||
* given project and location. | ||
* | ||
* @param string $formattedParent The parent in whose context the TerraformVersions are listed. The | ||
* parent value is in the format: | ||
* 'projects/{project_id}/locations/{location}'. Please see | ||
* {@see ConfigClient::locationName()} for help formatting this field. | ||
*/ | ||
function list_terraform_versions_sample(string $formattedParent): void | ||
{ | ||
// Create a client. | ||
$configClient = new ConfigClient(); | ||
|
||
// Prepare the request message. | ||
$request = (new ListTerraformVersionsRequest()) | ||
->setParent($formattedParent); | ||
|
||
// Call the API and handle any network failures. | ||
try { | ||
/** @var PagedListResponse $response */ | ||
$response = $configClient->listTerraformVersions($request); | ||
|
||
/** @var TerraformVersion $element */ | ||
foreach ($response as $element) { | ||
printf('Element data: %s' . PHP_EOL, $element->serializeToJsonString()); | ||
} | ||
} catch (ApiException $ex) { | ||
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage()); | ||
} | ||
} | ||
|
||
/** | ||
* Helper to execute the sample. | ||
* | ||
* This sample 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. | ||
* - It may require specifying regional endpoints when creating the service client, | ||
* please see the apiEndpoint client configuration option for more details. | ||
*/ | ||
function callSample(): void | ||
{ | ||
$formattedParent = ConfigClient::locationName('[PROJECT]', '[LOCATION]'); | ||
|
||
list_terraform_versions_sample($formattedParent); | ||
} | ||
// [END config_v1_generated_Config_ListTerraformVersions_sync] |
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
Oops, something went wrong.