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