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