source: vendor/google/apiclient-services/src/Compute/Resource/Networks.php

Last change on this file was e3d4e0a, checked in by Vlado 222039 <vlado.popovski@…>, 10 days ago

Upload project files

  • Property mode set to 100644
File size: 21.5 KB
Line 
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
18namespace Google\Service\Compute\Resource;
19
20use Google\Service\Compute\ExchangedPeeringRoutesList;
21use Google\Service\Compute\Network;
22use Google\Service\Compute\NetworkList;
23use Google\Service\Compute\NetworksAddPeeringRequest;
24use Google\Service\Compute\NetworksGetEffectiveFirewallsResponse;
25use Google\Service\Compute\NetworksRemovePeeringRequest;
26use Google\Service\Compute\NetworksUpdatePeeringRequest;
27use Google\Service\Compute\Operation;
28
29/**
30 * The "networks" collection of methods.
31 * Typical usage is:
32 * <code>
33 * $computeService = new Google\Service\Compute(...);
34 * $networks = $computeService->networks;
35 * </code>
36 */
37class Networks extends \Google\Service\Resource
38{
39 /**
40 * Adds a peering to the specified network. (networks.addPeering)
41 *
42 * @param string $project Project ID for this request.
43 * @param string $network Name of the network resource to add peering to.
44 * @param NetworksAddPeeringRequest $postBody
45 * @param array $optParams Optional parameters.
46 *
47 * @opt_param string requestId An optional request ID to identify requests.
48 * Specify a unique request ID so that if you must retry your request, the
49 * server will know to ignore the request if it has already been completed. For
50 * example, consider a situation where you make an initial request and the
51 * request times out. If you make the request again with the same request ID,
52 * the server can check if original operation with the same request ID was
53 * received, and if so, will ignore the second request. This prevents clients
54 * from accidentally creating duplicate commitments. The request ID must be a
55 * valid UUID with the 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 addPeering($project, $network, NetworksAddPeeringRequest $postBody, $optParams = [])
61 {
62 $params = ['project' => $project, 'network' => $network, 'postBody' => $postBody];
63 $params = array_merge($params, $optParams);
64 return $this->call('addPeering', [$params], Operation::class);
65 }
66 /**
67 * Deletes the specified network. (networks.delete)
68 *
69 * @param string $project Project ID for this request.
70 * @param string $network Name of the network to delete.
71 * @param array $optParams Optional parameters.
72 *
73 * @opt_param string requestId An optional request ID to identify requests.
74 * Specify a unique request ID so that if you must retry your request, the
75 * server will know to ignore the request if it has already been completed. For
76 * example, consider a situation where you make an initial request and the
77 * request times out. If you make the request again with the same request ID,
78 * the server can check if original operation with the same request ID was
79 * received, and if so, will ignore the second request. This prevents clients
80 * from accidentally creating duplicate commitments. The request ID must be a
81 * valid UUID with the exception that zero UUID is not supported (
82 * 00000000-0000-0000-0000-000000000000).
83 * @return Operation
84 * @throws \Google\Service\Exception
85 */
86 public function delete($project, $network, $optParams = [])
87 {
88 $params = ['project' => $project, 'network' => $network];
89 $params = array_merge($params, $optParams);
90 return $this->call('delete', [$params], Operation::class);
91 }
92 /**
93 * Returns the specified network. (networks.get)
94 *
95 * @param string $project Project ID for this request.
96 * @param string $network Name of the network to return.
97 * @param array $optParams Optional parameters.
98 * @return Network
99 * @throws \Google\Service\Exception
100 */
101 public function get($project, $network, $optParams = [])
102 {
103 $params = ['project' => $project, 'network' => $network];
104 $params = array_merge($params, $optParams);
105 return $this->call('get', [$params], Network::class);
106 }
107 /**
108 * Returns the effective firewalls on a given network.
109 * (networks.getEffectiveFirewalls)
110 *
111 * @param string $project Project ID for this request.
112 * @param string $network Name of the network for this request.
113 * @param array $optParams Optional parameters.
114 * @return NetworksGetEffectiveFirewallsResponse
115 * @throws \Google\Service\Exception
116 */
117 public function getEffectiveFirewalls($project, $network, $optParams = [])
118 {
119 $params = ['project' => $project, 'network' => $network];
120 $params = array_merge($params, $optParams);
121 return $this->call('getEffectiveFirewalls', [$params], NetworksGetEffectiveFirewallsResponse::class);
122 }
123 /**
124 * Creates a network in the specified project using the data included in the
125 * request. (networks.insert)
126 *
127 * @param string $project Project ID for this request.
128 * @param Network $postBody
129 * @param array $optParams Optional parameters.
130 *
131 * @opt_param string requestId An optional request ID to identify requests.
132 * Specify a unique request ID so that if you must retry your request, the
133 * server will know to ignore the request if it has already been completed. For
134 * example, consider a situation where you make an initial request and the
135 * request times out. If you make the request again with the same request ID,
136 * the server can check if original operation with the same request ID was
137 * received, and if so, will ignore the second request. This prevents clients
138 * from accidentally creating duplicate commitments. The request ID must be a
139 * valid UUID with the exception that zero UUID is not supported (
140 * 00000000-0000-0000-0000-000000000000).
141 * @return Operation
142 * @throws \Google\Service\Exception
143 */
144 public function insert($project, Network $postBody, $optParams = [])
145 {
146 $params = ['project' => $project, 'postBody' => $postBody];
147 $params = array_merge($params, $optParams);
148 return $this->call('insert', [$params], Operation::class);
149 }
150 /**
151 * Retrieves the list of networks available to the specified project.
152 * (networks.listNetworks)
153 *
154 * @param string $project Project ID for this request.
155 * @param array $optParams Optional parameters.
156 *
157 * @opt_param string filter A filter expression that filters resources listed in
158 * the response. Most Compute resources support two types of filter expressions:
159 * expressions that support regular expressions and expressions that follow API
160 * improvement proposal AIP-160. These two types of filter expressions cannot be
161 * mixed in one request. If you want to use AIP-160, your expression must
162 * specify the field name, an operator, and the value that you want to use for
163 * filtering. The value must be a string, a number, or a boolean. The operator
164 * must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you
165 * are filtering Compute Engine instances, you can exclude instances named
166 * `example-instance` by specifying `name != example-instance`. The `:*`
167 * comparison can be used to test whether a key has been defined. For example,
168 * to find all objects with `owner` label use: ``` labels.owner:* ``` You can
169 * also filter nested fields. For example, you could specify
170 * `scheduling.automaticRestart = false` to include instances only if they are
171 * not scheduled for automatic restarts. You can use filtering on nested fields
172 * to filter based on resource labels. To filter on multiple expressions,
173 * provide each separate expression within parentheses. For example: ```
174 * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
175 * default, each expression is an `AND` expression. However, you can include
176 * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
177 * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
178 * (scheduling.automaticRestart = true) ``` If you want to use a regular
179 * expression, use the `eq` (equal) or `ne` (not equal) operator against a
180 * single un-parenthesized expression with or without quotes or against multiple
181 * parenthesized expressions. Examples: `fieldname eq unquoted literal`
182 * `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"`
183 * `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is
184 * interpreted as a regular expression using Google RE2 library syntax. The
185 * literal value must match the entire field. For example, to filter for
186 * instances that do not end with name "instance", you would use `name ne
187 * .*instance`. You cannot combine constraints on multiple fields using regular
188 * expressions.
189 * @opt_param string maxResults The maximum number of results per page that
190 * should be returned. If the number of available results is larger than
191 * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
192 * get the next page of results in subsequent list requests. Acceptable values
193 * are `0` to `500`, inclusive. (Default: `500`)
194 * @opt_param string orderBy Sorts list results by a certain order. By default,
195 * results are returned in alphanumerical order based on the resource name. You
196 * can also sort results in descending order based on the creation timestamp
197 * using `orderBy="creationTimestamp desc"`. This sorts results based on the
198 * `creationTimestamp` field in reverse chronological order (newest result
199 * first). Use this to sort resources like operations so that the newest
200 * operation is returned first. Currently, only sorting by `name` or
201 * `creationTimestamp desc` is supported.
202 * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
203 * the `nextPageToken` returned by a previous list request to get the next page
204 * of results.
205 * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
206 * which provides partial results in case of failure. The default value is
207 * false. For example, when partial success behavior is enabled, aggregatedList
208 * for a single zone scope either returns all resources in the zone or no
209 * resources, with an error code.
210 * @return NetworkList
211 * @throws \Google\Service\Exception
212 */
213 public function listNetworks($project, $optParams = [])
214 {
215 $params = ['project' => $project];
216 $params = array_merge($params, $optParams);
217 return $this->call('list', [$params], NetworkList::class);
218 }
219 /**
220 * Lists the peering routes exchanged over peering connection.
221 * (networks.listPeeringRoutes)
222 *
223 * @param string $project Project ID for this request.
224 * @param string $network Name of the network for this request.
225 * @param array $optParams Optional parameters.
226 *
227 * @opt_param string direction The direction of the exchanged routes.
228 * @opt_param string filter A filter expression that filters resources listed in
229 * the response. Most Compute resources support two types of filter expressions:
230 * expressions that support regular expressions and expressions that follow API
231 * improvement proposal AIP-160. These two types of filter expressions cannot be
232 * mixed in one request. If you want to use AIP-160, your expression must
233 * specify the field name, an operator, and the value that you want to use for
234 * filtering. The value must be a string, a number, or a boolean. The operator
235 * must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you
236 * are filtering Compute Engine instances, you can exclude instances named
237 * `example-instance` by specifying `name != example-instance`. The `:*`
238 * comparison can be used to test whether a key has been defined. For example,
239 * to find all objects with `owner` label use: ``` labels.owner:* ``` You can
240 * also filter nested fields. For example, you could specify
241 * `scheduling.automaticRestart = false` to include instances only if they are
242 * not scheduled for automatic restarts. You can use filtering on nested fields
243 * to filter based on resource labels. To filter on multiple expressions,
244 * provide each separate expression within parentheses. For example: ```
245 * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
246 * default, each expression is an `AND` expression. However, you can include
247 * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
248 * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
249 * (scheduling.automaticRestart = true) ``` If you want to use a regular
250 * expression, use the `eq` (equal) or `ne` (not equal) operator against a
251 * single un-parenthesized expression with or without quotes or against multiple
252 * parenthesized expressions. Examples: `fieldname eq unquoted literal`
253 * `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"`
254 * `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is
255 * interpreted as a regular expression using Google RE2 library syntax. The
256 * literal value must match the entire field. For example, to filter for
257 * instances that do not end with name "instance", you would use `name ne
258 * .*instance`. You cannot combine constraints on multiple fields using regular
259 * expressions.
260 * @opt_param string maxResults The maximum number of results per page that
261 * should be returned. If the number of available results is larger than
262 * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
263 * get the next page of results in subsequent list requests. Acceptable values
264 * are `0` to `500`, inclusive. (Default: `500`)
265 * @opt_param string orderBy Sorts list results by a certain order. By default,
266 * results are returned in alphanumerical order based on the resource name. You
267 * can also sort results in descending order based on the creation timestamp
268 * using `orderBy="creationTimestamp desc"`. This sorts results based on the
269 * `creationTimestamp` field in reverse chronological order (newest result
270 * first). Use this to sort resources like operations so that the newest
271 * operation is returned first. Currently, only sorting by `name` or
272 * `creationTimestamp desc` is supported.
273 * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
274 * the `nextPageToken` returned by a previous list request to get the next page
275 * of results.
276 * @opt_param string peeringName The response will show routes exchanged over
277 * the given peering connection.
278 * @opt_param string region The region of the request. The response will include
279 * all subnet routes, static routes and dynamic routes in the region.
280 * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
281 * which provides partial results in case of failure. The default value is
282 * false. For example, when partial success behavior is enabled, aggregatedList
283 * for a single zone scope either returns all resources in the zone or no
284 * resources, with an error code.
285 * @return ExchangedPeeringRoutesList
286 * @throws \Google\Service\Exception
287 */
288 public function listPeeringRoutes($project, $network, $optParams = [])
289 {
290 $params = ['project' => $project, 'network' => $network];
291 $params = array_merge($params, $optParams);
292 return $this->call('listPeeringRoutes', [$params], ExchangedPeeringRoutesList::class);
293 }
294 /**
295 * Patches the specified network with the data included in the request. Only
296 * routingConfig can be modified. (networks.patch)
297 *
298 * @param string $project Project ID for this request.
299 * @param string $network Name of the network to update.
300 * @param Network $postBody
301 * @param array $optParams Optional parameters.
302 *
303 * @opt_param string requestId An optional request ID to identify requests.
304 * Specify a unique request ID so that if you must retry your request, the
305 * server will know to ignore the request if it has already been completed. For
306 * example, consider a situation where you make an initial request and the
307 * request times out. If you make the request again with the same request ID,
308 * the server can check if original operation with the same request ID was
309 * received, and if so, will ignore the second request. This prevents clients
310 * from accidentally creating duplicate commitments. The request ID must be a
311 * valid UUID with the exception that zero UUID is not supported (
312 * 00000000-0000-0000-0000-000000000000).
313 * @return Operation
314 * @throws \Google\Service\Exception
315 */
316 public function patch($project, $network, Network $postBody, $optParams = [])
317 {
318 $params = ['project' => $project, 'network' => $network, 'postBody' => $postBody];
319 $params = array_merge($params, $optParams);
320 return $this->call('patch', [$params], Operation::class);
321 }
322 /**
323 * Removes a peering from the specified network. (networks.removePeering)
324 *
325 * @param string $project Project ID for this request.
326 * @param string $network Name of the network resource to remove peering from.
327 * @param NetworksRemovePeeringRequest $postBody
328 * @param array $optParams Optional parameters.
329 *
330 * @opt_param string requestId An optional request ID to identify requests.
331 * Specify a unique request ID so that if you must retry your request, the
332 * server will know to ignore the request if it has already been completed. For
333 * example, consider a situation where you make an initial request and the
334 * request times out. If you make the request again with the same request ID,
335 * the server can check if original operation with the same request ID was
336 * received, and if so, will ignore the second request. This prevents clients
337 * from accidentally creating duplicate commitments. The request ID must be a
338 * valid UUID with the exception that zero UUID is not supported (
339 * 00000000-0000-0000-0000-000000000000).
340 * @return Operation
341 * @throws \Google\Service\Exception
342 */
343 public function removePeering($project, $network, NetworksRemovePeeringRequest $postBody, $optParams = [])
344 {
345 $params = ['project' => $project, 'network' => $network, 'postBody' => $postBody];
346 $params = array_merge($params, $optParams);
347 return $this->call('removePeering', [$params], Operation::class);
348 }
349 /**
350 * Switches the network mode from auto subnet mode to custom subnet mode.
351 * (networks.switchToCustomMode)
352 *
353 * @param string $project Project ID for this request.
354 * @param string $network Name of the network to be updated.
355 * @param array $optParams Optional parameters.
356 *
357 * @opt_param string requestId An optional request ID to identify requests.
358 * Specify a unique request ID so that if you must retry your request, the
359 * server will know to ignore the request if it has already been completed. For
360 * example, consider a situation where you make an initial request and the
361 * request times out. If you make the request again with the same request ID,
362 * the server can check if original operation with the same request ID was
363 * received, and if so, will ignore the second request. This prevents clients
364 * from accidentally creating duplicate commitments. The request ID must be a
365 * valid UUID with the exception that zero UUID is not supported (
366 * 00000000-0000-0000-0000-000000000000).
367 * @return Operation
368 * @throws \Google\Service\Exception
369 */
370 public function switchToCustomMode($project, $network, $optParams = [])
371 {
372 $params = ['project' => $project, 'network' => $network];
373 $params = array_merge($params, $optParams);
374 return $this->call('switchToCustomMode', [$params], Operation::class);
375 }
376 /**
377 * Updates the specified network peering with the data included in the request.
378 * You can only modify the NetworkPeering.export_custom_routes field and the
379 * NetworkPeering.import_custom_routes field. (networks.updatePeering)
380 *
381 * @param string $project Project ID for this request.
382 * @param string $network Name of the network resource which the updated peering
383 * is belonging to.
384 * @param NetworksUpdatePeeringRequest $postBody
385 * @param array $optParams Optional parameters.
386 *
387 * @opt_param string requestId An optional request ID to identify requests.
388 * Specify a unique request ID so that if you must retry your request, the
389 * server will know to ignore the request if it has already been completed. For
390 * example, consider a situation where you make an initial request and the
391 * request times out. If you make the request again with the same request ID,
392 * the server can check if original operation with the same request ID was
393 * received, and if so, will ignore the second request. This prevents clients
394 * from accidentally creating duplicate commitments. The request ID must be a
395 * valid UUID with the exception that zero UUID is not supported (
396 * 00000000-0000-0000-0000-000000000000).
397 * @return Operation
398 * @throws \Google\Service\Exception
399 */
400 public function updatePeering($project, $network, NetworksUpdatePeeringRequest $postBody, $optParams = [])
401 {
402 $params = ['project' => $project, 'network' => $network, 'postBody' => $postBody];
403 $params = array_merge($params, $optParams);
404 return $this->call('updatePeering', [$params], Operation::class);
405 }
406}
407
408// Adding a class alias for backwards compatibility with the previous class name.
409class_alias(Networks::class, 'Google_Service_Compute_Resource_Networks');
Note: See TracBrowser for help on using the repository browser.