Skip to content

Commit a04ce72

Browse files
feat: [GkeHub] Add GKE Hub teams scope and RBAC GAPIC (#8897)
* feat: Add GKE Hub teams scope and RBAC GAPIC docs: A comment for message `Feature` is changed docs: A comment for field `labels` in message `.google.cloud.gkehub.v1.Feature` is changed docs: A comment for field `spec` in message `.google.cloud.gkehub.v1.Feature` is changed docs: A comment for field `membership_specs` in message `.google.cloud.gkehub.v1.Feature` is changed docs: A comment for field `state` in message `.google.cloud.gkehub.v1.Feature` is changed docs: A comment for field `membership_states` in message `.google.cloud.gkehub.v1.Feature` is changed docs: A comment for message `FeatureResourceState` is changed docs: A comment for enum value `ENABLING` in enum `State` is changed docs: A comment for enum value `ACTIVE` in enum `State` is changed docs: A comment for enum value `DISABLING` in enum `State` is changed docs: A comment for message `CommonFeatureState` is changed docs: A comment for field `state` in message `.google.cloud.gkehub.v1.CommonFeatureState` is changed docs: A comment for field `request_id` in message `.google.cloud.gkehub.v1.CreateFeatureRequest` is changed docs: A comment for field `request_id` in message `.google.cloud.gkehub.v1.UpdateFeatureRequest` is changed docs: A comment for field `cancel_requested` in message `.google.cloud.gkehub.v1.OperationMetadata` is changed PiperOrigin-RevId: 865111649 Source-Link: googleapis/googleapis@7a57066 Source-Link: googleapis/googleapis-gen@12b9e72 Copy-Tag: eyJwIjoiR2tlSHViLy5Pd2xCb3QueWFtbCIsImgiOiIxMmI5ZTcyZGE4YzQwYzhiNGQyZjAzZDc1ZjVkMWNjMTVkYWU1MDI1In0= * 🦉 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 dc1e2dd commit a04ce72

125 files changed

Lines changed: 19324 additions & 341 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.

GkeHub/metadata/V1/Feature.php

769 Bytes
Binary file not shown.

GkeHub/metadata/V1/Fleet.php

6.65 KB
Binary file not shown.

GkeHub/metadata/V1/Rbacrolebindingactuation/Rbacrolebindingactuation.php

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

GkeHub/metadata/V1/Service.php

Lines changed: 226 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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 gkehub_v1_generated_GkeHub_CreateFleet_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\OperationResponse;
28+
use Google\Cloud\GkeHub\V1\Client\GkeHubClient;
29+
use Google\Cloud\GkeHub\V1\CreateFleetRequest;
30+
use Google\Cloud\GkeHub\V1\Fleet;
31+
use Google\Rpc\Status;
32+
33+
/**
34+
* Creates a fleet.
35+
*
36+
* @param string $formattedParent The parent (project and location) where the Fleet will be
37+
* created. Specified in the format `projects/&#42;/locations/*`. Please see
38+
* {@see GkeHubClient::locationName()} for help formatting this field.
39+
*/
40+
function create_fleet_sample(string $formattedParent): void
41+
{
42+
// Create a client.
43+
$gkeHubClient = new GkeHubClient();
44+
45+
// Prepare the request message.
46+
$fleet = new Fleet();
47+
$request = (new CreateFleetRequest())
48+
->setParent($formattedParent)
49+
->setFleet($fleet);
50+
51+
// Call the API and handle any network failures.
52+
try {
53+
/** @var OperationResponse $response */
54+
$response = $gkeHubClient->createFleet($request);
55+
$response->pollUntilComplete();
56+
57+
if ($response->operationSucceeded()) {
58+
/** @var Fleet $result */
59+
$result = $response->getResult();
60+
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
61+
} else {
62+
/** @var Status $error */
63+
$error = $response->getError();
64+
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
65+
}
66+
} catch (ApiException $ex) {
67+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
68+
}
69+
}
70+
71+
/**
72+
* Helper to execute the sample.
73+
*
74+
* This sample has been automatically generated and should be regarded as a code
75+
* template only. It will require modifications to work:
76+
* - It may require correct/in-range values for request initialization.
77+
* - It may require specifying regional endpoints when creating the service client,
78+
* please see the apiEndpoint client configuration option for more details.
79+
*/
80+
function callSample(): void
81+
{
82+
$formattedParent = GkeHubClient::locationName('[PROJECT]', '[LOCATION]');
83+
84+
create_fleet_sample($formattedParent);
85+
}
86+
// [END gkehub_v1_generated_GkeHub_CreateFleet_sync]
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
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 gkehub_v1_generated_GkeHub_CreateMembershipBinding_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\OperationResponse;
28+
use Google\Cloud\GkeHub\V1\Client\GkeHubClient;
29+
use Google\Cloud\GkeHub\V1\CreateMembershipBindingRequest;
30+
use Google\Cloud\GkeHub\V1\MembershipBinding;
31+
use Google\Rpc\Status;
32+
33+
/**
34+
* Creates a MembershipBinding.
35+
*
36+
* @param string $formattedParent The parent (project and location) where the MembershipBinding
37+
* will be created. Specified in the format
38+
* `projects/&#42;/locations/&#42;/memberships/*`. Please see
39+
* {@see GkeHubClient::membershipName()} for help formatting this field.
40+
* @param string $membershipBindingId The ID to use for the MembershipBinding.
41+
*/
42+
function create_membership_binding_sample(
43+
string $formattedParent,
44+
string $membershipBindingId
45+
): void {
46+
// Create a client.
47+
$gkeHubClient = new GkeHubClient();
48+
49+
// Prepare the request message.
50+
$membershipBinding = new MembershipBinding();
51+
$request = (new CreateMembershipBindingRequest())
52+
->setParent($formattedParent)
53+
->setMembershipBinding($membershipBinding)
54+
->setMembershipBindingId($membershipBindingId);
55+
56+
// Call the API and handle any network failures.
57+
try {
58+
/** @var OperationResponse $response */
59+
$response = $gkeHubClient->createMembershipBinding($request);
60+
$response->pollUntilComplete();
61+
62+
if ($response->operationSucceeded()) {
63+
/** @var MembershipBinding $result */
64+
$result = $response->getResult();
65+
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
66+
} else {
67+
/** @var Status $error */
68+
$error = $response->getError();
69+
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
70+
}
71+
} catch (ApiException $ex) {
72+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
73+
}
74+
}
75+
76+
/**
77+
* Helper to execute the sample.
78+
*
79+
* This sample has been automatically generated and should be regarded as a code
80+
* template only. It will require modifications to work:
81+
* - It may require correct/in-range values for request initialization.
82+
* - It may require specifying regional endpoints when creating the service client,
83+
* please see the apiEndpoint client configuration option for more details.
84+
*/
85+
function callSample(): void
86+
{
87+
$formattedParent = GkeHubClient::membershipName('[PROJECT]', '[LOCATION]', '[MEMBERSHIP]');
88+
$membershipBindingId = '[MEMBERSHIP_BINDING_ID]';
89+
90+
create_membership_binding_sample($formattedParent, $membershipBindingId);
91+
}
92+
// [END gkehub_v1_generated_GkeHub_CreateMembershipBinding_sync]
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
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 gkehub_v1_generated_GkeHub_CreateMembershipRBACRoleBinding_sync]
26+
use Google\ApiCore\ApiException;
27+
use Google\ApiCore\OperationResponse;
28+
use Google\Cloud\GkeHub\V1\Client\GkeHubClient;
29+
use Google\Cloud\GkeHub\V1\CreateMembershipRBACRoleBindingRequest;
30+
use Google\Cloud\GkeHub\V1\RBACRoleBinding;
31+
use Google\Cloud\GkeHub\V1\RBACRoleBinding\Role;
32+
use Google\Rpc\Status;
33+
34+
/**
35+
* Creates a Membership RBACRoleBinding.
36+
*
37+
* @param string $formattedParent The parent (project and location) where the RBACRoleBinding will
38+
* be created. Specified in the format `projects/&#42;/locations/&#42;/memberships/*`. Please see
39+
* {@see GkeHubClient::scopeName()} for help formatting this field.
40+
* @param string $rbacrolebindingId Client chosen ID for the RBACRoleBinding. `rbacrolebinding_id`
41+
* must be a valid RFC 1123 compliant DNS label:
42+
*
43+
* 1. At most 63 characters in length
44+
* 2. It must consist of lower case alphanumeric characters or `-`
45+
* 3. It must start and end with an alphanumeric character
46+
*
47+
* Which can be expressed as the regex: `[a-z0-9]([-a-z0-9]*[a-z0-9])?`,
48+
* with a maximum length of 63 characters.
49+
*/
50+
function create_membership_rbac_role_binding_sample(
51+
string $formattedParent,
52+
string $rbacrolebindingId
53+
): void {
54+
// Create a client.
55+
$gkeHubClient = new GkeHubClient();
56+
57+
// Prepare the request message.
58+
$rbacrolebindingRole = new Role();
59+
$rbacrolebinding = (new RBACRoleBinding())
60+
->setRole($rbacrolebindingRole);
61+
$request = (new CreateMembershipRBACRoleBindingRequest())
62+
->setParent($formattedParent)
63+
->setRbacrolebindingId($rbacrolebindingId)
64+
->setRbacrolebinding($rbacrolebinding);
65+
66+
// Call the API and handle any network failures.
67+
try {
68+
/** @var OperationResponse $response */
69+
$response = $gkeHubClient->createMembershipRBACRoleBinding($request);
70+
$response->pollUntilComplete();
71+
72+
if ($response->operationSucceeded()) {
73+
/** @var RBACRoleBinding $result */
74+
$result = $response->getResult();
75+
printf('Operation successful with response data: %s' . PHP_EOL, $result->serializeToJsonString());
76+
} else {
77+
/** @var Status $error */
78+
$error = $response->getError();
79+
printf('Operation failed with error data: %s' . PHP_EOL, $error->serializeToJsonString());
80+
}
81+
} catch (ApiException $ex) {
82+
printf('Call failed with message: %s' . PHP_EOL, $ex->getMessage());
83+
}
84+
}
85+
86+
/**
87+
* Helper to execute the sample.
88+
*
89+
* This sample has been automatically generated and should be regarded as a code
90+
* template only. It will require modifications to work:
91+
* - It may require correct/in-range values for request initialization.
92+
* - It may require specifying regional endpoints when creating the service client,
93+
* please see the apiEndpoint client configuration option for more details.
94+
*/
95+
function callSample(): void
96+
{
97+
$formattedParent = GkeHubClient::scopeName('[PROJECT]', '[LOCATION]', '[SCOPE]');
98+
$rbacrolebindingId = '[RBACROLEBINDING_ID]';
99+
100+
create_membership_rbac_role_binding_sample($formattedParent, $rbacrolebindingId);
101+
}
102+
// [END gkehub_v1_generated_GkeHub_CreateMembershipRBACRoleBinding_sync]

0 commit comments

Comments
 (0)