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\Baremetalsolution\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\Baremetalsolution\DetachLunRequest;
|
---|
21 | use Google\Service\Baremetalsolution\DisableHyperthreadingRequest;
|
---|
22 | use Google\Service\Baremetalsolution\DisableInteractiveSerialConsoleRequest;
|
---|
23 | use Google\Service\Baremetalsolution\EnableHyperthreadingRequest;
|
---|
24 | use Google\Service\Baremetalsolution\EnableInteractiveSerialConsoleRequest;
|
---|
25 | use Google\Service\Baremetalsolution\Instance;
|
---|
26 | use Google\Service\Baremetalsolution\ListInstancesResponse;
|
---|
27 | use Google\Service\Baremetalsolution\LoadInstanceAuthInfoResponse;
|
---|
28 | use Google\Service\Baremetalsolution\Operation;
|
---|
29 | use Google\Service\Baremetalsolution\ReimageInstanceRequest;
|
---|
30 | use Google\Service\Baremetalsolution\RenameInstanceRequest;
|
---|
31 | use Google\Service\Baremetalsolution\ResetInstanceRequest;
|
---|
32 | use Google\Service\Baremetalsolution\StartInstanceRequest;
|
---|
33 | use Google\Service\Baremetalsolution\StopInstanceRequest;
|
---|
34 |
|
---|
35 | /**
|
---|
36 | * The "instances" collection of methods.
|
---|
37 | * Typical usage is:
|
---|
38 | * <code>
|
---|
39 | * $baremetalsolutionService = new Google\Service\Baremetalsolution(...);
|
---|
40 | * $instances = $baremetalsolutionService->projects_locations_instances;
|
---|
41 | * </code>
|
---|
42 | */
|
---|
43 | class ProjectsLocationsInstances extends \Google\Service\Resource
|
---|
44 | {
|
---|
45 | /**
|
---|
46 | * Detach LUN from Instance. (instances.detachLun)
|
---|
47 | *
|
---|
48 | * @param string $instance Required. Name of the instance.
|
---|
49 | * @param DetachLunRequest $postBody
|
---|
50 | * @param array $optParams Optional parameters.
|
---|
51 | * @return Operation
|
---|
52 | * @throws \Google\Service\Exception
|
---|
53 | */
|
---|
54 | public function detachLun($instance, DetachLunRequest $postBody, $optParams = [])
|
---|
55 | {
|
---|
56 | $params = ['instance' => $instance, 'postBody' => $postBody];
|
---|
57 | $params = array_merge($params, $optParams);
|
---|
58 | return $this->call('detachLun', [$params], Operation::class);
|
---|
59 | }
|
---|
60 | /**
|
---|
61 | * Perform disable hyperthreading operation on a single server.
|
---|
62 | * (instances.disableHyperthreading)
|
---|
63 | *
|
---|
64 | * @param string $name Required. The `name` field is used to identify the
|
---|
65 | * instance. Format:
|
---|
66 | * projects/{project}/locations/{location}/instances/{instance}
|
---|
67 | * @param DisableHyperthreadingRequest $postBody
|
---|
68 | * @param array $optParams Optional parameters.
|
---|
69 | * @return Operation
|
---|
70 | * @throws \Google\Service\Exception
|
---|
71 | */
|
---|
72 | public function disableHyperthreading($name, DisableHyperthreadingRequest $postBody, $optParams = [])
|
---|
73 | {
|
---|
74 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
75 | $params = array_merge($params, $optParams);
|
---|
76 | return $this->call('disableHyperthreading', [$params], Operation::class);
|
---|
77 | }
|
---|
78 | /**
|
---|
79 | * Disable the interactive serial console feature on an instance.
|
---|
80 | * (instances.disableInteractiveSerialConsole)
|
---|
81 | *
|
---|
82 | * @param string $name Required. Name of the resource.
|
---|
83 | * @param DisableInteractiveSerialConsoleRequest $postBody
|
---|
84 | * @param array $optParams Optional parameters.
|
---|
85 | * @return Operation
|
---|
86 | * @throws \Google\Service\Exception
|
---|
87 | */
|
---|
88 | public function disableInteractiveSerialConsole($name, DisableInteractiveSerialConsoleRequest $postBody, $optParams = [])
|
---|
89 | {
|
---|
90 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
91 | $params = array_merge($params, $optParams);
|
---|
92 | return $this->call('disableInteractiveSerialConsole', [$params], Operation::class);
|
---|
93 | }
|
---|
94 | /**
|
---|
95 | * Perform enable hyperthreading operation on a single server.
|
---|
96 | * (instances.enableHyperthreading)
|
---|
97 | *
|
---|
98 | * @param string $name Required. The `name` field is used to identify the
|
---|
99 | * instance. Format:
|
---|
100 | * projects/{project}/locations/{location}/instances/{instance}
|
---|
101 | * @param EnableHyperthreadingRequest $postBody
|
---|
102 | * @param array $optParams Optional parameters.
|
---|
103 | * @return Operation
|
---|
104 | * @throws \Google\Service\Exception
|
---|
105 | */
|
---|
106 | public function enableHyperthreading($name, EnableHyperthreadingRequest $postBody, $optParams = [])
|
---|
107 | {
|
---|
108 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
109 | $params = array_merge($params, $optParams);
|
---|
110 | return $this->call('enableHyperthreading', [$params], Operation::class);
|
---|
111 | }
|
---|
112 | /**
|
---|
113 | * Enable the interactive serial console feature on an instance.
|
---|
114 | * (instances.enableInteractiveSerialConsole)
|
---|
115 | *
|
---|
116 | * @param string $name Required. Name of the resource.
|
---|
117 | * @param EnableInteractiveSerialConsoleRequest $postBody
|
---|
118 | * @param array $optParams Optional parameters.
|
---|
119 | * @return Operation
|
---|
120 | * @throws \Google\Service\Exception
|
---|
121 | */
|
---|
122 | public function enableInteractiveSerialConsole($name, EnableInteractiveSerialConsoleRequest $postBody, $optParams = [])
|
---|
123 | {
|
---|
124 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
125 | $params = array_merge($params, $optParams);
|
---|
126 | return $this->call('enableInteractiveSerialConsole', [$params], Operation::class);
|
---|
127 | }
|
---|
128 | /**
|
---|
129 | * Get details about a single server. (instances.get)
|
---|
130 | *
|
---|
131 | * @param string $name Required. Name of the resource.
|
---|
132 | * @param array $optParams Optional parameters.
|
---|
133 | * @return Instance
|
---|
134 | * @throws \Google\Service\Exception
|
---|
135 | */
|
---|
136 | public function get($name, $optParams = [])
|
---|
137 | {
|
---|
138 | $params = ['name' => $name];
|
---|
139 | $params = array_merge($params, $optParams);
|
---|
140 | return $this->call('get', [$params], Instance::class);
|
---|
141 | }
|
---|
142 | /**
|
---|
143 | * List servers in a given project and location.
|
---|
144 | * (instances.listProjectsLocationsInstances)
|
---|
145 | *
|
---|
146 | * @param string $parent Required. Parent value for ListInstancesRequest.
|
---|
147 | * @param array $optParams Optional parameters.
|
---|
148 | *
|
---|
149 | * @opt_param string filter List filter.
|
---|
150 | * @opt_param int pageSize Requested page size. Server may return fewer items
|
---|
151 | * than requested. If unspecified, the server will pick an appropriate default.
|
---|
152 | * @opt_param string pageToken A token identifying a page of results from the
|
---|
153 | * server.
|
---|
154 | * @return ListInstancesResponse
|
---|
155 | * @throws \Google\Service\Exception
|
---|
156 | */
|
---|
157 | public function listProjectsLocationsInstances($parent, $optParams = [])
|
---|
158 | {
|
---|
159 | $params = ['parent' => $parent];
|
---|
160 | $params = array_merge($params, $optParams);
|
---|
161 | return $this->call('list', [$params], ListInstancesResponse::class);
|
---|
162 | }
|
---|
163 | /**
|
---|
164 | * Load auth info for a server. (instances.loadAuthInfo)
|
---|
165 | *
|
---|
166 | * @param string $name Required. Name of the server.
|
---|
167 | * @param array $optParams Optional parameters.
|
---|
168 | * @return LoadInstanceAuthInfoResponse
|
---|
169 | * @throws \Google\Service\Exception
|
---|
170 | */
|
---|
171 | public function loadAuthInfo($name, $optParams = [])
|
---|
172 | {
|
---|
173 | $params = ['name' => $name];
|
---|
174 | $params = array_merge($params, $optParams);
|
---|
175 | return $this->call('loadAuthInfo', [$params], LoadInstanceAuthInfoResponse::class);
|
---|
176 | }
|
---|
177 | /**
|
---|
178 | * Update details of a single server. (instances.patch)
|
---|
179 | *
|
---|
180 | * @param string $name Immutable. The resource name of this `Instance`. Resource
|
---|
181 | * names are schemeless URIs that follow the conventions in
|
---|
182 | * https://cloud.google.com/apis/design/resource_names. Format:
|
---|
183 | * `projects/{project}/locations/{location}/instances/{instance}`
|
---|
184 | * @param Instance $postBody
|
---|
185 | * @param array $optParams Optional parameters.
|
---|
186 | *
|
---|
187 | * @opt_param string updateMask The list of fields to update. The currently
|
---|
188 | * supported fields are: `labels` `hyperthreading_enabled` `os_image` `ssh_keys`
|
---|
189 | * `kms_key_version`
|
---|
190 | * @return Operation
|
---|
191 | * @throws \Google\Service\Exception
|
---|
192 | */
|
---|
193 | public function patch($name, Instance $postBody, $optParams = [])
|
---|
194 | {
|
---|
195 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
196 | $params = array_merge($params, $optParams);
|
---|
197 | return $this->call('patch', [$params], Operation::class);
|
---|
198 | }
|
---|
199 | /**
|
---|
200 | * Perform reimage operation on a single server. (instances.reimage)
|
---|
201 | *
|
---|
202 | * @param string $name Required. The `name` field is used to identify the
|
---|
203 | * instance. Format:
|
---|
204 | * projects/{project}/locations/{location}/instances/{instance}
|
---|
205 | * @param ReimageInstanceRequest $postBody
|
---|
206 | * @param array $optParams Optional parameters.
|
---|
207 | * @return Operation
|
---|
208 | * @throws \Google\Service\Exception
|
---|
209 | */
|
---|
210 | public function reimage($name, ReimageInstanceRequest $postBody, $optParams = [])
|
---|
211 | {
|
---|
212 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
213 | $params = array_merge($params, $optParams);
|
---|
214 | return $this->call('reimage', [$params], Operation::class);
|
---|
215 | }
|
---|
216 | /**
|
---|
217 | * RenameInstance sets a new name for an instance. Use with caution, previous
|
---|
218 | * names become immediately invalidated. (instances.rename)
|
---|
219 | *
|
---|
220 | * @param string $name Required. The `name` field is used to identify the
|
---|
221 | * instance. Format:
|
---|
222 | * projects/{project}/locations/{location}/instances/{instance}
|
---|
223 | * @param RenameInstanceRequest $postBody
|
---|
224 | * @param array $optParams Optional parameters.
|
---|
225 | * @return Instance
|
---|
226 | * @throws \Google\Service\Exception
|
---|
227 | */
|
---|
228 | public function rename($name, RenameInstanceRequest $postBody, $optParams = [])
|
---|
229 | {
|
---|
230 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
231 | $params = array_merge($params, $optParams);
|
---|
232 | return $this->call('rename', [$params], Instance::class);
|
---|
233 | }
|
---|
234 | /**
|
---|
235 | * Perform an ungraceful, hard reset on a server. Equivalent to shutting the
|
---|
236 | * power off and then turning it back on. (instances.reset)
|
---|
237 | *
|
---|
238 | * @param string $name Required. Name of the resource.
|
---|
239 | * @param ResetInstanceRequest $postBody
|
---|
240 | * @param array $optParams Optional parameters.
|
---|
241 | * @return Operation
|
---|
242 | * @throws \Google\Service\Exception
|
---|
243 | */
|
---|
244 | public function reset($name, ResetInstanceRequest $postBody, $optParams = [])
|
---|
245 | {
|
---|
246 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
247 | $params = array_merge($params, $optParams);
|
---|
248 | return $this->call('reset', [$params], Operation::class);
|
---|
249 | }
|
---|
250 | /**
|
---|
251 | * Starts a server that was shutdown. (instances.start)
|
---|
252 | *
|
---|
253 | * @param string $name Required. Name of the resource.
|
---|
254 | * @param StartInstanceRequest $postBody
|
---|
255 | * @param array $optParams Optional parameters.
|
---|
256 | * @return Operation
|
---|
257 | * @throws \Google\Service\Exception
|
---|
258 | */
|
---|
259 | public function start($name, StartInstanceRequest $postBody, $optParams = [])
|
---|
260 | {
|
---|
261 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
262 | $params = array_merge($params, $optParams);
|
---|
263 | return $this->call('start', [$params], Operation::class);
|
---|
264 | }
|
---|
265 | /**
|
---|
266 | * Stop a running server. (instances.stop)
|
---|
267 | *
|
---|
268 | * @param string $name Required. Name of the resource.
|
---|
269 | * @param StopInstanceRequest $postBody
|
---|
270 | * @param array $optParams Optional parameters.
|
---|
271 | * @return Operation
|
---|
272 | * @throws \Google\Service\Exception
|
---|
273 | */
|
---|
274 | public function stop($name, StopInstanceRequest $postBody, $optParams = [])
|
---|
275 | {
|
---|
276 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
277 | $params = array_merge($params, $optParams);
|
---|
278 | return $this->call('stop', [$params], Operation::class);
|
---|
279 | }
|
---|
280 | }
|
---|
281 |
|
---|
282 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
283 | class_alias(ProjectsLocationsInstances::class, 'Google_Service_Baremetalsolution_Resource_ProjectsLocationsInstances');
|
---|