Skip to content

Commit

Permalink
feat: [VpcAccess] Adds support for configuring scaling settings (#5465)
Browse files Browse the repository at this point in the history
* feat: Adds support for configuring scaling settings

Clients can now specify machine type and min/max instances when creating a connector.

PiperOrigin-RevId: 469463049

Source-Link: googleapis/googleapis@17b39f1

Source-Link: googleapis/googleapis-gen@88b74ac
Copy-Tag: eyJwIjoiVnBjQWNjZXNzLy5Pd2xCb3QueWFtbCIsImgiOiI4OGI3NGFjNjllNzY3OTFhMDIwY2I1NDM3NDdjMDkwNjU1ZWU3MTQ0In0=

* 🦉 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>
Co-authored-by: David Supplee <[email protected]>
  • Loading branch information
3 people authored Sep 16, 2022
1 parent 7363cb2 commit 83e318b
Show file tree
Hide file tree
Showing 7 changed files with 286 additions and 5 deletions.
Binary file modified VpcAccess/metadata/V1/VpcAccess.php
Binary file not shown.
110 changes: 106 additions & 4 deletions VpcAccess/src/V1/Connector.php

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

79 changes: 79 additions & 0 deletions VpcAccess/src/V1/Gapic/VpcAccessServiceGapicClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
use Google\ApiCore\Transport\TransportInterface;
use Google\ApiCore\ValidationException;
use Google\Auth\FetchAuthTokenInterface;
use Google\Cloud\Location\ListLocationsRequest;
use Google\Cloud\Location\ListLocationsResponse;
use Google\Cloud\VpcAccess\V1\Connector;
use Google\Cloud\VpcAccess\V1\CreateConnectorRequest;
use Google\Cloud\VpcAccess\V1\DeleteConnectorRequest;
Expand Down Expand Up @@ -595,4 +597,81 @@ public function listConnectors($parent, array $optionalArgs = [])
$optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader();
return $this->getPagedListResponse('ListConnectors', $optionalArgs, ListConnectorsResponse::class, $request);
}

/**
* Lists information about the supported locations for this service.
*
* Sample code:
* ```
* $vpcAccessServiceClient = new VpcAccessServiceClient();
* try {
* // Iterate over pages of elements
* $pagedResponse = $vpcAccessServiceClient->listLocations();
* foreach ($pagedResponse->iteratePages() as $page) {
* foreach ($page as $element) {
* // doSomethingWith($element);
* }
* }
* // Alternatively:
* // Iterate through all elements
* $pagedResponse = $vpcAccessServiceClient->listLocations();
* foreach ($pagedResponse->iterateAllElements() as $element) {
* // doSomethingWith($element);
* }
* } finally {
* $vpcAccessServiceClient->close();
* }
* ```
*
* @param array $optionalArgs {
* Optional.
*
* @type string $name
* The resource that owns the locations collection, if applicable.
* @type string $filter
* The standard list filter.
* @type int $pageSize
* The maximum number of resources contained in the underlying API
* response. The API may return fewer values in a page, even if
* there are additional values to be retrieved.
* @type string $pageToken
* A page token is used to specify a page of values to be returned.
* If no page token is specified (the default), the first page
* of values will be returned. Any page token used here must have
* been generated by a previous call to the API.
* @type RetrySettings|array $retrySettings
* Retry settings to use for this call. Can be a {@see RetrySettings} object, or an
* associative array of retry settings parameters. See the documentation on
* {@see RetrySettings} for example usage.
* }
*
* @return \Google\ApiCore\PagedListResponse
*
* @throws ApiException if the remote call fails
*/
public function listLocations(array $optionalArgs = [])
{
$request = new ListLocationsRequest();
$requestParamHeaders = [];
if (isset($optionalArgs['name'])) {
$request->setName($optionalArgs['name']);
$requestParamHeaders['name'] = $optionalArgs['name'];
}

if (isset($optionalArgs['filter'])) {
$request->setFilter($optionalArgs['filter']);
}

if (isset($optionalArgs['pageSize'])) {
$request->setPageSize($optionalArgs['pageSize']);
}

if (isset($optionalArgs['pageToken'])) {
$request->setPageToken($optionalArgs['pageToken']);
}

$requestParams = new RequestParamsHeaderDescriptor($requestParamHeaders);
$optionalArgs['headers'] = isset($optionalArgs['headers']) ? array_merge($requestParams->getHeader(), $optionalArgs['headers']) : $requestParams->getHeader();
return $this->getPagedListResponse('ListLocations', $optionalArgs, ListLocationsResponse::class, $request, 'google.cloud.location.Locations');
}
}
5 changes: 5 additions & 0 deletions VpcAccess/src/V1/gapic_metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@
"methods": [
"listConnectors"
]
},
"ListLocations": {
"methods": [
"listLocations"
]
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@
"timeout_millis": 60000,
"retry_codes_name": "no_retry_1_codes",
"retry_params_name": "no_retry_1_params"
},
"ListLocations": {
"timeout_millis": 60000,
"retry_codes_name": "retry_policy_1_codes",
"retry_params_name": "retry_policy_1_params"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@
'resourcesGetMethod' => 'getConnectors',
],
],
'ListLocations' => [
'pageStreaming' => [
'requestPageTokenGetMethod' => 'getPageToken',
'requestPageTokenSetMethod' => 'setPageToken',
'requestPageSizeGetMethod' => 'getPageSize',
'requestPageSizeSetMethod' => 'setPageSize',
'responsePageTokenGetMethod' => 'getNextPageToken',
'resourcesGetMethod' => 'getLocations',
],
],
],
],
];
Loading

0 comments on commit 83e318b

Please sign in to comment.