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