source: vendor/google/apiclient-services/src/Compute/Resource/MachineImages.php@ e3d4e0a

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

Upload project files

  • Property mode set to 100644
File size: 11.5 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\GlobalSetPolicyRequest;
21use Google\Service\Compute\MachineImage;
22use Google\Service\Compute\MachineImageList;
23use Google\Service\Compute\Operation;
24use Google\Service\Compute\Policy;
25use Google\Service\Compute\TestPermissionsRequest;
26use Google\Service\Compute\TestPermissionsResponse;
27
28/**
29 * The "machineImages" collection of methods.
30 * Typical usage is:
31 * <code>
32 * $computeService = new Google\Service\Compute(...);
33 * $machineImages = $computeService->machineImages;
34 * </code>
35 */
36class MachineImages extends \Google\Service\Resource
37{
38 /**
39 * Deletes the specified machine image. Deleting a machine image is permanent
40 * and cannot be undone. (machineImages.delete)
41 *
42 * @param string $project Project ID for this request.
43 * @param string $machineImage The name of the machine image to delete.
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 * @throws \Google\Service\Exception
58 */
59 public function delete($project, $machineImage, $optParams = [])
60 {
61 $params = ['project' => $project, 'machineImage' => $machineImage];
62 $params = array_merge($params, $optParams);
63 return $this->call('delete', [$params], Operation::class);
64 }
65 /**
66 * Returns the specified machine image. (machineImages.get)
67 *
68 * @param string $project Project ID for this request.
69 * @param string $machineImage The name of the machine image.
70 * @param array $optParams Optional parameters.
71 * @return MachineImage
72 * @throws \Google\Service\Exception
73 */
74 public function get($project, $machineImage, $optParams = [])
75 {
76 $params = ['project' => $project, 'machineImage' => $machineImage];
77 $params = array_merge($params, $optParams);
78 return $this->call('get', [$params], MachineImage::class);
79 }
80 /**
81 * Gets the access control policy for a resource. May be empty if no such policy
82 * or resource exists. (machineImages.getIamPolicy)
83 *
84 * @param string $project Project ID for this request.
85 * @param string $resource Name or id of the resource for this request.
86 * @param array $optParams Optional parameters.
87 *
88 * @opt_param int optionsRequestedPolicyVersion Requested IAM Policy version.
89 * @return Policy
90 * @throws \Google\Service\Exception
91 */
92 public function getIamPolicy($project, $resource, $optParams = [])
93 {
94 $params = ['project' => $project, 'resource' => $resource];
95 $params = array_merge($params, $optParams);
96 return $this->call('getIamPolicy', [$params], Policy::class);
97 }
98 /**
99 * Creates a machine image in the specified project using the data that is
100 * included in the request. If you are creating a new machine image to update an
101 * existing instance, your new machine image should use the same network or, if
102 * applicable, the same subnetwork as the original instance.
103 * (machineImages.insert)
104 *
105 * @param string $project Project ID for this request.
106 * @param MachineImage $postBody
107 * @param array $optParams Optional parameters.
108 *
109 * @opt_param string requestId An optional request ID to identify requests.
110 * Specify a unique request ID so that if you must retry your request, the
111 * server will know to ignore the request if it has already been completed. For
112 * example, consider a situation where you make an initial request and the
113 * request times out. If you make the request again with the same request ID,
114 * the server can check if original operation with the same request ID was
115 * received, and if so, will ignore the second request. This prevents clients
116 * from accidentally creating duplicate commitments. The request ID must be a
117 * valid UUID with the exception that zero UUID is not supported (
118 * 00000000-0000-0000-0000-000000000000).
119 * @opt_param string sourceInstance Required. Source instance that is used to
120 * create the machine image from.
121 * @return Operation
122 * @throws \Google\Service\Exception
123 */
124 public function insert($project, MachineImage $postBody, $optParams = [])
125 {
126 $params = ['project' => $project, 'postBody' => $postBody];
127 $params = array_merge($params, $optParams);
128 return $this->call('insert', [$params], Operation::class);
129 }
130 /**
131 * Retrieves a list of machine images that are contained within the specified
132 * project. (machineImages.listMachineImages)
133 *
134 * @param string $project Project ID for this request.
135 * @param array $optParams Optional parameters.
136 *
137 * @opt_param string filter A filter expression that filters resources listed in
138 * the response. Most Compute resources support two types of filter expressions:
139 * expressions that support regular expressions and expressions that follow API
140 * improvement proposal AIP-160. These two types of filter expressions cannot be
141 * mixed in one request. If you want to use AIP-160, your expression must
142 * specify the field name, an operator, and the value that you want to use for
143 * filtering. The value must be a string, a number, or a boolean. The operator
144 * must be either `=`, `!=`, `>`, `<`, `<=`, `>=` or `:`. For example, if you
145 * are filtering Compute Engine instances, you can exclude instances named
146 * `example-instance` by specifying `name != example-instance`. The `:*`
147 * comparison can be used to test whether a key has been defined. For example,
148 * to find all objects with `owner` label use: ``` labels.owner:* ``` You can
149 * also filter nested fields. For example, you could specify
150 * `scheduling.automaticRestart = false` to include instances only if they are
151 * not scheduled for automatic restarts. You can use filtering on nested fields
152 * to filter based on resource labels. To filter on multiple expressions,
153 * provide each separate expression within parentheses. For example: ```
154 * (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By
155 * default, each expression is an `AND` expression. However, you can include
156 * `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel
157 * Skylake") OR (cpuPlatform = "Intel Broadwell") AND
158 * (scheduling.automaticRestart = true) ``` If you want to use a regular
159 * expression, use the `eq` (equal) or `ne` (not equal) operator against a
160 * single un-parenthesized expression with or without quotes or against multiple
161 * parenthesized expressions. Examples: `fieldname eq unquoted literal`
162 * `fieldname eq 'single quoted literal'` `fieldname eq "double quoted literal"`
163 * `(fieldname1 eq literal) (fieldname2 ne "literal")` The literal value is
164 * interpreted as a regular expression using Google RE2 library syntax. The
165 * literal value must match the entire field. For example, to filter for
166 * instances that do not end with name "instance", you would use `name ne
167 * .*instance`. You cannot combine constraints on multiple fields using regular
168 * expressions.
169 * @opt_param string maxResults The maximum number of results per page that
170 * should be returned. If the number of available results is larger than
171 * `maxResults`, Compute Engine returns a `nextPageToken` that can be used to
172 * get the next page of results in subsequent list requests. Acceptable values
173 * are `0` to `500`, inclusive. (Default: `500`)
174 * @opt_param string orderBy Sorts list results by a certain order. By default,
175 * results are returned in alphanumerical order based on the resource name. You
176 * can also sort results in descending order based on the creation timestamp
177 * using `orderBy="creationTimestamp desc"`. This sorts results based on the
178 * `creationTimestamp` field in reverse chronological order (newest result
179 * first). Use this to sort resources like operations so that the newest
180 * operation is returned first. Currently, only sorting by `name` or
181 * `creationTimestamp desc` is supported.
182 * @opt_param string pageToken Specifies a page token to use. Set `pageToken` to
183 * the `nextPageToken` returned by a previous list request to get the next page
184 * of results.
185 * @opt_param bool returnPartialSuccess Opt-in for partial success behavior
186 * which provides partial results in case of failure. The default value is
187 * false. For example, when partial success behavior is enabled, aggregatedList
188 * for a single zone scope either returns all resources in the zone or no
189 * resources, with an error code.
190 * @return MachineImageList
191 * @throws \Google\Service\Exception
192 */
193 public function listMachineImages($project, $optParams = [])
194 {
195 $params = ['project' => $project];
196 $params = array_merge($params, $optParams);
197 return $this->call('list', [$params], MachineImageList::class);
198 }
199 /**
200 * Sets the access control policy on the specified resource. Replaces any
201 * existing policy. (machineImages.setIamPolicy)
202 *
203 * @param string $project Project ID for this request.
204 * @param string $resource Name or id of the resource for this request.
205 * @param GlobalSetPolicyRequest $postBody
206 * @param array $optParams Optional parameters.
207 * @return Policy
208 * @throws \Google\Service\Exception
209 */
210 public function setIamPolicy($project, $resource, GlobalSetPolicyRequest $postBody, $optParams = [])
211 {
212 $params = ['project' => $project, 'resource' => $resource, 'postBody' => $postBody];
213 $params = array_merge($params, $optParams);
214 return $this->call('setIamPolicy', [$params], Policy::class);
215 }
216 /**
217 * Returns permissions that a caller has on the specified resource.
218 * (machineImages.testIamPermissions)
219 *
220 * @param string $project Project ID for this request.
221 * @param string $resource Name or id of the resource for this request.
222 * @param TestPermissionsRequest $postBody
223 * @param array $optParams Optional parameters.
224 * @return TestPermissionsResponse
225 * @throws \Google\Service\Exception
226 */
227 public function testIamPermissions($project, $resource, TestPermissionsRequest $postBody, $optParams = [])
228 {
229 $params = ['project' => $project, 'resource' => $resource, 'postBody' => $postBody];
230 $params = array_merge($params, $optParams);
231 return $this->call('testIamPermissions', [$params], TestPermissionsResponse::class);
232 }
233}
234
235// Adding a class alias for backwards compatibility with the previous class name.
236class_alias(MachineImages::class, 'Google_Service_Compute_Resource_MachineImages');
Note: See TracBrowser for help on using the repository browser.