1 <html><body> 2 <style> 3 4 body, 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 15 body { 16 font-size: 13px; 17 padding: 1em; 18 } 19 20 h1 { 21 font-size: 26px; 22 margin-bottom: 1em; 23 } 24 25 h2 { 26 font-size: 24px; 27 margin-bottom: 1em; 28 } 29 30 h3 { 31 font-size: 20px; 32 margin-bottom: 1em; 33 margin-top: 1em; 34 } 35 36 pre, code { 37 line-height: 1.5; 38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; 39 } 40 41 pre { 42 margin-top: 0.5em; 43 } 44 45 h1, h2, h3, p { 46 font-family: Arial, sans serif; 47 } 48 49 h1, 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.subnetworks.html">subnetworks</a></h1> 76 <h2>Instance Methods</h2> 77 <p class="toc_element"> 78 <code><a href="#aggregatedList">aggregatedList(project, orderBy=None, maxResults=None, pageToken=None, filter=None)</a></code></p> 79 <p class="firstline">Retrieves an aggregated list of subnetworks.</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, region, subnetwork, requestId=None)</a></code></p> 85 <p class="firstline">Deletes the specified subnetwork.</p> 86 <p class="toc_element"> 87 <code><a href="#expandIpCidrRange">expandIpCidrRange(project, region, subnetwork, body, requestId=None)</a></code></p> 88 <p class="firstline">Expands the IP CIDR range of the subnetwork to a specified value.</p> 89 <p class="toc_element"> 90 <code><a href="#get">get(project, region, subnetwork)</a></code></p> 91 <p class="firstline">Returns the specified subnetwork. Get a list of available subnetworks list() request.</p> 92 <p class="toc_element"> 93 <code><a href="#getIamPolicy">getIamPolicy(project, region, resource)</a></code></p> 94 <p class="firstline">Gets the access control policy for a resource. May be empty if no such policy or resource exists.</p> 95 <p class="toc_element"> 96 <code><a href="#insert">insert(project, region, body, requestId=None)</a></code></p> 97 <p class="firstline">Creates a subnetwork in the specified project using the data included in the request.</p> 98 <p class="toc_element"> 99 <code><a href="#list">list(project, region, orderBy=None, maxResults=None, pageToken=None, filter=None)</a></code></p> 100 <p class="firstline">Retrieves a list of subnetworks available to the specified project.</p> 101 <p class="toc_element"> 102 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> 103 <p class="firstline">Retrieves the next page of results.</p> 104 <p class="toc_element"> 105 <code><a href="#setIamPolicy">setIamPolicy(project, region, resource, body)</a></code></p> 106 <p class="firstline">Sets the access control policy on the specified resource. Replaces any existing policy.</p> 107 <p class="toc_element"> 108 <code><a href="#setPrivateIpGoogleAccess">setPrivateIpGoogleAccess(project, region, subnetwork, body, requestId=None)</a></code></p> 109 <p class="firstline">Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access.</p> 110 <p class="toc_element"> 111 <code><a href="#testIamPermissions">testIamPermissions(project, region, resource, body)</a></code></p> 112 <p class="firstline">Returns permissions that a caller has on the specified resource.</p> 113 <h3>Method Details</h3> 114 <div class="method"> 115 <code class="details" id="aggregatedList">aggregatedList(project, orderBy=None, maxResults=None, pageToken=None, filter=None)</code> 116 <pre>Retrieves an aggregated list of subnetworks. 117 118 Args: 119 project: string, Project ID for this request. (required) 120 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. 121 122 You 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. 123 124 Currently, only sorting by name or creationTimestamp desc is supported. 125 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) 126 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. 127 filter: string, Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string. 128 129 The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. 130 131 For example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance. 132 133 You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. 134 135 To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. 136 137 Returns: 138 An object of the form: 139 140 { 141 "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. 142 "items": { # [Output] A map of scoped Subnetwork lists. 143 "a_key": { # Name of the scope containing this set of Subnetworks. 144 "subnetworks": [ # List of subnetworks contained in this scope. 145 { # A Subnetwork resource. 146 "kind": "compute#subnetwork", # [Output Only] Type of the resource. Always compute#subnetwork for Subnetwork resources. 147 "description": "A String", # An optional description of this resource. Provide this property when you create the resource. This field can be set only at resource creation time. 148 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. 149 "region": "A String", # URL of the region where the Subnetwork resides. This field can be set only at resource creation time. 150 "secondaryIpRanges": [ # An array of configurations for secondary IP ranges for VM instances contained in this subnetwork. The primary IP of such VM must belong to the primary ipCidrRange of the subnetwork. The alias IPs may belong to either primary or secondary ranges. 151 { # Represents a secondary IP range of a subnetwork. 152 "ipCidrRange": "A String", # The range of IP addresses belonging to this subnetwork secondary range. Provide this property when you create the subnetwork. Ranges must be unique and non-overlapping with all primary and secondary IP ranges within a network. Only IPv4 is supported. 153 "rangeName": "A String", # The name associated with this subnetwork secondary range, used when adding an alias IP range to a VM instance. The name must be 1-63 characters long, and comply with RFC1035. The name must be unique within the subnetwork. 154 }, 155 ], 156 "network": "A String", # The URL of the network to which this subnetwork belongs, provided by the client when initially creating the subnetwork. Only networks that are in the distributed mode can have subnetworks. This field can be set only at resource creation time. 157 "privateIpGoogleAccess": True or False, # Whether the VMs in this subnet can access Google services without assigned external IP addresses. This field can be both set at resource creation time and updated using setPrivateIpGoogleAccess. 158 "ipCidrRange": "A String", # The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. This field can be set only at resource creation time. 159 "gatewayAddress": "A String", # [Output Only] The gateway address for default routes to reach destination addresses outside this subnetwork. This field can be set only at resource creation time. 160 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 161 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 162 "name": "A String", # The name of the resource, provided by the client when initially creating the resource. The 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. 163 }, 164 ], 165 "warning": { # An informational warning that appears when the list of addresses is empty. 166 "message": "A String", # [Output Only] A human-readable description of the warning code. 167 "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. 168 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 169 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 170 { 171 "value": "A String", # [Output Only] A warning data value corresponding to the key. 172 "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). 173 }, 174 ], 175 }, 176 }, 177 }, 178 "kind": "compute#subnetworkAggregatedList", # [Output Only] Type of resource. Always compute#subnetworkAggregatedList for aggregated lists of subnetworks. 179 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 180 "selfLink": "A String", # [Output Only] Server-defined URL for this resource. 181 }</pre> 182 </div> 183 184 <div class="method"> 185 <code class="details" id="aggregatedList_next">aggregatedList_next(previous_request, previous_response)</code> 186 <pre>Retrieves the next page of results. 187 188 Args: 189 previous_request: The request for the previous page. (required) 190 previous_response: The response from the request for the previous page. (required) 191 192 Returns: 193 A request object that you can call 'execute()' on to request the next 194 page. Returns None if there are no more items in the collection. 195 </pre> 196 </div> 197 198 <div class="method"> 199 <code class="details" id="delete">delete(project, region, subnetwork, requestId=None)</code> 200 <pre>Deletes the specified subnetwork. 201 202 Args: 203 project: string, Project ID for this request. (required) 204 region: string, Name of the region scoping this request. (required) 205 subnetwork: string, Name of the Subnetwork resource to delete. (required) 206 requestId: string, begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. 207 208 Returns: 209 An object of the form: 210 211 { # An Operation resource, used to manage asynchronous API requests. 212 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 213 "clientOperationId": "A String", # [Output Only] Reserved for future use. 214 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 215 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 216 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations. 217 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 218 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 219 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 220 "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. 221 "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. 222 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 223 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 224 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 225 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 226 { 227 "message": "A String", # [Output Only] A human-readable description of the warning code. 228 "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. 229 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 230 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 231 { 232 "value": "A String", # [Output Only] A warning data value corresponding to the key. 233 "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). 234 }, 235 ], 236 }, 237 ], 238 "user": "A String", # [Output Only] User who requested the operation, for example: user (a] example.com. 239 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 240 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 241 "name": "A String", # [Output Only] Name of the resource. 242 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations. 243 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 244 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 245 { 246 "message": "A String", # [Output Only] An optional, human-readable error message. 247 "code": "A String", # [Output Only] The error type identifier for this error. 248 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 249 }, 250 ], 251 }, 252 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 253 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 254 "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. 255 }</pre> 256 </div> 257 258 <div class="method"> 259 <code class="details" id="expandIpCidrRange">expandIpCidrRange(project, region, subnetwork, body, requestId=None)</code> 260 <pre>Expands the IP CIDR range of the subnetwork to a specified value. 261 262 Args: 263 project: string, Project ID for this request. (required) 264 region: string, Name of the region scoping this request. (required) 265 subnetwork: string, Name of the Subnetwork resource to update. (required) 266 body: object, The request body. (required) 267 The object takes the form of: 268 269 { 270 "ipCidrRange": "A String", # The IP (in CIDR format or netmask) of internal addresses that are legal on this Subnetwork. This range should be disjoint from other subnetworks within this network. This range can only be larger than (i.e. a superset of) the range previously defined before the update. 271 } 272 273 requestId: string, begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. 274 275 Returns: 276 An object of the form: 277 278 { # An Operation resource, used to manage asynchronous API requests. 279 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 280 "clientOperationId": "A String", # [Output Only] Reserved for future use. 281 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 282 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 283 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations. 284 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 285 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 286 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 287 "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. 288 "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. 289 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 290 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 291 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 292 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 293 { 294 "message": "A String", # [Output Only] A human-readable description of the warning code. 295 "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. 296 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 297 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 298 { 299 "value": "A String", # [Output Only] A warning data value corresponding to the key. 300 "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). 301 }, 302 ], 303 }, 304 ], 305 "user": "A String", # [Output Only] User who requested the operation, for example: user (a] example.com. 306 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 307 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 308 "name": "A String", # [Output Only] Name of the resource. 309 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations. 310 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 311 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 312 { 313 "message": "A String", # [Output Only] An optional, human-readable error message. 314 "code": "A String", # [Output Only] The error type identifier for this error. 315 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 316 }, 317 ], 318 }, 319 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 320 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 321 "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. 322 }</pre> 323 </div> 324 325 <div class="method"> 326 <code class="details" id="get">get(project, region, subnetwork)</code> 327 <pre>Returns the specified subnetwork. Get a list of available subnetworks list() request. 328 329 Args: 330 project: string, Project ID for this request. (required) 331 region: string, Name of the region scoping this request. (required) 332 subnetwork: string, Name of the Subnetwork resource to return. (required) 333 334 Returns: 335 An object of the form: 336 337 { # A Subnetwork resource. 338 "kind": "compute#subnetwork", # [Output Only] Type of the resource. Always compute#subnetwork for Subnetwork resources. 339 "description": "A String", # An optional description of this resource. Provide this property when you create the resource. This field can be set only at resource creation time. 340 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. 341 "region": "A String", # URL of the region where the Subnetwork resides. This field can be set only at resource creation time. 342 "secondaryIpRanges": [ # An array of configurations for secondary IP ranges for VM instances contained in this subnetwork. The primary IP of such VM must belong to the primary ipCidrRange of the subnetwork. The alias IPs may belong to either primary or secondary ranges. 343 { # Represents a secondary IP range of a subnetwork. 344 "ipCidrRange": "A String", # The range of IP addresses belonging to this subnetwork secondary range. Provide this property when you create the subnetwork. Ranges must be unique and non-overlapping with all primary and secondary IP ranges within a network. Only IPv4 is supported. 345 "rangeName": "A String", # The name associated with this subnetwork secondary range, used when adding an alias IP range to a VM instance. The name must be 1-63 characters long, and comply with RFC1035. The name must be unique within the subnetwork. 346 }, 347 ], 348 "network": "A String", # The URL of the network to which this subnetwork belongs, provided by the client when initially creating the subnetwork. Only networks that are in the distributed mode can have subnetworks. This field can be set only at resource creation time. 349 "privateIpGoogleAccess": True or False, # Whether the VMs in this subnet can access Google services without assigned external IP addresses. This field can be both set at resource creation time and updated using setPrivateIpGoogleAccess. 350 "ipCidrRange": "A String", # The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. This field can be set only at resource creation time. 351 "gatewayAddress": "A String", # [Output Only] The gateway address for default routes to reach destination addresses outside this subnetwork. This field can be set only at resource creation time. 352 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 353 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 354 "name": "A String", # The name of the resource, provided by the client when initially creating the resource. The 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. 355 }</pre> 356 </div> 357 358 <div class="method"> 359 <code class="details" id="getIamPolicy">getIamPolicy(project, region, resource)</code> 360 <pre>Gets the access control policy for a resource. May be empty if no such policy or resource exists. 361 362 Args: 363 project: string, Project ID for this request. (required) 364 region: string, The name of the region for this request. (required) 365 resource: string, Name of the resource for this request. (required) 366 367 Returns: 368 An object of the form: 369 370 { # Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources. 371 # 372 # 373 # 374 # A `Policy` consists of a list of `bindings`. A `Binding` binds a list of `members` to a `role`, where the members can be user accounts, Google groups, Google domains, and service accounts. A `role` is a named list of permissions defined by IAM. 375 # 376 # **Example** 377 # 378 # { "bindings": [ { "role": "roles/owner", "members": [ "user:mike (a] example.com", "group:admins (a] example.com", "domain:google.com", "serviceAccount:my-other-app (a] appspot.gserviceaccount.com", ] }, { "role": "roles/viewer", "members": ["user:sean (a] example.com"] } ] } 379 # 380 # For a description of IAM and its features, see the [IAM developer's guide](https://cloud.google.com/iam). 381 "auditConfigs": [ # Specifies cloud audit logging configuration for this policy. 382 { # 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. 383 # 384 # 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 AuditConfig are exempted. 385 # 386 # Example Policy with multiple AuditConfigs: 387 # 388 # { "audit_configs": [ { "service": "allServices" "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:foo (a] gmail.com" ] }, { "log_type": "DATA_WRITE", }, { "log_type": "ADMIN_READ", } ] }, { "service": "fooservice.googleapis.com" "audit_log_configs": [ { "log_type": "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [ "user:bar (a] gmail.com" ] } ] } ] } 389 # 390 # For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts foo (a] gmail.com from DATA_READ logging, and bar (a] gmail.com from DATA_WRITE logging. 391 "exemptedMembers": [ 392 "A String", 393 ], 394 "auditLogConfigs": [ # The configuration for logging of each type of permission. 395 { # Provides the configuration for logging a type of permissions. Example: 396 # 397 # { "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:foo (a] gmail.com" ] }, { "log_type": "DATA_WRITE", } ] } 398 # 399 # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting foo (a] gmail.com from DATA_READ logging. 400 "exemptedMembers": [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][]. 401 "A String", 402 ], 403 "logType": "A String", # The log type that this config enables. 404 }, 405 ], 406 "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. 407 }, 408 ], 409 "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. 410 { # A rule to be applied in a Policy. 411 "logConfigs": [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action. 412 { # Specifies what kind of log the caller must write 413 "counter": { # Options for counters # Counter options. 414 "field": "A String", # The field value to attribute. 415 "metric": "A String", # The metric to update. 416 }, 417 "cloudAudit": { # Write a Cloud Audit log # Cloud audit options. 418 "logName": "A String", # The log_name to populate in the Cloud Audit Record. 419 }, 420 }, 421 ], 422 "notIns": [ # If one or more 'not_in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries. 423 "A String", 424 ], 425 "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. 426 "A String", 427 ], 428 "action": "A String", # Required 429 "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. 430 "A String", 431 ], 432 "conditions": [ # Additional restrictions that must be met 433 { # A condition to be met. 434 "iam": "A String", # Trusted attributes supplied by the IAM system. 435 "svc": "A String", # Trusted attributes discharged by the service. 436 "value": "A String", # DEPRECATED. Use 'values' instead. 437 "sys": "A String", # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control. 438 "values": [ # The objects of the condition. This is mutually exclusive with 'value'. 439 "A String", 440 ], 441 "op": "A String", # An operator to apply the subject with. 442 }, 443 ], 444 "description": "A String", # Human-readable description of the rule. 445 }, 446 ], 447 "version": 42, # Version of the `Policy`. The default version is 0. 448 "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. 449 # 450 # If no `etag` is provided in the call to `setIamPolicy`, then the existing policy is overwritten blindly. 451 "bindings": [ # Associates a list of `members` to a `role`. Multiple `bindings` must not be specified for the same `role`. `bindings` with no members will result in an error. 452 { # Associates `members` with a `role`. 453 "role": "A String", # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. 454 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values: 455 # 456 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. 457 # 458 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. 459 # 460 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice (a] gmail.com` or `joe (a] example.com`. 461 # 462 # 463 # 464 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app (a] appspot.gserviceaccount.com`. 465 # 466 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins (a] example.com`. 467 # 468 # 469 # 470 # * `domain:{domain}`: A Google Apps domain name that represents all the users of that domain. For example, `google.com` or `example.com`. 471 "A String", 472 ], 473 }, 474 ], 475 "iamOwned": True or False, 476 }</pre> 477 </div> 478 479 <div class="method"> 480 <code class="details" id="insert">insert(project, region, body, requestId=None)</code> 481 <pre>Creates a subnetwork in the specified project using the data included in the request. 482 483 Args: 484 project: string, Project ID for this request. (required) 485 region: string, Name of the region scoping this request. (required) 486 body: object, The request body. (required) 487 The object takes the form of: 488 489 { # A Subnetwork resource. 490 "kind": "compute#subnetwork", # [Output Only] Type of the resource. Always compute#subnetwork for Subnetwork resources. 491 "description": "A String", # An optional description of this resource. Provide this property when you create the resource. This field can be set only at resource creation time. 492 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. 493 "region": "A String", # URL of the region where the Subnetwork resides. This field can be set only at resource creation time. 494 "secondaryIpRanges": [ # An array of configurations for secondary IP ranges for VM instances contained in this subnetwork. The primary IP of such VM must belong to the primary ipCidrRange of the subnetwork. The alias IPs may belong to either primary or secondary ranges. 495 { # Represents a secondary IP range of a subnetwork. 496 "ipCidrRange": "A String", # The range of IP addresses belonging to this subnetwork secondary range. Provide this property when you create the subnetwork. Ranges must be unique and non-overlapping with all primary and secondary IP ranges within a network. Only IPv4 is supported. 497 "rangeName": "A String", # The name associated with this subnetwork secondary range, used when adding an alias IP range to a VM instance. The name must be 1-63 characters long, and comply with RFC1035. The name must be unique within the subnetwork. 498 }, 499 ], 500 "network": "A String", # The URL of the network to which this subnetwork belongs, provided by the client when initially creating the subnetwork. Only networks that are in the distributed mode can have subnetworks. This field can be set only at resource creation time. 501 "privateIpGoogleAccess": True or False, # Whether the VMs in this subnet can access Google services without assigned external IP addresses. This field can be both set at resource creation time and updated using setPrivateIpGoogleAccess. 502 "ipCidrRange": "A String", # The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. This field can be set only at resource creation time. 503 "gatewayAddress": "A String", # [Output Only] The gateway address for default routes to reach destination addresses outside this subnetwork. This field can be set only at resource creation time. 504 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 505 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 506 "name": "A String", # The name of the resource, provided by the client when initially creating the resource. The 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. 507 } 508 509 requestId: string, begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. 510 511 Returns: 512 An object of the form: 513 514 { # An Operation resource, used to manage asynchronous API requests. 515 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 516 "clientOperationId": "A String", # [Output Only] Reserved for future use. 517 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 518 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 519 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations. 520 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 521 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 522 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 523 "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. 524 "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. 525 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 526 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 527 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 528 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 529 { 530 "message": "A String", # [Output Only] A human-readable description of the warning code. 531 "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. 532 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 533 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 534 { 535 "value": "A String", # [Output Only] A warning data value corresponding to the key. 536 "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). 537 }, 538 ], 539 }, 540 ], 541 "user": "A String", # [Output Only] User who requested the operation, for example: user (a] example.com. 542 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 543 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 544 "name": "A String", # [Output Only] Name of the resource. 545 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations. 546 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 547 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 548 { 549 "message": "A String", # [Output Only] An optional, human-readable error message. 550 "code": "A String", # [Output Only] The error type identifier for this error. 551 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 552 }, 553 ], 554 }, 555 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 556 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 557 "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. 558 }</pre> 559 </div> 560 561 <div class="method"> 562 <code class="details" id="list">list(project, region, orderBy=None, maxResults=None, pageToken=None, filter=None)</code> 563 <pre>Retrieves a list of subnetworks available to the specified project. 564 565 Args: 566 project: string, Project ID for this request. (required) 567 region: string, Name of the region scoping this request. (required) 568 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. 569 570 You 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. 571 572 Currently, only sorting by name or creationTimestamp desc is supported. 573 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) 574 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. 575 filter: string, Sets a filter expression for filtering listed resources, in the form filter={expression}. Your {expression} must be in the format: field_name comparison_string literal_string. 576 577 The field_name is the name of the field you want to compare. Only atomic field types are supported (string, number, boolean). The comparison_string must be either eq (equals) or ne (not equals). The literal_string is the string value to filter to. The literal value must be valid for the type of field you are filtering by (string, number, boolean). For string fields, the literal value is interpreted as a regular expression using RE2 syntax. The literal value must match the entire field. 578 579 For example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance. 580 581 You can filter on nested fields. For example, you could filter on instances that have set the scheduling.automaticRestart field to true. Use filtering on nested fields to take advantage of labels to organize and search for results based on label values. 582 583 To filter on multiple expressions, provide each separate expression within parentheses. For example, (scheduling.automaticRestart eq true) (zone eq us-central1-f). Multiple expressions are treated as AND expressions, meaning that resources must match all expressions to pass the filters. 584 585 Returns: 586 An object of the form: 587 588 { # Contains a list of Subnetwork resources. 589 "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. 590 "items": [ # The Subnetwork resources. 591 { # A Subnetwork resource. 592 "kind": "compute#subnetwork", # [Output Only] Type of the resource. Always compute#subnetwork for Subnetwork resources. 593 "description": "A String", # An optional description of this resource. Provide this property when you create the resource. This field can be set only at resource creation time. 594 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. 595 "region": "A String", # URL of the region where the Subnetwork resides. This field can be set only at resource creation time. 596 "secondaryIpRanges": [ # An array of configurations for secondary IP ranges for VM instances contained in this subnetwork. The primary IP of such VM must belong to the primary ipCidrRange of the subnetwork. The alias IPs may belong to either primary or secondary ranges. 597 { # Represents a secondary IP range of a subnetwork. 598 "ipCidrRange": "A String", # The range of IP addresses belonging to this subnetwork secondary range. Provide this property when you create the subnetwork. Ranges must be unique and non-overlapping with all primary and secondary IP ranges within a network. Only IPv4 is supported. 599 "rangeName": "A String", # The name associated with this subnetwork secondary range, used when adding an alias IP range to a VM instance. The name must be 1-63 characters long, and comply with RFC1035. The name must be unique within the subnetwork. 600 }, 601 ], 602 "network": "A String", # The URL of the network to which this subnetwork belongs, provided by the client when initially creating the subnetwork. Only networks that are in the distributed mode can have subnetworks. This field can be set only at resource creation time. 603 "privateIpGoogleAccess": True or False, # Whether the VMs in this subnet can access Google services without assigned external IP addresses. This field can be both set at resource creation time and updated using setPrivateIpGoogleAccess. 604 "ipCidrRange": "A String", # The range of internal addresses that are owned by this subnetwork. Provide this property when you create the subnetwork. For example, 10.0.0.0/8 or 192.168.0.0/16. Ranges must be unique and non-overlapping within a network. Only IPv4 is supported. This field can be set only at resource creation time. 605 "gatewayAddress": "A String", # [Output Only] The gateway address for default routes to reach destination addresses outside this subnetwork. This field can be set only at resource creation time. 606 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 607 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 608 "name": "A String", # The name of the resource, provided by the client when initially creating the resource. The 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. 609 }, 610 ], 611 "kind": "compute#subnetworkList", # [Output Only] Type of resource. Always compute#subnetworkList for lists of subnetworks. 612 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 613 "selfLink": "A String", # [Output Only] Server-defined URL for this resource. 614 }</pre> 615 </div> 616 617 <div class="method"> 618 <code class="details" id="list_next">list_next(previous_request, previous_response)</code> 619 <pre>Retrieves the next page of results. 620 621 Args: 622 previous_request: The request for the previous page. (required) 623 previous_response: The response from the request for the previous page. (required) 624 625 Returns: 626 A request object that you can call 'execute()' on to request the next 627 page. Returns None if there are no more items in the collection. 628 </pre> 629 </div> 630 631 <div class="method"> 632 <code class="details" id="setIamPolicy">setIamPolicy(project, region, resource, body)</code> 633 <pre>Sets the access control policy on the specified resource. Replaces any existing policy. 634 635 Args: 636 project: string, Project ID for this request. (required) 637 region: string, The name of the region for this request. (required) 638 resource: string, Name of the resource for this request. (required) 639 body: object, The request body. (required) 640 The object takes the form of: 641 642 { # Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources. 643 # 644 # 645 # 646 # A `Policy` consists of a list of `bindings`. A `Binding` binds a list of `members` to a `role`, where the members can be user accounts, Google groups, Google domains, and service accounts. A `role` is a named list of permissions defined by IAM. 647 # 648 # **Example** 649 # 650 # { "bindings": [ { "role": "roles/owner", "members": [ "user:mike (a] example.com", "group:admins (a] example.com", "domain:google.com", "serviceAccount:my-other-app (a] appspot.gserviceaccount.com", ] }, { "role": "roles/viewer", "members": ["user:sean (a] example.com"] } ] } 651 # 652 # For a description of IAM and its features, see the [IAM developer's guide](https://cloud.google.com/iam). 653 "auditConfigs": [ # Specifies cloud audit logging configuration for this policy. 654 { # 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. 655 # 656 # 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 AuditConfig are exempted. 657 # 658 # Example Policy with multiple AuditConfigs: 659 # 660 # { "audit_configs": [ { "service": "allServices" "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:foo (a] gmail.com" ] }, { "log_type": "DATA_WRITE", }, { "log_type": "ADMIN_READ", } ] }, { "service": "fooservice.googleapis.com" "audit_log_configs": [ { "log_type": "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [ "user:bar (a] gmail.com" ] } ] } ] } 661 # 662 # For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts foo (a] gmail.com from DATA_READ logging, and bar (a] gmail.com from DATA_WRITE logging. 663 "exemptedMembers": [ 664 "A String", 665 ], 666 "auditLogConfigs": [ # The configuration for logging of each type of permission. 667 { # Provides the configuration for logging a type of permissions. Example: 668 # 669 # { "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:foo (a] gmail.com" ] }, { "log_type": "DATA_WRITE", } ] } 670 # 671 # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting foo (a] gmail.com from DATA_READ logging. 672 "exemptedMembers": [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][]. 673 "A String", 674 ], 675 "logType": "A String", # The log type that this config enables. 676 }, 677 ], 678 "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. 679 }, 680 ], 681 "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. 682 { # A rule to be applied in a Policy. 683 "logConfigs": [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action. 684 { # Specifies what kind of log the caller must write 685 "counter": { # Options for counters # Counter options. 686 "field": "A String", # The field value to attribute. 687 "metric": "A String", # The metric to update. 688 }, 689 "cloudAudit": { # Write a Cloud Audit log # Cloud audit options. 690 "logName": "A String", # The log_name to populate in the Cloud Audit Record. 691 }, 692 }, 693 ], 694 "notIns": [ # If one or more 'not_in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries. 695 "A String", 696 ], 697 "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. 698 "A String", 699 ], 700 "action": "A String", # Required 701 "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. 702 "A String", 703 ], 704 "conditions": [ # Additional restrictions that must be met 705 { # A condition to be met. 706 "iam": "A String", # Trusted attributes supplied by the IAM system. 707 "svc": "A String", # Trusted attributes discharged by the service. 708 "value": "A String", # DEPRECATED. Use 'values' instead. 709 "sys": "A String", # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control. 710 "values": [ # The objects of the condition. This is mutually exclusive with 'value'. 711 "A String", 712 ], 713 "op": "A String", # An operator to apply the subject with. 714 }, 715 ], 716 "description": "A String", # Human-readable description of the rule. 717 }, 718 ], 719 "version": 42, # Version of the `Policy`. The default version is 0. 720 "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. 721 # 722 # If no `etag` is provided in the call to `setIamPolicy`, then the existing policy is overwritten blindly. 723 "bindings": [ # Associates a list of `members` to a `role`. Multiple `bindings` must not be specified for the same `role`. `bindings` with no members will result in an error. 724 { # Associates `members` with a `role`. 725 "role": "A String", # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. 726 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values: 727 # 728 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. 729 # 730 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. 731 # 732 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice (a] gmail.com` or `joe (a] example.com`. 733 # 734 # 735 # 736 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app (a] appspot.gserviceaccount.com`. 737 # 738 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins (a] example.com`. 739 # 740 # 741 # 742 # * `domain:{domain}`: A Google Apps domain name that represents all the users of that domain. For example, `google.com` or `example.com`. 743 "A String", 744 ], 745 }, 746 ], 747 "iamOwned": True or False, 748 } 749 750 751 Returns: 752 An object of the form: 753 754 { # Defines an Identity and Access Management (IAM) policy. It is used to specify access control policies for Cloud Platform resources. 755 # 756 # 757 # 758 # A `Policy` consists of a list of `bindings`. A `Binding` binds a list of `members` to a `role`, where the members can be user accounts, Google groups, Google domains, and service accounts. A `role` is a named list of permissions defined by IAM. 759 # 760 # **Example** 761 # 762 # { "bindings": [ { "role": "roles/owner", "members": [ "user:mike (a] example.com", "group:admins (a] example.com", "domain:google.com", "serviceAccount:my-other-app (a] appspot.gserviceaccount.com", ] }, { "role": "roles/viewer", "members": ["user:sean (a] example.com"] } ] } 763 # 764 # For a description of IAM and its features, see the [IAM developer's guide](https://cloud.google.com/iam). 765 "auditConfigs": [ # Specifies cloud audit logging configuration for this policy. 766 { # 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. 767 # 768 # 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 AuditConfig are exempted. 769 # 770 # Example Policy with multiple AuditConfigs: 771 # 772 # { "audit_configs": [ { "service": "allServices" "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:foo (a] gmail.com" ] }, { "log_type": "DATA_WRITE", }, { "log_type": "ADMIN_READ", } ] }, { "service": "fooservice.googleapis.com" "audit_log_configs": [ { "log_type": "DATA_READ", }, { "log_type": "DATA_WRITE", "exempted_members": [ "user:bar (a] gmail.com" ] } ] } ] } 773 # 774 # For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ logging. It also exempts foo (a] gmail.com from DATA_READ logging, and bar (a] gmail.com from DATA_WRITE logging. 775 "exemptedMembers": [ 776 "A String", 777 ], 778 "auditLogConfigs": [ # The configuration for logging of each type of permission. 779 { # Provides the configuration for logging a type of permissions. Example: 780 # 781 # { "audit_log_configs": [ { "log_type": "DATA_READ", "exempted_members": [ "user:foo (a] gmail.com" ] }, { "log_type": "DATA_WRITE", } ] } 782 # 783 # This enables 'DATA_READ' and 'DATA_WRITE' logging, while exempting foo (a] gmail.com from DATA_READ logging. 784 "exemptedMembers": [ # Specifies the identities that do not cause logging for this type of permission. Follows the same format of [Binding.members][]. 785 "A String", 786 ], 787 "logType": "A String", # The log type that this config enables. 788 }, 789 ], 790 "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. 791 }, 792 ], 793 "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. 794 { # A rule to be applied in a Policy. 795 "logConfigs": [ # The config returned to callers of tech.iam.IAM.CheckPolicy for any entries that match the LOG action. 796 { # Specifies what kind of log the caller must write 797 "counter": { # Options for counters # Counter options. 798 "field": "A String", # The field value to attribute. 799 "metric": "A String", # The metric to update. 800 }, 801 "cloudAudit": { # Write a Cloud Audit log # Cloud audit options. 802 "logName": "A String", # The log_name to populate in the Cloud Audit Record. 803 }, 804 }, 805 ], 806 "notIns": [ # If one or more 'not_in' clauses are specified, the rule matches if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries. 807 "A String", 808 ], 809 "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. 810 "A String", 811 ], 812 "action": "A String", # Required 813 "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. 814 "A String", 815 ], 816 "conditions": [ # Additional restrictions that must be met 817 { # A condition to be met. 818 "iam": "A String", # Trusted attributes supplied by the IAM system. 819 "svc": "A String", # Trusted attributes discharged by the service. 820 "value": "A String", # DEPRECATED. Use 'values' instead. 821 "sys": "A String", # Trusted attributes supplied by any service that owns resources and uses the IAM system for access control. 822 "values": [ # The objects of the condition. This is mutually exclusive with 'value'. 823 "A String", 824 ], 825 "op": "A String", # An operator to apply the subject with. 826 }, 827 ], 828 "description": "A String", # Human-readable description of the rule. 829 }, 830 ], 831 "version": 42, # Version of the `Policy`. The default version is 0. 832 "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. 833 # 834 # If no `etag` is provided in the call to `setIamPolicy`, then the existing policy is overwritten blindly. 835 "bindings": [ # Associates a list of `members` to a `role`. Multiple `bindings` must not be specified for the same `role`. `bindings` with no members will result in an error. 836 { # Associates `members` with a `role`. 837 "role": "A String", # Role that is assigned to `members`. For example, `roles/viewer`, `roles/editor`, or `roles/owner`. 838 "members": [ # Specifies the identities requesting access for a Cloud Platform resource. `members` can have the following values: 839 # 840 # * `allUsers`: A special identifier that represents anyone who is on the internet; with or without a Google account. 841 # 842 # * `allAuthenticatedUsers`: A special identifier that represents anyone who is authenticated with a Google account or a service account. 843 # 844 # * `user:{emailid}`: An email address that represents a specific Google account. For example, `alice (a] gmail.com` or `joe (a] example.com`. 845 # 846 # 847 # 848 # * `serviceAccount:{emailid}`: An email address that represents a service account. For example, `my-other-app (a] appspot.gserviceaccount.com`. 849 # 850 # * `group:{emailid}`: An email address that represents a Google group. For example, `admins (a] example.com`. 851 # 852 # 853 # 854 # * `domain:{domain}`: A Google Apps domain name that represents all the users of that domain. For example, `google.com` or `example.com`. 855 "A String", 856 ], 857 }, 858 ], 859 "iamOwned": True or False, 860 }</pre> 861 </div> 862 863 <div class="method"> 864 <code class="details" id="setPrivateIpGoogleAccess">setPrivateIpGoogleAccess(project, region, subnetwork, body, requestId=None)</code> 865 <pre>Set whether VMs in this subnet can access Google services without assigning external IP addresses through Private Google Access. 866 867 Args: 868 project: string, Project ID for this request. (required) 869 region: string, Name of the region scoping this request. (required) 870 subnetwork: string, Name of the Subnetwork resource. (required) 871 body: object, The request body. (required) 872 The object takes the form of: 873 874 { 875 "privateIpGoogleAccess": True or False, 876 } 877 878 requestId: string, begin_interface: MixerMutationRequestBuilder Request ID to support idempotency. 879 880 Returns: 881 An object of the form: 882 883 { # An Operation resource, used to manage asynchronous API requests. 884 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 885 "clientOperationId": "A String", # [Output Only] Reserved for future use. 886 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 887 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 888 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations. 889 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 890 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 891 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 892 "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. 893 "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. 894 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 895 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 896 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 897 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 898 { 899 "message": "A String", # [Output Only] A human-readable description of the warning code. 900 "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. 901 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 902 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 903 { 904 "value": "A String", # [Output Only] A warning data value corresponding to the key. 905 "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). 906 }, 907 ], 908 }, 909 ], 910 "user": "A String", # [Output Only] User who requested the operation, for example: user (a] example.com. 911 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 912 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 913 "name": "A String", # [Output Only] Name of the resource. 914 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations. 915 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 916 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 917 { 918 "message": "A String", # [Output Only] An optional, human-readable error message. 919 "code": "A String", # [Output Only] The error type identifier for this error. 920 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 921 }, 922 ], 923 }, 924 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 925 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 926 "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. 927 }</pre> 928 </div> 929 930 <div class="method"> 931 <code class="details" id="testIamPermissions">testIamPermissions(project, region, resource, body)</code> 932 <pre>Returns permissions that a caller has on the specified resource. 933 934 Args: 935 project: string, Project ID for this request. (required) 936 region: string, The name of the region for this request. (required) 937 resource: string, Name of the resource for this request. (required) 938 body: object, The request body. (required) 939 The object takes the form of: 940 941 { 942 "permissions": [ # The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. 943 "A String", 944 ], 945 } 946 947 948 Returns: 949 An object of the form: 950 951 { 952 "permissions": [ # A subset of `TestPermissionsRequest.permissions` that the caller is allowed. 953 "A String", 954 ], 955 }</pre> 956 </div> 957 958 </body></html>