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\VMwareEngine\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\VMwareEngine\Cluster;
|
---|
21 | use Google\Service\VMwareEngine\ListClustersResponse;
|
---|
22 | use Google\Service\VMwareEngine\Operation;
|
---|
23 | use Google\Service\VMwareEngine\Policy;
|
---|
24 | use Google\Service\VMwareEngine\SetIamPolicyRequest;
|
---|
25 | use Google\Service\VMwareEngine\TestIamPermissionsRequest;
|
---|
26 | use Google\Service\VMwareEngine\TestIamPermissionsResponse;
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * The "clusters" collection of methods.
|
---|
30 | * Typical usage is:
|
---|
31 | * <code>
|
---|
32 | * $vmwareengineService = new Google\Service\VMwareEngine(...);
|
---|
33 | * $clusters = $vmwareengineService->projects_locations_privateClouds_clusters;
|
---|
34 | * </code>
|
---|
35 | */
|
---|
36 | class ProjectsLocationsPrivateCloudsClusters extends \Google\Service\Resource
|
---|
37 | {
|
---|
38 | /**
|
---|
39 | * Creates a new cluster in a given private cloud. Creating a new cluster
|
---|
40 | * provides additional nodes for use in the parent private cloud and requires
|
---|
41 | * sufficient [node quota](https://cloud.google.com/vmware-engine/quotas).
|
---|
42 | * (clusters.create)
|
---|
43 | *
|
---|
44 | * @param string $parent Required. The resource name of the private cloud to
|
---|
45 | * create a new cluster in. Resource names are schemeless URIs that follow the
|
---|
46 | * conventions in https://cloud.google.com/apis/design/resource_names. For
|
---|
47 | * example: `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
|
---|
48 | * @param Cluster $postBody
|
---|
49 | * @param array $optParams Optional parameters.
|
---|
50 | *
|
---|
51 | * @opt_param string clusterId Required. The user-provided identifier of the new
|
---|
52 | * `Cluster`. This identifier must be unique among clusters within the parent
|
---|
53 | * and becomes the final token in the name URI. The identifier must meet the
|
---|
54 | * following requirements: * Only contains 1-63 alphanumeric characters and
|
---|
55 | * hyphens * Begins with an alphabetical character * Ends with a non-hyphen
|
---|
56 | * character * Not formatted as a UUID * Complies with [RFC
|
---|
57 | * 1034](https://datatracker.ietf.org/doc/html/rfc1034) (section 3.5)
|
---|
58 | * @opt_param string requestId Optional. The request ID must be a valid UUID
|
---|
59 | * with the exception that zero UUID is not supported
|
---|
60 | * (00000000-0000-0000-0000-000000000000).
|
---|
61 | * @opt_param bool validateOnly Optional. True if you want the request to be
|
---|
62 | * validated and not executed; false otherwise.
|
---|
63 | * @return Operation
|
---|
64 | * @throws \Google\Service\Exception
|
---|
65 | */
|
---|
66 | public function create($parent, Cluster $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 | * Deletes a `Cluster` resource. To avoid unintended data loss, migrate or
|
---|
74 | * gracefully shut down any workloads running on the cluster before deletion.
|
---|
75 | * You cannot delete the management cluster of a private cloud using this
|
---|
76 | * method. (clusters.delete)
|
---|
77 | *
|
---|
78 | * @param string $name Required. The resource name of the cluster to delete.
|
---|
79 | * Resource names are schemeless URIs that follow the conventions in
|
---|
80 | * https://cloud.google.com/apis/design/resource_names. For example:
|
---|
81 | * `projects/my-project/locations/us-central1-a/privateClouds/my-
|
---|
82 | * cloud/clusters/my-cluster`
|
---|
83 | * @param array $optParams Optional parameters.
|
---|
84 | *
|
---|
85 | * @opt_param string requestId Optional. The request ID must be a valid UUID
|
---|
86 | * with the exception that zero UUID is not supported
|
---|
87 | * (00000000-0000-0000-0000-000000000000).
|
---|
88 | * @return Operation
|
---|
89 | * @throws \Google\Service\Exception
|
---|
90 | */
|
---|
91 | public function delete($name, $optParams = [])
|
---|
92 | {
|
---|
93 | $params = ['name' => $name];
|
---|
94 | $params = array_merge($params, $optParams);
|
---|
95 | return $this->call('delete', [$params], Operation::class);
|
---|
96 | }
|
---|
97 | /**
|
---|
98 | * Retrieves a `Cluster` resource by its resource name. (clusters.get)
|
---|
99 | *
|
---|
100 | * @param string $name Required. The cluster resource name to retrieve. Resource
|
---|
101 | * names are schemeless URIs that follow the conventions in
|
---|
102 | * https://cloud.google.com/apis/design/resource_names. For example:
|
---|
103 | * `projects/my-project/locations/us-central1-a/privateClouds/my-
|
---|
104 | * cloud/clusters/my-cluster`
|
---|
105 | * @param array $optParams Optional parameters.
|
---|
106 | * @return Cluster
|
---|
107 | * @throws \Google\Service\Exception
|
---|
108 | */
|
---|
109 | public function get($name, $optParams = [])
|
---|
110 | {
|
---|
111 | $params = ['name' => $name];
|
---|
112 | $params = array_merge($params, $optParams);
|
---|
113 | return $this->call('get', [$params], Cluster::class);
|
---|
114 | }
|
---|
115 | /**
|
---|
116 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
117 | * resource exists and does not have a policy set. (clusters.getIamPolicy)
|
---|
118 | *
|
---|
119 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
120 | * requested. See [Resource
|
---|
121 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
122 | * appropriate value for this field.
|
---|
123 | * @param array $optParams Optional parameters.
|
---|
124 | *
|
---|
125 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
126 | * version that will be used to format the policy. Valid values are 0, 1, and 3.
|
---|
127 | * Requests specifying an invalid value will be rejected. Requests for policies
|
---|
128 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
129 | * conditional role bindings may specify any valid value or leave the field
|
---|
130 | * unset. The policy in the response might use the policy version that you
|
---|
131 | * specified, or it might use a lower policy version. For example, if you
|
---|
132 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
133 | * response uses version 1. To learn which resources support conditions in their
|
---|
134 | * IAM policies, see the [IAM
|
---|
135 | * documentation](https://cloud.google.com/iam/help/conditions/resource-
|
---|
136 | * policies).
|
---|
137 | * @return Policy
|
---|
138 | * @throws \Google\Service\Exception
|
---|
139 | */
|
---|
140 | public function getIamPolicy($resource, $optParams = [])
|
---|
141 | {
|
---|
142 | $params = ['resource' => $resource];
|
---|
143 | $params = array_merge($params, $optParams);
|
---|
144 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
145 | }
|
---|
146 | /**
|
---|
147 | * Lists `Cluster` resources in a given private cloud.
|
---|
148 | * (clusters.listProjectsLocationsPrivateCloudsClusters)
|
---|
149 | *
|
---|
150 | * @param string $parent Required. The resource name of the private cloud to
|
---|
151 | * query for clusters. Resource names are schemeless URIs that follow the
|
---|
152 | * conventions in https://cloud.google.com/apis/design/resource_names. For
|
---|
153 | * example: `projects/my-project/locations/us-central1-a/privateClouds/my-cloud`
|
---|
154 | * @param array $optParams Optional parameters.
|
---|
155 | *
|
---|
156 | * @opt_param string filter To filter on multiple expressions, provide each
|
---|
157 | * separate expression within parentheses. For example: ``` (name = "example-
|
---|
158 | * cluster") (nodeCount = "3") ``` By default, each expression is an `AND`
|
---|
159 | * expression. However, you can include `AND` and `OR` expressions explicitly.
|
---|
160 | * For example: ``` (name = "example-cluster-1") AND (createTime >
|
---|
161 | * "2021-04-12T08:15:10.40Z") OR (name = "example-cluster-2") ```
|
---|
162 | * @opt_param string orderBy Sorts list results by a certain order. By default,
|
---|
163 | * returned results are ordered by `name` in ascending order. You can also sort
|
---|
164 | * results in descending order based on the `name` value using `orderBy="name
|
---|
165 | * desc"`. Currently, only ordering by `name` is supported.
|
---|
166 | * @opt_param int pageSize The maximum number of clusters to return in one page.
|
---|
167 | * The service may return fewer than this value. The maximum value is coerced to
|
---|
168 | * 1000. The default value of this field is 500.
|
---|
169 | * @opt_param string pageToken A page token, received from a previous
|
---|
170 | * `ListClusters` call. Provide this to retrieve the subsequent page. When
|
---|
171 | * paginating, all other parameters provided to `ListClusters` must match the
|
---|
172 | * call that provided the page token.
|
---|
173 | * @return ListClustersResponse
|
---|
174 | * @throws \Google\Service\Exception
|
---|
175 | */
|
---|
176 | public function listProjectsLocationsPrivateCloudsClusters($parent, $optParams = [])
|
---|
177 | {
|
---|
178 | $params = ['parent' => $parent];
|
---|
179 | $params = array_merge($params, $optParams);
|
---|
180 | return $this->call('list', [$params], ListClustersResponse::class);
|
---|
181 | }
|
---|
182 | /**
|
---|
183 | * Modifies a `Cluster` resource. Only fields specified in `updateMask` are
|
---|
184 | * applied. During operation processing, the resource is temporarily in the
|
---|
185 | * `ACTIVE` state before the operation fully completes. For that period of time,
|
---|
186 | * you can't update the resource. Use the operation status to determine when the
|
---|
187 | * processing fully completes. (clusters.patch)
|
---|
188 | *
|
---|
189 | * @param string $name Output only. Identifier. The resource name of this
|
---|
190 | * cluster. Resource names are schemeless URIs that follow the conventions in
|
---|
191 | * https://cloud.google.com/apis/design/resource_names. For example:
|
---|
192 | * `projects/my-project/locations/us-central1-a/privateClouds/my-
|
---|
193 | * cloud/clusters/my-cluster`
|
---|
194 | * @param Cluster $postBody
|
---|
195 | * @param array $optParams Optional parameters.
|
---|
196 | *
|
---|
197 | * @opt_param string requestId Optional. The request ID must be a valid UUID
|
---|
198 | * with the exception that zero UUID is not supported
|
---|
199 | * (00000000-0000-0000-0000-000000000000).
|
---|
200 | * @opt_param string updateMask Required. Field mask is used to specify the
|
---|
201 | * fields to be overwritten in the `Cluster` resource by the update. The fields
|
---|
202 | * specified in the `updateMask` are relative to the resource, not the full
|
---|
203 | * request. A field will be overwritten if it is in the mask. If the user does
|
---|
204 | * not provide a mask then all fields will be overwritten.
|
---|
205 | * @opt_param bool validateOnly Optional. True if you want the request to be
|
---|
206 | * validated and not executed; false otherwise.
|
---|
207 | * @return Operation
|
---|
208 | * @throws \Google\Service\Exception
|
---|
209 | */
|
---|
210 | public function patch($name, Cluster $postBody, $optParams = [])
|
---|
211 | {
|
---|
212 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
213 | $params = array_merge($params, $optParams);
|
---|
214 | return $this->call('patch', [$params], Operation::class);
|
---|
215 | }
|
---|
216 | /**
|
---|
217 | * Sets the access control policy on the specified resource. Replaces any
|
---|
218 | * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
|
---|
219 | * `PERMISSION_DENIED` errors. (clusters.setIamPolicy)
|
---|
220 | *
|
---|
221 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
222 | * specified. See [Resource
|
---|
223 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
224 | * appropriate value for this field.
|
---|
225 | * @param SetIamPolicyRequest $postBody
|
---|
226 | * @param array $optParams Optional parameters.
|
---|
227 | * @return Policy
|
---|
228 | * @throws \Google\Service\Exception
|
---|
229 | */
|
---|
230 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
231 | {
|
---|
232 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
233 | $params = array_merge($params, $optParams);
|
---|
234 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
235 | }
|
---|
236 | /**
|
---|
237 | * Returns permissions that a caller has on the specified resource. If the
|
---|
238 | * resource does not exist, this will return an empty set of permissions, not a
|
---|
239 | * `NOT_FOUND` error. Note: This operation is designed to be used for building
|
---|
240 | * permission-aware UIs and command-line tools, not for authorization checking.
|
---|
241 | * This operation may "fail open" without warning. (clusters.testIamPermissions)
|
---|
242 | *
|
---|
243 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
244 | * being requested. See [Resource
|
---|
245 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
246 | * appropriate value for this field.
|
---|
247 | * @param TestIamPermissionsRequest $postBody
|
---|
248 | * @param array $optParams Optional parameters.
|
---|
249 | * @return TestIamPermissionsResponse
|
---|
250 | * @throws \Google\Service\Exception
|
---|
251 | */
|
---|
252 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
253 | {
|
---|
254 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
255 | $params = array_merge($params, $optParams);
|
---|
256 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
257 | }
|
---|
258 | }
|
---|
259 |
|
---|
260 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
261 | class_alias(ProjectsLocationsPrivateCloudsClusters::class, 'Google_Service_VMwareEngine_Resource_ProjectsLocationsPrivateCloudsClusters');
|
---|