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/**
19 * The "routers" collection of methods.
20 * Typical usage is:
21 *  <code>
22 *   $computeService = new Google_Service_Compute(...);
23 *   $routers = $computeService->routers;
24 *  </code>
25 */
26class Google_Service_Compute_Resource_Routers extends Google_Service_Resource
27{
28  /**
29   * Retrieves an aggregated list of routers. (routers.aggregatedList)
30   *
31   * @param string $project Project ID for this request.
32   * @param array $optParams Optional parameters.
33   *
34   * @opt_param string filter A filter expression that filters resources listed in
35   * the response. The expression must specify the field name, a comparison
36   * operator, and the value that you want to use for filtering. The value must be
37   * a string, a number, or a boolean. The comparison operator must be either =,
38   * !=, >, or <.
39   *
40   * For example, if you are filtering Compute Engine instances, you can exclude
41   * instances named example-instance by specifying name != example-instance.
42   *
43   * You can also filter nested fields. For example, you could specify
44   * scheduling.automaticRestart = false to include instances only if they are not
45   * scheduled for automatic restarts. You can use filtering on nested fields to
46   * filter based on resource labels.
47   *
48   * To filter on multiple expressions, provide each separate expression within
49   * parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform =
50   * "Intel Skylake"). By default, each expression is an AND expression. However,
51   * you can include AND and OR expressions explicitly. For example, (cpuPlatform
52   * = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
53   * (scheduling.automaticRestart = true).
54   * @opt_param string maxResults The maximum number of results per page that
55   * should be returned. If the number of available results is larger than
56   * maxResults, Compute Engine returns a nextPageToken that can be used to get
57   * the next page of results in subsequent list requests. Acceptable values are 0
58   * to 500, inclusive. (Default: 500)
59   * @opt_param string orderBy Sorts list results by a certain order. By default,
60   * results are returned in alphanumerical order based on the resource name.
61   *
62   * You can also sort results in descending order based on the creation timestamp
63   * using orderBy="creationTimestamp desc". This sorts results based on the
64   * creationTimestamp field in reverse chronological order (newest result first).
65   * Use this to sort resources like operations so that the newest operation is
66   * returned first.
67   *
68   * Currently, only sorting by name or creationTimestamp desc is supported.
69   * @opt_param string pageToken Specifies a page token to use. Set pageToken to
70   * the nextPageToken returned by a previous list request to get the next page of
71   * results.
72   * @return Google_Service_Compute_RouterAggregatedList
73   */
74  public function aggregatedList($project, $optParams = array())
75  {
76    $params = array('project' => $project);
77    $params = array_merge($params, $optParams);
78    return $this->call('aggregatedList', array($params), "Google_Service_Compute_RouterAggregatedList");
79  }
80  /**
81   * Deletes the specified Router resource. (routers.delete)
82   *
83   * @param string $project Project ID for this request.
84   * @param string $region Name of the region for this request.
85   * @param string $router Name of the Router resource to delete.
86   * @param array $optParams Optional parameters.
87   *
88   * @opt_param string requestId An optional request ID to identify requests.
89   * Specify a unique request ID so that if you must retry your request, the
90   * server will know to ignore the request if it has already been completed.
91   *
92   * For example, consider a situation where you make an initial request and the
93   * request times out. If you make the request again with the same request ID,
94   * the server can check if original operation with the same request ID was
95   * received, and if so, will ignore the second request. This prevents clients
96   * from accidentally creating duplicate commitments.
97   *
98   * The request ID must be a valid UUID with the exception that zero UUID is not
99   * supported (00000000-0000-0000-0000-000000000000).
100   * @return Google_Service_Compute_Operation
101   */
102  public function delete($project, $region, $router, $optParams = array())
103  {
104    $params = array('project' => $project, 'region' => $region, 'router' => $router);
105    $params = array_merge($params, $optParams);
106    return $this->call('delete', array($params), "Google_Service_Compute_Operation");
107  }
108  /**
109   * Returns the specified Router resource. Gets a list of available routers by
110   * making a list() request. (routers.get)
111   *
112   * @param string $project Project ID for this request.
113   * @param string $region Name of the region for this request.
114   * @param string $router Name of the Router resource to return.
115   * @param array $optParams Optional parameters.
116   * @return Google_Service_Compute_Router
117   */
118  public function get($project, $region, $router, $optParams = array())
119  {
120    $params = array('project' => $project, 'region' => $region, 'router' => $router);
121    $params = array_merge($params, $optParams);
122    return $this->call('get', array($params), "Google_Service_Compute_Router");
123  }
124  /**
125   * Retrieves runtime Nat mapping information of VM endpoints.
126   * (routers.getNatMappingInfo)
127   *
128   * @param string $project Project ID for this request.
129   * @param string $region Name of the region for this request.
130   * @param string $router Name of the Router resource to query for Nat Mapping
131   * information of VM endpoints.
132   * @param array $optParams Optional parameters.
133   *
134   * @opt_param string filter A filter expression that filters resources listed in
135   * the response. The expression must specify the field name, a comparison
136   * operator, and the value that you want to use for filtering. The value must be
137   * a string, a number, or a boolean. The comparison operator must be either =,
138   * !=, >, or <.
139   *
140   * For example, if you are filtering Compute Engine instances, you can exclude
141   * instances named example-instance by specifying name != example-instance.
142   *
143   * You can also filter nested fields. For example, you could specify
144   * scheduling.automaticRestart = false to include instances only if they are not
145   * scheduled for automatic restarts. You can use filtering on nested fields to
146   * filter based on resource labels.
147   *
148   * To filter on multiple expressions, provide each separate expression within
149   * parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform =
150   * "Intel Skylake"). By default, each expression is an AND expression. However,
151   * you can include AND and OR expressions explicitly. For example, (cpuPlatform
152   * = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
153   * (scheduling.automaticRestart = true).
154   * @opt_param string maxResults The maximum number of results per page that
155   * should be returned. If the number of available results is larger than
156   * maxResults, Compute Engine returns a nextPageToken that can be used to get
157   * the next page of results in subsequent list requests. Acceptable values are 0
158   * to 500, inclusive. (Default: 500)
159   * @opt_param string orderBy Sorts list results by a certain order. By default,
160   * results are returned in alphanumerical order based on the resource name.
161   *
162   * You can also sort results in descending order based on the creation timestamp
163   * using orderBy="creationTimestamp desc". This sorts results based on the
164   * creationTimestamp field in reverse chronological order (newest result first).
165   * Use this to sort resources like operations so that the newest operation is
166   * returned first.
167   *
168   * Currently, only sorting by name or creationTimestamp desc is supported.
169   * @opt_param string pageToken Specifies a page token to use. Set pageToken to
170   * the nextPageToken returned by a previous list request to get the next page of
171   * results.
172   * @return Google_Service_Compute_VmEndpointNatMappingsList
173   */
174  public function getNatMappingInfo($project, $region, $router, $optParams = array())
175  {
176    $params = array('project' => $project, 'region' => $region, 'router' => $router);
177    $params = array_merge($params, $optParams);
178    return $this->call('getNatMappingInfo', array($params), "Google_Service_Compute_VmEndpointNatMappingsList");
179  }
180  /**
181   * Retrieves runtime information of the specified router.
182   * (routers.getRouterStatus)
183   *
184   * @param string $project Project ID for this request.
185   * @param string $region Name of the region for this request.
186   * @param string $router Name of the Router resource to query.
187   * @param array $optParams Optional parameters.
188   * @return Google_Service_Compute_RouterStatusResponse
189   */
190  public function getRouterStatus($project, $region, $router, $optParams = array())
191  {
192    $params = array('project' => $project, 'region' => $region, 'router' => $router);
193    $params = array_merge($params, $optParams);
194    return $this->call('getRouterStatus', array($params), "Google_Service_Compute_RouterStatusResponse");
195  }
196  /**
197   * Creates a Router resource in the specified project and region using the data
198   * included in the request. (routers.insert)
199   *
200   * @param string $project Project ID for this request.
201   * @param string $region Name of the region for this request.
202   * @param Google_Service_Compute_Router $postBody
203   * @param array $optParams Optional parameters.
204   *
205   * @opt_param string requestId An optional request ID to identify requests.
206   * Specify a unique request ID so that if you must retry your request, the
207   * server will know to ignore the request if it has already been completed.
208   *
209   * For example, consider a situation where you make an initial request and the
210   * request times out. If you make the request again with the same request ID,
211   * the server can check if original operation with the same request ID was
212   * received, and if so, will ignore the second request. This prevents clients
213   * from accidentally creating duplicate commitments.
214   *
215   * The request ID must be a valid UUID with the exception that zero UUID is not
216   * supported (00000000-0000-0000-0000-000000000000).
217   * @return Google_Service_Compute_Operation
218   */
219  public function insert($project, $region, Google_Service_Compute_Router $postBody, $optParams = array())
220  {
221    $params = array('project' => $project, 'region' => $region, 'postBody' => $postBody);
222    $params = array_merge($params, $optParams);
223    return $this->call('insert', array($params), "Google_Service_Compute_Operation");
224  }
225  /**
226   * Retrieves a list of Router resources available to the specified project.
227   * (routers.listRouters)
228   *
229   * @param string $project Project ID for this request.
230   * @param string $region Name of the region for this request.
231   * @param array $optParams Optional parameters.
232   *
233   * @opt_param string filter A filter expression that filters resources listed in
234   * the response. The expression must specify the field name, a comparison
235   * operator, and the value that you want to use for filtering. The value must be
236   * a string, a number, or a boolean. The comparison operator must be either =,
237   * !=, >, or <.
238   *
239   * For example, if you are filtering Compute Engine instances, you can exclude
240   * instances named example-instance by specifying name != example-instance.
241   *
242   * You can also filter nested fields. For example, you could specify
243   * scheduling.automaticRestart = false to include instances only if they are not
244   * scheduled for automatic restarts. You can use filtering on nested fields to
245   * filter based on resource labels.
246   *
247   * To filter on multiple expressions, provide each separate expression within
248   * parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform =
249   * "Intel Skylake"). By default, each expression is an AND expression. However,
250   * you can include AND and OR expressions explicitly. For example, (cpuPlatform
251   * = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND
252   * (scheduling.automaticRestart = true).
253   * @opt_param string maxResults The maximum number of results per page that
254   * should be returned. If the number of available results is larger than
255   * maxResults, Compute Engine returns a nextPageToken that can be used to get
256   * the next page of results in subsequent list requests. Acceptable values are 0
257   * to 500, inclusive. (Default: 500)
258   * @opt_param string orderBy Sorts list results by a certain order. By default,
259   * results are returned in alphanumerical order based on the resource name.
260   *
261   * You can also sort results in descending order based on the creation timestamp
262   * using orderBy="creationTimestamp desc". This sorts results based on the
263   * creationTimestamp field in reverse chronological order (newest result first).
264   * Use this to sort resources like operations so that the newest operation is
265   * returned first.
266   *
267   * Currently, only sorting by name or creationTimestamp desc is supported.
268   * @opt_param string pageToken Specifies a page token to use. Set pageToken to
269   * the nextPageToken returned by a previous list request to get the next page of
270   * results.
271   * @return Google_Service_Compute_RouterList
272   */
273  public function listRouters($project, $region, $optParams = array())
274  {
275    $params = array('project' => $project, 'region' => $region);
276    $params = array_merge($params, $optParams);
277    return $this->call('list', array($params), "Google_Service_Compute_RouterList");
278  }
279  /**
280   * Patches the specified Router resource with the data included in the request.
281   * This method supports PATCH semantics and uses JSON merge patch format and
282   * processing rules. (routers.patch)
283   *
284   * @param string $project Project ID for this request.
285   * @param string $region Name of the region for this request.
286   * @param string $router Name of the Router resource to patch.
287   * @param Google_Service_Compute_Router $postBody
288   * @param array $optParams Optional parameters.
289   *
290   * @opt_param string requestId An optional request ID to identify requests.
291   * Specify a unique request ID so that if you must retry your request, the
292   * server will know to ignore the request if it has already been completed.
293   *
294   * For example, consider a situation where you make an initial request and the
295   * request times out. If you make the request again with the same request ID,
296   * the server can check if original operation with the same request ID was
297   * received, and if so, will ignore the second request. This prevents clients
298   * from accidentally creating duplicate commitments.
299   *
300   * The request ID must be a valid UUID with the exception that zero UUID is not
301   * supported (00000000-0000-0000-0000-000000000000).
302   * @return Google_Service_Compute_Operation
303   */
304  public function patch($project, $region, $router, Google_Service_Compute_Router $postBody, $optParams = array())
305  {
306    $params = array('project' => $project, 'region' => $region, 'router' => $router, 'postBody' => $postBody);
307    $params = array_merge($params, $optParams);
308    return $this->call('patch', array($params), "Google_Service_Compute_Operation");
309  }
310  /**
311   * Preview fields auto-generated during router create and update operations.
312   * Calling this method does NOT create or update the router. (routers.preview)
313   *
314   * @param string $project Project ID for this request.
315   * @param string $region Name of the region for this request.
316   * @param string $router Name of the Router resource to query.
317   * @param Google_Service_Compute_Router $postBody
318   * @param array $optParams Optional parameters.
319   * @return Google_Service_Compute_RoutersPreviewResponse
320   */
321  public function preview($project, $region, $router, Google_Service_Compute_Router $postBody, $optParams = array())
322  {
323    $params = array('project' => $project, 'region' => $region, 'router' => $router, 'postBody' => $postBody);
324    $params = array_merge($params, $optParams);
325    return $this->call('preview', array($params), "Google_Service_Compute_RoutersPreviewResponse");
326  }
327  /**
328   * Updates the specified Router resource with the data included in the request.
329   * (routers.update)
330   *
331   * @param string $project Project ID for this request.
332   * @param string $region Name of the region for this request.
333   * @param string $router Name of the Router resource to update.
334   * @param Google_Service_Compute_Router $postBody
335   * @param array $optParams Optional parameters.
336   *
337   * @opt_param string requestId An optional request ID to identify requests.
338   * Specify a unique request ID so that if you must retry your request, the
339   * server will know to ignore the request if it has already been completed.
340   *
341   * For example, consider a situation where you make an initial request and the
342   * request times out. If you make the request again with the same request ID,
343   * the server can check if original operation with the same request ID was
344   * received, and if so, will ignore the second request. This prevents clients
345   * from accidentally creating duplicate commitments.
346   *
347   * The request ID must be a valid UUID with the exception that zero UUID is not
348   * supported (00000000-0000-0000-0000-000000000000).
349   * @return Google_Service_Compute_Operation
350   */
351  public function update($project, $region, $router, Google_Service_Compute_Router $postBody, $optParams = array())
352  {
353    $params = array('project' => $project, 'region' => $region, 'router' => $router, 'postBody' => $postBody);
354    $params = array_merge($params, $optParams);
355    return $this->call('update', array($params), "Google_Service_Compute_Operation");
356  }
357}
358