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