Skip to content

Commit 0e07e30

Browse files
feat: [AlloyDb] add CRUD APIs on Databases (#8621)
* feat: add CRUD APIs on Databases feat: add PG 17 as a Database version chore: annotate `EncryptionConfig.kms_key_name`, `SecondaryConfig.primary_cluster_name`, `PrimaryConfig.secondary_cluster_names`, and `PscInstanceConfig.service_attachment_link` with what resource they're referencing feat: add configuration for Managed Connection Pool feat: update `Database.charset` to be immutable feat: add additional fields to Database object to specify the collation type, character type, if it is a template database, and the template to use for the database feat: add field to ExecuteSQL request to just validate the sql statement feat: add fields on the estimated/actual start/end times for an Upgrade Cluster operation docs: specify that the STOPPED state is not used for clusters anymore PiperOrigin-RevId: 811874303 Source-Link: googleapis/googleapis@fc225fe Source-Link: googleapis/googleapis-gen@fd7ed88 Copy-Tag: eyJwIjoiQWxsb3lEYi8uT3dsQm90LnlhbWwiLCJoIjoiZmQ3ZWQ4OGQ2NmUzMzIxMDA4NmU1MzJiMmQ3ODdhMDEzMzk4MjlmMiJ9 * 🦉 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 4c0fb49 commit 0e07e30

20 files changed

Lines changed: 756 additions & 65 deletions

AlloyDb/metadata/V1/Resources.php

858 Bytes
Binary file not shown.

AlloyDb/metadata/V1/Service.php

364 Bytes
Binary file not shown.

AlloyDb/src/V1/Client/AlloyDBAdminClient.php

Lines changed: 70 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,7 @@ final class AlloyDBAdminClient
167167
private const CODEGEN_NAME = 'gapic';
168168

169169
/** The default scopes required by the service. */
170-
public static $serviceScopes = [
171-
'https://www.googleapis.com/auth/cloud-platform',
172-
];
170+
public static $serviceScopes = ['https://www.googleapis.com/auth/cloud-platform'];
173171

174172
private $operationsClient;
175173

@@ -278,6 +276,27 @@ public static function clusterName(string $project, string $location, string $cl
278276
]);
279277
}
280278

279+
/**
280+
* Formats a string containing the fully-qualified path to represent a crypto_key
281+
* resource.
282+
*
283+
* @param string $project
284+
* @param string $location
285+
* @param string $keyRing
286+
* @param string $cryptoKey
287+
*
288+
* @return string The formatted crypto_key resource.
289+
*/
290+
public static function cryptoKeyName(string $project, string $location, string $keyRing, string $cryptoKey): string
291+
{
292+
return self::getPathTemplate('cryptoKey')->render([
293+
'project' => $project,
294+
'location' => $location,
295+
'key_ring' => $keyRing,
296+
'crypto_key' => $cryptoKey,
297+
]);
298+
}
299+
281300
/**
282301
* Formats a string containing the fully-qualified path to represent a
283302
* crypto_key_version resource.
@@ -290,8 +309,13 @@ public static function clusterName(string $project, string $location, string $cl
290309
*
291310
* @return string The formatted crypto_key_version resource.
292311
*/
293-
public static function cryptoKeyVersionName(string $project, string $location, string $keyRing, string $cryptoKey, string $cryptoKeyVersion): string
294-
{
312+
public static function cryptoKeyVersionName(
313+
string $project,
314+
string $location,
315+
string $keyRing,
316+
string $cryptoKey,
317+
string $cryptoKeyVersion
318+
): string {
295319
return self::getPathTemplate('cryptoKeyVersion')->render([
296320
'project' => $project,
297321
'location' => $location,
@@ -356,6 +380,25 @@ public static function networkName(string $project, string $network): string
356380
]);
357381
}
358382

383+
/**
384+
* Formats a string containing the fully-qualified path to represent a
385+
* service_attachment resource.
386+
*
387+
* @param string $project
388+
* @param string $region
389+
* @param string $serviceAttachment
390+
*
391+
* @return string The formatted service_attachment resource.
392+
*/
393+
public static function serviceAttachmentName(string $project, string $region, string $serviceAttachment): string
394+
{
395+
return self::getPathTemplate('serviceAttachment')->render([
396+
'project' => $project,
397+
'region' => $region,
398+
'service_attachment' => $serviceAttachment,
399+
]);
400+
}
401+
359402
/**
360403
* Formats a string containing the fully-qualified path to represent a user
361404
* resource.
@@ -383,10 +426,12 @@ public static function userName(string $project, string $location, string $clust
383426
* Template: Pattern
384427
* - backup: projects/{project}/locations/{location}/backups/{backup}
385428
* - cluster: projects/{project}/locations/{location}/clusters/{cluster}
429+
* - cryptoKey: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}
386430
* - cryptoKeyVersion: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}
387431
* - instance: projects/{project}/locations/{location}/clusters/{cluster}/instances/{instance}
388432
* - location: projects/{project}/locations/{location}
389433
* - network: projects/{project}/global/networks/{network}
434+
* - serviceAttachment: projects/{project}/regions/{region}/serviceAttachments/{service_attachment}
390435
* - user: projects/{project}/locations/{location}/clusters/{cluster}/users/{user}
391436
*
392437
* The optional $template argument can be supplied to specify a particular pattern,
@@ -523,8 +568,10 @@ public function __call($method, $args)
523568
*
524569
* @throws ApiException Thrown if the API call fails.
525570
*/
526-
public function batchCreateInstances(BatchCreateInstancesRequest $request, array $callOptions = []): OperationResponse
527-
{
571+
public function batchCreateInstances(
572+
BatchCreateInstancesRequest $request,
573+
array $callOptions = []
574+
): OperationResponse {
528575
return $this->startApiCall('BatchCreateInstances', $request, $callOptions)->wait();
529576
}
530577

@@ -628,8 +675,10 @@ public function createInstance(CreateInstanceRequest $request, array $callOption
628675
*
629676
* @throws ApiException Thrown if the API call fails.
630677
*/
631-
public function createSecondaryCluster(CreateSecondaryClusterRequest $request, array $callOptions = []): OperationResponse
632-
{
678+
public function createSecondaryCluster(
679+
CreateSecondaryClusterRequest $request,
680+
array $callOptions = []
681+
): OperationResponse {
633682
return $this->startApiCall('CreateSecondaryCluster', $request, $callOptions)->wait();
634683
}
635684

@@ -654,8 +703,10 @@ public function createSecondaryCluster(CreateSecondaryClusterRequest $request, a
654703
*
655704
* @throws ApiException Thrown if the API call fails.
656705
*/
657-
public function createSecondaryInstance(CreateSecondaryInstanceRequest $request, array $callOptions = []): OperationResponse
658-
{
706+
public function createSecondaryInstance(
707+
CreateSecondaryInstanceRequest $request,
708+
array $callOptions = []
709+
): OperationResponse {
659710
return $this->startApiCall('CreateSecondaryInstance', $request, $callOptions)->wait();
660711
}
661712

@@ -894,8 +945,10 @@ public function failoverInstance(FailoverInstanceRequest $request, array $callOp
894945
*
895946
* @throws ApiException Thrown if the API call fails.
896947
*/
897-
public function generateClientCertificate(GenerateClientCertificateRequest $request, array $callOptions = []): GenerateClientCertificateResponse
898-
{
948+
public function generateClientCertificate(
949+
GenerateClientCertificateRequest $request,
950+
array $callOptions = []
951+
): GenerateClientCertificateResponse {
899952
return $this->startApiCall('GenerateClientCertificate', $request, $callOptions)->wait();
900953
}
901954

@@ -1209,8 +1262,10 @@ public function listInstances(ListInstancesRequest $request, array $callOptions
12091262
*
12101263
* @throws ApiException Thrown if the API call fails.
12111264
*/
1212-
public function listSupportedDatabaseFlags(ListSupportedDatabaseFlagsRequest $request, array $callOptions = []): PagedListResponse
1213-
{
1265+
public function listSupportedDatabaseFlags(
1266+
ListSupportedDatabaseFlagsRequest $request,
1267+
array $callOptions = []
1268+
): PagedListResponse {
12141269
return $this->startApiCall('ListSupportedDatabaseFlags', $request, $callOptions);
12151270
}
12161271

AlloyDb/src/V1/Client/AlloyDBCSQLAdminClient.php

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,7 @@ final class AlloyDBCSQLAdminClient
8585
private const CODEGEN_NAME = 'gapic';
8686

8787
/** The default scopes required by the service. */
88-
public static $serviceScopes = [
89-
'https://www.googleapis.com/auth/cloud-platform',
90-
];
88+
public static $serviceScopes = ['https://www.googleapis.com/auth/cloud-platform'];
9189

9290
private $operationsClient;
9391

@@ -196,6 +194,27 @@ public static function clusterName(string $project, string $location, string $cl
196194
]);
197195
}
198196

197+
/**
198+
* Formats a string containing the fully-qualified path to represent a crypto_key
199+
* resource.
200+
*
201+
* @param string $project
202+
* @param string $location
203+
* @param string $keyRing
204+
* @param string $cryptoKey
205+
*
206+
* @return string The formatted crypto_key resource.
207+
*/
208+
public static function cryptoKeyName(string $project, string $location, string $keyRing, string $cryptoKey): string
209+
{
210+
return self::getPathTemplate('cryptoKey')->render([
211+
'project' => $project,
212+
'location' => $location,
213+
'key_ring' => $keyRing,
214+
'crypto_key' => $cryptoKey,
215+
]);
216+
}
217+
199218
/**
200219
* Formats a string containing the fully-qualified path to represent a
201220
* crypto_key_version resource.
@@ -208,8 +227,13 @@ public static function clusterName(string $project, string $location, string $cl
208227
*
209228
* @return string The formatted crypto_key_version resource.
210229
*/
211-
public static function cryptoKeyVersionName(string $project, string $location, string $keyRing, string $cryptoKey, string $cryptoKeyVersion): string
212-
{
230+
public static function cryptoKeyVersionName(
231+
string $project,
232+
string $location,
233+
string $keyRing,
234+
string $cryptoKey,
235+
string $cryptoKeyVersion
236+
): string {
213237
return self::getPathTemplate('cryptoKeyVersion')->render([
214238
'project' => $project,
215239
'location' => $location,
@@ -259,6 +283,7 @@ public static function networkName(string $project, string $network): string
259283
* Template: Pattern
260284
* - backup: projects/{project}/locations/{location}/backups/{backup}
261285
* - cluster: projects/{project}/locations/{location}/clusters/{cluster}
286+
* - cryptoKey: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}
262287
* - cryptoKeyVersion: projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}
263288
* - location: projects/{project}/locations/{location}
264289
* - network: projects/{project}/global/networks/{network}

AlloyDb/src/V1/Cluster/PrimaryConfig.php

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

AlloyDb/src/V1/Cluster/SecondaryConfig.php

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

AlloyDb/src/V1/Cluster/State.php

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

0 commit comments

Comments
 (0)