1 | <?php
|
---|
2 | /*
|
---|
3 | * Copyright 2014 Google Inc.
|
---|
4 | *
|
---|
5 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
---|
6 | * use this file except in compliance with the License. You may obtain a copy of
|
---|
7 | * the License at
|
---|
8 | *
|
---|
9 | * http://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, WITHOUT
|
---|
13 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
---|
14 | * License for the specific language governing permissions and limitations under
|
---|
15 | * the License.
|
---|
16 | */
|
---|
17 |
|
---|
18 | namespace Google\Service\GKEOnPrem\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\GKEOnPrem\BareMetalAdminCluster;
|
---|
21 | use Google\Service\GKEOnPrem\EnrollBareMetalAdminClusterRequest;
|
---|
22 | use Google\Service\GKEOnPrem\ListBareMetalAdminClustersResponse;
|
---|
23 | use Google\Service\GKEOnPrem\Operation;
|
---|
24 | use Google\Service\GKEOnPrem\Policy;
|
---|
25 | use Google\Service\GKEOnPrem\QueryBareMetalAdminVersionConfigResponse;
|
---|
26 | use Google\Service\GKEOnPrem\SetIamPolicyRequest;
|
---|
27 | use Google\Service\GKEOnPrem\TestIamPermissionsRequest;
|
---|
28 | use Google\Service\GKEOnPrem\TestIamPermissionsResponse;
|
---|
29 |
|
---|
30 | /**
|
---|
31 | * The "bareMetalAdminClusters" collection of methods.
|
---|
32 | * Typical usage is:
|
---|
33 | * <code>
|
---|
34 | * $gkeonpremService = new Google\Service\GKEOnPrem(...);
|
---|
35 | * $bareMetalAdminClusters = $gkeonpremService->projects_locations_bareMetalAdminClusters;
|
---|
36 | * </code>
|
---|
37 | */
|
---|
38 | class ProjectsLocationsBareMetalAdminClusters extends \Google\Service\Resource
|
---|
39 | {
|
---|
40 | /**
|
---|
41 | * Creates a new bare metal admin cluster in a given project and location. The
|
---|
42 | * API needs to be combined with creating a bootstrap cluster to work. See:
|
---|
43 | * https://cloud.google.com/anthos/clusters/docs/bare-
|
---|
44 | * metal/latest/installing/creating-clusters/create-admin-cluster-
|
---|
45 | * api#prepare_bootstrap_environment (bareMetalAdminClusters.create)
|
---|
46 | *
|
---|
47 | * @param string $parent Required. The parent of the project and location where
|
---|
48 | * the cluster is created in. Format: "projects/{project}/locations/{location}"
|
---|
49 | * @param BareMetalAdminCluster $postBody
|
---|
50 | * @param array $optParams Optional parameters.
|
---|
51 | *
|
---|
52 | * @opt_param bool allowPreflightFailure Optional. If set to true, CLM will
|
---|
53 | * force CCFE to persist the cluster resource in RMS when the creation fails
|
---|
54 | * during standalone preflight checks. In that case the subsequent create call
|
---|
55 | * will fail with "cluster already exists" error and hence a update cluster is
|
---|
56 | * required to fix the cluster.
|
---|
57 | * @opt_param string bareMetalAdminClusterId Required. User provided identifier
|
---|
58 | * that is used as part of the resource name; must conform to RFC-1034 and
|
---|
59 | * additionally restrict to lower-cased letters. This comes out roughly to:
|
---|
60 | * /^a-z+[a-z0-9]$/
|
---|
61 | * @opt_param bool validateOnly Validate the request without actually doing any
|
---|
62 | * updates.
|
---|
63 | * @return Operation
|
---|
64 | * @throws \Google\Service\Exception
|
---|
65 | */
|
---|
66 | public function create($parent, BareMetalAdminCluster $postBody, $optParams = [])
|
---|
67 | {
|
---|
68 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
69 | $params = array_merge($params, $optParams);
|
---|
70 | return $this->call('create', [$params], Operation::class);
|
---|
71 | }
|
---|
72 | /**
|
---|
73 | * Enrolls an existing bare metal admin cluster to the Anthos On-Prem API within
|
---|
74 | * a given project and location. Through enrollment, an existing admin cluster
|
---|
75 | * will become Anthos On-Prem API managed. The corresponding GCP resources will
|
---|
76 | * be created and all future modifications to the cluster will be expected to be
|
---|
77 | * performed through the API. (bareMetalAdminClusters.enroll)
|
---|
78 | *
|
---|
79 | * @param string $parent Required. The parent of the project and location where
|
---|
80 | * the cluster is enrolled in. Format: "projects/{project}/locations/{location}"
|
---|
81 | * @param EnrollBareMetalAdminClusterRequest $postBody
|
---|
82 | * @param array $optParams Optional parameters.
|
---|
83 | * @return Operation
|
---|
84 | * @throws \Google\Service\Exception
|
---|
85 | */
|
---|
86 | public function enroll($parent, EnrollBareMetalAdminClusterRequest $postBody, $optParams = [])
|
---|
87 | {
|
---|
88 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
89 | $params = array_merge($params, $optParams);
|
---|
90 | return $this->call('enroll', [$params], Operation::class);
|
---|
91 | }
|
---|
92 | /**
|
---|
93 | * Gets details of a single bare metal admin cluster.
|
---|
94 | * (bareMetalAdminClusters.get)
|
---|
95 | *
|
---|
96 | * @param string $name Required. Name of the bare metal admin cluster to get.
|
---|
97 | * Format: "projects/{project}/locations/{location}/bareMetalAdminClusters/{bare
|
---|
98 | * _metal_admin_cluster}"
|
---|
99 | * @param array $optParams Optional parameters.
|
---|
100 | *
|
---|
101 | * @opt_param bool allowMissing Optional. If true, return BareMetal Admin
|
---|
102 | * Cluster including the one that only exists in RMS.
|
---|
103 | * @opt_param string view View for bare metal admin cluster. When `BASIC` is
|
---|
104 | * specified, only the cluster resource name and membership are returned. The
|
---|
105 | * default/unset value `CLUSTER_VIEW_UNSPECIFIED` is the same as `FULL', which
|
---|
106 | * returns the complete cluster configuration details.
|
---|
107 | * @return BareMetalAdminCluster
|
---|
108 | * @throws \Google\Service\Exception
|
---|
109 | */
|
---|
110 | public function get($name, $optParams = [])
|
---|
111 | {
|
---|
112 | $params = ['name' => $name];
|
---|
113 | $params = array_merge($params, $optParams);
|
---|
114 | return $this->call('get', [$params], BareMetalAdminCluster::class);
|
---|
115 | }
|
---|
116 | /**
|
---|
117 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
118 | * resource exists and does not have a policy set.
|
---|
119 | * (bareMetalAdminClusters.getIamPolicy)
|
---|
120 | *
|
---|
121 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
122 | * requested. See [Resource
|
---|
123 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
124 | * appropriate value for this field.
|
---|
125 | * @param array $optParams Optional parameters.
|
---|
126 | *
|
---|
127 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
128 | * version that will be used to format the policy. Valid values are 0, 1, and 3.
|
---|
129 | * Requests specifying an invalid value will be rejected. Requests for policies
|
---|
130 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
131 | * conditional role bindings may specify any valid value or leave the field
|
---|
132 | * unset. The policy in the response might use the policy version that you
|
---|
133 | * specified, or it might use a lower policy version. For example, if you
|
---|
134 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
135 | * response uses version 1. To learn which resources support conditions in their
|
---|
136 | * IAM policies, see the [IAM
|
---|
137 | * documentation](https://cloud.google.com/iam/help/conditions/resource-
|
---|
138 | * policies).
|
---|
139 | * @return Policy
|
---|
140 | * @throws \Google\Service\Exception
|
---|
141 | */
|
---|
142 | public function getIamPolicy($resource, $optParams = [])
|
---|
143 | {
|
---|
144 | $params = ['resource' => $resource];
|
---|
145 | $params = array_merge($params, $optParams);
|
---|
146 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
147 | }
|
---|
148 | /**
|
---|
149 | * Lists bare metal admin clusters in a given project and location.
|
---|
150 | * (bareMetalAdminClusters.listProjectsLocationsBareMetalAdminClusters)
|
---|
151 | *
|
---|
152 | * @param string $parent Required. The parent of the project and location where
|
---|
153 | * the clusters are listed in. Format: "projects/{project}/locations/{location}"
|
---|
154 | * @param array $optParams Optional parameters.
|
---|
155 | *
|
---|
156 | * @opt_param bool allowMissing Optional. If true, return list of BareMetal
|
---|
157 | * Admin Clusters including the ones that only exists in RMS.
|
---|
158 | * @opt_param int pageSize Requested page size. Server may return fewer items
|
---|
159 | * than requested. If unspecified, at most 50 clusters will be returned. The
|
---|
160 | * maximum value is 1000; values above 1000 will be coerced to 1000.
|
---|
161 | * @opt_param string pageToken A token identifying a page of results the server
|
---|
162 | * should return.
|
---|
163 | * @opt_param string view View for bare metal admin clusters. When `BASIC` is
|
---|
164 | * specified, only the admin cluster resource name and membership are returned.
|
---|
165 | * The default/unset value `CLUSTER_VIEW_UNSPECIFIED` is the same as `FULL',
|
---|
166 | * which returns the complete admin cluster configuration details.
|
---|
167 | * @return ListBareMetalAdminClustersResponse
|
---|
168 | * @throws \Google\Service\Exception
|
---|
169 | */
|
---|
170 | public function listProjectsLocationsBareMetalAdminClusters($parent, $optParams = [])
|
---|
171 | {
|
---|
172 | $params = ['parent' => $parent];
|
---|
173 | $params = array_merge($params, $optParams);
|
---|
174 | return $this->call('list', [$params], ListBareMetalAdminClustersResponse::class);
|
---|
175 | }
|
---|
176 | /**
|
---|
177 | * Updates the parameters of a single bare metal admin cluster.
|
---|
178 | * (bareMetalAdminClusters.patch)
|
---|
179 | *
|
---|
180 | * @param string $name Immutable. The bare metal admin cluster resource name.
|
---|
181 | * @param BareMetalAdminCluster $postBody
|
---|
182 | * @param array $optParams Optional parameters.
|
---|
183 | *
|
---|
184 | * @opt_param string updateMask Required. Field mask is used to specify the
|
---|
185 | * fields to be overwritten in the BareMetalAdminCluster resource by the update.
|
---|
186 | * The fields specified in the update_mask are relative to the resource, not the
|
---|
187 | * full request. A field will be overwritten if it is in the mask. If the user
|
---|
188 | * does not provide a mask then all populated fields in the
|
---|
189 | * BareMetalAdminCluster message will be updated. Empty fields will be ignored
|
---|
190 | * unless a field mask is used.
|
---|
191 | * @opt_param bool validateOnly Validate the request without actually doing any
|
---|
192 | * updates.
|
---|
193 | * @return Operation
|
---|
194 | * @throws \Google\Service\Exception
|
---|
195 | */
|
---|
196 | public function patch($name, BareMetalAdminCluster $postBody, $optParams = [])
|
---|
197 | {
|
---|
198 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
199 | $params = array_merge($params, $optParams);
|
---|
200 | return $this->call('patch', [$params], Operation::class);
|
---|
201 | }
|
---|
202 | /**
|
---|
203 | * Queries the bare metal admin cluster version config.
|
---|
204 | * (bareMetalAdminClusters.queryVersionConfig)
|
---|
205 | *
|
---|
206 | * @param string $parent Required. The parent of the project and location to
|
---|
207 | * query for version config. Format: "projects/{project}/locations/{location}"
|
---|
208 | * @param array $optParams Optional parameters.
|
---|
209 | *
|
---|
210 | * @opt_param string upgradeConfig.clusterName The admin cluster resource name.
|
---|
211 | * This is the full resource name of the admin cluster resource. Format: "projec
|
---|
212 | * ts/{project}/locations/{location}/bareMetalAdminClusters/{bare_metal_admin_cl
|
---|
213 | * uster}"
|
---|
214 | * @return QueryBareMetalAdminVersionConfigResponse
|
---|
215 | * @throws \Google\Service\Exception
|
---|
216 | */
|
---|
217 | public function queryVersionConfig($parent, $optParams = [])
|
---|
218 | {
|
---|
219 | $params = ['parent' => $parent];
|
---|
220 | $params = array_merge($params, $optParams);
|
---|
221 | return $this->call('queryVersionConfig', [$params], QueryBareMetalAdminVersionConfigResponse::class);
|
---|
222 | }
|
---|
223 | /**
|
---|
224 | * Sets the access control policy on the specified resource. Replaces any
|
---|
225 | * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
|
---|
226 | * `PERMISSION_DENIED` errors. (bareMetalAdminClusters.setIamPolicy)
|
---|
227 | *
|
---|
228 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
229 | * specified. See [Resource
|
---|
230 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
231 | * appropriate value for this field.
|
---|
232 | * @param SetIamPolicyRequest $postBody
|
---|
233 | * @param array $optParams Optional parameters.
|
---|
234 | * @return Policy
|
---|
235 | * @throws \Google\Service\Exception
|
---|
236 | */
|
---|
237 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
238 | {
|
---|
239 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
240 | $params = array_merge($params, $optParams);
|
---|
241 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
242 | }
|
---|
243 | /**
|
---|
244 | * Returns permissions that a caller has on the specified resource. If the
|
---|
245 | * resource does not exist, this will return an empty set of permissions, not a
|
---|
246 | * `NOT_FOUND` error. Note: This operation is designed to be used for building
|
---|
247 | * permission-aware UIs and command-line tools, not for authorization checking.
|
---|
248 | * This operation may "fail open" without warning.
|
---|
249 | * (bareMetalAdminClusters.testIamPermissions)
|
---|
250 | *
|
---|
251 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
252 | * being requested. See [Resource
|
---|
253 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
254 | * appropriate value for this field.
|
---|
255 | * @param TestIamPermissionsRequest $postBody
|
---|
256 | * @param array $optParams Optional parameters.
|
---|
257 | * @return TestIamPermissionsResponse
|
---|
258 | * @throws \Google\Service\Exception
|
---|
259 | */
|
---|
260 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
261 | {
|
---|
262 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
263 | $params = array_merge($params, $optParams);
|
---|
264 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
265 | }
|
---|
266 | /**
|
---|
267 | * Unenrolls an existing bare metal admin cluster from the Anthos On-Prem API
|
---|
268 | * within a given project and location. Unenrollment removes the Cloud reference
|
---|
269 | * to the cluster without modifying the underlying OnPrem Resources. Clusters
|
---|
270 | * will continue to run; however, they will no longer be accessible through the
|
---|
271 | * Anthos On-Prem API or its clients. (bareMetalAdminClusters.unenroll)
|
---|
272 | *
|
---|
273 | * @param string $name Required. Name of the bare metal admin cluster to be
|
---|
274 | * unenrolled. Format:
|
---|
275 | * "projects/{project}/locations/{location}/bareMetalAdminClusters/{cluster}"
|
---|
276 | * @param array $optParams Optional parameters.
|
---|
277 | *
|
---|
278 | * @opt_param bool allowMissing If set to true, and the bare metal admin cluster
|
---|
279 | * is not found, the request will succeed but no action will be taken on the
|
---|
280 | * server and return a completed LRO.
|
---|
281 | * @opt_param string etag The current etag of the bare metal admin cluster. If
|
---|
282 | * an etag is provided and does not match the current etag of the cluster,
|
---|
283 | * deletion will be blocked and an ABORTED error will be returned.
|
---|
284 | * @opt_param bool ignoreErrors If set to true, the unenrollment of a bare metal
|
---|
285 | * admin cluster resource will succeed even if errors occur during unenrollment.
|
---|
286 | * This parameter can be used when you want to unenroll admin cluster resource
|
---|
287 | * and the on-prem admin cluster is disconnected / unreachable. WARNING: Using
|
---|
288 | * this parameter when your admin cluster still exists may result in a deleted
|
---|
289 | * GCP admin cluster but existing resourcelink in on-prem admin cluster and
|
---|
290 | * membership.
|
---|
291 | * @opt_param bool validateOnly Validate the request without actually doing any
|
---|
292 | * updates.
|
---|
293 | * @return Operation
|
---|
294 | * @throws \Google\Service\Exception
|
---|
295 | */
|
---|
296 | public function unenroll($name, $optParams = [])
|
---|
297 | {
|
---|
298 | $params = ['name' => $name];
|
---|
299 | $params = array_merge($params, $optParams);
|
---|
300 | return $this->call('unenroll', [$params], Operation::class);
|
---|
301 | }
|
---|
302 | }
|
---|
303 |
|
---|
304 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
305 | class_alias(ProjectsLocationsBareMetalAdminClusters::class, 'Google_Service_GKEOnPrem_Resource_ProjectsLocationsBareMetalAdminClusters');
|
---|