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\VMMigrationService\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\VMMigrationService\FinalizeMigrationRequest;
|
---|
21 | use Google\Service\VMMigrationService\ListMigratingVmsResponse;
|
---|
22 | use Google\Service\VMMigrationService\MigratingVm;
|
---|
23 | use Google\Service\VMMigrationService\Operation;
|
---|
24 | use Google\Service\VMMigrationService\PauseMigrationRequest;
|
---|
25 | use Google\Service\VMMigrationService\ResumeMigrationRequest;
|
---|
26 | use Google\Service\VMMigrationService\StartMigrationRequest;
|
---|
27 |
|
---|
28 | /**
|
---|
29 | * The "migratingVms" collection of methods.
|
---|
30 | * Typical usage is:
|
---|
31 | * <code>
|
---|
32 | * $vmmigrationService = new Google\Service\VMMigrationService(...);
|
---|
33 | * $migratingVms = $vmmigrationService->projects_locations_sources_migratingVms;
|
---|
34 | * </code>
|
---|
35 | */
|
---|
36 | class ProjectsLocationsSourcesMigratingVms extends \Google\Service\Resource
|
---|
37 | {
|
---|
38 | /**
|
---|
39 | * Creates a new MigratingVm in a given Source. (migratingVms.create)
|
---|
40 | *
|
---|
41 | * @param string $parent Required. The MigratingVm's parent.
|
---|
42 | * @param MigratingVm $postBody
|
---|
43 | * @param array $optParams Optional parameters.
|
---|
44 | *
|
---|
45 | * @opt_param string migratingVmId Required. The migratingVm identifier.
|
---|
46 | * @opt_param string requestId A request ID to identify requests. Specify a
|
---|
47 | * unique request ID so that if you must retry your request, the server will
|
---|
48 | * know to ignore the request if it has already been completed. The server will
|
---|
49 | * guarantee that for at least 60 minutes since the first request. For example,
|
---|
50 | * consider a situation where you make an initial request and the request times
|
---|
51 | * out. If you make the request again with the same request ID, the server can
|
---|
52 | * check if original operation with the same request ID was received, and if so,
|
---|
53 | * will ignore the second request. This prevents clients from accidentally
|
---|
54 | * creating duplicate commitments. The request ID must be a valid UUID with the
|
---|
55 | * exception that zero UUID is not supported
|
---|
56 | * (00000000-0000-0000-0000-000000000000).
|
---|
57 | * @return Operation
|
---|
58 | * @throws \Google\Service\Exception
|
---|
59 | */
|
---|
60 | public function create($parent, MigratingVm $postBody, $optParams = [])
|
---|
61 | {
|
---|
62 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
63 | $params = array_merge($params, $optParams);
|
---|
64 | return $this->call('create', [$params], Operation::class);
|
---|
65 | }
|
---|
66 | /**
|
---|
67 | * Deletes a single MigratingVm. (migratingVms.delete)
|
---|
68 | *
|
---|
69 | * @param string $name Required. The name of the MigratingVm.
|
---|
70 | * @param array $optParams Optional parameters.
|
---|
71 | * @return Operation
|
---|
72 | * @throws \Google\Service\Exception
|
---|
73 | */
|
---|
74 | public function delete($name, $optParams = [])
|
---|
75 | {
|
---|
76 | $params = ['name' => $name];
|
---|
77 | $params = array_merge($params, $optParams);
|
---|
78 | return $this->call('delete', [$params], Operation::class);
|
---|
79 | }
|
---|
80 | /**
|
---|
81 | * Marks a migration as completed, deleting migration resources that are no
|
---|
82 | * longer being used. Only applicable after cutover is done.
|
---|
83 | * (migratingVms.finalizeMigration)
|
---|
84 | *
|
---|
85 | * @param string $migratingVm Required. The name of the MigratingVm.
|
---|
86 | * @param FinalizeMigrationRequest $postBody
|
---|
87 | * @param array $optParams Optional parameters.
|
---|
88 | * @return Operation
|
---|
89 | * @throws \Google\Service\Exception
|
---|
90 | */
|
---|
91 | public function finalizeMigration($migratingVm, FinalizeMigrationRequest $postBody, $optParams = [])
|
---|
92 | {
|
---|
93 | $params = ['migratingVm' => $migratingVm, 'postBody' => $postBody];
|
---|
94 | $params = array_merge($params, $optParams);
|
---|
95 | return $this->call('finalizeMigration', [$params], Operation::class);
|
---|
96 | }
|
---|
97 | /**
|
---|
98 | * Gets details of a single MigratingVm. (migratingVms.get)
|
---|
99 | *
|
---|
100 | * @param string $name Required. The name of the MigratingVm.
|
---|
101 | * @param array $optParams Optional parameters.
|
---|
102 | *
|
---|
103 | * @opt_param string view Optional. The level of details of the migrating VM.
|
---|
104 | * @return MigratingVm
|
---|
105 | * @throws \Google\Service\Exception
|
---|
106 | */
|
---|
107 | public function get($name, $optParams = [])
|
---|
108 | {
|
---|
109 | $params = ['name' => $name];
|
---|
110 | $params = array_merge($params, $optParams);
|
---|
111 | return $this->call('get', [$params], MigratingVm::class);
|
---|
112 | }
|
---|
113 | /**
|
---|
114 | * Lists MigratingVms in a given Source.
|
---|
115 | * (migratingVms.listProjectsLocationsSourcesMigratingVms)
|
---|
116 | *
|
---|
117 | * @param string $parent Required. The parent, which owns this collection of
|
---|
118 | * MigratingVms.
|
---|
119 | * @param array $optParams Optional parameters.
|
---|
120 | *
|
---|
121 | * @opt_param string filter Optional. The filter request.
|
---|
122 | * @opt_param string orderBy Optional. the order by fields for the result.
|
---|
123 | * @opt_param int pageSize Optional. The maximum number of migrating VMs to
|
---|
124 | * return. The service may return fewer than this value. If unspecified, at most
|
---|
125 | * 500 migrating VMs will be returned. The maximum value is 1000; values above
|
---|
126 | * 1000 will be coerced to 1000.
|
---|
127 | * @opt_param string pageToken Required. A page token, received from a previous
|
---|
128 | * `ListMigratingVms` call. Provide this to retrieve the subsequent page. When
|
---|
129 | * paginating, all other parameters provided to `ListMigratingVms` must match
|
---|
130 | * the call that provided the page token.
|
---|
131 | * @opt_param string view Optional. The level of details of each migrating VM.
|
---|
132 | * @return ListMigratingVmsResponse
|
---|
133 | * @throws \Google\Service\Exception
|
---|
134 | */
|
---|
135 | public function listProjectsLocationsSourcesMigratingVms($parent, $optParams = [])
|
---|
136 | {
|
---|
137 | $params = ['parent' => $parent];
|
---|
138 | $params = array_merge($params, $optParams);
|
---|
139 | return $this->call('list', [$params], ListMigratingVmsResponse::class);
|
---|
140 | }
|
---|
141 | /**
|
---|
142 | * Updates the parameters of a single MigratingVm. (migratingVms.patch)
|
---|
143 | *
|
---|
144 | * @param string $name Output only. The identifier of the MigratingVm.
|
---|
145 | * @param MigratingVm $postBody
|
---|
146 | * @param array $optParams Optional parameters.
|
---|
147 | *
|
---|
148 | * @opt_param string requestId A request ID to identify requests. Specify a
|
---|
149 | * unique request ID so that if you must retry your request, the server will
|
---|
150 | * know to ignore the request if it has already been completed. The server will
|
---|
151 | * guarantee that for at least 60 minutes since the first request. For example,
|
---|
152 | * consider a situation where you make an initial request and the request times
|
---|
153 | * out. If you make the request again with the same request ID, the server can
|
---|
154 | * check if original operation with the same request ID was received, and if so,
|
---|
155 | * will ignore the second request. This prevents clients from accidentally
|
---|
156 | * creating duplicate commitments. The request ID must be a valid UUID with the
|
---|
157 | * exception that zero UUID is not supported
|
---|
158 | * (00000000-0000-0000-0000-000000000000).
|
---|
159 | * @opt_param string updateMask Field mask is used to specify the fields to be
|
---|
160 | * overwritten in the MigratingVm resource by the update. The fields specified
|
---|
161 | * in the update_mask are relative to the resource, not the full request. A
|
---|
162 | * field will be overwritten if it is in the mask. If the user does not provide
|
---|
163 | * a mask then all fields will be overwritten.
|
---|
164 | * @return Operation
|
---|
165 | * @throws \Google\Service\Exception
|
---|
166 | */
|
---|
167 | public function patch($name, MigratingVm $postBody, $optParams = [])
|
---|
168 | {
|
---|
169 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
170 | $params = array_merge($params, $optParams);
|
---|
171 | return $this->call('patch', [$params], Operation::class);
|
---|
172 | }
|
---|
173 | /**
|
---|
174 | * Pauses a migration for a VM. If cycle tasks are running they will be
|
---|
175 | * cancelled, preserving source task data. Further replication cycles will not
|
---|
176 | * be triggered while the VM is paused. (migratingVms.pauseMigration)
|
---|
177 | *
|
---|
178 | * @param string $migratingVm Required. The name of the MigratingVm.
|
---|
179 | * @param PauseMigrationRequest $postBody
|
---|
180 | * @param array $optParams Optional parameters.
|
---|
181 | * @return Operation
|
---|
182 | * @throws \Google\Service\Exception
|
---|
183 | */
|
---|
184 | public function pauseMigration($migratingVm, PauseMigrationRequest $postBody, $optParams = [])
|
---|
185 | {
|
---|
186 | $params = ['migratingVm' => $migratingVm, 'postBody' => $postBody];
|
---|
187 | $params = array_merge($params, $optParams);
|
---|
188 | return $this->call('pauseMigration', [$params], Operation::class);
|
---|
189 | }
|
---|
190 | /**
|
---|
191 | * Resumes a migration for a VM. When called on a paused migration, will start
|
---|
192 | * the process of uploading data and creating snapshots; when called on a
|
---|
193 | * completed cut-over migration, will update the migration to active state and
|
---|
194 | * start the process of uploading data and creating snapshots.
|
---|
195 | * (migratingVms.resumeMigration)
|
---|
196 | *
|
---|
197 | * @param string $migratingVm Required. The name of the MigratingVm.
|
---|
198 | * @param ResumeMigrationRequest $postBody
|
---|
199 | * @param array $optParams Optional parameters.
|
---|
200 | * @return Operation
|
---|
201 | * @throws \Google\Service\Exception
|
---|
202 | */
|
---|
203 | public function resumeMigration($migratingVm, ResumeMigrationRequest $postBody, $optParams = [])
|
---|
204 | {
|
---|
205 | $params = ['migratingVm' => $migratingVm, 'postBody' => $postBody];
|
---|
206 | $params = array_merge($params, $optParams);
|
---|
207 | return $this->call('resumeMigration', [$params], Operation::class);
|
---|
208 | }
|
---|
209 | /**
|
---|
210 | * Starts migration for a VM. Starts the process of uploading data and creating
|
---|
211 | * snapshots, in replication cycles scheduled by the policy.
|
---|
212 | * (migratingVms.startMigration)
|
---|
213 | *
|
---|
214 | * @param string $migratingVm Required. The name of the MigratingVm.
|
---|
215 | * @param StartMigrationRequest $postBody
|
---|
216 | * @param array $optParams Optional parameters.
|
---|
217 | * @return Operation
|
---|
218 | * @throws \Google\Service\Exception
|
---|
219 | */
|
---|
220 | public function startMigration($migratingVm, StartMigrationRequest $postBody, $optParams = [])
|
---|
221 | {
|
---|
222 | $params = ['migratingVm' => $migratingVm, 'postBody' => $postBody];
|
---|
223 | $params = array_merge($params, $optParams);
|
---|
224 | return $this->call('startMigration', [$params], Operation::class);
|
---|
225 | }
|
---|
226 | }
|
---|
227 |
|
---|
228 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
229 | class_alias(ProjectsLocationsSourcesMigratingVms::class, 'Google_Service_VMMigrationService_Resource_ProjectsLocationsSourcesMigratingVms');
|
---|