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/** 19 * The "nodeTemplates" collection of methods. 20 * Typical usage is: 21 * <code> 22 * $computeService = new Google_Service_Compute(...); 23 * $nodeTemplates = $computeService->nodeTemplates; 24 * </code> 25 */ 26class Google_Service_Compute_Resource_NodeTemplates extends Google_Service_Resource 27{ 28 /** 29 * Retrieves an aggregated list of node templates. 30 * (nodeTemplates.aggregatedList) 31 * 32 * @param string $project Project ID for this request. 33 * @param array $optParams Optional parameters. 34 * 35 * @opt_param string filter A filter expression that filters resources listed in 36 * the response. The expression must specify the field name, a comparison 37 * operator, and the value that you want to use for filtering. The value must be 38 * a string, a number, or a boolean. The comparison operator must be either =, 39 * !=, >, or <. 40 * 41 * For example, if you are filtering Compute Engine instances, you can exclude 42 * instances named example-instance by specifying name != example-instance. 43 * 44 * You can also filter nested fields. For example, you could specify 45 * scheduling.automaticRestart = false to include instances only if they are not 46 * scheduled for automatic restarts. You can use filtering on nested fields to 47 * filter based on resource labels. 48 * 49 * To filter on multiple expressions, provide each separate expression within 50 * parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = 51 * "Intel Skylake"). By default, each expression is an AND expression. However, 52 * you can include AND and OR expressions explicitly. For example, (cpuPlatform 53 * = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND 54 * (scheduling.automaticRestart = true). 55 * @opt_param string maxResults The maximum number of results per page that 56 * should be returned. If the number of available results is larger than 57 * maxResults, Compute Engine returns a nextPageToken that can be used to get 58 * the next page of results in subsequent list requests. Acceptable values are 0 59 * to 500, inclusive. (Default: 500) 60 * @opt_param string orderBy Sorts list results by a certain order. By default, 61 * results are returned in alphanumerical order based on the resource name. 62 * 63 * You can also sort results in descending order based on the creation timestamp 64 * using orderBy="creationTimestamp desc". This sorts results based on the 65 * creationTimestamp field in reverse chronological order (newest result first). 66 * Use this to sort resources like operations so that the newest operation is 67 * returned first. 68 * 69 * Currently, only sorting by name or creationTimestamp desc is supported. 70 * @opt_param string pageToken Specifies a page token to use. Set pageToken to 71 * the nextPageToken returned by a previous list request to get the next page of 72 * results. 73 * @return Google_Service_Compute_NodeTemplateAggregatedList 74 */ 75 public function aggregatedList($project, $optParams = array()) 76 { 77 $params = array('project' => $project); 78 $params = array_merge($params, $optParams); 79 return $this->call('aggregatedList', array($params), "Google_Service_Compute_NodeTemplateAggregatedList"); 80 } 81 /** 82 * Deletes the specified NodeTemplate resource. (nodeTemplates.delete) 83 * 84 * @param string $project Project ID for this request. 85 * @param string $region The name of the region for this request. 86 * @param string $nodeTemplate Name of the NodeTemplate resource to delete. 87 * @param array $optParams Optional parameters. 88 * 89 * @opt_param string requestId An optional request ID to identify requests. 90 * Specify a unique request ID so that if you must retry your request, the 91 * server will know to ignore the request if it has already been completed. 92 * 93 * For example, consider a situation where you make an initial request and the 94 * request times out. If you make the request again with the same request ID, 95 * the server can check if original operation with the same request ID was 96 * received, and if so, will ignore the second request. This prevents clients 97 * from accidentally creating duplicate commitments. 98 * 99 * The request ID must be a valid UUID with the exception that zero UUID is not 100 * supported (00000000-0000-0000-0000-000000000000). 101 * @return Google_Service_Compute_Operation 102 */ 103 public function delete($project, $region, $nodeTemplate, $optParams = array()) 104 { 105 $params = array('project' => $project, 'region' => $region, 'nodeTemplate' => $nodeTemplate); 106 $params = array_merge($params, $optParams); 107 return $this->call('delete', array($params), "Google_Service_Compute_Operation"); 108 } 109 /** 110 * Returns the specified node template. Gets a list of available node templates 111 * by making a list() request. (nodeTemplates.get) 112 * 113 * @param string $project Project ID for this request. 114 * @param string $region The name of the region for this request. 115 * @param string $nodeTemplate Name of the node template to return. 116 * @param array $optParams Optional parameters. 117 * @return Google_Service_Compute_NodeTemplate 118 */ 119 public function get($project, $region, $nodeTemplate, $optParams = array()) 120 { 121 $params = array('project' => $project, 'region' => $region, 'nodeTemplate' => $nodeTemplate); 122 $params = array_merge($params, $optParams); 123 return $this->call('get', array($params), "Google_Service_Compute_NodeTemplate"); 124 } 125 /** 126 * Gets the access control policy for a resource. May be empty if no such policy 127 * or resource exists. (nodeTemplates.getIamPolicy) 128 * 129 * @param string $project Project ID for this request. 130 * @param string $region The name of the region for this request. 131 * @param string $resource Name or id of the resource for this request. 132 * @param array $optParams Optional parameters. 133 * @return Google_Service_Compute_Policy 134 */ 135 public function getIamPolicy($project, $region, $resource, $optParams = array()) 136 { 137 $params = array('project' => $project, 'region' => $region, 'resource' => $resource); 138 $params = array_merge($params, $optParams); 139 return $this->call('getIamPolicy', array($params), "Google_Service_Compute_Policy"); 140 } 141 /** 142 * Creates a NodeTemplate resource in the specified project using the data 143 * included in the request. (nodeTemplates.insert) 144 * 145 * @param string $project Project ID for this request. 146 * @param string $region The name of the region for this request. 147 * @param Google_Service_Compute_NodeTemplate $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. 153 * 154 * For example, consider a situation where you make an initial request and the 155 * request times out. If you make the request again with the same request ID, 156 * the server can check if original operation with the same request ID was 157 * received, and if so, will ignore the second request. This prevents clients 158 * from accidentally creating duplicate commitments. 159 * 160 * The request ID must be a valid UUID with the exception that zero UUID is not 161 * supported (00000000-0000-0000-0000-000000000000). 162 * @return Google_Service_Compute_Operation 163 */ 164 public function insert($project, $region, Google_Service_Compute_NodeTemplate $postBody, $optParams = array()) 165 { 166 $params = array('project' => $project, 'region' => $region, 'postBody' => $postBody); 167 $params = array_merge($params, $optParams); 168 return $this->call('insert', array($params), "Google_Service_Compute_Operation"); 169 } 170 /** 171 * Retrieves a list of node templates available to the specified project. 172 * (nodeTemplates.listNodeTemplates) 173 * 174 * @param string $project Project ID for this request. 175 * @param string $region The name of the region for this request. 176 * @param array $optParams Optional parameters. 177 * 178 * @opt_param string filter A filter expression that filters resources listed in 179 * the response. The expression must specify the field name, a comparison 180 * operator, and the value that you want to use for filtering. The value must be 181 * a string, a number, or a boolean. The comparison operator must be either =, 182 * !=, >, or <. 183 * 184 * For example, if you are filtering Compute Engine instances, you can exclude 185 * instances named example-instance by specifying name != example-instance. 186 * 187 * You can also filter nested fields. For example, you could specify 188 * scheduling.automaticRestart = false to include instances only if they are not 189 * scheduled for automatic restarts. You can use filtering on nested fields to 190 * filter based on resource labels. 191 * 192 * To filter on multiple expressions, provide each separate expression within 193 * parentheses. For example, (scheduling.automaticRestart = true) (cpuPlatform = 194 * "Intel Skylake"). By default, each expression is an AND expression. However, 195 * you can include AND and OR expressions explicitly. For example, (cpuPlatform 196 * = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND 197 * (scheduling.automaticRestart = true). 198 * @opt_param string maxResults The maximum number of results per page that 199 * should be returned. If the number of available results is larger than 200 * maxResults, Compute Engine returns a nextPageToken that can be used to get 201 * the next page of results in subsequent list requests. Acceptable values are 0 202 * to 500, inclusive. (Default: 500) 203 * @opt_param string orderBy Sorts list results by a certain order. By default, 204 * results are returned in alphanumerical order based on the resource name. 205 * 206 * You can also sort results in descending order based on the creation timestamp 207 * using orderBy="creationTimestamp desc". This sorts results based on the 208 * creationTimestamp field in reverse chronological order (newest result first). 209 * Use this to sort resources like operations so that the newest operation is 210 * returned first. 211 * 212 * Currently, only sorting by name or creationTimestamp desc is supported. 213 * @opt_param string pageToken Specifies a page token to use. Set pageToken to 214 * the nextPageToken returned by a previous list request to get the next page of 215 * results. 216 * @return Google_Service_Compute_NodeTemplateList 217 */ 218 public function listNodeTemplates($project, $region, $optParams = array()) 219 { 220 $params = array('project' => $project, 'region' => $region); 221 $params = array_merge($params, $optParams); 222 return $this->call('list', array($params), "Google_Service_Compute_NodeTemplateList"); 223 } 224 /** 225 * Sets the access control policy on the specified resource. Replaces any 226 * existing policy. (nodeTemplates.setIamPolicy) 227 * 228 * @param string $project Project ID for this request. 229 * @param string $region The name of the region for this request. 230 * @param string $resource Name or id of the resource for this request. 231 * @param Google_Service_Compute_RegionSetPolicyRequest $postBody 232 * @param array $optParams Optional parameters. 233 * @return Google_Service_Compute_Policy 234 */ 235 public function setIamPolicy($project, $region, $resource, Google_Service_Compute_RegionSetPolicyRequest $postBody, $optParams = array()) 236 { 237 $params = array('project' => $project, 'region' => $region, 'resource' => $resource, 'postBody' => $postBody); 238 $params = array_merge($params, $optParams); 239 return $this->call('setIamPolicy', array($params), "Google_Service_Compute_Policy"); 240 } 241 /** 242 * Returns permissions that a caller has on the specified resource. 243 * (nodeTemplates.testIamPermissions) 244 * 245 * @param string $project Project ID for this request. 246 * @param string $region The name of the region for this request. 247 * @param string $resource Name or id of the resource for this request. 248 * @param Google_Service_Compute_TestPermissionsRequest $postBody 249 * @param array $optParams Optional parameters. 250 * @return Google_Service_Compute_TestPermissionsResponse 251 */ 252 public function testIamPermissions($project, $region, $resource, Google_Service_Compute_TestPermissionsRequest $postBody, $optParams = array()) 253 { 254 $params = array('project' => $project, 'region' => $region, 'resource' => $resource, 'postBody' => $postBody); 255 $params = array_merge($params, $optParams); 256 return $this->call('testIamPermissions', array($params), "Google_Service_Compute_TestPermissionsResponse"); 257 } 258} 259