source: vendor/google/apiclient-services/src/Compute/Resource/FirewallPolicies.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: 24.2 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\FirewallPoliciesListAssociationsResponse;
21use Google\Service\Compute\FirewallPolicy;
22use Google\Service\Compute\FirewallPolicyAssociation;
23use Google\Service\Compute\FirewallPolicyList;
24use Google\Service\Compute\FirewallPolicyRule;
25use Google\Service\Compute\GlobalOrganizationSetPolicyRequest;
26use Google\Service\Compute\Operation;
27use Google\Service\Compute\Policy;
28use Google\Service\Compute\TestPermissionsRequest;
29use Google\Service\Compute\TestPermissionsResponse;
30
31/**
32 * The "firewallPolicies" collection of methods.
33 * Typical usage is:
34 * <code>
35 * $computeService = new Google\Service\Compute(...);
36 * $firewallPolicies = $computeService->firewallPolicies;
37 * </code>
38 */
39class FirewallPolicies extends \Google\Service\Resource
40{
41 /**
42 * Inserts an association for the specified firewall policy.
43 * (firewallPolicies.addAssociation)
44 *
45 * @param string $firewallPolicy Name of the firewall policy to update.
46 * @param FirewallPolicyAssociation $postBody
47 * @param array $optParams Optional parameters.
48 *
49 * @opt_param bool replaceExistingAssociation Indicates whether or not to
50 * replace it if an association of the attachment already exists. This is false
51 * by default, in which case an error will be returned if an association already
52 * exists.
53 * @opt_param string requestId An optional request ID to identify requests.
54 * Specify a unique request ID so that if you must retry your request, the
55 * server will know to ignore the request if it has already been completed. For
56 * example, consider a situation where you make an initial request and the
57 * request times out. If you make the request again with the same request ID,
58 * the server can check if original operation with the same request ID was
59 * received, and if so, will ignore the second request. This prevents clients
60 * from accidentally creating duplicate commitments. The request ID must be a
61 * valid UUID with the exception that zero UUID is not supported (
62 * 00000000-0000-0000-0000-000000000000).
63 * @return Operation
64 * @throws \Google\Service\Exception
65 */
66 public function addAssociation($firewallPolicy, FirewallPolicyAssociation $postBody, $optParams = [])
67 {
68 $params = ['firewallPolicy' => $firewallPolicy, 'postBody' => $postBody];
69 $params = array_merge($params, $optParams);
70 return $this->call('addAssociation', [$params], Operation::class);
71 }
72 /**
73 * Inserts a rule into a firewall policy. (firewallPolicies.addRule)
74 *
75 * @param string $firewallPolicy Name of the firewall policy to update.
76 * @param FirewallPolicyRule $postBody
77 * @param array $optParams Optional parameters.
78 *
79 * @opt_param string requestId An optional request ID to identify requests.
80 * Specify a unique request ID so that if you must retry your request, the
81 * server will know to ignore the request if it has already been completed. For
82 * example, consider a situation where you make an initial request and the
83 * request times out. If you make the request again with the same request ID,
84 * the server can check if original operation with the same request ID was
85 * received, and if so, will ignore the second request. This prevents clients
86 * from accidentally creating duplicate commitments. The request ID must be a
87 * valid UUID with the exception that zero UUID is not supported (
88 * 00000000-0000-0000-0000-000000000000).
89 * @return Operation
90 * @throws \Google\Service\Exception
91 */
92 public function addRule($firewallPolicy, FirewallPolicyRule $postBody, $optParams = [])
93 {
94 $params = ['firewallPolicy' => $firewallPolicy, 'postBody' => $postBody];
95 $params = array_merge($params, $optParams);
96 return $this->call('addRule', [$params], Operation::class);
97 }
98 /**
99 * Copies rules to the specified firewall policy. (firewallPolicies.cloneRules)
100 *
101 * @param string $firewallPolicy Name of the firewall policy to update.
102 * @param array $optParams Optional parameters.
103 *
104 * @opt_param string requestId An optional request ID to identify requests.
105 * Specify a unique request ID so that if you must retry your request, the
106 * server will know to ignore the request if it has already been completed. For
107 * example, consider a situation where you make an initial request and the
108 * request times out. If you make the request again with the same request ID,
109 * the server can check if original operation with the same request ID was
110 * received, and if so, will ignore the second request. This prevents clients
111 * from accidentally creating duplicate commitments. The request ID must be a
112 * valid UUID with the exception that zero UUID is not supported (
113 * 00000000-0000-0000-0000-000000000000).
114 * @opt_param string sourceFirewallPolicy The firewall policy from which to copy
115 * rules.
116 * @return Operation
117 * @throws \Google\Service\Exception
118 */
119 public function cloneRules($firewallPolicy, $optParams = [])
120 {
121 $params = ['firewallPolicy' => $firewallPolicy];
122 $params = array_merge($params, $optParams);
123 return $this->call('cloneRules', [$params], Operation::class);
124 }
125 /**
126 * Deletes the specified policy. (firewallPolicies.delete)
127 *
128 * @param string $firewallPolicy Name of the firewall policy to delete.
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 delete($firewallPolicy, $optParams = [])
145 {
146 $params = ['firewallPolicy' => $firewallPolicy];
147 $params = array_merge($params, $optParams);
148 return $this->call('delete', [$params], Operation::class);
149 }
150 /**
151 * Returns the specified firewall policy. (firewallPolicies.get)
152 *
153 * @param string $firewallPolicy Name of the firewall policy to get.
154 * @param array $optParams Optional parameters.
155 * @return FirewallPolicy
156 * @throws \Google\Service\Exception
157 */
158 public function get($firewallPolicy, $optParams = [])
159 {
160 $params = ['firewallPolicy' => $firewallPolicy];
161 $params = array_merge($params, $optParams);
162 return $this->call('get', [$params], FirewallPolicy::class);
163 }
164 /**
165 * Gets an association with the specified name.
166 * (firewallPolicies.getAssociation)
167 *
168 * @param string $firewallPolicy Name of the firewall policy to which the
169 * queried rule belongs.
170 * @param array $optParams Optional parameters.
171 *
172 * @opt_param string name The name of the association to get from the firewall
173 * policy.
174 * @return FirewallPolicyAssociation
175 * @throws \Google\Service\Exception
176 */
177 public function getAssociation($firewallPolicy, $optParams = [])
178 {
179 $params = ['firewallPolicy' => $firewallPolicy];
180 $params = array_merge($params, $optParams);
181 return $this->call('getAssociation', [$params], FirewallPolicyAssociation::class);
182 }
183 /**
184 * Gets the access control policy for a resource. May be empty if no such policy
185 * or resource exists. (firewallPolicies.getIamPolicy)
186 *
187 * @param string $resource Name or id of the resource for this request.
188 * @param array $optParams Optional parameters.
189 *
190 * @opt_param int optionsRequestedPolicyVersion Requested IAM Policy version.
191 * @return Policy
192 * @throws \Google\Service\Exception
193 */
194 public function getIamPolicy($resource, $optParams = [])
195 {
196 $params = ['resource' => $resource];
197 $params = array_merge($params, $optParams);
198 return $this->call('getIamPolicy', [$params], Policy::class);
199 }
200 /**
201 * Gets a rule of the specified priority. (firewallPolicies.getRule)
202 *
203 * @param string $firewallPolicy Name of the firewall policy to which the
204 * queried rule belongs.
205 * @param array $optParams Optional parameters.
206 *
207 * @opt_param int priority The priority of the rule to get from the firewall
208 * policy.
209 * @return FirewallPolicyRule
210 * @throws \Google\Service\Exception
211 */
212 public function getRule($firewallPolicy, $optParams = [])
213 {
214 $params = ['firewallPolicy' => $firewallPolicy];
215 $params = array_merge($params, $optParams);
216 return $this->call('getRule', [$params], FirewallPolicyRule::class);
217 }
218 /**
219 * Creates a new policy in the specified project using the data included in the
220 * request. (firewallPolicies.insert)
221 *
222 * @param FirewallPolicy $postBody
223 * @param array $optParams Optional parameters.
224 *
225 * @opt_param string parentId Parent ID for this request. The ID can be either
226 * be "folders/[FOLDER_ID]" if the parent is a folder or
227 * "organizations/[ORGANIZATION_ID]" if the parent is an organization.
228 * @opt_param string requestId An optional request ID to identify requests.
229 * Specify a unique request ID so that if you must retry your request, the
230 * server will know to ignore the request if it has already been completed. For
231 * example, consider a situation where you make an initial request and the
232 * request times out. If you make the request again with the same request ID,
233 * the server can check if original operation with the same request ID was
234 * received, and if so, will ignore the second request. This prevents clients
235 * from accidentally creating duplicate commitments. The request ID must be a
236 * valid UUID with the exception that zero UUID is not supported (
237 * 00000000-0000-0000-0000-000000000000).
238 * @return Operation
239 * @throws \Google\Service\Exception
240 */
241 public function insert(FirewallPolicy $postBody, $optParams = [])
242 {
243 $params = ['postBody' => $postBody];
244 $params = array_merge($params, $optParams);
245 return $this->call('insert', [$params], Operation::class);
246 }
247 /**
248 * Lists all the policies that have been configured for the specified folder or
249 * organization. (firewallPolicies.listFirewallPolicies)
250 *
251 * @param array $optParams Optional parameters.
252 *
253 * @opt_param string filter A filter expression that filters resources listed in
254 * the response. Most Compute resources support two types of filter expressions:
255 * expressions that support regular expressions and expressions that follow API
256 * improvement proposal AIP-160. These two types of filter expressions cannot be
257 * mixed in one request. If you want to use AIP-160, your expression must
258 * specify the field name, an operator, and the value that you want to use for
259 * filtering. The value must be a string, a number, or a boolean. The operator
260 * must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you
261 * are filtering Compute Engine instances, you can exclude instances named
262 * `example-instance` by specifying `name != example-instance`. The `:*`
263 * comparison can be used to test whether a key has been defined. For example,
264 * to find all objects with `owner` label use: ``` labels.owner:* ``` You can
265 * also filter nested fields. For example, you could specify
266 * `scheduling.automaticRestart = false` to include instances only if they are
267 * not scheduled for automatic restarts. You can use filtering on nested fields
268 * to filter based on resource labels. To filter on multiple expressions,
269 * provide each separate expression within parentheses. For example: ```
270 * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
271 * default, each expression is an `AND` expression. However, you can include
272 * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
273 * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
274 * (scheduling.automaticRestart = true) ``` If you want to use a regular
275 * expression, use the `eq` (equal) or `ne` (not equal) operator against a
276 * single un-parenthesized expression with or without quotes or against multiple
277 * parenthesized expressions. Examples: `fieldname eq unquoted literal`
278 * `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"`
279 * `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is
280 * interpreted as a regular expression using Google RE2 library syntax. The
281 * literal value must match the entire field. For example, to filter for
282 * instances that do not end with name "instance", you would use `name ne
283 * .*instance`. You cannot combine constraints on multiple fields using regular
284 * expressions.
285 * @opt_param string maxResults The maximum number of results per page that
286 * should be returned. If the number of available results is larger than
287 * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
288 * get the next page of results in subsequent list requests. Acceptable values
289 * are `0` to `500`, inclusive. (Default: `500`)
290 * @opt_param string orderBy Sorts list results by a certain order. By default,
291 * results are returned in alphanumerical order based on the resource name. You
292 * can also sort results in descending order based on the creation timestamp
293 * using `orderBy="creationTimestamp desc"`. This sorts results based on the
294 * `creationTimestamp` field in reverse chronological order (newest result
295 * first). Use this to sort resources like operations so that the newest
296 * operation is returned first. Currently, only sorting by `name` or
297 * `creationTimestamp desc` is supported.
298 * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
299 * the `nextPageToken` returned by a previous list request to get the next page
300 * of results.
301 * @opt_param string parentId Parent ID for this request. The ID can be either
302 * be "folders/[FOLDER_ID]" if the parent is a folder or
303 * "organizations/[ORGANIZATION_ID]" if the parent is an organization.
304 * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
305 * which provides partial results in case of failure. The default value is
306 * false. For example, when partial success behavior is enabled, aggregatedList
307 * for a single zone scope either returns all resources in the zone or no
308 * resources, with an error code.
309 * @return FirewallPolicyList
310 * @throws \Google\Service\Exception
311 */
312 public function listFirewallPolicies($optParams = [])
313 {
314 $params = [];
315 $params = array_merge($params, $optParams);
316 return $this->call('list', [$params], FirewallPolicyList::class);
317 }
318 /**
319 * Lists associations of a specified target, i.e., organization or folder.
320 * (firewallPolicies.listAssociations)
321 *
322 * @param array $optParams Optional parameters.
323 *
324 * @opt_param string targetResource The target resource to list associations. It
325 * is an organization, or a folder.
326 * @return FirewallPoliciesListAssociationsResponse
327 * @throws \Google\Service\Exception
328 */
329 public function listAssociations($optParams = [])
330 {
331 $params = [];
332 $params = array_merge($params, $optParams);
333 return $this->call('listAssociations', [$params], FirewallPoliciesListAssociationsResponse::class);
334 }
335 /**
336 * Moves the specified firewall policy. (firewallPolicies.move)
337 *
338 * @param string $firewallPolicy Name of the firewall policy to update.
339 * @param array $optParams Optional parameters.
340 *
341 * @opt_param string parentId The new parent of the firewall policy. The ID can
342 * be either be "folders/[FOLDER_ID]" if the parent is a folder or
343 * "organizations/[ORGANIZATION_ID]" if the parent is an organization.
344 * @opt_param string requestId An optional request ID to identify requests.
345 * Specify a unique request ID so that if you must retry your request, the
346 * server will know to ignore the request if it has already been completed. For
347 * example, consider a situation where you make an initial request and the
348 * request times out. If you make the request again with the same request ID,
349 * the server can check if original operation with the same request ID was
350 * received, and if so, will ignore the second request. This prevents clients
351 * from accidentally creating duplicate commitments. The request ID must be a
352 * valid UUID with the exception that zero UUID is not supported (
353 * 00000000-0000-0000-0000-000000000000).
354 * @return Operation
355 * @throws \Google\Service\Exception
356 */
357 public function move($firewallPolicy, $optParams = [])
358 {
359 $params = ['firewallPolicy' => $firewallPolicy];
360 $params = array_merge($params, $optParams);
361 return $this->call('move', [$params], Operation::class);
362 }
363 /**
364 * Patches the specified policy with the data included in the request.
365 * (firewallPolicies.patch)
366 *
367 * @param string $firewallPolicy Name of the firewall policy to update.
368 * @param FirewallPolicy $postBody
369 * @param array $optParams Optional parameters.
370 *
371 * @opt_param string requestId An optional request ID to identify requests.
372 * Specify a unique request ID so that if you must retry your request, the
373 * server will know to ignore the request if it has already been completed. For
374 * example, consider a situation where you make an initial request and the
375 * request times out. If you make the request again with the same request ID,
376 * the server can check if original operation with the same request ID was
377 * received, and if so, will ignore the second request. This prevents clients
378 * from accidentally creating duplicate commitments. The request ID must be a
379 * valid UUID with the exception that zero UUID is not supported (
380 * 00000000-0000-0000-0000-000000000000).
381 * @return Operation
382 * @throws \Google\Service\Exception
383 */
384 public function patch($firewallPolicy, FirewallPolicy $postBody, $optParams = [])
385 {
386 $params = ['firewallPolicy' => $firewallPolicy, 'postBody' => $postBody];
387 $params = array_merge($params, $optParams);
388 return $this->call('patch', [$params], Operation::class);
389 }
390 /**
391 * Patches a rule of the specified priority. (firewallPolicies.patchRule)
392 *
393 * @param string $firewallPolicy Name of the firewall policy to update.
394 * @param FirewallPolicyRule $postBody
395 * @param array $optParams Optional parameters.
396 *
397 * @opt_param int priority The priority of the rule to patch.
398 * @opt_param string requestId An optional request ID to identify requests.
399 * Specify a unique request ID so that if you must retry your request, the
400 * server will know to ignore the request if it has already been completed. For
401 * example, consider a situation where you make an initial request and the
402 * request times out. If you make the request again with the same request ID,
403 * the server can check if original operation with the same request ID was
404 * received, and if so, will ignore the second request. This prevents clients
405 * from accidentally creating duplicate commitments. The request ID must be a
406 * valid UUID with the exception that zero UUID is not supported (
407 * 00000000-0000-0000-0000-000000000000).
408 * @return Operation
409 * @throws \Google\Service\Exception
410 */
411 public function patchRule($firewallPolicy, FirewallPolicyRule $postBody, $optParams = [])
412 {
413 $params = ['firewallPolicy' => $firewallPolicy, 'postBody' => $postBody];
414 $params = array_merge($params, $optParams);
415 return $this->call('patchRule', [$params], Operation::class);
416 }
417 /**
418 * Removes an association for the specified firewall policy.
419 * (firewallPolicies.removeAssociation)
420 *
421 * @param string $firewallPolicy Name of the firewall policy to update.
422 * @param array $optParams Optional parameters.
423 *
424 * @opt_param string name Name for the attachment that will be removed.
425 * @opt_param string requestId An optional request ID to identify requests.
426 * Specify a unique request ID so that if you must retry your request, the
427 * server will know to ignore the request if it has already been completed. For
428 * example, consider a situation where you make an initial request and the
429 * request times out. If you make the request again with the same request ID,
430 * the server can check if original operation with the same request ID was
431 * received, and if so, will ignore the second request. This prevents clients
432 * from accidentally creating duplicate commitments. The request ID must be a
433 * valid UUID with the exception that zero UUID is not supported (
434 * 00000000-0000-0000-0000-000000000000).
435 * @return Operation
436 * @throws \Google\Service\Exception
437 */
438 public function removeAssociation($firewallPolicy, $optParams = [])
439 {
440 $params = ['firewallPolicy' => $firewallPolicy];
441 $params = array_merge($params, $optParams);
442 return $this->call('removeAssociation', [$params], Operation::class);
443 }
444 /**
445 * Deletes a rule of the specified priority. (firewallPolicies.removeRule)
446 *
447 * @param string $firewallPolicy Name of the firewall policy to update.
448 * @param array $optParams Optional parameters.
449 *
450 * @opt_param int priority The priority of the rule to remove from the firewall
451 * policy.
452 * @opt_param string requestId An optional request ID to identify requests.
453 * Specify a unique request ID so that if you must retry your request, the
454 * server will know to ignore the request if it has already been completed. For
455 * example, consider a situation where you make an initial request and the
456 * request times out. If you make the request again with the same request ID,
457 * the server can check if original operation with the same request ID was
458 * received, and if so, will ignore the second request. This prevents clients
459 * from accidentally creating duplicate commitments. The request ID must be a
460 * valid UUID with the exception that zero UUID is not supported (
461 * 00000000-0000-0000-0000-000000000000).
462 * @return Operation
463 * @throws \Google\Service\Exception
464 */
465 public function removeRule($firewallPolicy, $optParams = [])
466 {
467 $params = ['firewallPolicy' => $firewallPolicy];
468 $params = array_merge($params, $optParams);
469 return $this->call('removeRule', [$params], Operation::class);
470 }
471 /**
472 * Sets the access control policy on the specified resource. Replaces any
473 * existing policy. (firewallPolicies.setIamPolicy)
474 *
475 * @param string $resource Name or id of the resource for this request.
476 * @param GlobalOrganizationSetPolicyRequest $postBody
477 * @param array $optParams Optional parameters.
478 * @return Policy
479 * @throws \Google\Service\Exception
480 */
481 public function setIamPolicy($resource, GlobalOrganizationSetPolicyRequest $postBody, $optParams = [])
482 {
483 $params = ['resource' => $resource, 'postBody' => $postBody];
484 $params = array_merge($params, $optParams);
485 return $this->call('setIamPolicy', [$params], Policy::class);
486 }
487 /**
488 * Returns permissions that a caller has on the specified resource.
489 * (firewallPolicies.testIamPermissions)
490 *
491 * @param string $resource Name or id of the resource for this request.
492 * @param TestPermissionsRequest $postBody
493 * @param array $optParams Optional parameters.
494 * @return TestPermissionsResponse
495 * @throws \Google\Service\Exception
496 */
497 public function testIamPermissions($resource, TestPermissionsRequest $postBody, $optParams = [])
498 {
499 $params = ['resource' => $resource, 'postBody' => $postBody];
500 $params = array_merge($params, $optParams);
501 return $this->call('testIamPermissions', [$params], TestPermissionsResponse::class);
502 }
503}
504
505// Adding a class alias for backwards compatibility with the previous class name.
506class_alias(FirewallPolicies::class, 'Google_Service_Compute_Resource_FirewallPolicies');
Note: See TracBrowser for help on using the repository browser.