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\NetAppFiles\Resource;
|
---|
19 |
|
---|
20 | use Google\Service\NetAppFiles\EstablishPeeringRequest;
|
---|
21 | use Google\Service\NetAppFiles\ListReplicationsResponse;
|
---|
22 | use Google\Service\NetAppFiles\Operation;
|
---|
23 | use Google\Service\NetAppFiles\Replication;
|
---|
24 | use Google\Service\NetAppFiles\ResumeReplicationRequest;
|
---|
25 | use Google\Service\NetAppFiles\ReverseReplicationDirectionRequest;
|
---|
26 | use Google\Service\NetAppFiles\StopReplicationRequest;
|
---|
27 | use Google\Service\NetAppFiles\SyncReplicationRequest;
|
---|
28 |
|
---|
29 | /**
|
---|
30 | * The "replications" collection of methods.
|
---|
31 | * Typical usage is:
|
---|
32 | * <code>
|
---|
33 | * $netappService = new Google\Service\NetAppFiles(...);
|
---|
34 | * $replications = $netappService->projects_locations_volumes_replications;
|
---|
35 | * </code>
|
---|
36 | */
|
---|
37 | class ProjectsLocationsVolumesReplications extends \Google\Service\Resource
|
---|
38 | {
|
---|
39 | /**
|
---|
40 | * Create a new replication for a volume. (replications.create)
|
---|
41 | *
|
---|
42 | * @param string $parent Required. The NetApp volume to create the replications
|
---|
43 | * of, in the format
|
---|
44 | * `projects/{project_id}/locations/{location}/volumes/{volume_id}`
|
---|
45 | * @param Replication $postBody
|
---|
46 | * @param array $optParams Optional parameters.
|
---|
47 | *
|
---|
48 | * @opt_param string replicationId Required. ID of the replication to create.
|
---|
49 | * Must be unique within the parent resource. Must contain only letters, numbers
|
---|
50 | * and hyphen, with the first character a letter, the last a letter or a number,
|
---|
51 | * and a 63 character maximum.
|
---|
52 | * @return Operation
|
---|
53 | * @throws \Google\Service\Exception
|
---|
54 | */
|
---|
55 | public function create($parent, Replication $postBody, $optParams = [])
|
---|
56 | {
|
---|
57 | $params = ['parent' => $parent, 'postBody' => $postBody];
|
---|
58 | $params = array_merge($params, $optParams);
|
---|
59 | return $this->call('create', [$params], Operation::class);
|
---|
60 | }
|
---|
61 | /**
|
---|
62 | * Deletes a replication. (replications.delete)
|
---|
63 | *
|
---|
64 | * @param string $name Required. The replication resource name, in the format
|
---|
65 | * `projects/locations/volumes/replications/{replication_id}`
|
---|
66 | * @param array $optParams Optional parameters.
|
---|
67 | * @return Operation
|
---|
68 | * @throws \Google\Service\Exception
|
---|
69 | */
|
---|
70 | public function delete($name, $optParams = [])
|
---|
71 | {
|
---|
72 | $params = ['name' => $name];
|
---|
73 | $params = array_merge($params, $optParams);
|
---|
74 | return $this->call('delete', [$params], Operation::class);
|
---|
75 | }
|
---|
76 | /**
|
---|
77 | * Establish replication peering. (replications.establishPeering)
|
---|
78 | *
|
---|
79 | * @param string $name Required. The resource name of the replication, in the
|
---|
80 | * format of projects/{project_id}/locations/{location}/volumes/{volume_id}/repl
|
---|
81 | * ications/{replication_id}.
|
---|
82 | * @param EstablishPeeringRequest $postBody
|
---|
83 | * @param array $optParams Optional parameters.
|
---|
84 | * @return Operation
|
---|
85 | * @throws \Google\Service\Exception
|
---|
86 | */
|
---|
87 | public function establishPeering($name, EstablishPeeringRequest $postBody, $optParams = [])
|
---|
88 | {
|
---|
89 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
90 | $params = array_merge($params, $optParams);
|
---|
91 | return $this->call('establishPeering', [$params], Operation::class);
|
---|
92 | }
|
---|
93 | /**
|
---|
94 | * Describe a replication for a volume. (replications.get)
|
---|
95 | *
|
---|
96 | * @param string $name Required. The replication resource name, in the format `p
|
---|
97 | * rojects/{project_id}/locations/{location}/volumes/{volume_id}/replications/{r
|
---|
98 | * eplication_id}`
|
---|
99 | * @param array $optParams Optional parameters.
|
---|
100 | * @return Replication
|
---|
101 | * @throws \Google\Service\Exception
|
---|
102 | */
|
---|
103 | public function get($name, $optParams = [])
|
---|
104 | {
|
---|
105 | $params = ['name' => $name];
|
---|
106 | $params = array_merge($params, $optParams);
|
---|
107 | return $this->call('get', [$params], Replication::class);
|
---|
108 | }
|
---|
109 | /**
|
---|
110 | * Returns descriptions of all replications for a volume.
|
---|
111 | * (replications.listProjectsLocationsVolumesReplications)
|
---|
112 | *
|
---|
113 | * @param string $parent Required. The volume for which to retrieve replication
|
---|
114 | * information, in the format
|
---|
115 | * `projects/{project_id}/locations/{location}/volumes/{volume_id}`.
|
---|
116 | * @param array $optParams Optional parameters.
|
---|
117 | *
|
---|
118 | * @opt_param string filter List filter.
|
---|
119 | * @opt_param string orderBy Sort results. Supported values are "name", "name
|
---|
120 | * desc" or "" (unsorted).
|
---|
121 | * @opt_param int pageSize The maximum number of items to return.
|
---|
122 | * @opt_param string pageToken The next_page_token value to use if there are
|
---|
123 | * additional results to retrieve for this list request.
|
---|
124 | * @return ListReplicationsResponse
|
---|
125 | * @throws \Google\Service\Exception
|
---|
126 | */
|
---|
127 | public function listProjectsLocationsVolumesReplications($parent, $optParams = [])
|
---|
128 | {
|
---|
129 | $params = ['parent' => $parent];
|
---|
130 | $params = array_merge($params, $optParams);
|
---|
131 | return $this->call('list', [$params], ListReplicationsResponse::class);
|
---|
132 | }
|
---|
133 | /**
|
---|
134 | * Updates the settings of a specific replication. (replications.patch)
|
---|
135 | *
|
---|
136 | * @param string $name Identifier. The resource name of the Replication. Format:
|
---|
137 | * `projects/{project_id}/locations/{location}/volumes/{volume_id}/replications/
|
---|
138 | * {replication_id}`.
|
---|
139 | * @param Replication $postBody
|
---|
140 | * @param array $optParams Optional parameters.
|
---|
141 | *
|
---|
142 | * @opt_param string updateMask Required. Mask of fields to update. At least one
|
---|
143 | * path must be supplied in this field.
|
---|
144 | * @return Operation
|
---|
145 | * @throws \Google\Service\Exception
|
---|
146 | */
|
---|
147 | public function patch($name, Replication $postBody, $optParams = [])
|
---|
148 | {
|
---|
149 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
150 | $params = array_merge($params, $optParams);
|
---|
151 | return $this->call('patch', [$params], Operation::class);
|
---|
152 | }
|
---|
153 | /**
|
---|
154 | * Resume Cross Region Replication. (replications.resume)
|
---|
155 | *
|
---|
156 | * @param string $name Required. The resource name of the replication, in the
|
---|
157 | * format of projects/{project_id}/locations/{location}/volumes/{volume_id}/repl
|
---|
158 | * ications/{replication_id}.
|
---|
159 | * @param ResumeReplicationRequest $postBody
|
---|
160 | * @param array $optParams Optional parameters.
|
---|
161 | * @return Operation
|
---|
162 | * @throws \Google\Service\Exception
|
---|
163 | */
|
---|
164 | public function resume($name, ResumeReplicationRequest $postBody, $optParams = [])
|
---|
165 | {
|
---|
166 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
167 | $params = array_merge($params, $optParams);
|
---|
168 | return $this->call('resume', [$params], Operation::class);
|
---|
169 | }
|
---|
170 | /**
|
---|
171 | * Reverses direction of replication. Source becomes destination and destination
|
---|
172 | * becomes source. (replications.reverseDirection)
|
---|
173 | *
|
---|
174 | * @param string $name Required. The resource name of the replication, in the
|
---|
175 | * format of projects/{project_id}/locations/{location}/volumes/{volume_id}/repl
|
---|
176 | * ications/{replication_id}.
|
---|
177 | * @param ReverseReplicationDirectionRequest $postBody
|
---|
178 | * @param array $optParams Optional parameters.
|
---|
179 | * @return Operation
|
---|
180 | * @throws \Google\Service\Exception
|
---|
181 | */
|
---|
182 | public function reverseDirection($name, ReverseReplicationDirectionRequest $postBody, $optParams = [])
|
---|
183 | {
|
---|
184 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
185 | $params = array_merge($params, $optParams);
|
---|
186 | return $this->call('reverseDirection', [$params], Operation::class);
|
---|
187 | }
|
---|
188 | /**
|
---|
189 | * Stop Cross Region Replication. (replications.stop)
|
---|
190 | *
|
---|
191 | * @param string $name Required. The resource name of the replication, in the
|
---|
192 | * format of projects/{project_id}/locations/{location}/volumes/{volume_id}/repl
|
---|
193 | * ications/{replication_id}.
|
---|
194 | * @param StopReplicationRequest $postBody
|
---|
195 | * @param array $optParams Optional parameters.
|
---|
196 | * @return Operation
|
---|
197 | * @throws \Google\Service\Exception
|
---|
198 | */
|
---|
199 | public function stop($name, StopReplicationRequest $postBody, $optParams = [])
|
---|
200 | {
|
---|
201 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
202 | $params = array_merge($params, $optParams);
|
---|
203 | return $this->call('stop', [$params], Operation::class);
|
---|
204 | }
|
---|
205 | /**
|
---|
206 | * Syncs the replication. This will invoke one time volume data transfer from
|
---|
207 | * source to destination. (replications.sync)
|
---|
208 | *
|
---|
209 | * @param string $name Required. The resource name of the replication, in the
|
---|
210 | * format of projects/{project_id}/locations/{location}/volumes/{volume_id}/repl
|
---|
211 | * ications/{replication_id}.
|
---|
212 | * @param SyncReplicationRequest $postBody
|
---|
213 | * @param array $optParams Optional parameters.
|
---|
214 | * @return Operation
|
---|
215 | * @throws \Google\Service\Exception
|
---|
216 | */
|
---|
217 | public function sync($name, SyncReplicationRequest $postBody, $optParams = [])
|
---|
218 | {
|
---|
219 | $params = ['name' => $name, 'postBody' => $postBody];
|
---|
220 | $params = array_merge($params, $optParams);
|
---|
221 | return $this->call('sync', [$params], Operation::class);
|
---|
222 | }
|
---|
223 | }
|
---|
224 |
|
---|
225 | // Adding a class alias for backwards compatibility with the previous class name.
|
---|
226 | class_alias(ProjectsLocationsVolumesReplications::class, 'Google_Service_NetAppFiles_Resource_ProjectsLocationsVolumesReplications');
|
---|