blob: c821029440a4085a8c07388f01e16c98f7f4be0c [file] [log] [blame]
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5 margin: 0;
6 padding: 0;
7 border: 0;
8 font-weight: inherit;
9 font-style: inherit;
10 font-size: 100%;
11 font-family: inherit;
12 vertical-align: baseline;
13}
14
15body {
16 font-size: 13px;
17 padding: 1em;
18}
19
20h1 {
21 font-size: 26px;
22 margin-bottom: 1em;
23}
24
25h2 {
26 font-size: 24px;
27 margin-bottom: 1em;
28}
29
30h3 {
31 font-size: 20px;
32 margin-bottom: 1em;
33 margin-top: 1em;
34}
35
36pre, code {
37 line-height: 1.5;
38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42 margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46 font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50 border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54 margin-top: 0.5em;
55}
56
57.firstline {
58 margin-left: 2 em;
59}
60
61.method {
62 margin-top: 1em;
63 border: solid 1px #CCC;
64 padding: 1em;
65 background: #EEE;
66}
67
68.details {
69 font-weight: bold;
70 font-size: 14px;
71}
72
73</style>
74
75<h1><a href="compute_alpha.html">Compute Engine API</a> . <a href="compute_alpha.reservations.html">reservations</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070078 <code><a href="#aggregatedList">aggregatedList(project, orderBy=None, maxResults=None, pageToken=None, returnPartialSuccess=None, filter=None, includeAllScopes=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070079<p class="firstline">Retrieves an aggregated list of reservations.</p>
80<p class="toc_element">
81 <code><a href="#aggregatedList_next">aggregatedList_next(previous_request, previous_response)</a></code></p>
82<p class="firstline">Retrieves the next page of results.</p>
83<p class="toc_element">
84 <code><a href="#delete">delete(project, zone, reservation, requestId=None)</a></code></p>
85<p class="firstline">Deletes the specified reservation.</p>
86<p class="toc_element">
87 <code><a href="#get">get(project, zone, reservation)</a></code></p>
Dan O'Mearadd494642020-05-01 07:42:23 -070088<p class="firstline">Retrieves information about the specified reservation.</p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070089<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070090 <code><a href="#getIamPolicy">getIamPolicy(project, zone, resource, optionsRequestedPolicyVersion=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070091<p class="firstline">Gets the access control policy for a resource. May be empty if no such policy or resource exists.</p>
92<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070093 <code><a href="#insert">insert(project, zone, body=None, requestId=None)</a></code></p>
94<p class="firstline">Creates a new reservation. For more information, read Reserving zonal resources.</p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070095<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -070096 <code><a href="#list">list(project, zone, orderBy=None, pageToken=None, maxResults=None, returnPartialSuccess=None, filter=None)</a></code></p>
97<p class="firstline">A list of all the reservations that have been configured for the specified project in specified zone.</p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -070098<p class="toc_element">
99 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
100<p class="firstline">Retrieves the next page of results.</p>
101<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700102 <code><a href="#resize">resize(project, zone, reservation, body=None, requestId=None)</a></code></p>
103<p class="firstline">Resizes the reservation (applicable to standalone reservations only). For more information, read Modifying reservations.</p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700104<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700105 <code><a href="#setIamPolicy">setIamPolicy(project, zone, resource, body=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700106<p class="firstline">Sets the access control policy on the specified resource. Replaces any existing policy.</p>
107<p class="toc_element">
Dan O'Mearadd494642020-05-01 07:42:23 -0700108 <code><a href="#testIamPermissions">testIamPermissions(project, zone, resource, body=None)</a></code></p>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700109<p class="firstline">Returns permissions that a caller has on the specified resource.</p>
110<h3>Method Details</h3>
111<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700112 <code class="details" id="aggregatedList">aggregatedList(project, orderBy=None, maxResults=None, pageToken=None, returnPartialSuccess=None, filter=None, includeAllScopes=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700113 <pre>Retrieves an aggregated list of reservations.
114
115Args:
116 project: string, Project ID for this request. (required)
117 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
118
Dan O'Mearadd494642020-05-01 07:42:23 -0700119You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700120
Dan O'Mearadd494642020-05-01 07:42:23 -0700121Currently, only sorting by `name` or `creationTimestamp desc` is supported.
122 maxResults: integer, The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
123 pageToken: string, Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
124 returnPartialSuccess: boolean, Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today.
125 filter: string, A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `&gt;`, or `&lt;`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700126
Dan O'Mearadd494642020-05-01 07:42:23 -0700127For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700128
Dan O'Mearadd494642020-05-01 07:42:23 -0700129You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700130
Dan O'Mearadd494642020-05-01 07:42:23 -0700131To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ```
132 includeAllScopes: boolean, Indicates whether every visible scope for each scope type (zone, region, global) should be included in the response. For new resource types added after this field, the flag has no effect as new resource types will always include every visible scope for each scope type in response. For resource types which predate this field, if this flag is omitted or false, only scopes of the scope types where the resource type is expected to be found will be included.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700133
134Returns:
135 An object of the form:
136
137 { # Contains a list of reservations.
138 "nextPageToken": "A String", # [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.
139 "kind": "compute#reservationAggregatedList", # Type of resource.
140 "items": { # A list of Allocation resources.
141 "a_key": { # Name of the scope containing this set of reservations.
142 "reservations": [ # A list of reservations contained in this scope.
Dan O'Mearadd494642020-05-01 07:42:23 -0700143 { # Represents a reservation resource. A reservation ensures that capacity is held in a specific zone even if the reserved VMs are not running. For more information, read Reserving zonal resources. (== resource_for {$api_version}.reservations ==)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700144 "status": "A String", # [Output Only] The status of the reservation.
145 "kind": "compute#reservation", # [Output Only] Type of the resource. Always compute#reservations for reservations.
146 "name": "A String", # The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
Dan O'Mearadd494642020-05-01 07:42:23 -0700147 "specificReservationRequired": True or False, # Indicates whether the reservation can be consumed by VMs with affinity for "any" reservation. If the field is set, then only VMs that target the reservation by name can consume from this reservation.
148 "commitment": "A String", # [Output Only] Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700149 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
150 "specificReservation": { # This reservation type allows to pre allocate specific instance configuration. # Reservation for instances with specific machine shapes.
Dan O'Mearadd494642020-05-01 07:42:23 -0700151 "count": "A String", # Specifies the number of resources that are allocated.
152 "instanceProperties": { # Properties of the SKU instances being reserved. # The instance properties for the reservation.
153 "longTermRelease": True or False, # Compute Engine Long Term Release. When specified, VMs that have this policy become long term release (internal: stable fleet) VMs.
154 #
155 # For all VM shapes, this should result in fewer disruptions due to software updates and greater predictability via 1 week extended notifications.
156 #
157 # For GPU VMs, this should also result in an 2 week uptime guarantee. See go/stable-fleet-gpus-design for more details.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700158 "machineType": "A String", # Specifies type of machine (name only) which has fixed number of vCPUs and fixed amount of memory. This also includes specifying custom machine type following custom-NUMBER_OF_CPUS-AMOUNT_OF_MEMORY pattern.
159 "guestAccelerators": [ # Specifies accelerator type and count.
160 { # A specification of the type and number of accelerator cards attached to the instance.
161 "acceleratorCount": 42, # The number of the guest accelerator cards exposed to this instance.
162 "acceleratorType": "A String", # Full or partial URL of the accelerator type resource to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name. See GPUs on Compute Engine for a full list of accelerator types.
163 },
164 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700165 "locationHint": "A String", # An opaque location hint used to place the allocation close to other resources. This field is for use by internal tools that use the public API.
166 "minCpuPlatform": "A String", # Minimum cpu platform the reservation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700167 "localSsds": [ # Specifies amount of local ssd to reserve with each instance. The type of disk is local-ssd.
168 {
169 "interface": "A String", # Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance.
170 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
171 },
172 ],
173 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700174 "inUseCount": "A String", # [Output Only] Indicates how many instances are in use.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700175 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700176 "zone": "A String", # Zone in which the reservation resides. A zone must be provided if the reservation is created within a commitment.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700177 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
178 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
179 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
180 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
181 },
182 ],
183 "warning": { # Informational warning which replaces the list of reservations when the list is empty.
184 "message": "A String", # [Output Only] A human-readable description of the warning code.
185 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
186 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
187 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
188 {
189 "value": "A String", # [Output Only] A warning data value corresponding to the key.
190 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
191 },
192 ],
193 },
194 },
195 },
196 "warning": { # [Output Only] Informational warning message.
197 "message": "A String", # [Output Only] A human-readable description of the warning code.
198 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
199 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
200 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
201 {
202 "value": "A String", # [Output Only] A warning data value corresponding to the key.
203 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
204 },
205 ],
206 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700207 "unreachables": [ # [Output Only] Unreachable resources.
208 "A String",
209 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700210 "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server.
211 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
212 }</pre>
213</div>
214
215<div class="method">
216 <code class="details" id="aggregatedList_next">aggregatedList_next(previous_request, previous_response)</code>
217 <pre>Retrieves the next page of results.
218
219Args:
220 previous_request: The request for the previous page. (required)
221 previous_response: The response from the request for the previous page. (required)
222
223Returns:
224 A request object that you can call 'execute()' on to request the next
225 page. Returns None if there are no more items in the collection.
226 </pre>
227</div>
228
229<div class="method">
230 <code class="details" id="delete">delete(project, zone, reservation, requestId=None)</code>
231 <pre>Deletes the specified reservation.
232
233Args:
234 project: string, Project ID for this request. (required)
235 zone: string, Name of the zone for this request. (required)
236 reservation: string, Name of the reservation to delete. (required)
237 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
238
239For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
240
241The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
242
243Returns:
244 An object of the form:
245
246 { # Represents an Operation resource.
247 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700248 # Google Compute Engine has three Operation resources:
249 #
250 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
251 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700252 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
253 #
254 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -0700255 # - For global operations, use the `globalOperations` resource.
256 # - For regional operations, use the `regionOperations` resource.
257 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700258 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700259 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700260 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
261 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
262 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -0700263 "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700264 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
265 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700266 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
267 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700268 "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
Dan O'Mearadd494642020-05-01 07:42:23 -0700269 "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a `404` means the resource was not found.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700270 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -0700271 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700272 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
273 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
274 {
275 "message": "A String", # [Output Only] A human-readable description of the warning code.
276 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
277 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
278 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
279 {
280 "value": "A String", # [Output Only] A warning data value corresponding to the key.
281 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
282 },
283 ],
284 },
285 ],
286 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Dan O'Mearadd494642020-05-01 07:42:23 -0700287 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700288 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700289 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
290 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700291 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
292 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
293 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
294 {
295 "message": "A String", # [Output Only] An optional, human-readable error message.
296 "code": "A String", # [Output Only] The error type identifier for this error.
297 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
298 },
299 ],
300 },
301 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
302 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
303 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
304 }</pre>
305</div>
306
307<div class="method">
308 <code class="details" id="get">get(project, zone, reservation)</code>
Dan O'Mearadd494642020-05-01 07:42:23 -0700309 <pre>Retrieves information about the specified reservation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700310
311Args:
312 project: string, Project ID for this request. (required)
313 zone: string, Name of the zone for this request. (required)
314 reservation: string, Name of the reservation to retrieve. (required)
315
316Returns:
317 An object of the form:
318
Dan O'Mearadd494642020-05-01 07:42:23 -0700319 { # Represents a reservation resource. A reservation ensures that capacity is held in a specific zone even if the reserved VMs are not running. For more information, read Reserving zonal resources. (== resource_for {$api_version}.reservations ==)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700320 "status": "A String", # [Output Only] The status of the reservation.
321 "kind": "compute#reservation", # [Output Only] Type of the resource. Always compute#reservations for reservations.
322 "name": "A String", # The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
Dan O'Mearadd494642020-05-01 07:42:23 -0700323 "specificReservationRequired": True or False, # Indicates whether the reservation can be consumed by VMs with affinity for "any" reservation. If the field is set, then only VMs that target the reservation by name can consume from this reservation.
324 "commitment": "A String", # [Output Only] Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700325 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
326 "specificReservation": { # This reservation type allows to pre allocate specific instance configuration. # Reservation for instances with specific machine shapes.
Dan O'Mearadd494642020-05-01 07:42:23 -0700327 "count": "A String", # Specifies the number of resources that are allocated.
328 "instanceProperties": { # Properties of the SKU instances being reserved. # The instance properties for the reservation.
329 "longTermRelease": True or False, # Compute Engine Long Term Release. When specified, VMs that have this policy become long term release (internal: stable fleet) VMs.
330 #
331 # For all VM shapes, this should result in fewer disruptions due to software updates and greater predictability via 1 week extended notifications.
332 #
333 # For GPU VMs, this should also result in an 2 week uptime guarantee. See go/stable-fleet-gpus-design for more details.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700334 "machineType": "A String", # Specifies type of machine (name only) which has fixed number of vCPUs and fixed amount of memory. This also includes specifying custom machine type following custom-NUMBER_OF_CPUS-AMOUNT_OF_MEMORY pattern.
335 "guestAccelerators": [ # Specifies accelerator type and count.
336 { # A specification of the type and number of accelerator cards attached to the instance.
337 "acceleratorCount": 42, # The number of the guest accelerator cards exposed to this instance.
338 "acceleratorType": "A String", # Full or partial URL of the accelerator type resource to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name. See GPUs on Compute Engine for a full list of accelerator types.
339 },
340 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700341 "locationHint": "A String", # An opaque location hint used to place the allocation close to other resources. This field is for use by internal tools that use the public API.
342 "minCpuPlatform": "A String", # Minimum cpu platform the reservation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700343 "localSsds": [ # Specifies amount of local ssd to reserve with each instance. The type of disk is local-ssd.
344 {
345 "interface": "A String", # Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance.
346 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
347 },
348 ],
349 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700350 "inUseCount": "A String", # [Output Only] Indicates how many instances are in use.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700351 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700352 "zone": "A String", # Zone in which the reservation resides. A zone must be provided if the reservation is created within a commitment.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700353 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
354 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
355 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
356 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
357 }</pre>
358</div>
359
360<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700361 <code class="details" id="getIamPolicy">getIamPolicy(project, zone, resource, optionsRequestedPolicyVersion=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700362 <pre>Gets the access control policy for a resource. May be empty if no such policy or resource exists.
363
364Args:
365 project: string, Project ID for this request. (required)
366 zone: string, The name of the zone for this request. (required)
367 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700368 optionsRequestedPolicyVersion: integer, Requested IAM Policy version.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700369
370Returns:
371 An object of the form:
372
Dan O'Mearadd494642020-05-01 07:42:23 -0700373 { # An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700374 #
375 #
376 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700377 # A `Policy` is a collection of `bindings`. A `binding` binds one or more `members` to a single `role`. Members can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700378 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700379 # Optionally, a `binding` can specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700380 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700381 # **JSON example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700382 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700383 # { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": ["user:eve@example.com"], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time &lt; timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700384 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700385 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700386 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700387 # bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time &lt; timestamp('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - version: 3
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700388 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700389 # For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700390 "auditConfigs": [ # Specifies cloud audit logging configuration for this policy.
391 { # Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs.
392 #
393 # If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted.
394 #
395 # Example Policy with multiple AuditConfigs:
396 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700397 # { "audit_configs": [ { "service": "allServices" "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE", }, { "log_type": "ADMIN_READ", } ] }, { "service": "sampleservice.googleapis.com" "audit_log_configs": [ { "log_type": "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700398 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700399 # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts jose@example.com from DATA_READ logging, and aliya@example.com from DATA_WRITE logging.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700400 "exemptedMembers": [
401 "A String",
402 ],
403 "auditLogConfigs": [ # The configuration for logging of each type of permission.
404 { # Provides the configuration for logging a type of permissions. Example:
405 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700406 # { "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE", } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700407 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700408 # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ logging.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700409 "exemptedMembers": [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
410 "A String",
411 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700412 "ignoreChildExemptions": True or False,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700413 "logType": "A String", # The log type that this config enables.
414 },
415 ],
416 "service": "A String", # Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services.
417 },
418 ],
419 "rules": [ # If more than one rule is specified, the rules are applied in the following manner: - All matching LOG rules are always applied. - If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be applied if one or more matching rule requires logging. - Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging will be applied if one or more matching rule requires logging. - Otherwise, if no rule applies, permission is denied.
420 { # A rule to be applied in a Policy.
421 "logConfigs": [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
422 { # Specifies what kind of log the caller must write
423 "counter": { # Increment a streamz counter with the specified metric and field names. # Counter options.
424 #
425 # Metric names should start with a '/', generally be lowercase-only, and end in "_count". Field names should not contain an initial slash. The actual exported metric names will have "/iam/policy" prepended.
426 #
427 # Field names correspond to IAM request parameters and field values are their respective values.
428 #
429 # Supported field names: - "authority", which is "[token]" if IAMContext.token is present, otherwise the value of IAMContext.authority_selector if present, and otherwise a representation of IAMContext.principal; or - "iam_principal", a representation of IAMContext.principal even if a token or authority selector is present; or - "" (empty string), resulting in a counter with no fields.
430 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700431 # Examples: counter { metric: "/debug_access_count" field: "iam_principal" } ==&gt; increment counter /iam/policy/debug_access_count {iam_principal=[value of IAMContext.principal]}
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700432 "field": "A String", # The field value to attribute.
Dan O'Mearadd494642020-05-01 07:42:23 -0700433 "customFields": [ # Custom fields.
434 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
435 "name": "A String", # Name is the field name.
436 "value": "A String", # Value is the field value. It is important that in contrast to the CounterOptions.field, the value here is a constant that is not derived from the IAMContext.
437 },
438 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700439 "metric": "A String", # The metric to update.
440 },
441 "dataAccess": { # Write a Data Access (Gin) log # Data access options.
Dan O'Mearadd494642020-05-01 07:42:23 -0700442 "logMode": "A String", # Whether Gin logging should happen in a fail-closed manner at the caller. This is currently supported in the LocalIAM implementation, Stubby C++, and Stubby Java. For Apps Framework, see go/af-audit-logging#failclosed. TODO(b/77591626): Add support for Stubby Go. TODO(b/129671387): Add support for Scaffolding.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700443 },
444 "cloudAudit": { # Write a Cloud Audit log # Cloud audit options.
445 "logName": "A String", # The log_name to populate in the Cloud Audit Record.
446 "authorizationLoggingOptions": { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
447 "permissionType": "A String", # The type of the permission that was checked.
448 },
449 },
450 },
451 ],
452 "notIns": [ # If one or more 'not_in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.
453 "A String",
454 ],
455 "ins": [ # If one or more 'in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
456 "A String",
457 ],
458 "action": "A String", # Required
459 "permissions": [ # A permission is a string of form '..' (e.g., 'storage.buckets.list'). A value of '*' matches all permissions, and a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.
460 "A String",
461 ],
462 "conditions": [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
463 { # A condition to be met.
464 "iam": "A String", # Trusted attributes supplied by the IAM system.
465 "sys": "A String", # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
466 "values": [ # The objects of the condition.
467 "A String",
468 ],
469 "svc": "A String", # Trusted attributes discharged by the service.
470 "op": "A String", # An operator to apply the subject with.
471 },
472 ],
473 "description": "A String", # Human-readable description of the rule.
474 },
475 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700476 "version": 42, # Specifies the format of the policy.
477 #
478 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
479 #
480 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
481 #
482 # * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions
483 #
484 # **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.
485 #
486 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700487 "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy.
488 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700489 # **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.
490 "bindings": [ # Associates a list of `members` to a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one member.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700491 { # Associates `members` with a `role`.
492 "role": "A String", # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
493 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
494 #
495 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
496 #
497 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
498 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700499 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700500 #
501 #
502 #
503 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
504 #
505 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
506 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700507 # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding.
508 #
509 # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding.
510 #
511 # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding.
512 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700513 #
514 #
515 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
516 "A String",
517 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700518 "condition": { # Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. # The condition that is associated with this binding. NOTE: An unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700519 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700520 # Example (Comparison):
521 #
522 # title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() &lt; 100"
523 #
524 # Example (Equality):
525 #
526 # title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email"
527 #
528 # Example (Logic):
529 #
530 # title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' &amp;&amp; document.type != 'internal'"
531 #
532 # Example (Data Manipulation):
533 #
534 # title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)"
535 #
536 # The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
537 "title": "A String", # Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700538 "expression": "A String", # Textual representation of an expression in Common Expression Language syntax.
Dan O'Mearadd494642020-05-01 07:42:23 -0700539 "description": "A String", # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
540 "location": "A String", # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700541 },
542 },
543 ],
544 "iamOwned": True or False,
545 }</pre>
546</div>
547
548<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700549 <code class="details" id="insert">insert(project, zone, body=None, requestId=None)</code>
550 <pre>Creates a new reservation. For more information, read Reserving zonal resources.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700551
552Args:
553 project: string, Project ID for this request. (required)
554 zone: string, Name of the zone for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700555 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700556 The object takes the form of:
557
Dan O'Mearadd494642020-05-01 07:42:23 -0700558{ # Represents a reservation resource. A reservation ensures that capacity is held in a specific zone even if the reserved VMs are not running. For more information, read Reserving zonal resources. (== resource_for {$api_version}.reservations ==)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700559 "status": "A String", # [Output Only] The status of the reservation.
560 "kind": "compute#reservation", # [Output Only] Type of the resource. Always compute#reservations for reservations.
561 "name": "A String", # The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
Dan O'Mearadd494642020-05-01 07:42:23 -0700562 "specificReservationRequired": True or False, # Indicates whether the reservation can be consumed by VMs with affinity for "any" reservation. If the field is set, then only VMs that target the reservation by name can consume from this reservation.
563 "commitment": "A String", # [Output Only] Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700564 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
565 "specificReservation": { # This reservation type allows to pre allocate specific instance configuration. # Reservation for instances with specific machine shapes.
Dan O'Mearadd494642020-05-01 07:42:23 -0700566 "count": "A String", # Specifies the number of resources that are allocated.
567 "instanceProperties": { # Properties of the SKU instances being reserved. # The instance properties for the reservation.
568 "longTermRelease": True or False, # Compute Engine Long Term Release. When specified, VMs that have this policy become long term release (internal: stable fleet) VMs.
569 #
570 # For all VM shapes, this should result in fewer disruptions due to software updates and greater predictability via 1 week extended notifications.
571 #
572 # For GPU VMs, this should also result in an 2 week uptime guarantee. See go/stable-fleet-gpus-design for more details.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700573 "machineType": "A String", # Specifies type of machine (name only) which has fixed number of vCPUs and fixed amount of memory. This also includes specifying custom machine type following custom-NUMBER_OF_CPUS-AMOUNT_OF_MEMORY pattern.
574 "guestAccelerators": [ # Specifies accelerator type and count.
575 { # A specification of the type and number of accelerator cards attached to the instance.
576 "acceleratorCount": 42, # The number of the guest accelerator cards exposed to this instance.
577 "acceleratorType": "A String", # Full or partial URL of the accelerator type resource to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name. See GPUs on Compute Engine for a full list of accelerator types.
578 },
579 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700580 "locationHint": "A String", # An opaque location hint used to place the allocation close to other resources. This field is for use by internal tools that use the public API.
581 "minCpuPlatform": "A String", # Minimum cpu platform the reservation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700582 "localSsds": [ # Specifies amount of local ssd to reserve with each instance. The type of disk is local-ssd.
583 {
584 "interface": "A String", # Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance.
585 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
586 },
587 ],
588 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700589 "inUseCount": "A String", # [Output Only] Indicates how many instances are in use.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700590 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700591 "zone": "A String", # Zone in which the reservation resides. A zone must be provided if the reservation is created within a commitment.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700592 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
593 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
594 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
595 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
596}
597
598 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
599
600For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
601
602The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
603
604Returns:
605 An object of the form:
606
607 { # Represents an Operation resource.
608 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700609 # Google Compute Engine has three Operation resources:
610 #
611 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
612 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700613 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
614 #
615 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -0700616 # - For global operations, use the `globalOperations` resource.
617 # - For regional operations, use the `regionOperations` resource.
618 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700619 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700620 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700621 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
622 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
623 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -0700624 "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700625 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
626 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700627 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
628 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700629 "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
Dan O'Mearadd494642020-05-01 07:42:23 -0700630 "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a `404` means the resource was not found.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700631 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -0700632 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700633 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
634 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
635 {
636 "message": "A String", # [Output Only] A human-readable description of the warning code.
637 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
638 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
639 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
640 {
641 "value": "A String", # [Output Only] A warning data value corresponding to the key.
642 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
643 },
644 ],
645 },
646 ],
647 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Dan O'Mearadd494642020-05-01 07:42:23 -0700648 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700649 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700650 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
651 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700652 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
653 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
654 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
655 {
656 "message": "A String", # [Output Only] An optional, human-readable error message.
657 "code": "A String", # [Output Only] The error type identifier for this error.
658 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
659 },
660 ],
661 },
662 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
663 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
664 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
665 }</pre>
666</div>
667
668<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700669 <code class="details" id="list">list(project, zone, orderBy=None, pageToken=None, maxResults=None, returnPartialSuccess=None, filter=None)</code>
670 <pre>A list of all the reservations that have been configured for the specified project in specified zone.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700671
672Args:
673 project: string, Project ID for this request. (required)
674 zone: string, Name of the zone for this request. (required)
675 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.
676
Dan O'Mearadd494642020-05-01 07:42:23 -0700677You can also sort results in descending order based on the creation timestamp using `orderBy="creationTimestamp desc"`. This sorts results based on the `creationTimestamp` field in reverse chronological order (newest result first). Use this to sort resources like operations so that the newest operation is returned first.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700678
Dan O'Mearadd494642020-05-01 07:42:23 -0700679Currently, only sorting by `name` or `creationTimestamp desc` is supported.
680 pageToken: string, Specifies a page token to use. Set `pageToken` to the `nextPageToken` returned by a previous list request to get the next page of results.
681 maxResults: integer, The maximum number of results per page that should be returned. If the number of available results is larger than `maxResults`, Compute Engine returns a `nextPageToken` that can be used to get the next page of results in subsequent list requests. Acceptable values are `0` to `500`, inclusive. (Default: `500`)
682 returnPartialSuccess: boolean, Opt-in for partial success behavior which provides partial results in case of failure. The default value is false and the logic is the same as today.
683 filter: string, A filter expression that filters resources listed in the response. The expression must specify the field name, a comparison operator, and the value that you want to use for filtering. The value must be a string, a number, or a boolean. The comparison operator must be either `=`, `!=`, `&gt;`, or `&lt;`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700684
Dan O'Mearadd494642020-05-01 07:42:23 -0700685For example, if you are filtering Compute Engine instances, you can exclude instances named `example-instance` by specifying `name != example-instance`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700686
Dan O'Mearadd494642020-05-01 07:42:23 -0700687You can also filter nested fields. For example, you could specify `scheduling.automaticRestart = false` to include instances only if they are not scheduled for automatic restarts. You can use filtering on nested fields to filter based on resource labels.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700688
Dan O'Mearadd494642020-05-01 07:42:23 -0700689To filter on multiple expressions, provide each separate expression within parentheses. For example: ``` (scheduling.automaticRestart = true) (cpuPlatform = "Intel Skylake") ``` By default, each expression is an `AND` expression. However, you can include `AND` and `OR` expressions explicitly. For example: ``` (cpuPlatform = "Intel Skylake") OR (cpuPlatform = "Intel Broadwell") AND (scheduling.automaticRestart = true) ```
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700690
691Returns:
692 An object of the form:
693
694 {
695 "nextPageToken": "A String", # [Output Only] This token allows you to get the next page of results for list requests. If the number of results is larger than maxResults, use the nextPageToken as a value for the query parameter pageToken in the next list request. Subsequent list requests will have their own nextPageToken to continue paging through the results.
696 "kind": "compute#reservationList", # [Output Only] Type of resource.Always compute#reservationsList for listsof reservations
697 "items": [ # [Output Only] A list of Allocation resources.
Dan O'Mearadd494642020-05-01 07:42:23 -0700698 { # Represents a reservation resource. A reservation ensures that capacity is held in a specific zone even if the reserved VMs are not running. For more information, read Reserving zonal resources. (== resource_for {$api_version}.reservations ==)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700699 "status": "A String", # [Output Only] The status of the reservation.
700 "kind": "compute#reservation", # [Output Only] Type of the resource. Always compute#reservations for reservations.
701 "name": "A String", # The name of the resource, provided by the client when initially creating the resource. The resource name must be 1-63 characters long, and comply with RFC1035. Specifically, the name must be 1-63 characters long and match the regular expression `[a-z]([-a-z0-9]*[a-z0-9])?` which means the first character must be a lowercase letter, and all following characters must be a dash, lowercase letter, or digit, except the last character, which cannot be a dash.
Dan O'Mearadd494642020-05-01 07:42:23 -0700702 "specificReservationRequired": True or False, # Indicates whether the reservation can be consumed by VMs with affinity for "any" reservation. If the field is set, then only VMs that target the reservation by name can consume from this reservation.
703 "commitment": "A String", # [Output Only] Full or partial URL to a parent commitment. This field displays for reservations that are tied to a commitment.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700704 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
705 "specificReservation": { # This reservation type allows to pre allocate specific instance configuration. # Reservation for instances with specific machine shapes.
Dan O'Mearadd494642020-05-01 07:42:23 -0700706 "count": "A String", # Specifies the number of resources that are allocated.
707 "instanceProperties": { # Properties of the SKU instances being reserved. # The instance properties for the reservation.
708 "longTermRelease": True or False, # Compute Engine Long Term Release. When specified, VMs that have this policy become long term release (internal: stable fleet) VMs.
709 #
710 # For all VM shapes, this should result in fewer disruptions due to software updates and greater predictability via 1 week extended notifications.
711 #
712 # For GPU VMs, this should also result in an 2 week uptime guarantee. See go/stable-fleet-gpus-design for more details.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700713 "machineType": "A String", # Specifies type of machine (name only) which has fixed number of vCPUs and fixed amount of memory. This also includes specifying custom machine type following custom-NUMBER_OF_CPUS-AMOUNT_OF_MEMORY pattern.
714 "guestAccelerators": [ # Specifies accelerator type and count.
715 { # A specification of the type and number of accelerator cards attached to the instance.
716 "acceleratorCount": 42, # The number of the guest accelerator cards exposed to this instance.
717 "acceleratorType": "A String", # Full or partial URL of the accelerator type resource to attach to this instance. For example: projects/my-project/zones/us-central1-c/acceleratorTypes/nvidia-tesla-p100 If you are creating an instance template, specify only the accelerator name. See GPUs on Compute Engine for a full list of accelerator types.
718 },
719 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700720 "locationHint": "A String", # An opaque location hint used to place the allocation close to other resources. This field is for use by internal tools that use the public API.
721 "minCpuPlatform": "A String", # Minimum cpu platform the reservation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700722 "localSsds": [ # Specifies amount of local ssd to reserve with each instance. The type of disk is local-ssd.
723 {
724 "interface": "A String", # Specifies the disk interface to use for attaching this disk, which is either SCSI or NVME. The default is SCSI. For performance characteristics of SCSI over NVMe, see Local SSD performance.
725 "diskSizeGb": "A String", # Specifies the size of the disk in base-2 GB.
726 },
727 ],
728 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700729 "inUseCount": "A String", # [Output Only] Indicates how many instances are in use.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700730 },
Dan O'Mearadd494642020-05-01 07:42:23 -0700731 "zone": "A String", # Zone in which the reservation resides. A zone must be provided if the reservation is created within a commitment.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700732 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format.
733 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
734 "selfLink": "A String", # [Output Only] Server-defined fully-qualified URL for this resource.
735 "description": "A String", # An optional description of this resource. Provide this property when you create the resource.
736 },
737 ],
738 "warning": { # [Output Only] Informational warning message.
739 "message": "A String", # [Output Only] A human-readable description of the warning code.
740 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
741 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
742 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
743 {
744 "value": "A String", # [Output Only] A warning data value corresponding to the key.
745 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
746 },
747 ],
748 },
749 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server.
750 "selfLink": "A String", # [Output Only] Server-defined URL for this resource.
751 }</pre>
752</div>
753
754<div class="method">
755 <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
756 <pre>Retrieves the next page of results.
757
758Args:
759 previous_request: The request for the previous page. (required)
760 previous_response: The response from the request for the previous page. (required)
761
762Returns:
763 A request object that you can call 'execute()' on to request the next
764 page. Returns None if there are no more items in the collection.
765 </pre>
766</div>
767
768<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700769 <code class="details" id="resize">resize(project, zone, reservation, body=None, requestId=None)</code>
770 <pre>Resizes the reservation (applicable to standalone reservations only). For more information, read Modifying reservations.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700771
772Args:
773 project: string, Project ID for this request. (required)
774 zone: string, Name of the zone for this request. (required)
775 reservation: string, Name of the reservation to update. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700776 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700777 The object takes the form of:
778
779{
780 "specificSkuCount": "A String", # Number of allocated resources can be resized with minimum = 1 and maximum = 1000.
781 }
782
783 requestId: string, An optional request ID to identify requests. Specify a unique request ID so that if you must retry your request, the server will know to ignore the request if it has already been completed.
784
785For example, consider a situation where you make an initial request and the request times out. If you make the request again with the same request ID, the server can check if original operation with the same request ID was received, and if so, will ignore the second request. This prevents clients from accidentally creating duplicate commitments.
786
787The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000).
788
789Returns:
790 An object of the form:
791
792 { # Represents an Operation resource.
793 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700794 # Google Compute Engine has three Operation resources:
795 #
796 # * [Global](/compute/docs/reference/rest/{$api_version}/globalOperations) * [Regional](/compute/docs/reference/rest/{$api_version}/regionOperations) * [Zonal](/compute/docs/reference/rest/{$api_version}/zoneOperations)
797 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700798 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses.
799 #
800 # Operations can be global, regional or zonal.
Dan O'Mearadd494642020-05-01 07:42:23 -0700801 # - For global operations, use the `globalOperations` resource.
802 # - For regional operations, use the `regionOperations` resource.
803 # - For zonal operations, use the `zonalOperations` resource.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700804 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700805 # For more information, read Global, Regional, and Zonal Resources. (== resource_for {$api_version}.globalOperations ==) (== resource_for {$api_version}.regionOperations ==) (== resource_for {$api_version}.zoneOperations ==)
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700806 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource.
807 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise.
808 "creationTimestamp": "A String", # [Deprecated] This field is deprecated.
Dan O'Mearadd494642020-05-01 07:42:23 -0700809 "id": "A String", # [Output Only] The unique identifier for the operation. This identifier is defined by the server.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700810 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations.
811 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700812 "operationType": "A String", # [Output Only] The type of operation, such as `insert`, `update`, or `delete`, and so on.
813 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as `NOT FOUND`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700814 "progress": 42, # [Output Only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess when the operation will be complete. This number should monotonically increase as the operation progresses.
Dan O'Mearadd494642020-05-01 07:42:23 -0700815 "httpErrorStatusCode": 42, # [Output Only] If the operation fails, this field contains the HTTP error status code that was returned. For example, a `404` means the resource was not found.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700816 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation.
Dan O'Mearadd494642020-05-01 07:42:23 -0700817 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: `PENDING`, `RUNNING`, or `DONE`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700818 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created.
819 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated.
820 {
821 "message": "A String", # [Output Only] A human-readable description of the warning code.
822 "code": "A String", # [Output Only] A warning code, if applicable. For example, Compute Engine returns NO_RESULTS_ON_PAGE if there are no results in the response.
823 "data": [ # [Output Only] Metadata about this warning in key: value format. For example:
824 # "data": [ { "key": "scope", "value": "zones/us-east1-d" }
825 {
826 "value": "A String", # [Output Only] A warning data value corresponding to the key.
827 "key": "A String", # [Output Only] A key that provides more detail on the warning being returned. For example, for warnings where there are no results in a list request for a particular zone, this key might be scope and the key value might be the zone name. Other examples might be a key indicating a deprecated resource and a suggested replacement, or a warning about invalid network settings (for example, if an instance attempts to perform IP forwarding but is not enabled for IP forwarding).
828 },
829 ],
830 },
831 ],
832 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id.
Dan O'Mearadd494642020-05-01 07:42:23 -0700833 "user": "A String", # [Output Only] User who requested the operation, for example: `user@example.com`.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700834 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format.
Dan O'Mearadd494642020-05-01 07:42:23 -0700835 "kind": "compute#operation", # [Output Only] Type of the resource. Always `compute#operation` for Operation resources.
836 "name": "A String", # [Output Only] Name of the operation.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700837 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations.
838 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated.
839 "errors": [ # [Output Only] The array of errors encountered while processing this operation.
840 {
841 "message": "A String", # [Output Only] An optional, human-readable error message.
842 "code": "A String", # [Output Only] The error type identifier for this error.
843 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional.
844 },
845 ],
846 },
847 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format.
848 "selfLink": "A String", # [Output Only] Server-defined URL for the resource.
849 "targetLink": "A String", # [Output Only] The URL of the resource that the operation modifies. For operations related to creating a snapshot, this points to the persistent disk that the snapshot was created from.
850 }</pre>
851</div>
852
853<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -0700854 <code class="details" id="setIamPolicy">setIamPolicy(project, zone, resource, body=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700855 <pre>Sets the access control policy on the specified resource. Replaces any existing policy.
856
857Args:
858 project: string, Project ID for this request. (required)
859 zone: string, The name of the zone for this request. (required)
860 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -0700861 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700862 The object takes the form of:
863
864{
Dan O'Mearadd494642020-05-01 07:42:23 -0700865 "policy": { # An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources. # REQUIRED: The complete policy to be applied to the 'resource'. The size of the policy is limited to a few 10s of KB. An empty policy is in general a valid policy but certain services (like Projects) might reject them.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700866 #
867 #
868 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700869 # A `Policy` is a collection of `bindings`. A `binding` binds one or more `members` to a single `role`. Members can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700870 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700871 # Optionally, a `binding` can specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700872 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700873 # **JSON example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700874 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700875 # { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": ["user:eve@example.com"], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time &lt; timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700876 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700877 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700878 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700879 # bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time &lt; timestamp('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - version: 3
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700880 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700881 # For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700882 "auditConfigs": [ # Specifies cloud audit logging configuration for this policy.
883 { # Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs.
884 #
885 # If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted.
886 #
887 # Example Policy with multiple AuditConfigs:
888 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700889 # { "audit_configs": [ { "service": "allServices" "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE", }, { "log_type": "ADMIN_READ", } ] }, { "service": "sampleservice.googleapis.com" "audit_log_configs": [ { "log_type": "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700890 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700891 # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts jose@example.com from DATA_READ logging, and aliya@example.com from DATA_WRITE logging.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700892 "exemptedMembers": [
893 "A String",
894 ],
895 "auditLogConfigs": [ # The configuration for logging of each type of permission.
896 { # Provides the configuration for logging a type of permissions. Example:
897 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700898 # { "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE", } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700899 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700900 # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ logging.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700901 "exemptedMembers": [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
902 "A String",
903 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700904 "ignoreChildExemptions": True or False,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700905 "logType": "A String", # The log type that this config enables.
906 },
907 ],
908 "service": "A String", # Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services.
909 },
910 ],
911 "rules": [ # If more than one rule is specified, the rules are applied in the following manner: - All matching LOG rules are always applied. - If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be applied if one or more matching rule requires logging. - Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging will be applied if one or more matching rule requires logging. - Otherwise, if no rule applies, permission is denied.
912 { # A rule to be applied in a Policy.
913 "logConfigs": [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
914 { # Specifies what kind of log the caller must write
915 "counter": { # Increment a streamz counter with the specified metric and field names. # Counter options.
916 #
917 # Metric names should start with a '/', generally be lowercase-only, and end in "_count". Field names should not contain an initial slash. The actual exported metric names will have "/iam/policy" prepended.
918 #
919 # Field names correspond to IAM request parameters and field values are their respective values.
920 #
921 # Supported field names: - "authority", which is "[token]" if IAMContext.token is present, otherwise the value of IAMContext.authority_selector if present, and otherwise a representation of IAMContext.principal; or - "iam_principal", a representation of IAMContext.principal even if a token or authority selector is present; or - "" (empty string), resulting in a counter with no fields.
922 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700923 # Examples: counter { metric: "/debug_access_count" field: "iam_principal" } ==&gt; increment counter /iam/policy/debug_access_count {iam_principal=[value of IAMContext.principal]}
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700924 "field": "A String", # The field value to attribute.
Dan O'Mearadd494642020-05-01 07:42:23 -0700925 "customFields": [ # Custom fields.
926 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
927 "name": "A String", # Name is the field name.
928 "value": "A String", # Value is the field value. It is important that in contrast to the CounterOptions.field, the value here is a constant that is not derived from the IAMContext.
929 },
930 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700931 "metric": "A String", # The metric to update.
932 },
933 "dataAccess": { # Write a Data Access (Gin) log # Data access options.
Dan O'Mearadd494642020-05-01 07:42:23 -0700934 "logMode": "A String", # Whether Gin logging should happen in a fail-closed manner at the caller. This is currently supported in the LocalIAM implementation, Stubby C++, and Stubby Java. For Apps Framework, see go/af-audit-logging#failclosed. TODO(b/77591626): Add support for Stubby Go. TODO(b/129671387): Add support for Scaffolding.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700935 },
936 "cloudAudit": { # Write a Cloud Audit log # Cloud audit options.
937 "logName": "A String", # The log_name to populate in the Cloud Audit Record.
938 "authorizationLoggingOptions": { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
939 "permissionType": "A String", # The type of the permission that was checked.
940 },
941 },
942 },
943 ],
944 "notIns": [ # If one or more 'not_in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.
945 "A String",
946 ],
947 "ins": [ # If one or more 'in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
948 "A String",
949 ],
950 "action": "A String", # Required
951 "permissions": [ # A permission is a string of form '..' (e.g., 'storage.buckets.list'). A value of '*' matches all permissions, and a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.
952 "A String",
953 ],
954 "conditions": [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
955 { # A condition to be met.
956 "iam": "A String", # Trusted attributes supplied by the IAM system.
957 "sys": "A String", # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
958 "values": [ # The objects of the condition.
959 "A String",
960 ],
961 "svc": "A String", # Trusted attributes discharged by the service.
962 "op": "A String", # An operator to apply the subject with.
963 },
964 ],
965 "description": "A String", # Human-readable description of the rule.
966 },
967 ],
Dan O'Mearadd494642020-05-01 07:42:23 -0700968 "version": 42, # Specifies the format of the policy.
969 #
970 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
971 #
972 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
973 #
974 # * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions
975 #
976 # **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.
977 #
978 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700979 "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy.
980 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700981 # **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.
982 "bindings": [ # Associates a list of `members` to a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one member.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700983 { # Associates `members` with a `role`.
984 "role": "A String", # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
985 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
986 #
987 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
988 #
989 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
990 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700991 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -0700992 #
993 #
994 #
995 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
996 #
997 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
998 #
Dan O'Mearadd494642020-05-01 07:42:23 -0700999 # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding.
1000 #
1001 # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding.
1002 #
1003 # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding.
1004 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001005 #
1006 #
1007 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
1008 "A String",
1009 ],
Dan O'Mearadd494642020-05-01 07:42:23 -07001010 "condition": { # Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. # The condition that is associated with this binding. NOTE: An unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001011 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001012 # Example (Comparison):
1013 #
1014 # title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() &lt; 100"
1015 #
1016 # Example (Equality):
1017 #
1018 # title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email"
1019 #
1020 # Example (Logic):
1021 #
1022 # title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' &amp;&amp; document.type != 'internal'"
1023 #
1024 # Example (Data Manipulation):
1025 #
1026 # title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)"
1027 #
1028 # The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
1029 "title": "A String", # Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001030 "expression": "A String", # Textual representation of an expression in Common Expression Language syntax.
Dan O'Mearadd494642020-05-01 07:42:23 -07001031 "description": "A String", # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
1032 "location": "A String", # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001033 },
1034 },
1035 ],
1036 "iamOwned": True or False,
1037 },
1038 "bindings": [ # Flatten Policy to create a backwacd compatible wire-format. Deprecated. Use 'policy' to specify bindings.
1039 { # Associates `members` with a `role`.
1040 "role": "A String", # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
1041 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
1042 #
1043 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
1044 #
1045 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
1046 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001047 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001048 #
1049 #
1050 #
1051 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
1052 #
1053 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
1054 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001055 # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding.
1056 #
1057 # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding.
1058 #
1059 # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding.
1060 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001061 #
1062 #
1063 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
1064 "A String",
1065 ],
Dan O'Mearadd494642020-05-01 07:42:23 -07001066 "condition": { # Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. # The condition that is associated with this binding. NOTE: An unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001067 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001068 # Example (Comparison):
1069 #
1070 # title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() &lt; 100"
1071 #
1072 # Example (Equality):
1073 #
1074 # title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email"
1075 #
1076 # Example (Logic):
1077 #
1078 # title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' &amp;&amp; document.type != 'internal'"
1079 #
1080 # Example (Data Manipulation):
1081 #
1082 # title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)"
1083 #
1084 # The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
1085 "title": "A String", # Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001086 "expression": "A String", # Textual representation of an expression in Common Expression Language syntax.
Dan O'Mearadd494642020-05-01 07:42:23 -07001087 "description": "A String", # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
1088 "location": "A String", # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001089 },
1090 },
1091 ],
1092 "etag": "A String", # Flatten Policy to create a backward compatible wire-format. Deprecated. Use 'policy' to specify the etag.
1093 }
1094
1095
1096Returns:
1097 An object of the form:
1098
Dan O'Mearadd494642020-05-01 07:42:23 -07001099 { # An Identity and Access Management (IAM) policy, which specifies access controls for Google Cloud resources.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001100 #
1101 #
1102 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001103 # A `Policy` is a collection of `bindings`. A `binding` binds one or more `members` to a single `role`. Members can be user accounts, service accounts, Google groups, and domains (such as G Suite). A `role` is a named list of permissions; each `role` can be an IAM predefined role or a user-created custom role.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001104 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001105 # Optionally, a `binding` can specify a `condition`, which is a logical expression that allows access to a resource only if the expression evaluates to `true`. A condition can add constraints based on attributes of the request, the resource, or both.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001106 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001107 # **JSON example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001108 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001109 # { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": ["user:eve@example.com"], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time &lt; timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001110 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001111 # **YAML example:**
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001112 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001113 # bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time &lt; timestamp('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - version: 3
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001114 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001115 # For a description of IAM and its features, see the [IAM documentation](https://cloud.google.com/iam/docs/).
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001116 "auditConfigs": [ # Specifies cloud audit logging configuration for this policy.
1117 { # Specifies the audit configuration for a service. The configuration determines which permission types are logged, and what identities, if any, are exempted from logging. An AuditConfig must have one or more AuditLogConfigs.
1118 #
1119 # If there are AuditConfigs for both `allServices` and a specific service, the union of the two AuditConfigs is used for that service: the log_types specified in each AuditConfig are enabled, and the exempted_members in each AuditLogConfig are exempted.
1120 #
1121 # Example Policy with multiple AuditConfigs:
1122 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001123 # { "audit_configs": [ { "service": "allServices" "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE", }, { "log_type": "ADMIN_READ", } ] }, { "service": "sampleservice.googleapis.com" "audit_log_configs": [ { "log_type": "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [ "user:aliya@example.com" ] } ] } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001124 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001125 # For sampleservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts jose@example.com from DATA_READ logging, and aliya@example.com from DATA_WRITE logging.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001126 "exemptedMembers": [
1127 "A String",
1128 ],
1129 "auditLogConfigs": [ # The configuration for logging of each type of permission.
1130 { # Provides the configuration for logging a type of permissions. Example:
1131 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001132 # { "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:jose@example.com" ] }, { "log_type": "DATA_WRITE", } ] }
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001133 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001134 # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting jose@example.com from DATA_READ logging.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001135 "exemptedMembers": [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][].
1136 "A String",
1137 ],
Dan O'Mearadd494642020-05-01 07:42:23 -07001138 "ignoreChildExemptions": True or False,
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001139 "logType": "A String", # The log type that this config enables.
1140 },
1141 ],
1142 "service": "A String", # Specifies a service that will be enabled for audit logging. For example, `storage.googleapis.com`, `cloudsql.googleapis.com`. `allServices` is a special value that covers all services.
1143 },
1144 ],
1145 "rules": [ # If more than one rule is specified, the rules are applied in the following manner: - All matching LOG rules are always applied. - If any DENY/DENY_WITH_LOG rule matches, permission is denied. Logging will be applied if one or more matching rule requires logging. - Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is granted. Logging will be applied if one or more matching rule requires logging. - Otherwise, if no rule applies, permission is denied.
1146 { # A rule to be applied in a Policy.
1147 "logConfigs": [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action.
1148 { # Specifies what kind of log the caller must write
1149 "counter": { # Increment a streamz counter with the specified metric and field names. # Counter options.
1150 #
1151 # Metric names should start with a '/', generally be lowercase-only, and end in "_count". Field names should not contain an initial slash. The actual exported metric names will have "/iam/policy" prepended.
1152 #
1153 # Field names correspond to IAM request parameters and field values are their respective values.
1154 #
1155 # Supported field names: - "authority", which is "[token]" if IAMContext.token is present, otherwise the value of IAMContext.authority_selector if present, and otherwise a representation of IAMContext.principal; or - "iam_principal", a representation of IAMContext.principal even if a token or authority selector is present; or - "" (empty string), resulting in a counter with no fields.
1156 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001157 # Examples: counter { metric: "/debug_access_count" field: "iam_principal" } ==&gt; increment counter /iam/policy/debug_access_count {iam_principal=[value of IAMContext.principal]}
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001158 "field": "A String", # The field value to attribute.
Dan O'Mearadd494642020-05-01 07:42:23 -07001159 "customFields": [ # Custom fields.
1160 { # Custom fields. These can be used to create a counter with arbitrary field/value pairs. See: go/rpcsp-custom-fields.
1161 "name": "A String", # Name is the field name.
1162 "value": "A String", # Value is the field value. It is important that in contrast to the CounterOptions.field, the value here is a constant that is not derived from the IAMContext.
1163 },
1164 ],
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001165 "metric": "A String", # The metric to update.
1166 },
1167 "dataAccess": { # Write a Data Access (Gin) log # Data access options.
Dan O'Mearadd494642020-05-01 07:42:23 -07001168 "logMode": "A String", # Whether Gin logging should happen in a fail-closed manner at the caller. This is currently supported in the LocalIAM implementation, Stubby C++, and Stubby Java. For Apps Framework, see go/af-audit-logging#failclosed. TODO(b/77591626): Add support for Stubby Go. TODO(b/129671387): Add support for Scaffolding.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001169 },
1170 "cloudAudit": { # Write a Cloud Audit log # Cloud audit options.
1171 "logName": "A String", # The log_name to populate in the Cloud Audit Record.
1172 "authorizationLoggingOptions": { # Authorization-related information used by Cloud Audit Logging. # Information used by the Cloud Audit Logging pipeline.
1173 "permissionType": "A String", # The type of the permission that was checked.
1174 },
1175 },
1176 },
1177 ],
1178 "notIns": [ # If one or more 'not_in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.
1179 "A String",
1180 ],
1181 "ins": [ # If one or more 'in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
1182 "A String",
1183 ],
1184 "action": "A String", # Required
1185 "permissions": [ # A permission is a string of form '..' (e.g., 'storage.buckets.list'). A value of '*' matches all permissions, and a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.
1186 "A String",
1187 ],
1188 "conditions": [ # Additional restrictions that must be met. All conditions must pass for the rule to match.
1189 { # A condition to be met.
1190 "iam": "A String", # Trusted attributes supplied by the IAM system.
1191 "sys": "A String", # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control.
1192 "values": [ # The objects of the condition.
1193 "A String",
1194 ],
1195 "svc": "A String", # Trusted attributes discharged by the service.
1196 "op": "A String", # An operator to apply the subject with.
1197 },
1198 ],
1199 "description": "A String", # Human-readable description of the rule.
1200 },
1201 ],
Dan O'Mearadd494642020-05-01 07:42:23 -07001202 "version": 42, # Specifies the format of the policy.
1203 #
1204 # Valid values are `0`, `1`, and `3`. Requests that specify an invalid value are rejected.
1205 #
1206 # Any operation that affects conditional role bindings must specify version `3`. This requirement applies to the following operations:
1207 #
1208 # * Getting a policy that includes a conditional role binding * Adding a conditional role binding to a policy * Changing a conditional role binding in a policy * Removing any role binding, with or without a condition, from a policy that includes conditions
1209 #
1210 # **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.
1211 #
1212 # If a policy does not include any conditions, operations on that policy may specify any valid version or leave the field unset.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001213 "etag": "A String", # `etag` is used for optimistic concurrency control as a way to help prevent simultaneous updates of a policy from overwriting each other. It is strongly suggested that systems make use of the `etag` in the read-modify-write cycle to perform policy updates in order to avoid race conditions: An `etag` is returned in the response to `getIamPolicy`, and systems are expected to put that etag in the request to `setIamPolicy` to ensure that their change will be applied to the same version of the policy.
1214 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001215 # **Important:** If you use IAM Conditions, you must include the `etag` field whenever you call `setIamPolicy`. If you omit this field, then IAM allows you to overwrite a version `3` policy with a version `1` policy, and all of the conditions in the version `3` policy are lost.
1216 "bindings": [ # Associates a list of `members` to a `role`. Optionally, may specify a `condition` that determines how and when the `bindings` are applied. Each of the `bindings` must contain at least one member.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001217 { # Associates `members` with a `role`.
1218 "role": "A String", # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
1219 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values:
1220 #
1221 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account.
1222 #
1223 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account.
1224 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001225 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice@example.com` .
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001226 #
1227 #
1228 #
1229 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app@appspot.gserviceaccount.com`.
1230 #
1231 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins@example.com`.
1232 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001233 # * `deleted:user:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a user that has been recently deleted. For example, `alice@example.com?uid=123456789012345678901`. If the user is recovered, this value reverts to `user:{emailid}` and the recovered user retains the role in the binding.
1234 #
1235 # * `deleted:serviceAccount:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a service account that has been recently deleted. For example, `my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901`. If the service account is undeleted, this value reverts to `serviceAccount:{emailid}` and the undeleted service account retains the role in the binding.
1236 #
1237 # * `deleted:group:{emailid}?uid={uniqueid}`: An email address (plus unique identifier) representing a Google group that has been recently deleted. For example, `admins@example.com?uid=123456789012345678901`. If the group is recovered, this value reverts to `group:{emailid}` and the recovered group retains the role in the binding.
1238 #
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001239 #
1240 #
1241 # * `domain:{domain}`: The G Suite domain (primary) that represents all the users of that domain. For example, `google.com` or `example.com`.
1242 "A String",
1243 ],
Dan O'Mearadd494642020-05-01 07:42:23 -07001244 "condition": { # Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. # The condition that is associated with this binding. NOTE: An unsatisfied condition will not allow user access via current binding. Different bindings, including their conditions, are examined independently.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001245 #
Dan O'Mearadd494642020-05-01 07:42:23 -07001246 # Example (Comparison):
1247 #
1248 # title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() &lt; 100"
1249 #
1250 # Example (Equality):
1251 #
1252 # title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email"
1253 #
1254 # Example (Logic):
1255 #
1256 # title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' &amp;&amp; document.type != 'internal'"
1257 #
1258 # Example (Data Manipulation):
1259 #
1260 # title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)"
1261 #
1262 # The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
1263 "title": "A String", # Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001264 "expression": "A String", # Textual representation of an expression in Common Expression Language syntax.
Dan O'Mearadd494642020-05-01 07:42:23 -07001265 "description": "A String", # Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
1266 "location": "A String", # Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001267 },
1268 },
1269 ],
1270 "iamOwned": True or False,
1271 }</pre>
1272</div>
1273
1274<div class="method">
Dan O'Mearadd494642020-05-01 07:42:23 -07001275 <code class="details" id="testIamPermissions">testIamPermissions(project, zone, resource, body=None)</code>
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001276 <pre>Returns permissions that a caller has on the specified resource.
1277
1278Args:
1279 project: string, Project ID for this request. (required)
1280 zone: string, The name of the zone for this request. (required)
1281 resource: string, Name or id of the resource for this request. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -07001282 body: object, The request body.
Bu Sun Kim715bd7f2019-06-14 16:50:42 -07001283 The object takes the form of:
1284
1285{
1286 "permissions": [ # The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed.
1287 "A String",
1288 ],
1289 }
1290
1291
1292Returns:
1293 An object of the form:
1294
1295 {
1296 "permissions": [ # A subset of `TestPermissionsRequest.permissions` that the caller is allowed.
1297 "A String",
1298 ],
1299 }</pre>
1300</div>
1301
1302</body></html>