Skip to content

Commit 89de3fc

Browse files
feat: [ApiHub] Introduce new services for data collection (ApiHubCollect) and curation (ApiHubCurate) (#8583)
* feat: Introduce new services for data collection (ApiHubCollect) and curation (ApiHubCurate) feat: Add full lifecycle management for API Operations within API Versions (Create, Update, Delete) feat: Significantly expand Plugin and Plugin Instance management capabilities, including creation, execution, and lifecycle control feat: Enable Deletion of ApiHub Instances via the Provisioning service feat: Enhance list filtering options across various resources (APIs, Versions, Specs, Operations, Deployments) with support for user-defined attributes feat: Add new fields and enums to resources to support richer metadata, including source tracking (SourceMetadata), plugin configurations (AuthConfig, ConfigVariable), new attributes, and additional deployment details feat: Make CMEK configuration optional for ApiHub Instances, defaulting to GMEK docs: Update field descriptions, comments, and links in existing services PiperOrigin-RevId: 805646287 Source-Link: googleapis/googleapis@6b78856 Source-Link: googleapis/googleapis-gen@c6df0ec Copy-Tag: eyJwIjoiQXBpSHViLy5Pd2xCb3QueWFtbCIsImgiOiJjNmRmMGVjZmRiYTI3MTBmOTdmOGUwNzhlYzgwOTNlZmEwZDU5ZDE4In0= * 🦉 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 db87072 commit 89de3fc

205 files changed

Lines changed: 25923 additions & 250 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.
1.06 KB
Binary file not shown.
3.4 KB
Binary file not shown.
7.86 KB
Binary file not shown.
4.18 KB
Binary file not shown.

ApiHub/metadata/V1/DiscoveryService.php

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

ApiHub/metadata/V1/ProvisioningService.php

Lines changed: 11 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<?php
2+
/*
3+
* Copyright 2025 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 apihub_v1_generated_ApiHub_CreateApiOperation_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\ApiHub\V1\ApiOperation;
28+
use Google\Cloud\ApiHub\V1\Client\ApiHubClient;
29+
use Google\Cloud\ApiHub\V1\CreateApiOperationRequest;
30+
31+
/**
32+
* Create an apiOperation in an API version.
33+
* An apiOperation can be created only if the version has no apiOperations
34+
* which were created by parsing a spec.
35+
*
36+
* @param string $formattedParent The parent resource for the operation resource.
37+
* Format:
38+
* `projects/{project}/locations/{location}/apis/{api}/versions/{version}`
39+
* Please see {@see ApiHubClient::versionName()} for help formatting this field.
40+
*/
41+
function create_api_operation_sample(string $formattedParent): void
42+
{
43+
// Create a client.
44+
$apiHubClient = new ApiHubClient();
45+
46+
// Prepare the request message.
47+
$apiOperation = new ApiOperation();
48+
$request = (new CreateApiOperationRequest())
49+
->setParent($formattedParent)
50+
->setApiOperation($apiOperation);
51+
52+
// Call the API and handle any network failures.
53+
try {
54+
/** @var ApiOperation $response */
55+
$response = $apiHubClient->createApiOperation($request);
56+
printf('Response data: %s' . PHP_EOL, $response->serializeToJsonString());
57+
} catch (ApiException $ex) {
58+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
59+
}
60+
}
61+
62+
/**
63+
* Helper to execute the sample.
64+
*
65+
* This sample has been automatically generated and should be regarded as a code
66+
* template only. It will require modifications to work:
67+
* - It may require correct/in-range values for request initialization.
68+
* - It may require specifying regional endpoints when creating the service client,
69+
* please see the apiEndpoint client configuration option for more details.
70+
*/
71+
function callSample(): void
72+
{
73+
$formattedParent = ApiHubClient::versionName('[PROJECT]', '[LOCATION]', '[API]', '[VERSION]');
74+
75+
create_api_operation_sample($formattedParent);
76+
}
77+
// [END apihub_v1_generated_ApiHub_CreateApiOperation_sync]

ApiHub/samples/V1/ApiHubClient/create_deployment.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,12 @@
3838
* Format: `projects/{project}/locations/{location}`
3939
* Please see {@see ApiHubClient::locationName()} for help formatting this field.
4040
* @param string $deploymentDisplayName The display name of the deployment.
41-
* @param string $deploymentResourceUri A URI to the runtime resource. This URI can be used to manage the
42-
* resource. For example, if the runtime resource is of type APIGEE_PROXY,
43-
* then this field will contain the URI to the management UI of the proxy.
41+
* @param string $deploymentResourceUri The resource URI identifies the deployment within its gateway.
42+
* For Apigee gateways, its recommended to use the format:
43+
* organizations/{org}/environments/{env}/apis/{api}.
44+
* For ex: if a proxy with name `orders` is deployed in `staging`
45+
* environment of `cymbal` organization, the resource URI would be:
46+
* `organizations/cymbal/environments/staging/apis/orders`.
4447
* @param string $deploymentEndpointsElement The endpoints at which this deployment resource is listening for
4548
* API requests. This could be a list of complete URIs, hostnames or an IP
4649
* addresses.
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<?php
2+
/*
3+
* Copyright 2025 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 apihub_v1_generated_ApiHub_DeleteApiOperation_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\Cloud\ApiHub\V1\Client\ApiHubClient;
28+
use Google\Cloud\ApiHub\V1\DeleteApiOperationRequest;
29+
30+
/**
31+
* Delete an operation in an API version and we can delete only the
32+
* operations created via create API. If the operation was created by parsing
33+
* the spec, then it can be deleted by editing or deleting the spec.
34+
*
35+
* @param string $formattedName The name of the operation resource to delete.
36+
* Format:
37+
* `projects/{project}/locations/{location}/apis/{api}/versions/{version}/operations/{operation}`
38+
* Please see {@see ApiHubClient::apiOperationName()} for help formatting this field.
39+
*/
40+
function delete_api_operation_sample(string $formattedName): void
41+
{
42+
// Create a client.
43+
$apiHubClient = new ApiHubClient();
44+
45+
// Prepare the request message.
46+
$request = (new DeleteApiOperationRequest())
47+
->setName($formattedName);
48+
49+
// Call the API and handle any network failures.
50+
try {
51+
$apiHubClient->deleteApiOperation($request);
52+
printf('Call completed successfully.' . PHP_EOL);
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 = ApiHubClient::apiOperationName(
70+
'[PROJECT]',
71+
'[LOCATION]',
72+
'[API]',
73+
'[VERSION]',
74+
'[OPERATION]'
75+
);
76+
77+
delete_api_operation_sample($formattedName);
78+
}
79+
// [END apihub_v1_generated_ApiHub_DeleteApiOperation_sync]

0 commit comments

Comments
 (0)