[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\CloudAlloyDBAdmin\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\CloudAlloyDBAdmin\Cluster;
|
---|
| 21 | use Google\Service\CloudAlloyDBAdmin\ExportClusterRequest;
|
---|
| 22 | use Google\Service\CloudAlloyDBAdmin\ListClustersResponse;
|
---|
| 23 | use Google\Service\CloudAlloyDBAdmin\Operation;
|
---|
| 24 | use Google\Service\CloudAlloyDBAdmin\PromoteClusterRequest;
|
---|
| 25 | use Google\Service\CloudAlloyDBAdmin\RestoreClusterRequest;
|
---|
| 26 | use Google\Service\CloudAlloyDBAdmin\SwitchoverClusterRequest;
|
---|
| 27 | use Google\Service\CloudAlloyDBAdmin\UpgradeClusterRequest;
|
---|
| 28 |
|
---|
| 29 | /**
|
---|
| 30 | * The "clusters" collection of methods.
|
---|
| 31 | * Typical usage is:
|
---|
| 32 | * <code>
|
---|
| 33 | * $alloydbService = new Google\Service\CloudAlloyDBAdmin(...);
|
---|
| 34 | * $clusters = $alloydbService->projects_locations_clusters;
|
---|
| 35 | * </code>
|
---|
| 36 | */
|
---|
| 37 | class ProjectsLocationsClusters extends \Google\Service\Resource
|
---|
| 38 | {
|
---|
| 39 | /**
|
---|
| 40 | * Creates a new Cluster in a given project and location. (clusters.create)
|
---|
| 41 | *
|
---|
| 42 | * @param string $parent Required. The location of the new cluster. For the
|
---|
| 43 | * required format, see the comment on the Cluster.name field.
|
---|
| 44 | * @param Cluster $postBody
|
---|
| 45 | * @param array $optParams Optional parameters.
|
---|
| 46 | *
|
---|
| 47 | * @opt_param string clusterId Required. ID of the requesting object.
|
---|
| 48 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
| 49 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
| 50 | * the server ignores the request if it has already been completed. The server
|
---|
| 51 | * guarantees that for at least 60 minutes since the first request. For example,
|
---|
| 52 | * consider a situation where you make an initial request and the request times
|
---|
| 53 | * out. If you make the request again with the same request ID, the server can
|
---|
| 54 | * check if the original operation with the same request ID was received, and if
|
---|
| 55 | * so, ignores the second request. This prevents clients from accidentally
|
---|
| 56 | * creating duplicate commitments. The request ID must be a valid UUID with the
|
---|
| 57 | * exception that zero UUID is not supported
|
---|
| 58 | * (00000000-0000-0000-0000-000000000000).
|
---|
| 59 | * @opt_param bool validateOnly Optional. If set, performs request validation,
|
---|
| 60 | * for example, permission checks and any other type of validation, but does not
|
---|
| 61 | * actually execute the create request.
|
---|
| 62 | * @return Operation
|
---|
| 63 | * @throws \Google\Service\Exception
|
---|
| 64 | */
|
---|
| 65 | public function create($parent, Cluster $postBody, $optParams = [])
|
---|
| 66 | {
|
---|
| 67 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 68 | $params = array_merge($params, $optParams);
|
---|
| 69 | return $this->call('create', [$params], Operation::class);
|
---|
| 70 | }
|
---|
| 71 | /**
|
---|
| 72 | * Creates a cluster of type SECONDARY in the given location using the primary
|
---|
| 73 | * cluster as the source. (clusters.createsecondary)
|
---|
| 74 | *
|
---|
| 75 | * @param string $parent Required. The location of the new cluster. For the
|
---|
| 76 | * required format, see the comment on the Cluster.name field.
|
---|
| 77 | * @param Cluster $postBody
|
---|
| 78 | * @param array $optParams Optional parameters.
|
---|
| 79 | *
|
---|
| 80 | * @opt_param string clusterId Required. ID of the requesting object (the
|
---|
| 81 | * secondary cluster).
|
---|
| 82 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
| 83 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
| 84 | * the server ignores the request if it has already been completed. The server
|
---|
| 85 | * guarantees that for at least 60 minutes since the first request. For example,
|
---|
| 86 | * consider a situation where you make an initial request and the request times
|
---|
| 87 | * out. If you make the request again with the same request ID, the server can
|
---|
| 88 | * check if the original operation with the same request ID was received, and if
|
---|
| 89 | * so, ignores the second request. This prevents clients from accidentally
|
---|
| 90 | * creating duplicate commitments. The request ID must be a valid UUID with the
|
---|
| 91 | * exception that zero UUID is not supported
|
---|
| 92 | * (00000000-0000-0000-0000-000000000000).
|
---|
| 93 | * @opt_param bool validateOnly Optional. If set, performs request validation,
|
---|
| 94 | * for example, permission checks and any other type of validation, but does not
|
---|
| 95 | * actually execute the create request.
|
---|
| 96 | * @return Operation
|
---|
| 97 | * @throws \Google\Service\Exception
|
---|
| 98 | */
|
---|
| 99 | public function createsecondary($parent, Cluster $postBody, $optParams = [])
|
---|
| 100 | {
|
---|
| 101 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 102 | $params = array_merge($params, $optParams);
|
---|
| 103 | return $this->call('createsecondary', [$params], Operation::class);
|
---|
| 104 | }
|
---|
| 105 | /**
|
---|
| 106 | * Deletes a single Cluster. (clusters.delete)
|
---|
| 107 | *
|
---|
| 108 | * @param string $name Required. The name of the resource. For the required
|
---|
| 109 | * format, see the comment on the Cluster.name field.
|
---|
| 110 | * @param array $optParams Optional parameters.
|
---|
| 111 | *
|
---|
| 112 | * @opt_param string etag Optional. The current etag of the Cluster. If an etag
|
---|
| 113 | * is provided and does not match the current etag of the Cluster, deletion will
|
---|
| 114 | * be blocked and an ABORTED error will be returned.
|
---|
| 115 | * @opt_param bool force Optional. Whether to cascade delete child instances for
|
---|
| 116 | * given cluster.
|
---|
| 117 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
| 118 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
| 119 | * the server ignores the request if it has already been completed. The server
|
---|
| 120 | * guarantees that for at least 60 minutes since the first request. For example,
|
---|
| 121 | * consider a situation where you make an initial request and the request times
|
---|
| 122 | * out. If you make the request again with the same request ID, the server can
|
---|
| 123 | * check if the original operation with the same request ID was received, and if
|
---|
| 124 | * so, ignores the second request. This prevents clients from accidentally
|
---|
| 125 | * creating duplicate commitments. The request ID must be a valid UUID with the
|
---|
| 126 | * exception that zero UUID is not supported
|
---|
| 127 | * (00000000-0000-0000-0000-000000000000).
|
---|
| 128 | * @opt_param bool validateOnly Optional. If set, performs request validation,
|
---|
| 129 | * for example, permission checks and any other type of validation, but does not
|
---|
| 130 | * actually execute the create request.
|
---|
| 131 | * @return Operation
|
---|
| 132 | * @throws \Google\Service\Exception
|
---|
| 133 | */
|
---|
| 134 | public function delete($name, $optParams = [])
|
---|
| 135 | {
|
---|
| 136 | $params = ['name' => $name];
|
---|
| 137 | $params = array_merge($params, $optParams);
|
---|
| 138 | return $this->call('delete', [$params], Operation::class);
|
---|
| 139 | }
|
---|
| 140 | /**
|
---|
| 141 | * Exports data from the cluster. Imperative only. (clusters.export)
|
---|
| 142 | *
|
---|
| 143 | * @param string $name Required. The resource name of the cluster.
|
---|
| 144 | * @param ExportClusterRequest $postBody
|
---|
| 145 | * @param array $optParams Optional parameters.
|
---|
| 146 | * @return Operation
|
---|
| 147 | * @throws \Google\Service\Exception
|
---|
| 148 | */
|
---|
| 149 | public function export($name, ExportClusterRequest $postBody, $optParams = [])
|
---|
| 150 | {
|
---|
| 151 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 152 | $params = array_merge($params, $optParams);
|
---|
| 153 | return $this->call('export', [$params], Operation::class);
|
---|
| 154 | }
|
---|
| 155 | /**
|
---|
| 156 | * Gets details of a single Cluster. (clusters.get)
|
---|
| 157 | *
|
---|
| 158 | * @param string $name Required. The name of the resource. For the required
|
---|
| 159 | * format, see the comment on the Cluster.name field.
|
---|
| 160 | * @param array $optParams Optional parameters.
|
---|
| 161 | *
|
---|
| 162 | * @opt_param string view Optional. The view of the cluster to return. Returns
|
---|
| 163 | * all default fields if not set.
|
---|
| 164 | * @return Cluster
|
---|
| 165 | * @throws \Google\Service\Exception
|
---|
| 166 | */
|
---|
| 167 | public function get($name, $optParams = [])
|
---|
| 168 | {
|
---|
| 169 | $params = ['name' => $name];
|
---|
| 170 | $params = array_merge($params, $optParams);
|
---|
| 171 | return $this->call('get', [$params], Cluster::class);
|
---|
| 172 | }
|
---|
| 173 | /**
|
---|
| 174 | * Lists Clusters in a given project and location.
|
---|
| 175 | * (clusters.listProjectsLocationsClusters)
|
---|
| 176 | *
|
---|
| 177 | * @param string $parent Required. The name of the parent resource. For the
|
---|
| 178 | * required format, see the comment on the Cluster.name field. Additionally, you
|
---|
| 179 | * can perform an aggregated list operation by specifying a value with the
|
---|
| 180 | * following format: * projects/{project}/locations/-
|
---|
| 181 | * @param array $optParams Optional parameters.
|
---|
| 182 | *
|
---|
| 183 | * @opt_param string filter Optional. Filtering results
|
---|
| 184 | * @opt_param string orderBy Optional. Hint for how to order the results
|
---|
| 185 | * @opt_param int pageSize Optional. Requested page size. Server may return
|
---|
| 186 | * fewer items than requested. If unspecified, server will pick an appropriate
|
---|
| 187 | * default.
|
---|
| 188 | * @opt_param string pageToken A token identifying a page of results the server
|
---|
| 189 | * should return.
|
---|
| 190 | * @return ListClustersResponse
|
---|
| 191 | * @throws \Google\Service\Exception
|
---|
| 192 | */
|
---|
| 193 | public function listProjectsLocationsClusters($parent, $optParams = [])
|
---|
| 194 | {
|
---|
| 195 | $params = ['parent' => $parent];
|
---|
| 196 | $params = array_merge($params, $optParams);
|
---|
| 197 | return $this->call('list', [$params], ListClustersResponse::class);
|
---|
| 198 | }
|
---|
| 199 | /**
|
---|
| 200 | * Updates the parameters of a single Cluster. (clusters.patch)
|
---|
| 201 | *
|
---|
| 202 | * @param string $name Output only. The name of the cluster resource with the
|
---|
| 203 | * format: * projects/{project}/locations/{region}/clusters/{cluster_id} where
|
---|
| 204 | * the cluster ID segment should satisfy the regex expression `[a-z0-9-]+`. For
|
---|
| 205 | * more details see https://google.aip.dev/122. The prefix of the cluster
|
---|
| 206 | * resource name is the name of the parent resource: *
|
---|
| 207 | * projects/{project}/locations/{region}
|
---|
| 208 | * @param Cluster $postBody
|
---|
| 209 | * @param array $optParams Optional parameters.
|
---|
| 210 | *
|
---|
| 211 | * @opt_param bool allowMissing Optional. If set to true, update succeeds even
|
---|
| 212 | * if cluster is not found. In that case, a new cluster is created and
|
---|
| 213 | * `update_mask` is ignored.
|
---|
| 214 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
| 215 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
| 216 | * the server ignores the request if it has already been completed. The server
|
---|
| 217 | * guarantees that for at least 60 minutes since the first request. For example,
|
---|
| 218 | * consider a situation where you make an initial request and the request times
|
---|
| 219 | * out. If you make the request again with the same request ID, the server can
|
---|
| 220 | * check if the original operation with the same request ID was received, and if
|
---|
| 221 | * so, ignores the second request. This prevents clients from accidentally
|
---|
| 222 | * creating duplicate commitments. The request ID must be a valid UUID with the
|
---|
| 223 | * exception that zero UUID is not supported
|
---|
| 224 | * (00000000-0000-0000-0000-000000000000).
|
---|
| 225 | * @opt_param string updateMask Optional. Field mask is used to specify the
|
---|
| 226 | * fields to be overwritten in the Cluster resource by the update. The fields
|
---|
| 227 | * specified in the update_mask are relative to the resource, not the full
|
---|
| 228 | * request. A field will be overwritten if it is in the mask. If the user does
|
---|
| 229 | * not provide a mask then all fields will be overwritten.
|
---|
| 230 | * @opt_param bool validateOnly Optional. If set, performs request validation,
|
---|
| 231 | * for example, permission checks and any other type of validation, but does not
|
---|
| 232 | * actually execute the create request.
|
---|
| 233 | * @return Operation
|
---|
| 234 | * @throws \Google\Service\Exception
|
---|
| 235 | */
|
---|
| 236 | public function patch($name, Cluster $postBody, $optParams = [])
|
---|
| 237 | {
|
---|
| 238 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 239 | $params = array_merge($params, $optParams);
|
---|
| 240 | return $this->call('patch', [$params], Operation::class);
|
---|
| 241 | }
|
---|
| 242 | /**
|
---|
| 243 | * Promotes a SECONDARY cluster. This turns down replication from the PRIMARY
|
---|
| 244 | * cluster and promotes a secondary cluster into its own standalone cluster.
|
---|
| 245 | * Imperative only. (clusters.promote)
|
---|
| 246 | *
|
---|
| 247 | * @param string $name Required. The name of the resource. For the required
|
---|
| 248 | * format, see the comment on the Cluster.name field
|
---|
| 249 | * @param PromoteClusterRequest $postBody
|
---|
| 250 | * @param array $optParams Optional parameters.
|
---|
| 251 | * @return Operation
|
---|
| 252 | * @throws \Google\Service\Exception
|
---|
| 253 | */
|
---|
| 254 | public function promote($name, PromoteClusterRequest $postBody, $optParams = [])
|
---|
| 255 | {
|
---|
| 256 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 257 | $params = array_merge($params, $optParams);
|
---|
| 258 | return $this->call('promote', [$params], Operation::class);
|
---|
| 259 | }
|
---|
| 260 | /**
|
---|
| 261 | * Creates a new Cluster in a given project and location, with a volume restored
|
---|
| 262 | * from the provided source, either a backup ID or a point-in-time and a source
|
---|
| 263 | * cluster. (clusters.restore)
|
---|
| 264 | *
|
---|
| 265 | * @param string $parent Required. The name of the parent resource. For the
|
---|
| 266 | * required format, see the comment on the Cluster.name field.
|
---|
| 267 | * @param RestoreClusterRequest $postBody
|
---|
| 268 | * @param array $optParams Optional parameters.
|
---|
| 269 | * @return Operation
|
---|
| 270 | * @throws \Google\Service\Exception
|
---|
| 271 | */
|
---|
| 272 | public function restore($parent, RestoreClusterRequest $postBody, $optParams = [])
|
---|
| 273 | {
|
---|
| 274 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 275 | $params = array_merge($params, $optParams);
|
---|
| 276 | return $this->call('restore', [$params], Operation::class);
|
---|
| 277 | }
|
---|
| 278 | /**
|
---|
| 279 | * Switches the roles of PRIMARY and SECONDARY clusters without any data loss.
|
---|
| 280 | * This promotes the SECONDARY cluster to PRIMARY and sets up the original
|
---|
| 281 | * PRIMARY cluster to replicate from this newly promoted cluster.
|
---|
| 282 | * (clusters.switchover)
|
---|
| 283 | *
|
---|
| 284 | * @param string $name Required. The name of the resource. For the required
|
---|
| 285 | * format, see the comment on the Cluster.name field
|
---|
| 286 | * @param SwitchoverClusterRequest $postBody
|
---|
| 287 | * @param array $optParams Optional parameters.
|
---|
| 288 | * @return Operation
|
---|
| 289 | * @throws \Google\Service\Exception
|
---|
| 290 | */
|
---|
| 291 | public function switchover($name, SwitchoverClusterRequest $postBody, $optParams = [])
|
---|
| 292 | {
|
---|
| 293 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 294 | $params = array_merge($params, $optParams);
|
---|
| 295 | return $this->call('switchover', [$params], Operation::class);
|
---|
| 296 | }
|
---|
| 297 | /**
|
---|
| 298 | * Upgrades a single Cluster. Imperative only. (clusters.upgrade)
|
---|
| 299 | *
|
---|
| 300 | * @param string $name Required. The resource name of the cluster.
|
---|
| 301 | * @param UpgradeClusterRequest $postBody
|
---|
| 302 | * @param array $optParams Optional parameters.
|
---|
| 303 | * @return Operation
|
---|
| 304 | * @throws \Google\Service\Exception
|
---|
| 305 | */
|
---|
| 306 | public function upgrade($name, UpgradeClusterRequest $postBody, $optParams = [])
|
---|
| 307 | {
|
---|
| 308 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 309 | $params = array_merge($params, $optParams);
|
---|
| 310 | return $this->call('upgrade', [$params], Operation::class);
|
---|
| 311 | }
|
---|
| 312 | }
|
---|
| 313 |
|
---|
| 314 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 315 | class_alias(ProjectsLocationsClusters::class, 'Google_Service_CloudAlloyDBAdmin_Resource_ProjectsLocationsClusters');
|
---|