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\CancelCloneJobRequest;
|
---|
21 | use Google\Service\VMMigrationService\CloneJob;
|
---|
22 | use Google\Service\VMMigrationService\ListCloneJobsResponse;
|
---|
23 | use Google\Service\VMMigrationService\Operation;
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * The "cloneJobs" collection of methods.
|
---|
27 | * Typical usage is:
|
---|
28 | * <code>
|
---|
29 | * $vmmigrationService = new Google\Service\VMMigrationService(...);
|
---|
30 | * $cloneJobs = $vmmigrationService->projects_locations_sources_migratingVms_cloneJobs;
|
---|
31 | * </code>
|
---|
32 | */
|
---|
33 | class ProjectsLocationsSourcesMigratingVmsCloneJobs extends \Google\Service\Resource
|
---|
34 | {
|
---|
35 | /**
|
---|
36 | * Initiates the cancellation of a running clone job. (cloneJobs.cancel)
|
---|
37 | *
|
---|
38 | * @param string $name Required. The clone job id
|
---|
39 | * @param CancelCloneJobRequest $postBody
|
---|
40 | * @param array $optParams Optional parameters.
|
---|
41 | * @return Operation
|
---|
42 | * @throws \Google\Service\Exception
|
---|
43 | */
|
---|
44 | public function cancel($name, CancelCloneJobRequest $postBody, $optParams = [])
|
---|
45 | {
|
---|
46 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
47 | $params = array_merge($params, $optParams);
|
---|
48 | return $this->call('cancel', [$params], Operation::class);
|
---|
49 | }
|
---|
50 | /**
|
---|
51 | * Initiates a Clone of a specific migrating VM. (cloneJobs.create)
|
---|
52 | *
|
---|
53 | * @param string $parent Required. The Clone's parent.
|
---|
54 | * @param CloneJob $postBody
|
---|
55 | * @param array $optParams Optional parameters.
|
---|
56 | *
|
---|
57 | * @opt_param string cloneJobId Required. The clone job identifier.
|
---|
58 | * @opt_param string requestId A request ID to identify requests. Specify a
|
---|
59 | * unique request ID so that if you must retry your request, the server will
|
---|
60 | * know to ignore the request if it has already been completed. The server will
|
---|
61 | * guarantee that for at least 60 minutes since the first request. For example,
|
---|
62 | * consider a situation where you make an initial request and the request times
|
---|
63 | * out. If you make the request again with the same request ID, the server can
|
---|
64 | * check if original operation with the same request ID was received, and if so,
|
---|
65 | * will ignore the second request. This prevents clients from accidentally
|
---|
66 | * creating duplicate commitments. The request ID must be a valid UUID with the
|
---|
67 | * exception that zero UUID is not supported
|
---|
68 | * (00000000-0000-0000-0000-000000000000).
|
---|
69 | * @return Operation
|
---|
70 | * @throws \Google\Service\Exception
|
---|
71 | */
|
---|
72 | public function create($parent, CloneJob $postBody, $optParams = [])
|
---|
73 | {
|
---|
74 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
75 | $params = array_merge($params, $optParams);
|
---|
76 | return $this->call('create', [$params], Operation::class);
|
---|
77 | }
|
---|
78 | /**
|
---|
79 | * Gets details of a single CloneJob. (cloneJobs.get)
|
---|
80 | *
|
---|
81 | * @param string $name Required. The name of the CloneJob.
|
---|
82 | * @param array $optParams Optional parameters.
|
---|
83 | * @return CloneJob
|
---|
84 | * @throws \Google\Service\Exception
|
---|
85 | */
|
---|
86 | public function get($name, $optParams = [])
|
---|
87 | {
|
---|
88 | $params = ['name' => $name];
|
---|
89 | $params = array_merge($params, $optParams);
|
---|
90 | return $this->call('get', [$params], CloneJob::class);
|
---|
91 | }
|
---|
92 | /**
|
---|
93 | * Lists the CloneJobs of a migrating VM. Only 25 most recent CloneJobs are
|
---|
94 | * listed. (cloneJobs.listProjectsLocationsSourcesMigratingVmsCloneJobs)
|
---|
95 | *
|
---|
96 | * @param string $parent Required. The parent, which owns this collection of
|
---|
97 | * source VMs.
|
---|
98 | * @param array $optParams Optional parameters.
|
---|
99 | *
|
---|
100 | * @opt_param string filter Optional. The filter request.
|
---|
101 | * @opt_param string orderBy Optional. the order by fields for the result.
|
---|
102 | * @opt_param int pageSize Optional. The maximum number of clone jobs to return.
|
---|
103 | * The service may return fewer than this value. If unspecified, at most 500
|
---|
104 | * clone jobs will be returned. The maximum value is 1000; values above 1000
|
---|
105 | * will be coerced to 1000.
|
---|
106 | * @opt_param string pageToken Required. A page token, received from a previous
|
---|
107 | * `ListCloneJobs` call. Provide this to retrieve the subsequent page. When
|
---|
108 | * paginating, all other parameters provided to `ListCloneJobs` must match the
|
---|
109 | * call that provided the page token.
|
---|
110 | * @return ListCloneJobsResponse
|
---|
111 | * @throws \Google\Service\Exception
|
---|
112 | */
|
---|
113 | public function listProjectsLocationsSourcesMigratingVmsCloneJobs($parent, $optParams = [])
|
---|
114 | {
|
---|
115 | $params = ['parent' => $parent];
|
---|
116 | $params = array_merge($params, $optParams);
|
---|
117 | return $this->call('list', [$params], ListCloneJobsResponse::class);
|
---|
118 | }
|
---|
119 | }
|
---|
120 |
|
---|
121 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
122 | class_alias(ProjectsLocationsSourcesMigratingVmsCloneJobs::class, 'Google_Service_VMMigrationService_Resource_ProjectsLocationsSourcesMigratingVmsCloneJobs');
|
---|