source: vendor/google/apiclient-services/src/Compute/Resource/RegionSecurityPolicies.php

Last change on this file was e3d4e0a, checked in by Vlado 222039 <vlado.popovski@…>, 8 weeks ago

Upload project files

  • Property mode set to 100644
File size: 14.8 KB
Line 
1<?php
2/*
3 * Copyright 2014 Google Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
6 * use this file except in compliance with the License. You may obtain a copy of
7 * the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14 * License for the specific language governing permissions and limitations under
15 * the License.
16 */
17
18namespace Google\Service\Compute\Resource;
19
20use Google\Service\Compute\Operation;
21use Google\Service\Compute\SecurityPolicy;
22use Google\Service\Compute\SecurityPolicyList;
23use Google\Service\Compute\SecurityPolicyRule;
24
25/**
26 * The "regionSecurityPolicies" collection of methods.
27 * Typical usage is:
28 * <code>
29 * $computeService = new Google\Service\Compute(...);
30 * $regionSecurityPolicies = $computeService->regionSecurityPolicies;
31 * </code>
32 */
33class RegionSecurityPolicies extends \Google\Service\Resource
34{
35 /**
36 * Inserts a rule into a security policy. (regionSecurityPolicies.addRule)
37 *
38 * @param string $project Project ID for this request.
39 * @param string $region Name of the region scoping this request.
40 * @param string $securityPolicy Name of the security policy to update.
41 * @param SecurityPolicyRule $postBody
42 * @param array $optParams Optional parameters.
43 *
44 * @opt_param bool validateOnly If true, the request will not be committed.
45 * @return Operation
46 * @throws \Google\Service\Exception
47 */
48 public function addRule($project, $region, $securityPolicy, SecurityPolicyRule $postBody, $optParams = [])
49 {
50 $params = ['project' => $project, 'region' => $region, 'securityPolicy' => $securityPolicy, 'postBody' => $postBody];
51 $params = array_merge($params, $optParams);
52 return $this->call('addRule', [$params], Operation::class);
53 }
54 /**
55 * Deletes the specified policy. (regionSecurityPolicies.delete)
56 *
57 * @param string $project Project ID for this request.
58 * @param string $region Name of the region scoping this request.
59 * @param string $securityPolicy Name of the security policy to delete.
60 * @param array $optParams Optional parameters.
61 *
62 * @opt_param string requestId An optional request ID to identify requests.
63 * Specify a unique request ID so that if you must retry your request, the
64 * server will know to ignore the request if it has already been completed. For
65 * example, consider a situation where you make an initial request and the
66 * request times out. If you make the request again with the same request ID,
67 * the server can check if original operation with the same request ID was
68 * received, and if so, will ignore the second request. This prevents clients
69 * from accidentally creating duplicate commitments. The request ID must be a
70 * valid UUID with the exception that zero UUID is not supported (
71 * 00000000-0000-0000-0000-000000000000).
72 * @return Operation
73 * @throws \Google\Service\Exception
74 */
75 public function delete($project, $region, $securityPolicy, $optParams = [])
76 {
77 $params = ['project' => $project, 'region' => $region, 'securityPolicy' => $securityPolicy];
78 $params = array_merge($params, $optParams);
79 return $this->call('delete', [$params], Operation::class);
80 }
81 /**
82 * List all of the ordered rules present in a single specified policy.
83 * (regionSecurityPolicies.get)
84 *
85 * @param string $project Project ID for this request.
86 * @param string $region Name of the region scoping this request.
87 * @param string $securityPolicy Name of the security policy to get.
88 * @param array $optParams Optional parameters.
89 * @return SecurityPolicy
90 * @throws \Google\Service\Exception
91 */
92 public function get($project, $region, $securityPolicy, $optParams = [])
93 {
94 $params = ['project' => $project, 'region' => $region, 'securityPolicy' => $securityPolicy];
95 $params = array_merge($params, $optParams);
96 return $this->call('get', [$params], SecurityPolicy::class);
97 }
98 /**
99 * Gets a rule at the specified priority. (regionSecurityPolicies.getRule)
100 *
101 * @param string $project Project ID for this request.
102 * @param string $region Name of the region scoping this request.
103 * @param string $securityPolicy Name of the security policy to which the
104 * queried rule belongs.
105 * @param array $optParams Optional parameters.
106 *
107 * @opt_param int priority The priority of the rule to get from the security
108 * policy.
109 * @return SecurityPolicyRule
110 * @throws \Google\Service\Exception
111 */
112 public function getRule($project, $region, $securityPolicy, $optParams = [])
113 {
114 $params = ['project' => $project, 'region' => $region, 'securityPolicy' => $securityPolicy];
115 $params = array_merge($params, $optParams);
116 return $this->call('getRule', [$params], SecurityPolicyRule::class);
117 }
118 /**
119 * Creates a new policy in the specified project using the data included in the
120 * request. (regionSecurityPolicies.insert)
121 *
122 * @param string $project Project ID for this request.
123 * @param string $region Name of the region scoping this request.
124 * @param SecurityPolicy $postBody
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 * @opt_param bool validateOnly If true, the request will not be committed.
138 * @return Operation
139 * @throws \Google\Service\Exception
140 */
141 public function insert($project, $region, SecurityPolicy $postBody, $optParams = [])
142 {
143 $params = ['project' => $project, 'region' => $region, 'postBody' => $postBody];
144 $params = array_merge($params, $optParams);
145 return $this->call('insert', [$params], Operation::class);
146 }
147 /**
148 * List all the policies that have been configured for the specified project and
149 * region. (regionSecurityPolicies.listRegionSecurityPolicies)
150 *
151 * @param string $project Project ID for this request.
152 * @param string $region Name of the region scoping this request.
153 * @param array $optParams Optional parameters.
154 *
155 * @opt_param string filter A filter expression that filters resources listed in
156 * the response. Most Compute resources support two types of filter expressions:
157 * expressions that support regular expressions and expressions that follow API
158 * improvement proposal AIP-160. These two types of filter expressions cannot be
159 * mixed in one request. If you want to use AIP-160, your expression must
160 * specify the field name, an operator, and the value that you want to use for
161 * filtering. The value must be a string, a number, or a boolean. The operator
162 * must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you
163 * are filtering Compute Engine instances, you can exclude instances named
164 * `example-instance` by specifying `name != example-instance`. The `:*`
165 * comparison can be used to test whether a key has been defined. For example,
166 * to find all objects with `owner` label use: ``` labels.owner:* ``` You can
167 * also filter nested fields. For example, you could specify
168 * `scheduling.automaticRestart = false` to include instances only if they are
169 * not scheduled for automatic restarts. You can use filtering on nested fields
170 * to filter based on resource labels. To filter on multiple expressions,
171 * provide each separate expression within parentheses. For example: ```
172 * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
173 * default, each expression is an `AND` expression. However, you can include
174 * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
175 * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
176 * (scheduling.automaticRestart = true) ``` If you want to use a regular
177 * expression, use the `eq` (equal) or `ne` (not equal) operator against a
178 * single un-parenthesized expression with or without quotes or against multiple
179 * parenthesized expressions. Examples: `fieldname eq unquoted literal`
180 * `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"`
181 * `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is
182 * interpreted as a regular expression using Google RE2 library syntax. The
183 * literal value must match the entire field. For example, to filter for
184 * instances that do not end with name "instance", you would use `name ne
185 * .*instance`. You cannot combine constraints on multiple fields using regular
186 * expressions.
187 * @opt_param string maxResults The maximum number of results per page that
188 * should be returned. If the number of available results is larger than
189 * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
190 * get the next page of results in subsequent list requests. Acceptable values
191 * are `0` to `500`, inclusive. (Default: `500`)
192 * @opt_param string orderBy Sorts list results by a certain order. By default,
193 * results are returned in alphanumerical order based on the resource name. You
194 * can also sort results in descending order based on the creation timestamp
195 * using `orderBy="creationTimestamp desc"`. This sorts results based on the
196 * `creationTimestamp` field in reverse chronological order (newest result
197 * first). Use this to sort resources like operations so that the newest
198 * operation is returned first. Currently, only sorting by `name` or
199 * `creationTimestamp desc` is supported.
200 * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
201 * the `nextPageToken` returned by a previous list request to get the next page
202 * of results.
203 * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
204 * which provides partial results in case of failure. The default value is
205 * false. For example, when partial success behavior is enabled, aggregatedList
206 * for a single zone scope either returns all resources in the zone or no
207 * resources, with an error code.
208 * @return SecurityPolicyList
209 * @throws \Google\Service\Exception
210 */
211 public function listRegionSecurityPolicies($project, $region, $optParams = [])
212 {
213 $params = ['project' => $project, 'region' => $region];
214 $params = array_merge($params, $optParams);
215 return $this->call('list', [$params], SecurityPolicyList::class);
216 }
217 /**
218 * Patches the specified policy with the data included in the request. To clear
219 * fields in the policy, leave the fields empty and specify them in the
220 * updateMask. This cannot be used to be update the rules in the policy. Please
221 * use the per rule methods like addRule, patchRule, and removeRule instead.
222 * (regionSecurityPolicies.patch)
223 *
224 * @param string $project Project ID for this request.
225 * @param string $region Name of the region scoping this request.
226 * @param string $securityPolicy Name of the security policy to update.
227 * @param SecurityPolicy $postBody
228 * @param array $optParams Optional parameters.
229 *
230 * @opt_param string requestId An optional request ID to identify requests.
231 * Specify a unique request ID so that if you must retry your request, the
232 * server will know to ignore the request if it has already been completed. For
233 * example, consider a situation where you make an initial request and the
234 * request times out. If you make the request again with the same request ID,
235 * the server can check if original operation with the same request ID was
236 * received, and if so, will ignore the second request. This prevents clients
237 * from accidentally creating duplicate commitments. The request ID must be a
238 * valid UUID with the exception that zero UUID is not supported (
239 * 00000000-0000-0000-0000-000000000000).
240 * @opt_param string updateMask Indicates fields to be cleared as part of this
241 * request.
242 * @return Operation
243 * @throws \Google\Service\Exception
244 */
245 public function patch($project, $region, $securityPolicy, SecurityPolicy $postBody, $optParams = [])
246 {
247 $params = ['project' => $project, 'region' => $region, 'securityPolicy' => $securityPolicy, 'postBody' => $postBody];
248 $params = array_merge($params, $optParams);
249 return $this->call('patch', [$params], Operation::class);
250 }
251 /**
252 * Patches a rule at the specified priority. To clear fields in the rule, leave
253 * the fields empty and specify them in the updateMask.
254 * (regionSecurityPolicies.patchRule)
255 *
256 * @param string $project Project ID for this request.
257 * @param string $region Name of the region scoping this request.
258 * @param string $securityPolicy Name of the security policy to update.
259 * @param SecurityPolicyRule $postBody
260 * @param array $optParams Optional parameters.
261 *
262 * @opt_param int priority The priority of the rule to patch.
263 * @opt_param string updateMask Indicates fields to be cleared as part of this
264 * request.
265 * @opt_param bool validateOnly If true, the request will not be committed.
266 * @return Operation
267 * @throws \Google\Service\Exception
268 */
269 public function patchRule($project, $region, $securityPolicy, SecurityPolicyRule $postBody, $optParams = [])
270 {
271 $params = ['project' => $project, 'region' => $region, 'securityPolicy' => $securityPolicy, 'postBody' => $postBody];
272 $params = array_merge($params, $optParams);
273 return $this->call('patchRule', [$params], Operation::class);
274 }
275 /**
276 * Deletes a rule at the specified priority. (regionSecurityPolicies.removeRule)
277 *
278 * @param string $project Project ID for this request.
279 * @param string $region Name of the region scoping this request.
280 * @param string $securityPolicy Name of the security policy to update.
281 * @param array $optParams Optional parameters.
282 *
283 * @opt_param int priority The priority of the rule to remove from the security
284 * policy.
285 * @return Operation
286 * @throws \Google\Service\Exception
287 */
288 public function removeRule($project, $region, $securityPolicy, $optParams = [])
289 {
290 $params = ['project' => $project, 'region' => $region, 'securityPolicy' => $securityPolicy];
291 $params = array_merge($params, $optParams);
292 return $this->call('removeRule', [$params], Operation::class);
293 }
294}
295
296// Adding a class alias for backwards compatibility with the previous class name.
297class_alias(RegionSecurityPolicies::class, 'Google_Service_Compute_Resource_RegionSecurityPolicies');
Note: See TracBrowser for help on using the repository browser.