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\NetworkEndpointGroup; 21use Google\Service\Compute\NetworkEndpointGroupList; 22use Google\Service\Compute\Operation; 23 24/** 25 * The "regionNetworkEndpointGroups" collection of methods. 26 * Typical usage is: 27 * <code> 28 * $computeService = new Google\Service\Compute(...); 29 * $regionNetworkEndpointGroups = $computeService->regionNetworkEndpointGroups; 30 * </code> 31 */ 32class RegionNetworkEndpointGroups extends \Google\Service\Resource 33{ 34 /** 35 * Deletes the specified network endpoint group. Note that the NEG cannot be 36 * deleted if it is configured as a backend of a backend service. 37 * (regionNetworkEndpointGroups.delete) 38 * 39 * @param string $project Project ID for this request. 40 * @param string $region The name of the region where the network endpoint group 41 * is located. It should comply with RFC1035. 42 * @param string $networkEndpointGroup The name of the network endpoint group to 43 * delete. It should comply with RFC1035. 44 * @param array $optParams Optional parameters. 45 * 46 * @opt_param string requestId An optional request ID to identify requests. 47 * Specify a unique request ID so that if you must retry your request, the 48 * server will know to ignore the request if it has already been completed. For 49 * example, consider a situation where you make an initial request and the 50 * request times out. If you make the request again with the same request ID, 51 * the server can check if original operation with the same request ID was 52 * received, and if so, will ignore the second request. This prevents clients 53 * from accidentally creating duplicate commitments. The request ID must be a 54 * valid UUID with the exception that zero UUID is not supported ( 55 * 00000000-0000-0000-0000-000000000000). 56 * @return Operation 57 */ 58 public function delete($project, $region, $networkEndpointGroup, $optParams = []) 59 { 60 $params = ['project' => $project, 'region' => $region, 'networkEndpointGroup' => $networkEndpointGroup]; 61 $params = array_merge($params, $optParams); 62 return $this->call('delete', [$params], Operation::class); 63 } 64 /** 65 * Returns the specified network endpoint group. Gets a list of available 66 * network endpoint groups by making a list() request. 67 * (regionNetworkEndpointGroups.get) 68 * 69 * @param string $project Project ID for this request. 70 * @param string $region The name of the region where the network endpoint group 71 * is located. It should comply with RFC1035. 72 * @param string $networkEndpointGroup The name of the network endpoint group. 73 * It should comply with RFC1035. 74 * @param array $optParams Optional parameters. 75 * @return NetworkEndpointGroup 76 */ 77 public function get($project, $region, $networkEndpointGroup, $optParams = []) 78 { 79 $params = ['project' => $project, 'region' => $region, 'networkEndpointGroup' => $networkEndpointGroup]; 80 $params = array_merge($params, $optParams); 81 return $this->call('get', [$params], NetworkEndpointGroup::class); 82 } 83 /** 84 * Creates a network endpoint group in the specified project using the 85 * parameters that are included in the request. 86 * (regionNetworkEndpointGroups.insert) 87 * 88 * @param string $project Project ID for this request. 89 * @param string $region The name of the region where you want to create the 90 * network endpoint group. It should comply with RFC1035. 91 * @param NetworkEndpointGroup $postBody 92 * @param array $optParams Optional parameters. 93 * 94 * @opt_param string requestId An optional request ID to identify requests. 95 * Specify a unique request ID so that if you must retry your request, the 96 * server will know to ignore the request if it has already been completed. For 97 * example, consider a situation where you make an initial request and the 98 * request times out. If you make the request again with the same request ID, 99 * the server can check if original operation with the same request ID was 100 * received, and if so, will ignore the second request. This prevents clients 101 * from accidentally creating duplicate commitments. The request ID must be a 102 * valid UUID with the exception that zero UUID is not supported ( 103 * 00000000-0000-0000-0000-000000000000). 104 * @return Operation 105 */ 106 public function insert($project, $region, NetworkEndpointGroup $postBody, $optParams = []) 107 { 108 $params = ['project' => $project, 'region' => $region, 'postBody' => $postBody]; 109 $params = array_merge($params, $optParams); 110 return $this->call('insert', [$params], Operation::class); 111 } 112 /** 113 * Retrieves the list of regional network endpoint groups available to the 114 * specified project in the given region. 115 * (regionNetworkEndpointGroups.listRegionNetworkEndpointGroups) 116 * 117 * @param string $project Project ID for this request. 118 * @param string $region The name of the region where the network endpoint group 119 * is located. It should comply with RFC1035. 120 * @param array $optParams Optional parameters. 121 * 122 * @opt_param string filter A filter expression that filters resources listed in 123 * the response. The expression must specify the field name, an operator, and 124 * the value that you want to use for filtering. The value must be a string, a 125 * number, or a boolean. The operator must be either `=`, `!=`, `>`, `<`, `<=`, 126 * `>=` or `:`. For example, if you are filtering Compute Engine instances, you 127 * can exclude instances named `example-instance` by specifying `name != 128 * example-instance`. The `:` operator can be used with string fields to match 129 * substrings. For non-string fields it is equivalent to the `=` operator. The 130 * `:*` comparison can be used to test whether a key has been defined. For 131 * example, to find all objects with `owner` label use: ``` labels.owner:* ``` 132 * You can also filter nested fields. For example, you could specify 133 * `scheduling.automaticRestart = false` to include instances only if they are 134 * not scheduled for automatic restarts. You can use filtering on nested fields 135 * to filter based on resource labels. To filter on multiple expressions, 136 * provide each separate expression within parentheses. For example: ``` 137 * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By 138 * default, each expression is an `AND` expression. However, you can include 139 * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel 140 * Skylake") OR (cpuPlatform = "Intel Broadwell") AND 141 * (scheduling.automaticRestart = true) ``` 142 * @opt_param string maxResults The maximum number of results per page that 143 * should be returned. If the number of available results is larger than 144 * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to 145 * get the next page of results in subsequent list requests. Acceptable values 146 * are `0` to `500`, inclusive. (Default: `500`) 147 * @opt_param string orderBy Sorts list results by a certain order. By default, 148 * results are returned in alphanumerical order based on the resource name. You 149 * can also sort results in descending order based on the creation timestamp 150 * using `orderBy="creationTimestamp desc"`. This sorts results based on the 151 * `creationTimestamp` field in reverse chronological order (newest result 152 * first). Use this to sort resources like operations so that the newest 153 * operation is returned first. Currently, only sorting by `name` or 154 * `creationTimestamp desc` is supported. 155 * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to 156 * the `nextPageToken` returned by a previous list request to get the next page 157 * of results. 158 * @opt_param bool returnPartialSuccess Opt-in for partial success behavior 159 * which provides partial results in case of failure. The default value is 160 * false. 161 * @return NetworkEndpointGroupList 162 */ 163 public function listRegionNetworkEndpointGroups($project, $region, $optParams = []) 164 { 165 $params = ['project' => $project, 'region' => $region]; 166 $params = array_merge($params, $optParams); 167 return $this->call('list', [$params], NetworkEndpointGroupList::class); 168 } 169} 170 171// Adding a class alias for backwards compatibility with the previous class name. 172class_alias(RegionNetworkEndpointGroups::class, 'Google_Service_Compute_Resource_RegionNetworkEndpointGroups'); 173