source: vendor/google/apiclient-services/src/Compute/Resource/Routes.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: 8.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\Operation;
21use Google\Service\Compute\Route;
22use Google\Service\Compute\RouteList;
23
24/**
25 * The "routes" collection of methods.
26 * Typical usage is:
27 * <code>
28 * $computeService = new Google\Service\Compute(...);
29 * $routes = $computeService->routes;
30 * </code>
31 */
32class Routes extends \Google\Service\Resource
33{
34 /**
35 * Deletes the specified Route resource. (routes.delete)
36 *
37 * @param string $project Project ID for this request.
38 * @param string $route Name of the Route resource to delete.
39 * @param array $optParams Optional parameters.
40 *
41 * @opt_param string requestId An optional request ID to identify requests.
42 * Specify a unique request ID so that if you must retry your request, the
43 * server will know to ignore the request if it has already been completed. For
44 * example, consider a situation where you make an initial request and the
45 * request times out. If you make the request again with the same request ID,
46 * the server can check if original operation with the same request ID was
47 * received, and if so, will ignore the second request. This prevents clients
48 * from accidentally creating duplicate commitments. The request ID must be a
49 * valid UUID with the exception that zero UUID is not supported (
50 * 00000000-0000-0000-0000-000000000000).
51 * @return Operation
52 * @throws \Google\Service\Exception
53 */
54 public function delete($project, $route, $optParams = [])
55 {
56 $params = ['project' => $project, 'route' => $route];
57 $params = array_merge($params, $optParams);
58 return $this->call('delete', [$params], Operation::class);
59 }
60 /**
61 * Returns the specified Route resource. (routes.get)
62 *
63 * @param string $project Project ID for this request.
64 * @param string $route Name of the Route resource to return.
65 * @param array $optParams Optional parameters.
66 * @return Route
67 * @throws \Google\Service\Exception
68 */
69 public function get($project, $route, $optParams = [])
70 {
71 $params = ['project' => $project, 'route' => $route];
72 $params = array_merge($params, $optParams);
73 return $this->call('get', [$params], Route::class);
74 }
75 /**
76 * Creates a Route resource in the specified project using the data included in
77 * the request. (routes.insert)
78 *
79 * @param string $project Project ID for this request.
80 * @param Route $postBody
81 * @param array $optParams Optional parameters.
82 *
83 * @opt_param string requestId An optional request ID to identify requests.
84 * Specify a unique request ID so that if you must retry your request, the
85 * server will know to ignore the request if it has already been completed. For
86 * example, consider a situation where you make an initial request and the
87 * request times out. If you make the request again with the same request ID,
88 * the server can check if original operation with the same request ID was
89 * received, and if so, will ignore the second request. This prevents clients
90 * from accidentally creating duplicate commitments. The request ID must be a
91 * valid UUID with the exception that zero UUID is not supported (
92 * 00000000-0000-0000-0000-000000000000).
93 * @return Operation
94 * @throws \Google\Service\Exception
95 */
96 public function insert($project, Route $postBody, $optParams = [])
97 {
98 $params = ['project' => $project, 'postBody' => $postBody];
99 $params = array_merge($params, $optParams);
100 return $this->call('insert', [$params], Operation::class);
101 }
102 /**
103 * Retrieves the list of Route resources available to the specified project.
104 * (routes.listRoutes)
105 *
106 * @param string $project Project ID for this request.
107 * @param array $optParams Optional parameters.
108 *
109 * @opt_param string filter A filter expression that filters resources listed in
110 * the response. Most Compute resources support two types of filter expressions:
111 * expressions that support regular expressions and expressions that follow API
112 * improvement proposal AIP-160. These two types of filter expressions cannot be
113 * mixed in one request. If you want to use AIP-160, your expression must
114 * specify the field name, an operator, and the value that you want to use for
115 * filtering. The value must be a string, a number, or a boolean. The operator
116 * must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you
117 * are filtering Compute Engine instances, you can exclude instances named
118 * `example-instance` by specifying `name != example-instance`. The `:*`
119 * comparison can be used to test whether a key has been defined. For example,
120 * to find all objects with `owner` label use: ``` labels.owner:* ``` You can
121 * also filter nested fields. For example, you could specify
122 * `scheduling.automaticRestart = false` to include instances only if they are
123 * not scheduled for automatic restarts. You can use filtering on nested fields
124 * to filter based on resource labels. To filter on multiple expressions,
125 * provide each separate expression within parentheses. For example: ```
126 * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
127 * default, each expression is an `AND` expression. However, you can include
128 * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
129 * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
130 * (scheduling.automaticRestart = true) ``` If you want to use a regular
131 * expression, use the `eq` (equal) or `ne` (not equal) operator against a
132 * single un-parenthesized expression with or without quotes or against multiple
133 * parenthesized expressions. Examples: `fieldname eq unquoted literal`
134 * `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"`
135 * `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is
136 * interpreted as a regular expression using Google RE2 library syntax. The
137 * literal value must match the entire field. For example, to filter for
138 * instances that do not end with name "instance", you would use `name ne
139 * .*instance`. You cannot combine constraints on multiple fields using regular
140 * expressions.
141 * @opt_param string maxResults The maximum number of results per page that
142 * should be returned. If the number of available results is larger than
143 * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
144 * get the next page of results in subsequent list requests. Acceptable values
145 * are `0` to `500`, inclusive. (Default: `500`)
146 * @opt_param string orderBy Sorts list results by a certain order. By default,
147 * results are returned in alphanumerical order based on the resource name. You
148 * can also sort results in descending order based on the creation timestamp
149 * using `orderBy="creationTimestamp desc"`. This sorts results based on the
150 * `creationTimestamp` field in reverse chronological order (newest result
151 * first). Use this to sort resources like operations so that the newest
152 * operation is returned first. Currently, only sorting by `name` or
153 * `creationTimestamp desc` is supported.
154 * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
155 * the `nextPageToken` returned by a previous list request to get the next page
156 * of results.
157 * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
158 * which provides partial results in case of failure. The default value is
159 * false. For example, when partial success behavior is enabled, aggregatedList
160 * for a single zone scope either returns all resources in the zone or no
161 * resources, with an error code.
162 * @return RouteList
163 * @throws \Google\Service\Exception
164 */
165 public function listRoutes($project, $optParams = [])
166 {
167 $params = ['project' => $project];
168 $params = array_merge($params, $optParams);
169 return $this->call('list', [$params], RouteList::class);
170 }
171}
172
173// Adding a class alias for backwards compatibility with the previous class name.
174class_alias(Routes::class, 'Google_Service_Compute_Resource_Routes');
Note: See TracBrowser for help on using the repository browser.