source: vendor/google/apiclient-services/src/Compute/Resource/NodeTemplates.php@ f9c482b

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

Upload new project files

  • Property mode set to 100644
File size: 17.0 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\NodeTemplate;
21use Google\Service\Compute\NodeTemplateAggregatedList;
22use Google\Service\Compute\NodeTemplateList;
23use Google\Service\Compute\Operation;
24use Google\Service\Compute\Policy;
25use Google\Service\Compute\RegionSetPolicyRequest;
26use Google\Service\Compute\TestPermissionsRequest;
27use Google\Service\Compute\TestPermissionsResponse;
28
29/**
30 * The "nodeTemplates" collection of methods.
31 * Typical usage is:
32 * <code>
33 * $computeService = new Google\Service\Compute(...);
34 * $nodeTemplates = $computeService->nodeTemplates;
35 * </code>
36 */
37class NodeTemplates extends \Google\Service\Resource
38{
39 /**
40 * Retrieves an aggregated list of node templates. To prevent failure, Google
41 * recommends that you set the `returnPartialSuccess` parameter to `true`.
42 * (nodeTemplates.aggregatedList)
43 *
44 * @param string $project Project ID for this request.
45 * @param array $optParams Optional parameters.
46 *
47 * @opt_param string filter A filter expression that filters resources listed in
48 * the response. Most Compute resources support two types of filter expressions:
49 * expressions that support regular expressions and expressions that follow API
50 * improvement proposal AIP-160. These two types of filter expressions cannot be
51 * mixed in one request. If you want to use AIP-160, your expression must
52 * specify the field name, an operator, and the value that you want to use for
53 * filtering. The value must be a string, a number, or a boolean. The operator
54 * must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you
55 * are filtering Compute Engine instances, you can exclude instances named
56 * `example-instance` by specifying `name != example-instance`. The `:*`
57 * comparison can be used to test whether a key has been defined. For example,
58 * to find all objects with `owner` label use: ``` labels.owner:* ``` You can
59 * also filter nested fields. For example, you could specify
60 * `scheduling.automaticRestart = false` to include instances only if they are
61 * not scheduled for automatic restarts. You can use filtering on nested fields
62 * to filter based on resource labels. To filter on multiple expressions,
63 * provide each separate expression within parentheses. For example: ```
64 * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
65 * default, each expression is an `AND` expression. However, you can include
66 * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
67 * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
68 * (scheduling.automaticRestart = true) ``` If you want to use a regular
69 * expression, use the `eq` (equal) or `ne` (not equal) operator against a
70 * single un-parenthesized expression with or without quotes or against multiple
71 * parenthesized expressions. Examples: `fieldname eq unquoted literal`
72 * `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"`
73 * `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is
74 * interpreted as a regular expression using Google RE2 library syntax. The
75 * literal value must match the entire field. For example, to filter for
76 * instances that do not end with name "instance", you would use `name ne
77 * .*instance`. You cannot combine constraints on multiple fields using regular
78 * expressions.
79 * @opt_param bool includeAllScopes Indicates whether every visible scope for
80 * each scope type (zone, region, global) should be included in the response.
81 * For new resource types added after this field, the flag has no effect as new
82 * resource types will always include every visible scope for each scope type in
83 * response. For resource types which predate this field, if this flag is
84 * omitted or false, only scopes of the scope types where the resource type is
85 * expected to be found will be included.
86 * @opt_param string maxResults The maximum number of results per page that
87 * should be returned. If the number of available results is larger than
88 * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
89 * get the next page of results in subsequent list requests. Acceptable values
90 * are `0` to `500`, inclusive. (Default: `500`)
91 * @opt_param string orderBy Sorts list results by a certain order. By default,
92 * results are returned in alphanumerical order based on the resource name. You
93 * can also sort results in descending order based on the creation timestamp
94 * using `orderBy="creationTimestamp desc"`. This sorts results based on the
95 * `creationTimestamp` field in reverse chronological order (newest result
96 * first). Use this to sort resources like operations so that the newest
97 * operation is returned first. Currently, only sorting by `name` or
98 * `creationTimestamp desc` is supported.
99 * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
100 * the `nextPageToken` returned by a previous list request to get the next page
101 * of results.
102 * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
103 * which provides partial results in case of failure. The default value is
104 * false. For example, when partial success behavior is enabled, aggregatedList
105 * for a single zone scope either returns all resources in the zone or no
106 * resources, with an error code.
107 * @opt_param string serviceProjectNumber The Shared VPC service project id or
108 * service project number for which aggregated list request is invoked for
109 * subnetworks list-usable api.
110 * @return NodeTemplateAggregatedList
111 * @throws \Google\Service\Exception
112 */
113 public function aggregatedList($project, $optParams = [])
114 {
115 $params = ['project' => $project];
116 $params = array_merge($params, $optParams);
117 return $this->call('aggregatedList', [$params], NodeTemplateAggregatedList::class);
118 }
119 /**
120 * Deletes the specified NodeTemplate resource. (nodeTemplates.delete)
121 *
122 * @param string $project Project ID for this request.
123 * @param string $region The name of the region for this request.
124 * @param string $nodeTemplate Name of the NodeTemplate resource to delete.
125 * @param array $optParams Optional parameters.
126 *
127 * @opt_param string requestId An optional request ID to identify requests.
128 * Specify a unique request ID so that if you must retry your request, the
129 * server will know to ignore the request if it has already been completed. For
130 * example, consider a situation where you make an initial request and the
131 * request times out. If you make the request again with the same request ID,
132 * the server can check if original operation with the same request ID was
133 * received, and if so, will ignore the second request. This prevents clients
134 * from accidentally creating duplicate commitments. The request ID must be a
135 * valid UUID with the exception that zero UUID is not supported (
136 * 00000000-0000-0000-0000-000000000000).
137 * @return Operation
138 * @throws \Google\Service\Exception
139 */
140 public function delete($project, $region, $nodeTemplate, $optParams = [])
141 {
142 $params = ['project' => $project, 'region' => $region, 'nodeTemplate' => $nodeTemplate];
143 $params = array_merge($params, $optParams);
144 return $this->call('delete', [$params], Operation::class);
145 }
146 /**
147 * Returns the specified node template. (nodeTemplates.get)
148 *
149 * @param string $project Project ID for this request.
150 * @param string $region The name of the region for this request.
151 * @param string $nodeTemplate Name of the node template to return.
152 * @param array $optParams Optional parameters.
153 * @return NodeTemplate
154 * @throws \Google\Service\Exception
155 */
156 public function get($project, $region, $nodeTemplate, $optParams = [])
157 {
158 $params = ['project' => $project, 'region' => $region, 'nodeTemplate' => $nodeTemplate];
159 $params = array_merge($params, $optParams);
160 return $this->call('get', [$params], NodeTemplate::class);
161 }
162 /**
163 * Gets the access control policy for a resource. May be empty if no such policy
164 * or resource exists. (nodeTemplates.getIamPolicy)
165 *
166 * @param string $project Project ID for this request.
167 * @param string $region The name of the region for this request.
168 * @param string $resource Name or id of the resource for this request.
169 * @param array $optParams Optional parameters.
170 *
171 * @opt_param int optionsRequestedPolicyVersion Requested IAM Policy version.
172 * @return Policy
173 * @throws \Google\Service\Exception
174 */
175 public function getIamPolicy($project, $region, $resource, $optParams = [])
176 {
177 $params = ['project' => $project, 'region' => $region, 'resource' => $resource];
178 $params = array_merge($params, $optParams);
179 return $this->call('getIamPolicy', [$params], Policy::class);
180 }
181 /**
182 * Creates a NodeTemplate resource in the specified project using the data
183 * included in the request. (nodeTemplates.insert)
184 *
185 * @param string $project Project ID for this request.
186 * @param string $region The name of the region for this request.
187 * @param NodeTemplate $postBody
188 * @param array $optParams Optional parameters.
189 *
190 * @opt_param string requestId An optional request ID to identify requests.
191 * Specify a unique request ID so that if you must retry your request, the
192 * server will know to ignore the request if it has already been completed. For
193 * example, consider a situation where you make an initial request and the
194 * request times out. If you make the request again with the same request ID,
195 * the server can check if original operation with the same request ID was
196 * received, and if so, will ignore the second request. This prevents clients
197 * from accidentally creating duplicate commitments. The request ID must be a
198 * valid UUID with the exception that zero UUID is not supported (
199 * 00000000-0000-0000-0000-000000000000).
200 * @return Operation
201 * @throws \Google\Service\Exception
202 */
203 public function insert($project, $region, NodeTemplate $postBody, $optParams = [])
204 {
205 $params = ['project' => $project, 'region' => $region, 'postBody' => $postBody];
206 $params = array_merge($params, $optParams);
207 return $this->call('insert', [$params], Operation::class);
208 }
209 /**
210 * Retrieves a list of node templates available to the specified project.
211 * (nodeTemplates.listNodeTemplates)
212 *
213 * @param string $project Project ID for this request.
214 * @param string $region The name of the region for this request.
215 * @param array $optParams Optional parameters.
216 *
217 * @opt_param string filter A filter expression that filters resources listed in
218 * the response. Most Compute resources support two types of filter expressions:
219 * expressions that support regular expressions and expressions that follow API
220 * improvement proposal AIP-160. These two types of filter expressions cannot be
221 * mixed in one request. If you want to use AIP-160, your expression must
222 * specify the field name, an operator, and the value that you want to use for
223 * filtering. The value must be a string, a number, or a boolean. The operator
224 * must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you
225 * are filtering Compute Engine instances, you can exclude instances named
226 * `example-instance` by specifying `name != example-instance`. The `:*`
227 * comparison can be used to test whether a key has been defined. For example,
228 * to find all objects with `owner` label use: ``` labels.owner:* ``` You can
229 * also filter nested fields. For example, you could specify
230 * `scheduling.automaticRestart = false` to include instances only if they are
231 * not scheduled for automatic restarts. You can use filtering on nested fields
232 * to filter based on resource labels. To filter on multiple expressions,
233 * provide each separate expression within parentheses. For example: ```
234 * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
235 * default, each expression is an `AND` expression. However, you can include
236 * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
237 * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
238 * (scheduling.automaticRestart = true) ``` If you want to use a regular
239 * expression, use the `eq` (equal) or `ne` (not equal) operator against a
240 * single un-parenthesized expression with or without quotes or against multiple
241 * parenthesized expressions. Examples: `fieldname eq unquoted literal`
242 * `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"`
243 * `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is
244 * interpreted as a regular expression using Google RE2 library syntax. The
245 * literal value must match the entire field. For example, to filter for
246 * instances that do not end with name "instance", you would use `name ne
247 * .*instance`. You cannot combine constraints on multiple fields using regular
248 * expressions.
249 * @opt_param string maxResults The maximum number of results per page that
250 * should be returned. If the number of available results is larger than
251 * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
252 * get the next page of results in subsequent list requests. Acceptable values
253 * are `0` to `500`, inclusive. (Default: `500`)
254 * @opt_param string orderBy Sorts list results by a certain order. By default,
255 * results are returned in alphanumerical order based on the resource name. You
256 * can also sort results in descending order based on the creation timestamp
257 * using `orderBy="creationTimestamp desc"`. This sorts results based on the
258 * `creationTimestamp` field in reverse chronological order (newest result
259 * first). Use this to sort resources like operations so that the newest
260 * operation is returned first. Currently, only sorting by `name` or
261 * `creationTimestamp desc` is supported.
262 * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
263 * the `nextPageToken` returned by a previous list request to get the next page
264 * of results.
265 * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
266 * which provides partial results in case of failure. The default value is
267 * false. For example, when partial success behavior is enabled, aggregatedList
268 * for a single zone scope either returns all resources in the zone or no
269 * resources, with an error code.
270 * @return NodeTemplateList
271 * @throws \Google\Service\Exception
272 */
273 public function listNodeTemplates($project, $region, $optParams = [])
274 {
275 $params = ['project' => $project, 'region' => $region];
276 $params = array_merge($params, $optParams);
277 return $this->call('list', [$params], NodeTemplateList::class);
278 }
279 /**
280 * Sets the access control policy on the specified resource. Replaces any
281 * existing policy. (nodeTemplates.setIamPolicy)
282 *
283 * @param string $project Project ID for this request.
284 * @param string $region The name of the region for this request.
285 * @param string $resource Name or id of the resource for this request.
286 * @param RegionSetPolicyRequest $postBody
287 * @param array $optParams Optional parameters.
288 * @return Policy
289 * @throws \Google\Service\Exception
290 */
291 public function setIamPolicy($project, $region, $resource, RegionSetPolicyRequest $postBody, $optParams = [])
292 {
293 $params = ['project' => $project, 'region' => $region, 'resource' => $resource, 'postBody' => $postBody];
294 $params = array_merge($params, $optParams);
295 return $this->call('setIamPolicy', [$params], Policy::class);
296 }
297 /**
298 * Returns permissions that a caller has on the specified resource.
299 * (nodeTemplates.testIamPermissions)
300 *
301 * @param string $project Project ID for this request.
302 * @param string $region The name of the region for this request.
303 * @param string $resource Name or id of the resource for this request.
304 * @param TestPermissionsRequest $postBody
305 * @param array $optParams Optional parameters.
306 * @return TestPermissionsResponse
307 * @throws \Google\Service\Exception
308 */
309 public function testIamPermissions($project, $region, $resource, TestPermissionsRequest $postBody, $optParams = [])
310 {
311 $params = ['project' => $project, 'region' => $region, 'resource' => $resource, 'postBody' => $postBody];
312 $params = array_merge($params, $optParams);
313 return $this->call('testIamPermissions', [$params], TestPermissionsResponse::class);
314 }
315}
316
317// Adding a class alias for backwards compatibility with the previous class name.
318class_alias(NodeTemplates::class, 'Google_Service_Compute_Resource_NodeTemplates');
Note: See TracBrowser for help on using the repository browser.