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