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\Parallelstore\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Parallelstore\ExportDataRequest;
|
---|
21 | use Google\Service\Parallelstore\ImportDataRequest;
|
---|
22 | use Google\Service\Parallelstore\Instance;
|
---|
23 | use Google\Service\Parallelstore\ListInstancesResponse;
|
---|
24 | use Google\Service\Parallelstore\Operation;
|
---|
25 |
|
---|
26 | /**
|
---|
27 | * The "instances" collection of methods.
|
---|
28 | * Typical usage is:
|
---|
29 | * <code>
|
---|
30 | * $parallelstoreService = new Google\Service\Parallelstore(...);
|
---|
31 | * $instances = $parallelstoreService->projects_locations_instances;
|
---|
32 | * </code>
|
---|
33 | */
|
---|
34 | class ProjectsLocationsInstances extends \Google\Service\Resource
|
---|
35 | {
|
---|
36 | /**
|
---|
37 | * Creates a Parallelstore instance in a given project and location.
|
---|
38 | * (instances.create)
|
---|
39 | *
|
---|
40 | * @param string $parent Required. The instance's project and location, in the
|
---|
41 | * format `projects/{project}/locations/{location}`. Locations map to Google
|
---|
42 | * Cloud zones; for example, `us-west1-b`.
|
---|
43 | * @param Instance $postBody
|
---|
44 | * @param array $optParams Optional parameters.
|
---|
45 | *
|
---|
46 | * @opt_param string instanceId Required. The name of the Parallelstore
|
---|
47 | * instance. * Must contain only lowercase letters, numbers, and hyphens. * Must
|
---|
48 | * start with a letter. * Must be between 1-63 characters. * Must end with a
|
---|
49 | * number or a letter. * Must be unique within the customer project / location
|
---|
50 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
51 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
52 | * the server will know to ignore the request if it has already been completed.
|
---|
53 | * The server will guarantee that for at least 60 minutes since the first
|
---|
54 | * request. For example, consider a situation where you make an initial request
|
---|
55 | * and t he request times out. If you make the request again with the same
|
---|
56 | * request ID, the server can check if original operation with the same request
|
---|
57 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
58 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
59 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
60 | * (00000000-0000-0000-0000-000000000000).
|
---|
61 | * @return Operation
|
---|
62 | * @throws \Google\Service\Exception
|
---|
63 | */
|
---|
64 | public function create($parent, Instance $postBody, $optParams = [])
|
---|
65 | {
|
---|
66 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
67 | $params = array_merge($params, $optParams);
|
---|
68 | return $this->call('create', [$params], Operation::class);
|
---|
69 | }
|
---|
70 | /**
|
---|
71 | * Deletes a single instance. (instances.delete)
|
---|
72 | *
|
---|
73 | * @param string $name Required. Name of the resource
|
---|
74 | * @param array $optParams Optional parameters.
|
---|
75 | *
|
---|
76 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
77 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
78 | * the server will know to ignore the request if it has already been completed.
|
---|
79 | * The server will guarantee that for at least 60 minutes after the first
|
---|
80 | * request. For example, consider a situation where you make an initial request
|
---|
81 | * and t he request times out. If you make the request again with the same
|
---|
82 | * request ID, the server can check if original operation with the same request
|
---|
83 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
84 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
85 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
86 | * (00000000-0000-0000-0000-000000000000).
|
---|
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 | * Copies data from Parallelstore to Cloud Storage. (instances.exportData)
|
---|
98 | *
|
---|
99 | * @param string $name Required. Name of the resource.
|
---|
100 | * @param ExportDataRequest $postBody
|
---|
101 | * @param array $optParams Optional parameters.
|
---|
102 | * @return Operation
|
---|
103 | * @throws \Google\Service\Exception
|
---|
104 | */
|
---|
105 | public function exportData($name, ExportDataRequest $postBody, $optParams = [])
|
---|
106 | {
|
---|
107 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
108 | $params = array_merge($params, $optParams);
|
---|
109 | return $this->call('exportData', [$params], Operation::class);
|
---|
110 | }
|
---|
111 | /**
|
---|
112 | * Gets details of a single instance. (instances.get)
|
---|
113 | *
|
---|
114 | * @param string $name Required. The instance resource name, in the format
|
---|
115 | * `projects/{project_id}/locations/{location}/instances/{instance_id}`.
|
---|
116 | * @param array $optParams Optional parameters.
|
---|
117 | * @return Instance
|
---|
118 | * @throws \Google\Service\Exception
|
---|
119 | */
|
---|
120 | public function get($name, $optParams = [])
|
---|
121 | {
|
---|
122 | $params = ['name' => $name];
|
---|
123 | $params = array_merge($params, $optParams);
|
---|
124 | return $this->call('get', [$params], Instance::class);
|
---|
125 | }
|
---|
126 | /**
|
---|
127 | * Copies data from Cloud Storage to Parallelstore. (instances.importData)
|
---|
128 | *
|
---|
129 | * @param string $name Required. Name of the resource.
|
---|
130 | * @param ImportDataRequest $postBody
|
---|
131 | * @param array $optParams Optional parameters.
|
---|
132 | * @return Operation
|
---|
133 | * @throws \Google\Service\Exception
|
---|
134 | */
|
---|
135 | public function importData($name, ImportDataRequest $postBody, $optParams = [])
|
---|
136 | {
|
---|
137 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
138 | $params = array_merge($params, $optParams);
|
---|
139 | return $this->call('importData', [$params], Operation::class);
|
---|
140 | }
|
---|
141 | /**
|
---|
142 | * Lists all instances in a given project and location.
|
---|
143 | * (instances.listProjectsLocationsInstances)
|
---|
144 | *
|
---|
145 | * @param string $parent Required. The project and location for which to
|
---|
146 | * retrieve instance information, in the format
|
---|
147 | * `projects/{project_id}/locations/{location}`. To retrieve instance
|
---|
148 | * information for all locations, use "-" as the value of `{location}`.
|
---|
149 | * @param array $optParams Optional parameters.
|
---|
150 | *
|
---|
151 | * @opt_param string filter Optional. Filtering results.
|
---|
152 | * @opt_param string orderBy Optional. Hint for how to order the results.
|
---|
153 | * @opt_param int pageSize Optional. Requested page size. Server may return
|
---|
154 | * fewer items than requested. If unspecified, the server will pick an
|
---|
155 | * appropriate default.
|
---|
156 | * @opt_param string pageToken Optional. A token identifying a page of results
|
---|
157 | * the server should return.
|
---|
158 | * @return ListInstancesResponse
|
---|
159 | * @throws \Google\Service\Exception
|
---|
160 | */
|
---|
161 | public function listProjectsLocationsInstances($parent, $optParams = [])
|
---|
162 | {
|
---|
163 | $params = ['parent' => $parent];
|
---|
164 | $params = array_merge($params, $optParams);
|
---|
165 | return $this->call('list', [$params], ListInstancesResponse::class);
|
---|
166 | }
|
---|
167 | /**
|
---|
168 | * Updates the parameters of a single instance. (instances.patch)
|
---|
169 | *
|
---|
170 | * @param string $name Identifier. The resource name of the instance, in the
|
---|
171 | * format `projects/{project}/locations/{location}/instances/{instance_id}`.
|
---|
172 | * @param Instance $postBody
|
---|
173 | * @param array $optParams Optional parameters.
|
---|
174 | *
|
---|
175 | * @opt_param string requestId Optional. An optional request ID to identify
|
---|
176 | * requests. Specify a unique request ID so that if you must retry your request,
|
---|
177 | * the server will know to ignore the request if it has already been completed.
|
---|
178 | * The server will guarantee that for at least 60 minutes since the first
|
---|
179 | * request. For example, consider a situation where you make an initial request
|
---|
180 | * and t he request times out. If you make the request again with the same
|
---|
181 | * request ID, the server can check if original operation with the same request
|
---|
182 | * ID was received, and if so, will ignore the second request. This prevents
|
---|
183 | * clients from accidentally creating duplicate commitments. The request ID must
|
---|
184 | * be a valid UUID with the exception that zero UUID is not supported
|
---|
185 | * (00000000-0000-0000-0000-000000000000).
|
---|
186 | * @opt_param string updateMask Required. Mask of fields to update. Field mask
|
---|
187 | * is used to specify the fields to be overwritten in the Instance resource by
|
---|
188 | * the update. At least one path must be supplied in this field. The fields
|
---|
189 | * specified in the update_mask are relative to the resource, not the full
|
---|
190 | * request.
|
---|
191 | * @return Operation
|
---|
192 | * @throws \Google\Service\Exception
|
---|
193 | */
|
---|
194 | public function patch($name, Instance $postBody, $optParams = [])
|
---|
195 | {
|
---|
196 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
197 | $params = array_merge($params, $optParams);
|
---|
198 | return $this->call('patch', [$params], Operation::class);
|
---|
199 | }
|
---|
200 | }
|
---|
201 |
|
---|
202 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
203 | class_alias(ProjectsLocationsInstances::class, 'Google_Service_Parallelstore_Resource_ProjectsLocationsInstances');
|
---|