[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\BigtableAdmin\Resource;
|
---|
| 19 |
|
---|
| 20 | use Google\Service\BigtableAdmin\Backup;
|
---|
| 21 | use Google\Service\BigtableAdmin\BigtableadminEmpty;
|
---|
| 22 | use Google\Service\BigtableAdmin\CopyBackupRequest;
|
---|
| 23 | use Google\Service\BigtableAdmin\GetIamPolicyRequest;
|
---|
| 24 | use Google\Service\BigtableAdmin\ListBackupsResponse;
|
---|
| 25 | use Google\Service\BigtableAdmin\Operation;
|
---|
| 26 | use Google\Service\BigtableAdmin\Policy;
|
---|
| 27 | use Google\Service\BigtableAdmin\SetIamPolicyRequest;
|
---|
| 28 | use Google\Service\BigtableAdmin\TestIamPermissionsRequest;
|
---|
| 29 | use Google\Service\BigtableAdmin\TestIamPermissionsResponse;
|
---|
| 30 |
|
---|
| 31 | /**
|
---|
| 32 | * The "backups" collection of methods.
|
---|
| 33 | * Typical usage is:
|
---|
| 34 | * <code>
|
---|
| 35 | * $bigtableadminService = new Google\Service\BigtableAdmin(...);
|
---|
| 36 | * $backups = $bigtableadminService->projects_instances_clusters_backups;
|
---|
| 37 | * </code>
|
---|
| 38 | */
|
---|
| 39 | class ProjectsInstancesClustersBackups extends \Google\Service\Resource
|
---|
| 40 | {
|
---|
| 41 | /**
|
---|
| 42 | * Copy a Cloud Bigtable backup to a new backup in the destination cluster
|
---|
| 43 | * located in the destination instance and project. (backups.copy)
|
---|
| 44 | *
|
---|
| 45 | * @param string $parent Required. The name of the destination cluster that will
|
---|
| 46 | * contain the backup copy. The cluster must already exist. Values are of the
|
---|
| 47 | * form: `projects/{project}/instances/{instance}/clusters/{cluster}`.
|
---|
| 48 | * @param CopyBackupRequest $postBody
|
---|
| 49 | * @param array $optParams Optional parameters.
|
---|
| 50 | * @return Operation
|
---|
| 51 | * @throws \Google\Service\Exception
|
---|
| 52 | */
|
---|
| 53 | public function copy($parent, CopyBackupRequest $postBody, $optParams = [])
|
---|
| 54 | {
|
---|
| 55 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 56 | $params = array_merge($params, $optParams);
|
---|
| 57 | return $this->call('copy', [$params], Operation::class);
|
---|
| 58 | }
|
---|
| 59 | /**
|
---|
| 60 | * Starts creating a new Cloud Bigtable Backup. The returned backup long-running
|
---|
| 61 | * operation can be used to track creation of the backup. The metadata field
|
---|
| 62 | * type is CreateBackupMetadata. The response field type is Backup, if
|
---|
| 63 | * successful. Cancelling the returned operation will stop the creation and
|
---|
| 64 | * delete the backup. (backups.create)
|
---|
| 65 | *
|
---|
| 66 | * @param string $parent Required. This must be one of the clusters in the
|
---|
| 67 | * instance in which this table is located. The backup will be stored in this
|
---|
| 68 | * cluster. Values are of the form
|
---|
| 69 | * `projects/{project}/instances/{instance}/clusters/{cluster}`.
|
---|
| 70 | * @param Backup $postBody
|
---|
| 71 | * @param array $optParams Optional parameters.
|
---|
| 72 | *
|
---|
| 73 | * @opt_param string backupId Required. The id of the backup to be created. The
|
---|
| 74 | * `backup_id` along with the parent `parent` are combined as
|
---|
| 75 | * {parent}/backups/{backup_id} to create the full backup name, of the form: `pr
|
---|
| 76 | * ojects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}`
|
---|
| 77 | * . This string must be between 1 and 50 characters in length and match the
|
---|
| 78 | * regex _a-zA-Z0-9*.
|
---|
| 79 | * @return Operation
|
---|
| 80 | * @throws \Google\Service\Exception
|
---|
| 81 | */
|
---|
| 82 | public function create($parent, Backup $postBody, $optParams = [])
|
---|
| 83 | {
|
---|
| 84 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
| 85 | $params = array_merge($params, $optParams);
|
---|
| 86 | return $this->call('create', [$params], Operation::class);
|
---|
| 87 | }
|
---|
| 88 | /**
|
---|
| 89 | * Deletes a pending or completed Cloud Bigtable backup. (backups.delete)
|
---|
| 90 | *
|
---|
| 91 | * @param string $name Required. Name of the backup to delete. Values are of the
|
---|
| 92 | * form `projects/{project}/instances/{instance}/clusters/{cluster}/backups/{bac
|
---|
| 93 | * kup}`.
|
---|
| 94 | * @param array $optParams Optional parameters.
|
---|
| 95 | * @return BigtableadminEmpty
|
---|
| 96 | * @throws \Google\Service\Exception
|
---|
| 97 | */
|
---|
| 98 | public function delete($name, $optParams = [])
|
---|
| 99 | {
|
---|
| 100 | $params = ['name' => $name];
|
---|
| 101 | $params = array_merge($params, $optParams);
|
---|
| 102 | return $this->call('delete', [$params], BigtableadminEmpty::class);
|
---|
| 103 | }
|
---|
| 104 | /**
|
---|
| 105 | * Gets metadata on a pending or completed Cloud Bigtable Backup. (backups.get)
|
---|
| 106 | *
|
---|
| 107 | * @param string $name Required. Name of the backup. Values are of the form `pro
|
---|
| 108 | * jects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}`.
|
---|
| 109 | * @param array $optParams Optional parameters.
|
---|
| 110 | * @return Backup
|
---|
| 111 | * @throws \Google\Service\Exception
|
---|
| 112 | */
|
---|
| 113 | public function get($name, $optParams = [])
|
---|
| 114 | {
|
---|
| 115 | $params = ['name' => $name];
|
---|
| 116 | $params = array_merge($params, $optParams);
|
---|
| 117 | return $this->call('get', [$params], Backup::class);
|
---|
| 118 | }
|
---|
| 119 | /**
|
---|
| 120 | * Gets the access control policy for a Bigtable resource. Returns an empty
|
---|
| 121 | * policy if the resource exists but does not have a policy set.
|
---|
| 122 | * (backups.getIamPolicy)
|
---|
| 123 | *
|
---|
| 124 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
| 125 | * requested. See [Resource
|
---|
| 126 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 127 | * appropriate value for this field.
|
---|
| 128 | * @param GetIamPolicyRequest $postBody
|
---|
| 129 | * @param array $optParams Optional parameters.
|
---|
| 130 | * @return Policy
|
---|
| 131 | * @throws \Google\Service\Exception
|
---|
| 132 | */
|
---|
| 133 | public function getIamPolicy($resource, GetIamPolicyRequest $postBody, $optParams = [])
|
---|
| 134 | {
|
---|
| 135 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 136 | $params = array_merge($params, $optParams);
|
---|
| 137 | return $this->call('getIamPolicy', [$params], Policy::class);
|
---|
| 138 | }
|
---|
| 139 | /**
|
---|
| 140 | * Lists Cloud Bigtable backups. Returns both completed and pending backups.
|
---|
| 141 | * (backups.listProjectsInstancesClustersBackups)
|
---|
| 142 | *
|
---|
| 143 | * @param string $parent Required. The cluster to list backups from. Values are
|
---|
| 144 | * of the form `projects/{project}/instances/{instance}/clusters/{cluster}`. Use
|
---|
| 145 | * `{cluster} = '-'` to list backups for all clusters in an instance, e.g.,
|
---|
| 146 | * `projects/{project}/instances/{instance}/clusters/-`.
|
---|
| 147 | * @param array $optParams Optional parameters.
|
---|
| 148 | *
|
---|
| 149 | * @opt_param string filter A filter expression that filters backups listed in
|
---|
| 150 | * the response. The expression must specify the field name, a comparison
|
---|
| 151 | * operator, and the value that you want to use for filtering. The value must be
|
---|
| 152 | * a string, a number, or a boolean. The comparison operator must be <, >, <=,
|
---|
| 153 | * >=, !=, =, or :. Colon ':' represents a HAS operator which is roughly
|
---|
| 154 | * synonymous with equality. Filter rules are case insensitive. The fields
|
---|
| 155 | * eligible for filtering are: * `name` * `source_table` * `state` *
|
---|
| 156 | * `start_time` (and values are of the format YYYY-MM-DDTHH:MM:SSZ) * `end_time`
|
---|
| 157 | * (and values are of the format YYYY-MM-DDTHH:MM:SSZ) * `expire_time` (and
|
---|
| 158 | * values are of the format YYYY-MM-DDTHH:MM:SSZ) * `size_bytes` To filter on
|
---|
| 159 | * multiple expressions, provide each separate expression within parentheses. By
|
---|
| 160 | * default, each expression is an AND expression. However, you can include AND,
|
---|
| 161 | * OR, and NOT expressions explicitly. Some examples of using filters are: *
|
---|
| 162 | * `name:"exact"` --> The backup's name is the string "exact". * `name:howl` -->
|
---|
| 163 | * The backup's name contains the string "howl". * `source_table:prod` --> The
|
---|
| 164 | * source_table's name contains the string "prod". * `state:CREATING` --> The
|
---|
| 165 | * backup is pending creation. * `state:READY` --> The backup is fully created
|
---|
| 166 | * and ready for use. * `(name:howl) AND (start_time <
|
---|
| 167 | * \"2018-03-28T14:50:00Z\")` --> The backup name contains the string "howl" and
|
---|
| 168 | * start_time of the backup is before 2018-03-28T14:50:00Z. * `size_bytes >
|
---|
| 169 | * 10000000000` --> The backup's size is greater than 10GB
|
---|
| 170 | * @opt_param string orderBy An expression for specifying the sort order of the
|
---|
| 171 | * results of the request. The string value should specify one or more fields in
|
---|
| 172 | * Backup. The full syntax is described at https://aip.dev/132#ordering. Fields
|
---|
| 173 | * supported are: * name * source_table * expire_time * start_time * end_time *
|
---|
| 174 | * size_bytes * state For example, "start_time". The default sorting order is
|
---|
| 175 | * ascending. To specify descending order for the field, a suffix " desc" should
|
---|
| 176 | * be appended to the field name. For example, "start_time desc". Redundant
|
---|
| 177 | * space characters in the syntax are insigificant. If order_by is empty,
|
---|
| 178 | * results will be sorted by `start_time` in descending order starting from the
|
---|
| 179 | * most recently created backup.
|
---|
| 180 | * @opt_param int pageSize Number of backups to be returned in the response. If
|
---|
| 181 | * 0 or less, defaults to the server's maximum allowed page size.
|
---|
| 182 | * @opt_param string pageToken If non-empty, `page_token` should contain a
|
---|
| 183 | * next_page_token from a previous ListBackupsResponse to the same `parent` and
|
---|
| 184 | * with the same `filter`.
|
---|
| 185 | * @return ListBackupsResponse
|
---|
| 186 | * @throws \Google\Service\Exception
|
---|
| 187 | */
|
---|
| 188 | public function listProjectsInstancesClustersBackups($parent, $optParams = [])
|
---|
| 189 | {
|
---|
| 190 | $params = ['parent' => $parent];
|
---|
| 191 | $params = array_merge($params, $optParams);
|
---|
| 192 | return $this->call('list', [$params], ListBackupsResponse::class);
|
---|
| 193 | }
|
---|
| 194 | /**
|
---|
| 195 | * Updates a pending or completed Cloud Bigtable Backup. (backups.patch)
|
---|
| 196 | *
|
---|
| 197 | * @param string $name A globally unique identifier for the backup which cannot
|
---|
| 198 | * be changed. Values are of the form
|
---|
| 199 | * `projects/{project}/instances/{instance}/clusters/{cluster}/ backups/_a-
|
---|
| 200 | * zA-Z0-9*` The final segment of the name must be between 1 and 50 characters
|
---|
| 201 | * in length. The backup is stored in the cluster identified by the prefix of
|
---|
| 202 | * the backup name of the form
|
---|
| 203 | * `projects/{project}/instances/{instance}/clusters/{cluster}`.
|
---|
| 204 | * @param Backup $postBody
|
---|
| 205 | * @param array $optParams Optional parameters.
|
---|
| 206 | *
|
---|
| 207 | * @opt_param string updateMask Required. A mask specifying which fields (e.g.
|
---|
| 208 | * `expire_time`) in the Backup resource should be updated. This mask is
|
---|
| 209 | * relative to the Backup resource, not to the request message. The field mask
|
---|
| 210 | * must always be specified; this prevents any future fields from being erased
|
---|
| 211 | * accidentally by clients that do not know about them.
|
---|
| 212 | * @return Backup
|
---|
| 213 | * @throws \Google\Service\Exception
|
---|
| 214 | */
|
---|
| 215 | public function patch($name, Backup $postBody, $optParams = [])
|
---|
| 216 | {
|
---|
| 217 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
| 218 | $params = array_merge($params, $optParams);
|
---|
| 219 | return $this->call('patch', [$params], Backup::class);
|
---|
| 220 | }
|
---|
| 221 | /**
|
---|
| 222 | * Sets the access control policy on a Bigtable resource. Replaces any existing
|
---|
| 223 | * policy. (backups.setIamPolicy)
|
---|
| 224 | *
|
---|
| 225 | * @param string $resource REQUIRED: The resource for which the policy is being
|
---|
| 226 | * specified. See [Resource
|
---|
| 227 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 228 | * appropriate value for this field.
|
---|
| 229 | * @param SetIamPolicyRequest $postBody
|
---|
| 230 | * @param array $optParams Optional parameters.
|
---|
| 231 | * @return Policy
|
---|
| 232 | * @throws \Google\Service\Exception
|
---|
| 233 | */
|
---|
| 234 | public function setIamPolicy($resource, SetIamPolicyRequest $postBody, $optParams = [])
|
---|
| 235 | {
|
---|
| 236 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 237 | $params = array_merge($params, $optParams);
|
---|
| 238 | return $this->call('setIamPolicy', [$params], Policy::class);
|
---|
| 239 | }
|
---|
| 240 | /**
|
---|
| 241 | * Returns permissions that the caller has on the specified Bigtable resource.
|
---|
| 242 | * (backups.testIamPermissions)
|
---|
| 243 | *
|
---|
| 244 | * @param string $resource REQUIRED: The resource for which the policy detail is
|
---|
| 245 | * being requested. See [Resource
|
---|
| 246 | * names](https://cloud.google.com/apis/design/resource_names) for the
|
---|
| 247 | * appropriate value for this field.
|
---|
| 248 | * @param TestIamPermissionsRequest $postBody
|
---|
| 249 | * @param array $optParams Optional parameters.
|
---|
| 250 | * @return TestIamPermissionsResponse
|
---|
| 251 | * @throws \Google\Service\Exception
|
---|
| 252 | */
|
---|
| 253 | public function testIamPermissions($resource, TestIamPermissionsRequest $postBody, $optParams = [])
|
---|
| 254 | {
|
---|
| 255 | $params = ['resource' => $resource, 'postBody' => $postBody];
|
---|
| 256 | $params = array_merge($params, $optParams);
|
---|
| 257 | return $this->call('testIamPermissions', [$params], TestIamPermissionsResponse::class);
|
---|
| 258 | }
|
---|
| 259 | }
|
---|
| 260 |
|
---|
| 261 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
| 262 | class_alias(ProjectsInstancesClustersBackups::class, 'Google_Service_BigtableAdmin_Resource_ProjectsInstancesClustersBackups');
|
---|