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\DatacenterConnector;
|
---|
21 | use Google\Service\VMMigrationService\ListDatacenterConnectorsResponse;
|
---|
22 | use Google\Service\VMMigrationService\Operation;
|
---|
23 | use Google\Service\VMMigrationService\UpgradeApplianceRequest;
|
---|
24 |
|
---|
25 | /**
|
---|
26 | * The "datacenterConnectors" collection of methods.
|
---|
27 | * Typical usage is:
|
---|
28 | * <code>
|
---|
29 | * $vmmigrationService = new Google\Service\VMMigrationService(...);
|
---|
30 | * $datacenterConnectors = $vmmigrationService->projects_locations_sources_datacenterConnectors;
|
---|
31 | * </code>
|
---|
32 | */
|
---|
33 | class ProjectsLocationsSourcesDatacenterConnectors extends \Google\Service\Resource
|
---|
34 | {
|
---|
35 | /**
|
---|
36 | * Creates a new DatacenterConnector in a given Source.
|
---|
37 | * (datacenterConnectors.create)
|
---|
38 | *
|
---|
39 | * @param string $parent Required. The DatacenterConnector's parent. Required.
|
---|
40 | * The Source in where the new DatacenterConnector will be created. For example:
|
---|
41 | * `projects/my-project/locations/us-central1/sources/my-source`
|
---|
42 | * @param DatacenterConnector $postBody
|
---|
43 | * @param array $optParams Optional parameters.
|
---|
44 | *
|
---|
45 | * @opt_param string datacenterConnectorId Required. The datacenterConnector
|
---|
46 | * identifier.
|
---|
47 | * @opt_param string requestId A request ID to identify requests. Specify a
|
---|
48 | * unique request ID so that if you must retry your request, the server will
|
---|
49 | * know to ignore the request if it has already been completed. The server will
|
---|
50 | * guarantee that for at least 60 minutes since the first request. For example,
|
---|
51 | * consider a situation where you make an initial request and the request times
|
---|
52 | * out. If you make the request again with the same request ID, the server can
|
---|
53 | * check if original operation with the same request ID was received, and if so,
|
---|
54 | * will ignore the second request. This prevents clients from accidentally
|
---|
55 | * creating duplicate commitments. The request ID must be a valid UUID with the
|
---|
56 | * exception that zero UUID is not supported
|
---|
57 | * (00000000-0000-0000-0000-000000000000).
|
---|
58 | * @return Operation
|
---|
59 | * @throws \Google\Service\Exception
|
---|
60 | */
|
---|
61 | public function create($parent, DatacenterConnector $postBody, $optParams = [])
|
---|
62 | {
|
---|
63 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
64 | $params = array_merge($params, $optParams);
|
---|
65 | return $this->call('create', [$params], Operation::class);
|
---|
66 | }
|
---|
67 | /**
|
---|
68 | * Deletes a single DatacenterConnector. (datacenterConnectors.delete)
|
---|
69 | *
|
---|
70 | * @param string $name Required. The DatacenterConnector name.
|
---|
71 | * @param array $optParams Optional parameters.
|
---|
72 | *
|
---|
73 | * @opt_param string requestId A request ID to identify requests. Specify a
|
---|
74 | * unique request ID so that if you must retry your request, the server will
|
---|
75 | * know to ignore the request if it has already been completed. The server will
|
---|
76 | * guarantee that for at least 60 minutes after the first request. For example,
|
---|
77 | * consider a situation where you make an initial request and the request times
|
---|
78 | * out. If you make the request again with the same request ID, the server can
|
---|
79 | * check if original operation with the same request ID was received, and if so,
|
---|
80 | * will ignore the second request. This prevents clients from accidentally
|
---|
81 | * creating duplicate commitments. The request ID must be a valid UUID with the
|
---|
82 | * exception that zero UUID is not supported
|
---|
83 | * (00000000-0000-0000-0000-000000000000).
|
---|
84 | * @return Operation
|
---|
85 | * @throws \Google\Service\Exception
|
---|
86 | */
|
---|
87 | public function delete($name, $optParams = [])
|
---|
88 | {
|
---|
89 | $params = ['name' => $name];
|
---|
90 | $params = array_merge($params, $optParams);
|
---|
91 | return $this->call('delete', [$params], Operation::class);
|
---|
92 | }
|
---|
93 | /**
|
---|
94 | * Gets details of a single DatacenterConnector. (datacenterConnectors.get)
|
---|
95 | *
|
---|
96 | * @param string $name Required. The name of the DatacenterConnector.
|
---|
97 | * @param array $optParams Optional parameters.
|
---|
98 | * @return DatacenterConnector
|
---|
99 | * @throws \Google\Service\Exception
|
---|
100 | */
|
---|
101 | public function get($name, $optParams = [])
|
---|
102 | {
|
---|
103 | $params = ['name' => $name];
|
---|
104 | $params = array_merge($params, $optParams);
|
---|
105 | return $this->call('get', [$params], DatacenterConnector::class);
|
---|
106 | }
|
---|
107 | /**
|
---|
108 | * Lists DatacenterConnectors in a given Source.
|
---|
109 | * (datacenterConnectors.listProjectsLocationsSourcesDatacenterConnectors)
|
---|
110 | *
|
---|
111 | * @param string $parent Required. The parent, which owns this collection of
|
---|
112 | * connectors.
|
---|
113 | * @param array $optParams Optional parameters.
|
---|
114 | *
|
---|
115 | * @opt_param string filter Optional. The filter request.
|
---|
116 | * @opt_param string orderBy Optional. the order by fields for the result.
|
---|
117 | * @opt_param int pageSize Optional. The maximum number of connectors to return.
|
---|
118 | * The service may return fewer than this value. If unspecified, at most 500
|
---|
119 | * sources will be returned. The maximum value is 1000; values above 1000 will
|
---|
120 | * be coerced to 1000.
|
---|
121 | * @opt_param string pageToken Required. A page token, received from a previous
|
---|
122 | * `ListDatacenterConnectors` call. Provide this to retrieve the subsequent
|
---|
123 | * page. When paginating, all other parameters provided to
|
---|
124 | * `ListDatacenterConnectors` must match the call that provided the page token.
|
---|
125 | * @return ListDatacenterConnectorsResponse
|
---|
126 | * @throws \Google\Service\Exception
|
---|
127 | */
|
---|
128 | public function listProjectsLocationsSourcesDatacenterConnectors($parent, $optParams = [])
|
---|
129 | {
|
---|
130 | $params = ['parent' => $parent];
|
---|
131 | $params = array_merge($params, $optParams);
|
---|
132 | return $this->call('list', [$params], ListDatacenterConnectorsResponse::class);
|
---|
133 | }
|
---|
134 | /**
|
---|
135 | * Upgrades the appliance relate to this DatacenterConnector to the in-place
|
---|
136 | * updateable version. (datacenterConnectors.upgradeAppliance)
|
---|
137 | *
|
---|
138 | * @param string $datacenterConnector Required. The DatacenterConnector name.
|
---|
139 | * @param UpgradeApplianceRequest $postBody
|
---|
140 | * @param array $optParams Optional parameters.
|
---|
141 | * @return Operation
|
---|
142 | * @throws \Google\Service\Exception
|
---|
143 | */
|
---|
144 | public function upgradeAppliance($datacenterConnector, UpgradeApplianceRequest $postBody, $optParams = [])
|
---|
145 | {
|
---|
146 | $params = ['datacenterConnector' => $datacenterConnector, 'postBody' => $postBody];
|
---|
147 | $params = array_merge($params, $optParams);
|
---|
148 | return $this->call('upgradeAppliance', [$params], Operation::class);
|
---|
149 | }
|
---|
150 | }
|
---|
151 |
|
---|
152 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
153 | class_alias(ProjectsLocationsSourcesDatacenterConnectors::class, 'Google_Service_VMMigrationService_Resource_ProjectsLocationsSourcesDatacenterConnectors');
|
---|