[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\BareMetalNodePool;
|
---|
| 21 | use Google\Service\GKEOnPrem\EnrollBareMetalNodePoolRequest;
|
---|
| 22 | use Google\Service\GKEOnPrem\ListBareMetalNodePoolsResponse;
|
---|
| 23 | use Google\Service\GKEOnPrem\Operation;
|
---|
| 24 | use Google\Service\GKEOnPrem\Policy;
|
---|
| 25 | use Google\Service\GKEOnPrem\SetIamPolicyRequest;
|
---|
| 26 | use Google\Service\GKEOnPrem\TestIamPermissionsRequest;
|
---|
| 27 | use Google\Service\GKEOnPrem\TestIamPermissionsResponse;
|
---|
| 28 |
|
---|
| 29 | /**
|
---|
| 30 | * The "bareMetalNodePools" collection of methods.
|
---|
| 31 | * Typical usage is:
|
---|
| 32 | * <code>
|
---|
| 33 | * $gkeonpremService = new Google\Service\GKEOnPrem(...);
|
---|
| 34 | * $bareMetalNodePools = $gkeonpremService->projects_locations_bareMetalClusters_bareMetalNodePools;
|
---|
| 35 | * </code>
|
---|
| 36 | */
|
---|
| 37 | class ProjectsLocationsBareMetalClustersBareMetalNodePools extends \Google\Service\Resource
|
---|
| 38 | {
|
---|
| 39 | /**
|
---|
| 40 | * Creates a new bare metal node pool in a given project, location and Bare
|
---|
| 41 | * Metal cluster. (bareMetalNodePools.create)
|
---|
| 42 | *
|
---|
| 43 | * @param string $parent Required. The parent resource where this node pool will
|
---|
| 44 | * be created.
|
---|
| 45 | * projects/{project}/locations/{location}/bareMetalClusters/{cluster}
|
---|
| 46 | * @param BareMetalNodePool $postBody
|
---|
| 47 | * @param array $optParams Optional parameters.
|
---|
| 48 | *
|
---|
| 49 | * @opt_param string bareMetalNodePoolId The ID to use for the node pool, which
|
---|
| 50 | * will become the final component of the node pool's resource name. This value
|
---|
| 51 | * must be up to 63 characters, and valid characters are /a-z-/. The value must
|
---|
| 52 | * not be permitted to be a UUID (or UUID-like: anything matching
|
---|
| 53 | * /^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$/i).
|
---|
| 54 | * @opt_param bool validateOnly If set, only validate the request, but do not
|
---|
| 55 | * actually create the node pool.
|
---|
| 56 | * @return Operation
|
---|
| 57 | * @throws \Google\Service\Exception
|
---|
| 58 | */
|
---|
| 59 | public function create($parent, BareMetalNodePool $postBody, $optParams = [])
|
---|
| 60 | {
|
---|
| 61 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 62 | $params = array_merge($params, $optParams);
|
---|
| 63 | return $this->call('create', [$params], Operation::class);
|
---|
| 64 | }
|
---|
| 65 | /**
|
---|
| 66 | * Deletes a single bare metal node pool. (bareMetalNodePools.delete)
|
---|
| 67 | *
|
---|
| 68 | * @param string $name Required. The name of the node pool to delete. Format: pr
|
---|
| 69 | * ojects/{project}/locations/{location}/bareMetalClusters/{cluster}/bareMetalNo
|
---|
| 70 | * dePools/{nodepool}
|
---|
| 71 | * @param array $optParams Optional parameters.
|
---|
| 72 | *
|
---|
| 73 | * @opt_param bool allowMissing If set to true, and the bare metal node pool is
|
---|
| 74 | * not found, the request will succeed but no action will be taken on the server
|
---|
| 75 | * and return a completed LRO.
|
---|
| 76 | * @opt_param string etag The current etag of the BareMetalNodePool. If an etag
|
---|
| 77 | * is provided and does not match the current etag of the node pool, deletion
|
---|
| 78 | * will be blocked and an ABORTED error will be returned.
|
---|
| 79 | * @opt_param bool ignoreErrors If set to true, the deletion of a bare metal
|
---|
| 80 | * node pool resource will succeed even if errors occur during deletion. This
|
---|
| 81 | * parameter can be used when you want to delete GCP's node pool resource and
|
---|
| 82 | * you've already deleted the on-prem admin cluster that hosted your node pool.
|
---|
| 83 | * WARNING: Using this parameter when your user cluster still exists may result
|
---|
| 84 | * in a deleted GCP node pool but an existing on-prem node pool.
|
---|
| 85 | * @opt_param bool validateOnly If set, only validate the request, but do not
|
---|
| 86 | * actually delete the node pool.
|
---|
| 87 | * @return Operation
|
---|
| 88 | * @throws \Google\Service\Exception
|
---|
| 89 | */
|
---|
| 90 | public function delete($name, $optParams = [])
|
---|
| 91 | {
|
---|
| 92 | $params = ['name' => $name];
|
---|
| 93 | $params = array_merge($params, $optParams);
|
---|
| 94 | return $this->call('delete', [$params], Operation::class);
|
---|
| 95 | }
|
---|
| 96 | /**
|
---|
| 97 | * Enrolls an existing bare metal node pool to the Anthos On-Prem API within a
|
---|
| 98 | * given project and location. Through enrollment, an existing node pool will
|
---|
| 99 | * become Anthos On-Prem API managed. The corresponding GCP resources will be
|
---|
| 100 | * created. (bareMetalNodePools.enroll)
|
---|
| 101 | *
|
---|
| 102 | * @param string $parent Required. The parent resource where this node pool will
|
---|
| 103 | * be created.
|
---|
| 104 | * projects/{project}/locations/{location}/bareMetalClusters/{cluster}
|
---|
| 105 | * @param EnrollBareMetalNodePoolRequest $postBody
|
---|
| 106 | * @param array $optParams Optional parameters.
|
---|
| 107 | * @return Operation
|
---|
| 108 | * @throws \Google\Service\Exception
|
---|
| 109 | */
|
---|
| 110 | public function enroll($parent, EnrollBareMetalNodePoolRequest $postBody, $optParams = [])
|
---|
| 111 | {
|
---|
| 112 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 113 | $params = array_merge($params, $optParams);
|
---|
| 114 | return $this->call('enroll', [$params], Operation::class);
|
---|
| 115 | }
|
---|
| 116 | /**
|
---|
| 117 | * Gets details of a single bare metal node pool. (bareMetalNodePools.get)
|
---|
| 118 | *
|
---|
| 119 | * @param string $name Required. The name of the node pool to retrieve. projects
|
---|
| 120 | * /{project}/locations/{location}/bareMetalClusters/{cluster}/bareMetalNodePool
|
---|
| 121 | * s/{nodepool}
|
---|
| 122 | * @param array $optParams Optional parameters.
|
---|
| 123 | *
|
---|
| 124 | * @opt_param string view View for bare metal node pool. When `BASIC` is
|
---|
| 125 | * specified, only the node pool resource name is returned. The default/unset
|
---|
| 126 | * value `NODE_POOL_VIEW_UNSPECIFIED` is the same as `FULL', which returns the
|
---|
| 127 | * complete node pool configuration details.
|
---|
| 128 | * @return BareMetalNodePool
|
---|
| 129 | * @throws \Google\Service\Exception
|
---|
| 130 | */
|
---|
| 131 | public function get($name, $optParams = [])
|
---|
| 132 | {
|
---|
| 133 | $params = ['name' => $name];
|
---|
| 134 | $params = array_merge($params, $optParams);
|
---|
| 135 | return $this->call('get', [$params], BareMetalNodePool::class);
|
---|
| 136 | }
|
---|
| 137 | /**
|
---|
| 138 | * Gets the access control policy for a resource. Returns an empty policy if the
|
---|
| 139 | * resource exists and does not have a policy set.
|
---|
| 140 | * (bareMetalNodePools.getIamPolicy)
|
---|
| 141 | *
|
---|
| 142 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
| 143 | * requested. See [Resource
|
---|
| 144 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 145 | * appropriate value for this field.
|
---|
| 146 | * @param array $optParams Optional parameters.
|
---|
| 147 | *
|
---|
| 148 | * @opt_param int options.requestedPolicyVersion Optional. The maximum policy
|
---|
| 149 | * version that will be used to format the policy. Valid values are 0, 1, and 3.
|
---|
| 150 | * Requests specifying an invalid value will be rejected. Requests for policies
|
---|
| 151 | * with any conditional role bindings must specify version 3. Policies with no
|
---|
| 152 | * conditional role bindings may specify any valid value or leave the field
|
---|
| 153 | * unset. The policy in the response might use the policy version that you
|
---|
| 154 | * specified, or it might use a lower policy version. For example, if you
|
---|
| 155 | * specify version 3, but the policy has no conditional role bindings, the
|
---|
| 156 | * response uses version 1. To learn which resources support conditions in their
|
---|
| 157 | * IAM policies, see the [IAM
|
---|
| 158 | * documentation](https://cloud.google.com/iam/help/conditions/resource-
|
---|
| 159 | * policies).
|
---|
| 160 | * @return Policy
|
---|
| 161 | * @throws \Google\Service\Exception
|
---|
| 162 | */
|
---|
| 163 | public function getIamPolicy($resource, $optParams = [])
|
---|
| 164 | {
|
---|
| 165 | $params = ['resource' => $resource];
|
---|
| 166 | $params = array_merge($params, $optParams);
|
---|
| 167 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
| 168 | }
|
---|
| 169 | /**
|
---|
| 170 | * Lists bare metal node pools in a given project, location and bare metal
|
---|
| 171 | * cluster.
|
---|
| 172 | * (bareMetalNodePools.listProjectsLocationsBareMetalClustersBareMetalNodePools)
|
---|
| 173 | *
|
---|
| 174 | * @param string $parent Required. The parent, which owns this collection of
|
---|
| 175 | * node pools. Format:
|
---|
| 176 | * projects/{project}/locations/{location}/bareMetalClusters/{bareMetalCluster}
|
---|
| 177 | * @param array $optParams Optional parameters.
|
---|
| 178 | *
|
---|
| 179 | * @opt_param int pageSize The maximum number of node pools to return. The
|
---|
| 180 | * service may return fewer than this value. If unspecified, at most 50 node
|
---|
| 181 | * pools will be returned. The maximum value is 1000; values above 1000 will be
|
---|
| 182 | * coerced to 1000.
|
---|
| 183 | * @opt_param string pageToken A page token, received from a previous
|
---|
| 184 | * `ListBareMetalNodePools` call. Provide this to retrieve the subsequent page.
|
---|
| 185 | * When paginating, all other parameters provided to `ListBareMetalNodePools`
|
---|
| 186 | * must match the call that provided the page token.
|
---|
| 187 | * @opt_param string view View for bare metal node pools. When `BASIC` is
|
---|
| 188 | * specified, only the node pool resource name is returned. The default/unset
|
---|
| 189 | * value `NODE_POOL_VIEW_UNSPECIFIED` is the same as `FULL', which returns the
|
---|
| 190 | * complete node pool configuration details.
|
---|
| 191 | * @return ListBareMetalNodePoolsResponse
|
---|
| 192 | * @throws \Google\Service\Exception
|
---|
| 193 | */
|
---|
| 194 | public function listProjectsLocationsBareMetalClustersBareMetalNodePools($parent, $optParams = [])
|
---|
| 195 | {
|
---|
| 196 | $params = ['parent' => $parent];
|
---|
| 197 | $params = array_merge($params, $optParams);
|
---|
| 198 | return $this->call('list', [$params], ListBareMetalNodePoolsResponse::class);
|
---|
| 199 | }
|
---|
| 200 | /**
|
---|
| 201 | * Updates the parameters of a single bare metal node pool.
|
---|
| 202 | * (bareMetalNodePools.patch)
|
---|
| 203 | *
|
---|
| 204 | * @param string $name Immutable. The bare metal node pool resource name.
|
---|
| 205 | * @param BareMetalNodePool $postBody
|
---|
| 206 | * @param array $optParams Optional parameters.
|
---|
| 207 | *
|
---|
| 208 | * @opt_param bool allowMissing If set to true, and the bare metal node pool is
|
---|
| 209 | * not found, the request will create a new bare metal node pool with the
|
---|
| 210 | * provided configuration. The user must have both create and update permission
|
---|
| 211 | * to call Update with allow_missing set to true.
|
---|
| 212 | * @opt_param string updateMask Required. Field mask is used to specify the
|
---|
| 213 | * fields to be overwritten in the BareMetalNodePool resource by the update. The
|
---|
| 214 | * fields specified in the update_mask are relative to the resource, not the
|
---|
| 215 | * full request. A field will be overwritten if it is in the mask. If the user
|
---|
| 216 | * does not provide a mask then all populated fields in the BareMetalNodePool
|
---|
| 217 | * message will be updated. Empty fields will be ignored unless a field mask is
|
---|
| 218 | * used.
|
---|
| 219 | * @opt_param bool validateOnly Validate the request without actually doing any
|
---|
| 220 | * updates.
|
---|
| 221 | * @return Operation
|
---|
| 222 | * @throws \Google\Service\Exception
|
---|
| 223 | */
|
---|
| 224 | public function patch($name, BareMetalNodePool $postBody, $optParams = [])
|
---|
| 225 | {
|
---|
| 226 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 227 | $params = array_merge($params, $optParams);
|
---|
| 228 | return $this->call('patch', [$params], Operation::class);
|
---|
| 229 | }
|
---|
| 230 | /**
|
---|
| 231 | * Sets the access control policy on the specified resource. Replaces any
|
---|
| 232 | * existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and
|
---|
| 233 | * `PERMISSION_DENIED` errors. (bareMetalNodePools.setIamPolicy)
|
---|
| 234 | *
|
---|
| 235 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
| 236 | * specified. See [Resource
|
---|
| 237 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 238 | * appropriate value for this field.
|
---|
| 239 | * @param SetIamPolicyRequest $postBody
|
---|
| 240 | * @param array $optParams Optional parameters.
|
---|
| 241 | * @return Policy
|
---|
| 242 | * @throws \Google\Service\Exception
|
---|
| 243 | */
|
---|
| 244 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
| 245 | {
|
---|
| 246 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 247 | $params = array_merge($params, $optParams);
|
---|
| 248 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
| 249 | }
|
---|
| 250 | /**
|
---|
| 251 | * Returns permissions that a caller has on the specified resource. If the
|
---|
| 252 | * resource does not exist, this will return an empty set of permissions, not a
|
---|
| 253 | * `NOT_FOUND` error. Note: This operation is designed to be used for building
|
---|
| 254 | * permission-aware UIs and command-line tools, not for authorization checking.
|
---|
| 255 | * This operation may "fail open" without warning.
|
---|
| 256 | * (bareMetalNodePools.testIamPermissions)
|
---|
| 257 | *
|
---|
| 258 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
| 259 | * being requested. See [Resource
|
---|
| 260 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 261 | * appropriate value for this field.
|
---|
| 262 | * @param TestIamPermissionsRequest $postBody
|
---|
| 263 | * @param array $optParams Optional parameters.
|
---|
| 264 | * @return TestIamPermissionsResponse
|
---|
| 265 | * @throws \Google\Service\Exception
|
---|
| 266 | */
|
---|
| 267 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
| 268 | {
|
---|
| 269 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 270 | $params = array_merge($params, $optParams);
|
---|
| 271 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
| 272 | }
|
---|
| 273 | /**
|
---|
| 274 | * Unenrolls a bare metal node pool from Anthos On-Prem API.
|
---|
| 275 | * (bareMetalNodePools.unenroll)
|
---|
| 276 | *
|
---|
| 277 | * @param string $name Required. The name of the node pool to unenroll. Format:
|
---|
| 278 | * projects/{project}/locations/{location}/bareMetalClusters/{cluster}/bareMetal
|
---|
| 279 | * NodePools/{nodepool}
|
---|
| 280 | * @param array $optParams Optional parameters.
|
---|
| 281 | *
|
---|
| 282 | * @opt_param bool allowMissing If set to true, and the bare metal node pool is
|
---|
| 283 | * not found, the request will succeed but no action will be taken on the server
|
---|
| 284 | * and return a completed LRO.
|
---|
| 285 | * @opt_param string etag The current etag of the bare metal node pool. If an
|
---|
| 286 | * etag is provided and does not match the current etag of node pool, deletion
|
---|
| 287 | * will be blocked and an ABORTED error will be returned.
|
---|
| 288 | * @opt_param bool validateOnly If set, only validate the request, but do not
|
---|
| 289 | * actually unenroll the node pool.
|
---|
| 290 | * @return Operation
|
---|
| 291 | * @throws \Google\Service\Exception
|
---|
| 292 | */
|
---|
| 293 | public function unenroll($name, $optParams = [])
|
---|
| 294 | {
|
---|
| 295 | $params = ['name' => $name];
|
---|
| 296 | $params = array_merge($params, $optParams);
|
---|
| 297 | return $this->call('unenroll', [$params], Operation::class);
|
---|
| 298 | }
|
---|
| 299 | }
|
---|
| 300 |
|
---|
| 301 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 302 | class_alias(ProjectsLocationsBareMetalClustersBareMetalNodePools::class, 'Google_Service_GKEOnPrem_Resource_ProjectsLocationsBareMetalClustersBareMetalNodePools');
|
---|