[e3d4e0a] | 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\EnrollVmwareAdminClusterRequest;
|
---|
| 21 | use Google\Service\GKEOnPrem\ListVmwareAdminClustersResponse;
|
---|
| 22 | use Google\Service\GKEOnPrem\Operation;
|
---|
| 23 | use Google\Service\GKEOnPrem\Policy;
|
---|
| 24 | use Google\Service\GKEOnPrem\SetIamPolicyRequest;
|
---|
| 25 | use Google\Service\GKEOnPrem\TestIamPermissionsRequest;
|
---|
| 26 | use Google\Service\GKEOnPrem\TestIamPermissionsResponse;
|
---|
| 27 | use Google\Service\GKEOnPrem\VmwareAdminCluster;
|
---|
| 28 |
|
---|
| 29 | /**
|
---|
| 30 | * The "vmwareAdminClusters" collection of methods.
|
---|
| 31 | * Typical usage is:
|
---|
| 32 | * <code>
|
---|
| 33 | * $gkeonpremService = new Google\Service\GKEOnPrem(...);
|
---|
| 34 | * $vmwareAdminClusters = $gkeonpremService->projects_locations_vmwareAdminClusters;
|
---|
| 35 | * </code>
|
---|
| 36 | */
|
---|
| 37 | class ProjectsLocationsVmwareAdminClusters extends \Google\Service\Resource
|
---|
| 38 | {
|
---|
| 39 | /**
|
---|
| 40 | * Creates a new VMware admin cluster in a given project and location. The API
|
---|
| 41 | * needs to be combined with creating a bootstrap cluster to work.
|
---|
| 42 | * (vmwareAdminClusters.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 VmwareAdminCluster $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 vmwareAdminClusterId Required. User provided identifier
|
---|
| 57 | * that is used as part of the resource name; must conform to RFC-1034 and
|
---|
| 58 | * additionally restrict to lower-cased letters. This comes out roughly to:
|
---|
| 59 | * /^a-z+[a-z0-9]$/
|
---|
| 60 | * @return Operation
|
---|
| 61 | * @throws \Google\Service\Exception
|
---|
| 62 | */
|
---|
| 63 | public function create($parent, VmwareAdminCluster $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 | * Enrolls an existing VMware admin cluster to the Anthos On-Prem API within a
|
---|
| 71 | * given project and location. Through enrollment, an existing admin cluster
|
---|
| 72 | * will become Anthos On-Prem API managed. The corresponding GCP resources will
|
---|
| 73 | * be created and all future modifications to the cluster will be expected to be
|
---|
| 74 | * performed through the API. (vmwareAdminClusters.enroll)
|
---|
| 75 | *
|
---|
| 76 | * @param string $parent Required. The parent of the project and location where
|
---|
| 77 | * the cluster is enrolled in. Format: "projects/{project}/locations/{location}"
|
---|
| 78 | * @param EnrollVmwareAdminClusterRequest $postBody
|
---|
| 79 | * @param array $optParams Optional parameters.
|
---|
| 80 | * @return Operation
|
---|
| 81 | * @throws \Google\Service\Exception
|
---|
| 82 | */
|
---|
| 83 | public function enroll($parent, EnrollVmwareAdminClusterRequest $postBody, $optParams = [])
|
---|
| 84 | {
|
---|
| 85 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 86 | $params = array_merge($params, $optParams);
|
---|
| 87 | return $this->call('enroll', [$params], Operation::class);
|
---|
| 88 | }
|
---|
| 89 | /**
|
---|
| 90 | * Gets details of a single VMware admin cluster. (vmwareAdminClusters.get)
|
---|
| 91 | *
|
---|
| 92 | * @param string $name Required. Name of the VMware admin cluster to be
|
---|
| 93 | * returned. Format: "projects/{project}/locations/{location}/vmwareAdminCluster
|
---|
| 94 | * s/{vmware_admin_cluster}"
|
---|
| 95 | * @param array $optParams Optional parameters.
|
---|
| 96 | *
|
---|
| 97 | * @opt_param bool allowMissing Optional. If true, return Vmware Admin Cluster
|
---|
| 98 | * including the one that only exists in RMS.
|
---|
| 99 | * @opt_param string view View for VMware admin cluster. When `BASIC` is
|
---|
| 100 | * specified, only the cluster resource name and membership are returned. The
|
---|
| 101 | * default/unset value `CLUSTER_VIEW_UNSPECIFIED` is the same as `FULL', which
|
---|
| 102 | * returns the complete cluster configuration details.
|
---|
| 103 | * @return VmwareAdminCluster
|
---|
| 104 | * @throws \Google\Service\Exception
|
---|
| 105 | */
|
---|
| 106 | public function get($name, $optParams = [])
|
---|
| 107 | {
|
---|
| 108 | $params = ['name' => $name];
|
---|
| 109 | $params = array_merge($params, $optParams);
|
---|
| 110 | return $this->call('get', [$params], VmwareAdminCluster::class);
|
---|
| 111 | }
|
---|
| 112 | /**
|
---|
| 113 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
| 114 | * resource exists and does not have a policy set.
|
---|
| 115 | * (vmwareAdminClusters.getIamPolicy)
|
---|
| 116 | *
|
---|
| 117 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
| 118 | * requested. See [Resource
|
---|
| 119 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 120 | * appropriate value for this field.
|
---|
| 121 | * @param array $optParams Optional parameters.
|
---|
| 122 | *
|
---|
| 123 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
| 124 | * version that will be used to format the policy. Valid values are 0, 1, and 3.
|
---|
| 125 | * Requests specifying an invalid value will be rejected. Requests for policies
|
---|
| 126 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
| 127 | * conditional role bindings may specify any valid value or leave the field
|
---|
| 128 | * unset. The policy in the response might use the policy version that you
|
---|
| 129 | * specified, or it might use a lower policy version. For example, if you
|
---|
| 130 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
| 131 | * response uses version 1. To learn which resources support conditions in their
|
---|
| 132 | * IAM policies, see the [IAM
|
---|
| 133 | * documentation](https://cloud.google.com/iam/help/conditions/resource-
|
---|
| 134 | * policies).
|
---|
| 135 | * @return Policy
|
---|
| 136 | * @throws \Google\Service\Exception
|
---|
| 137 | */
|
---|
| 138 | public function getIamPolicy($resource, $optParams = [])
|
---|
| 139 | {
|
---|
| 140 | $params = ['resource' => $resource];
|
---|
| 141 | $params = array_merge($params, $optParams);
|
---|
| 142 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
| 143 | }
|
---|
| 144 | /**
|
---|
| 145 | * Lists VMware admin clusters in a given project and location.
|
---|
| 146 | * (vmwareAdminClusters.listProjectsLocationsVmwareAdminClusters)
|
---|
| 147 | *
|
---|
| 148 | * @param string $parent Required. The parent of the project and location where
|
---|
| 149 | * the clusters are listed in. Format: "projects/{project}/locations/{location}"
|
---|
| 150 | * @param array $optParams Optional parameters.
|
---|
| 151 | *
|
---|
| 152 | * @opt_param bool allowMissing Optional. If true, return list of Vmware Admin
|
---|
| 153 | * Clusters including the ones that only exists in RMS.
|
---|
| 154 | * @opt_param int pageSize Requested page size. Server may return fewer items
|
---|
| 155 | * than requested. If unspecified, at most 50 clusters will be returned. The
|
---|
| 156 | * maximum value is 1000; values above 1000 will be coerced to 1000.
|
---|
| 157 | * @opt_param string pageToken A token identifying a page of results the server
|
---|
| 158 | * should return.
|
---|
| 159 | * @opt_param string view View for VMware admin clusters. When `BASIC` is
|
---|
| 160 | * specified, only the admin cluster resource name and membership are returned.
|
---|
| 161 | * The default/unset value `CLUSTER_VIEW_UNSPECIFIED` is the same as `FULL',
|
---|
| 162 | * which returns the complete admin cluster configuration details.
|
---|
| 163 | * @return ListVmwareAdminClustersResponse
|
---|
| 164 | * @throws \Google\Service\Exception
|
---|
| 165 | */
|
---|
| 166 | public function listProjectsLocationsVmwareAdminClusters($parent, $optParams = [])
|
---|
| 167 | {
|
---|
| 168 | $params = ['parent' => $parent];
|
---|
| 169 | $params = array_merge($params, $optParams);
|
---|
| 170 | return $this->call('list', [$params], ListVmwareAdminClustersResponse::class);
|
---|
| 171 | }
|
---|
| 172 | /**
|
---|
| 173 | * Updates the parameters of a single VMware admin cluster.
|
---|
| 174 | * (vmwareAdminClusters.patch)
|
---|
| 175 | *
|
---|
| 176 | * @param string $name Immutable. The VMware admin cluster resource name.
|
---|
| 177 | * @param VmwareAdminCluster $postBody
|
---|
| 178 | * @param array $optParams Optional parameters.
|
---|
| 179 | *
|
---|
| 180 | * @opt_param string updateMask Required. Field mask is used to specify the
|
---|
| 181 | * fields to be overwritten in the VMwareAdminCluster resource by the update.
|
---|
| 182 | * The fields specified in the update_mask are relative to the resource, not the
|
---|
| 183 | * full request. A field will be overwritten if it is in the mask. If the user
|
---|
| 184 | * does not provide a mask then all populated fields in the VmwareAdminCluster
|
---|
| 185 | * message will be updated. Empty fields will be ignored unless a field mask is
|
---|
| 186 | * used.
|
---|
| 187 | * @opt_param bool validateOnly Validate the request without actually doing any
|
---|
| 188 | * updates.
|
---|
| 189 | * @return Operation
|
---|
| 190 | * @throws \Google\Service\Exception
|
---|
| 191 | */
|
---|
| 192 | public function patch($name, VmwareAdminCluster $postBody, $optParams = [])
|
---|
| 193 | {
|
---|
| 194 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 195 | $params = array_merge($params, $optParams);
|
---|
| 196 | return $this->call('patch', [$params], Operation::class);
|
---|
| 197 | }
|
---|
| 198 | /**
|
---|
| 199 | * Sets the access control policy on the specified resource. Replaces any
|
---|
| 200 | * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
|
---|
| 201 | * `PERMISSION_DENIED` errors. (vmwareAdminClusters.setIamPolicy)
|
---|
| 202 | *
|
---|
| 203 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
| 204 | * specified. See [Resource
|
---|
| 205 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 206 | * appropriate value for this field.
|
---|
| 207 | * @param SetIamPolicyRequest $postBody
|
---|
| 208 | * @param array $optParams Optional parameters.
|
---|
| 209 | * @return Policy
|
---|
| 210 | * @throws \Google\Service\Exception
|
---|
| 211 | */
|
---|
| 212 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
| 213 | {
|
---|
| 214 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 215 | $params = array_merge($params, $optParams);
|
---|
| 216 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
| 217 | }
|
---|
| 218 | /**
|
---|
| 219 | * Returns permissions that a caller has on the specified resource. If the
|
---|
| 220 | * resource does not exist, this will return an empty set of permissions, not a
|
---|
| 221 | * `NOT_FOUND` error. Note: This operation is designed to be used for building
|
---|
| 222 | * permission-aware UIs and command-line tools, not for authorization checking.
|
---|
| 223 | * This operation may "fail open" without warning.
|
---|
| 224 | * (vmwareAdminClusters.testIamPermissions)
|
---|
| 225 | *
|
---|
| 226 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
| 227 | * being requested. See [Resource
|
---|
| 228 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 229 | * appropriate value for this field.
|
---|
| 230 | * @param TestIamPermissionsRequest $postBody
|
---|
| 231 | * @param array $optParams Optional parameters.
|
---|
| 232 | * @return TestIamPermissionsResponse
|
---|
| 233 | * @throws \Google\Service\Exception
|
---|
| 234 | */
|
---|
| 235 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
| 236 | {
|
---|
| 237 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 238 | $params = array_merge($params, $optParams);
|
---|
| 239 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
| 240 | }
|
---|
| 241 | /**
|
---|
| 242 | * Unenrolls an existing VMware admin cluster from the Anthos On-Prem API within
|
---|
| 243 | * a given project and location. Unenrollment removes the Cloud reference to the
|
---|
| 244 | * cluster without modifying the underlying OnPrem Resources. Clusters will
|
---|
| 245 | * continue to run; however, they will no longer be accessible through the
|
---|
| 246 | * Anthos On-Prem API or its clients. (vmwareAdminClusters.unenroll)
|
---|
| 247 | *
|
---|
| 248 | * @param string $name Required. Name of the VMware admin cluster to be
|
---|
| 249 | * unenrolled. Format:
|
---|
| 250 | * "projects/{project}/locations/{location}/vmwareAdminClusters/{cluster}"
|
---|
| 251 | * @param array $optParams Optional parameters.
|
---|
| 252 | *
|
---|
| 253 | * @opt_param bool allowMissing If set to true, and the VMware admin cluster is
|
---|
| 254 | * not found, the request will succeed but no action will be taken on the server
|
---|
| 255 | * and return a completed LRO.
|
---|
| 256 | * @opt_param string etag The current etag of the VMware admin cluster. If an
|
---|
| 257 | * etag is provided and does not match the current etag of the cluster, deletion
|
---|
| 258 | * will be blocked and an ABORTED error will be returned.
|
---|
| 259 | * @opt_param bool validateOnly Validate the request without actually doing any
|
---|
| 260 | * updates.
|
---|
| 261 | * @return Operation
|
---|
| 262 | * @throws \Google\Service\Exception
|
---|
| 263 | */
|
---|
| 264 | public function unenroll($name, $optParams = [])
|
---|
| 265 | {
|
---|
| 266 | $params = ['name' => $name];
|
---|
| 267 | $params = array_merge($params, $optParams);
|
---|
| 268 | return $this->call('unenroll', [$params], Operation::class);
|
---|
| 269 | }
|
---|
| 270 | }
|
---|
| 271 |
|
---|
| 272 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 273 | class_alias(ProjectsLocationsVmwareAdminClusters::class, 'Google_Service_GKEOnPrem_Resource_ProjectsLocationsVmwareAdminClusters');
|
---|