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