1<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.firewalls.html">firewalls</a></h1> 76<h2>Instance Methods</h2> 77<p class="toc_element"> 78 <code><a href="#delete">delete(project, firewall, requestId=None)</a></code></p> 79<p class="firstline">Deletes the specified firewall.</p> 80<p class="toc_element"> 81 <code><a href="#get">get(project, firewall)</a></code></p> 82<p class="firstline">Returns the specified firewall.</p> 83<p class="toc_element"> 84 <code><a href="#insert">insert(project, body, requestId=None)</a></code></p> 85<p class="firstline">Creates a firewall rule in the specified project using the data included in the request.</p> 86<p class="toc_element"> 87 <code><a href="#list">list(project, orderBy=None, maxResults=None, pageToken=None, filter=None)</a></code></p> 88<p class="firstline">Retrieves the list of firewall rules available to the specified project.</p> 89<p class="toc_element"> 90 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> 91<p class="firstline">Retrieves the next page of results.</p> 92<p class="toc_element"> 93 <code><a href="#patch">patch(project, firewall, body, requestId=None)</a></code></p> 94<p class="firstline">Updates the specified firewall rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.</p> 95<p class="toc_element"> 96 <code><a href="#testIamPermissions">testIamPermissions(project, resource, body)</a></code></p> 97<p class="firstline">Returns permissions that a caller has on the specified resource.</p> 98<p class="toc_element"> 99 <code><a href="#update">update(project, firewall, body, requestId=None)</a></code></p> 100<p class="firstline">Updates the specified firewall rule with the data included in the request. The PUT method can only update the following fields of firewall rule: allowed, description, sourceRanges, sourceTags, targetTags.</p> 101<h3>Method Details</h3> 102<div class="method"> 103 <code class="details" id="delete">delete(project, firewall, requestId=None)</code> 104 <pre>Deletes the specified firewall. 105 106Args: 107 project: string, Project ID for this request. (required) 108 firewall: string, Name of the firewall rule to delete. (required) 109 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. 110 111For 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. 112 113The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). 114 115Returns: 116 An object of the form: 117 118 { # Represents an Operation resource. 119 # 120 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses. 121 # 122 # Operations can be global, regional or zonal. 123 # - For global operations, use the globalOperations resource. 124 # - For regional operations, use the regionOperations resource. 125 # - For zonal operations, use the zonalOperations resource. 126 # 127 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) 128 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 129 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. 130 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 131 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 132 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. 133 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 134 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 135 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 136 "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. 137 "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. 138 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 139 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 140 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 141 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 142 { 143 "message": "A String", # [Output Only] A human-readable description of the warning code. 144 "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. 145 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 146 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 147 { 148 "value": "A String", # [Output Only] A warning data value corresponding to the key. 149 "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). 150 }, 151 ], 152 }, 153 ], 154 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id. 155 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. 156 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 157 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 158 "name": "A String", # [Output Only] Name of the resource. 159 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. 160 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 161 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 162 { 163 "message": "A String", # [Output Only] An optional, human-readable error message. 164 "code": "A String", # [Output Only] The error type identifier for this error. 165 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 166 }, 167 ], 168 }, 169 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 170 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 171 "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. 172 }</pre> 173</div> 174 175<div class="method"> 176 <code class="details" id="get">get(project, firewall)</code> 177 <pre>Returns the specified firewall. 178 179Args: 180 project: string, Project ID for this request. (required) 181 firewall: string, Name of the firewall rule to return. (required) 182 183Returns: 184 An object of the form: 185 186 { # Represents a Firewall Rule resource. 187 # 188 # Firewall rules allow or deny ingress traffic to, and egress traffic from your instances. For more information, read Firewall rules. 189 "priority": 42, # Priority for this rule. This is an integer between `0` and `65535`, both inclusive. The default value is `1000`. Relative priorities determine which rule takes effect if multiple rules apply. Lower values indicate higher priority. For example, a rule with priority `0` has higher precedence than a rule with priority `1`. DENY rules take precedence over ALLOW rules if they have equal priority. Note that VPC networks have implied rules with a priority of `65535`. To avoid conflicts with the implied rules, use a priority number less than `65535`. 190 "direction": "A String", # Direction of traffic to which this firewall applies, either `INGRESS` or `EGRESS`. The default is `INGRESS`. For `INGRESS` traffic, you cannot specify the destinationRanges field, and for `EGRESS` traffic, you cannot specify the sourceRanges or sourceTags fields. 191 "sourceRanges": [ # If source ranges are specified, the firewall rule applies only to traffic that has a source IP address in these ranges. These ranges must be expressed in CIDR format. One or both of sourceRanges and sourceTags may be set. If both fields are set, the rule applies to traffic that has a source IP address within sourceRanges OR a source IP from a resource with a matching tag listed in the sourceTags field. The connection does not need to match both fields for the rule to apply. Only IPv4 is supported. 192 "A String", 193 ], 194 "sourceServiceAccounts": [ # If source service accounts are specified, the firewall rules apply only to traffic originating from an instance with a service account in this list. Source service accounts cannot be used to control traffic to an instance's external IP address because service accounts are associated with an instance, not an IP address. sourceRanges can be set at the same time as sourceServiceAccounts. If both are set, the firewall applies to traffic that has a source IP address within the sourceRanges OR a source IP that belongs to an instance with service account listed in sourceServiceAccount. The connection does not need to match both fields for the firewall to apply. sourceServiceAccounts cannot be used at the same time as sourceTags or targetTags. 195 "A String", 196 ], 197 "description": "A String", # An optional description of this resource. Provide this field when you create the resource. 198 "destinationRanges": [ # If destination ranges are specified, the firewall rule applies only to traffic that has destination IP address in these ranges. These ranges must be expressed in CIDR format. Only IPv4 is supported. 199 "A String", 200 ], 201 "sourceTags": [ # If source tags are specified, the firewall rule applies only to traffic with source IPs that match the primary network interfaces of VM instances that have the tag and are in the same VPC network. Source tags cannot be used to control traffic to an instance's external IP address, it only applies to traffic between instances in the same virtual network. Because tags are associated with instances, not IP addresses. One or both of sourceRanges and sourceTags may be set. If both fields are set, the firewall applies to traffic that has a source IP address within sourceRanges OR a source IP from a resource with a matching tag listed in the sourceTags field. The connection does not need to match both fields for the firewall to apply. 202 "A String", 203 ], 204 "allowed": [ # The list of ALLOW rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection. 205 { 206 "IPProtocol": "A String", # The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp) or the IP protocol number. 207 "ports": [ # An optional list of ports to which this rule applies. This field is only applicable for the UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. 208 # 209 # Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. 210 "A String", 211 ], 212 }, 213 ], 214 "enableLogging": True or False, # Deprecated in favor of enable in LogConfig. This field denotes whether to enable logging for a particular firewall rule. If logging is enabled, logs will be exported to Stackdriver. 215 "kind": "compute#firewall", # [Output Only] Type of the resource. Always compute#firewall for firewall rules. 216 "logConfig": { # The available logging options for a firewall rule. # This field denotes the logging options for a particular firewall rule. If logging is enabled, logs will be exported to Stackdriver. 217 "enable": True or False, # This field denotes whether to enable logging for a particular firewall rule. 218 "metadata": "A String", # This field can only be specified for a particular firewall rule if logging is enabled for that rule. This field denotes whether to include or exclude metadata for firewall logs. 219 }, 220 "disabled": True or False, # Denotes whether the firewall rule is disabled. When set to true, the firewall rule is not enforced and the network behaves as if it did not exist. If this is unspecified, the firewall rule will be enabled. 221 "network": "A String", # URL of the network resource for this firewall rule. If not specified when creating a firewall rule, the default network is used: 222 # global/networks/default 223 # If you choose to specify this field, you can specify the network as a full or partial URL. For example, the following are all valid URLs: 224 # - https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network 225 # - projects/myproject/global/networks/my-network 226 # - global/networks/default 227 "targetServiceAccounts": [ # A list of service accounts indicating sets of instances located in the network that may make network connections as specified in allowed[]. targetServiceAccounts cannot be used at the same time as targetTags or sourceTags. If neither targetServiceAccounts nor targetTags are specified, the firewall rule applies to all instances on the specified network. 228 "A String", 229 ], 230 "targetTags": [ # A list of tags that controls which instances the firewall rule applies to. If targetTags are specified, then the firewall rule applies only to instances in the VPC network that have one of those tags. If no targetTags are specified, the firewall rule applies to all instances on the specified network. 231 "A String", 232 ], 233 "denied": [ # The list of DENY rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a denied connection. 234 { 235 "IPProtocol": "A String", # The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp) or the IP protocol number. 236 "ports": [ # An optional list of ports to which this rule applies. This field is only applicable for the UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. 237 # 238 # Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. 239 "A String", 240 ], 241 }, 242 ], 243 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id. 244 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. 245 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 246 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 247 "name": "A String", # Name of the resource; provided by the client when the resource is created. 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])?. The first character must be a lowercase letter, and all following characters (except for the last character) must be a dash, lowercase letter, or digit. The last character must be a lowercase letter or digit. 248 }</pre> 249</div> 250 251<div class="method"> 252 <code class="details" id="insert">insert(project, body, requestId=None)</code> 253 <pre>Creates a firewall rule in the specified project using the data included in the request. 254 255Args: 256 project: string, Project ID for this request. (required) 257 body: object, The request body. (required) 258 The object takes the form of: 259 260{ # Represents a Firewall Rule resource. 261 # 262 # Firewall rules allow or deny ingress traffic to, and egress traffic from your instances. For more information, read Firewall rules. 263 "priority": 42, # Priority for this rule. This is an integer between `0` and `65535`, both inclusive. The default value is `1000`. Relative priorities determine which rule takes effect if multiple rules apply. Lower values indicate higher priority. For example, a rule with priority `0` has higher precedence than a rule with priority `1`. DENY rules take precedence over ALLOW rules if they have equal priority. Note that VPC networks have implied rules with a priority of `65535`. To avoid conflicts with the implied rules, use a priority number less than `65535`. 264 "direction": "A String", # Direction of traffic to which this firewall applies, either `INGRESS` or `EGRESS`. The default is `INGRESS`. For `INGRESS` traffic, you cannot specify the destinationRanges field, and for `EGRESS` traffic, you cannot specify the sourceRanges or sourceTags fields. 265 "sourceRanges": [ # If source ranges are specified, the firewall rule applies only to traffic that has a source IP address in these ranges. These ranges must be expressed in CIDR format. One or both of sourceRanges and sourceTags may be set. If both fields are set, the rule applies to traffic that has a source IP address within sourceRanges OR a source IP from a resource with a matching tag listed in the sourceTags field. The connection does not need to match both fields for the rule to apply. Only IPv4 is supported. 266 "A String", 267 ], 268 "sourceServiceAccounts": [ # If source service accounts are specified, the firewall rules apply only to traffic originating from an instance with a service account in this list. Source service accounts cannot be used to control traffic to an instance's external IP address because service accounts are associated with an instance, not an IP address. sourceRanges can be set at the same time as sourceServiceAccounts. If both are set, the firewall applies to traffic that has a source IP address within the sourceRanges OR a source IP that belongs to an instance with service account listed in sourceServiceAccount. The connection does not need to match both fields for the firewall to apply. sourceServiceAccounts cannot be used at the same time as sourceTags or targetTags. 269 "A String", 270 ], 271 "description": "A String", # An optional description of this resource. Provide this field when you create the resource. 272 "destinationRanges": [ # If destination ranges are specified, the firewall rule applies only to traffic that has destination IP address in these ranges. These ranges must be expressed in CIDR format. Only IPv4 is supported. 273 "A String", 274 ], 275 "sourceTags": [ # If source tags are specified, the firewall rule applies only to traffic with source IPs that match the primary network interfaces of VM instances that have the tag and are in the same VPC network. Source tags cannot be used to control traffic to an instance's external IP address, it only applies to traffic between instances in the same virtual network. Because tags are associated with instances, not IP addresses. One or both of sourceRanges and sourceTags may be set. If both fields are set, the firewall applies to traffic that has a source IP address within sourceRanges OR a source IP from a resource with a matching tag listed in the sourceTags field. The connection does not need to match both fields for the firewall to apply. 276 "A String", 277 ], 278 "allowed": [ # The list of ALLOW rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection. 279 { 280 "IPProtocol": "A String", # The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp) or the IP protocol number. 281 "ports": [ # An optional list of ports to which this rule applies. This field is only applicable for the UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. 282 # 283 # Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. 284 "A String", 285 ], 286 }, 287 ], 288 "enableLogging": True or False, # Deprecated in favor of enable in LogConfig. This field denotes whether to enable logging for a particular firewall rule. If logging is enabled, logs will be exported to Stackdriver. 289 "kind": "compute#firewall", # [Output Only] Type of the resource. Always compute#firewall for firewall rules. 290 "logConfig": { # The available logging options for a firewall rule. # This field denotes the logging options for a particular firewall rule. If logging is enabled, logs will be exported to Stackdriver. 291 "enable": True or False, # This field denotes whether to enable logging for a particular firewall rule. 292 "metadata": "A String", # This field can only be specified for a particular firewall rule if logging is enabled for that rule. This field denotes whether to include or exclude metadata for firewall logs. 293 }, 294 "disabled": True or False, # Denotes whether the firewall rule is disabled. When set to true, the firewall rule is not enforced and the network behaves as if it did not exist. If this is unspecified, the firewall rule will be enabled. 295 "network": "A String", # URL of the network resource for this firewall rule. If not specified when creating a firewall rule, the default network is used: 296 # global/networks/default 297 # If you choose to specify this field, you can specify the network as a full or partial URL. For example, the following are all valid URLs: 298 # - https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network 299 # - projects/myproject/global/networks/my-network 300 # - global/networks/default 301 "targetServiceAccounts": [ # A list of service accounts indicating sets of instances located in the network that may make network connections as specified in allowed[]. targetServiceAccounts cannot be used at the same time as targetTags or sourceTags. If neither targetServiceAccounts nor targetTags are specified, the firewall rule applies to all instances on the specified network. 302 "A String", 303 ], 304 "targetTags": [ # A list of tags that controls which instances the firewall rule applies to. If targetTags are specified, then the firewall rule applies only to instances in the VPC network that have one of those tags. If no targetTags are specified, the firewall rule applies to all instances on the specified network. 305 "A String", 306 ], 307 "denied": [ # The list of DENY rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a denied connection. 308 { 309 "IPProtocol": "A String", # The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp) or the IP protocol number. 310 "ports": [ # An optional list of ports to which this rule applies. This field is only applicable for the UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. 311 # 312 # Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. 313 "A String", 314 ], 315 }, 316 ], 317 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id. 318 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. 319 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 320 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 321 "name": "A String", # Name of the resource; provided by the client when the resource is created. 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])?. The first character must be a lowercase letter, and all following characters (except for the last character) must be a dash, lowercase letter, or digit. The last character must be a lowercase letter or digit. 322 } 323 324 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. 325 326For 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. 327 328The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). 329 330Returns: 331 An object of the form: 332 333 { # Represents an Operation resource. 334 # 335 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses. 336 # 337 # Operations can be global, regional or zonal. 338 # - For global operations, use the globalOperations resource. 339 # - For regional operations, use the regionOperations resource. 340 # - For zonal operations, use the zonalOperations resource. 341 # 342 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) 343 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 344 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. 345 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 346 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 347 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. 348 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 349 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 350 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 351 "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. 352 "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. 353 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 354 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 355 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 356 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 357 { 358 "message": "A String", # [Output Only] A human-readable description of the warning code. 359 "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. 360 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 361 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 362 { 363 "value": "A String", # [Output Only] A warning data value corresponding to the key. 364 "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). 365 }, 366 ], 367 }, 368 ], 369 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id. 370 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. 371 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 372 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 373 "name": "A String", # [Output Only] Name of the resource. 374 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. 375 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 376 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 377 { 378 "message": "A String", # [Output Only] An optional, human-readable error message. 379 "code": "A String", # [Output Only] The error type identifier for this error. 380 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 381 }, 382 ], 383 }, 384 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 385 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 386 "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. 387 }</pre> 388</div> 389 390<div class="method"> 391 <code class="details" id="list">list(project, orderBy=None, maxResults=None, pageToken=None, filter=None)</code> 392 <pre>Retrieves the list of firewall rules available to the specified project. 393 394Args: 395 project: string, Project ID for this request. (required) 396 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. 397 398You 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. 399 400Currently, only sorting by name or creationTimestamp desc is supported. 401 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) 402 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. 403 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 =, !=, >, or <. 404 405For example, if you are filtering Compute Engine instances, you can exclude instances named example-instance by specifying name != example-instance. 406 407You 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. 408 409To 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). 410 411Returns: 412 An object of the form: 413 414 { # Contains a list of firewalls. 415 "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. 416 "kind": "compute#firewallList", # [Output Only] Type of resource. Always compute#firewallList for lists of firewalls. 417 "items": [ # A list of Firewall resources. 418 { # Represents a Firewall Rule resource. 419 # 420 # Firewall rules allow or deny ingress traffic to, and egress traffic from your instances. For more information, read Firewall rules. 421 "priority": 42, # Priority for this rule. This is an integer between `0` and `65535`, both inclusive. The default value is `1000`. Relative priorities determine which rule takes effect if multiple rules apply. Lower values indicate higher priority. For example, a rule with priority `0` has higher precedence than a rule with priority `1`. DENY rules take precedence over ALLOW rules if they have equal priority. Note that VPC networks have implied rules with a priority of `65535`. To avoid conflicts with the implied rules, use a priority number less than `65535`. 422 "direction": "A String", # Direction of traffic to which this firewall applies, either `INGRESS` or `EGRESS`. The default is `INGRESS`. For `INGRESS` traffic, you cannot specify the destinationRanges field, and for `EGRESS` traffic, you cannot specify the sourceRanges or sourceTags fields. 423 "sourceRanges": [ # If source ranges are specified, the firewall rule applies only to traffic that has a source IP address in these ranges. These ranges must be expressed in CIDR format. One or both of sourceRanges and sourceTags may be set. If both fields are set, the rule applies to traffic that has a source IP address within sourceRanges OR a source IP from a resource with a matching tag listed in the sourceTags field. The connection does not need to match both fields for the rule to apply. Only IPv4 is supported. 424 "A String", 425 ], 426 "sourceServiceAccounts": [ # If source service accounts are specified, the firewall rules apply only to traffic originating from an instance with a service account in this list. Source service accounts cannot be used to control traffic to an instance's external IP address because service accounts are associated with an instance, not an IP address. sourceRanges can be set at the same time as sourceServiceAccounts. If both are set, the firewall applies to traffic that has a source IP address within the sourceRanges OR a source IP that belongs to an instance with service account listed in sourceServiceAccount. The connection does not need to match both fields for the firewall to apply. sourceServiceAccounts cannot be used at the same time as sourceTags or targetTags. 427 "A String", 428 ], 429 "description": "A String", # An optional description of this resource. Provide this field when you create the resource. 430 "destinationRanges": [ # If destination ranges are specified, the firewall rule applies only to traffic that has destination IP address in these ranges. These ranges must be expressed in CIDR format. Only IPv4 is supported. 431 "A String", 432 ], 433 "sourceTags": [ # If source tags are specified, the firewall rule applies only to traffic with source IPs that match the primary network interfaces of VM instances that have the tag and are in the same VPC network. Source tags cannot be used to control traffic to an instance's external IP address, it only applies to traffic between instances in the same virtual network. Because tags are associated with instances, not IP addresses. One or both of sourceRanges and sourceTags may be set. If both fields are set, the firewall applies to traffic that has a source IP address within sourceRanges OR a source IP from a resource with a matching tag listed in the sourceTags field. The connection does not need to match both fields for the firewall to apply. 434 "A String", 435 ], 436 "allowed": [ # The list of ALLOW rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection. 437 { 438 "IPProtocol": "A String", # The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp) or the IP protocol number. 439 "ports": [ # An optional list of ports to which this rule applies. This field is only applicable for the UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. 440 # 441 # Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. 442 "A String", 443 ], 444 }, 445 ], 446 "enableLogging": True or False, # Deprecated in favor of enable in LogConfig. This field denotes whether to enable logging for a particular firewall rule. If logging is enabled, logs will be exported to Stackdriver. 447 "kind": "compute#firewall", # [Output Only] Type of the resource. Always compute#firewall for firewall rules. 448 "logConfig": { # The available logging options for a firewall rule. # This field denotes the logging options for a particular firewall rule. If logging is enabled, logs will be exported to Stackdriver. 449 "enable": True or False, # This field denotes whether to enable logging for a particular firewall rule. 450 "metadata": "A String", # This field can only be specified for a particular firewall rule if logging is enabled for that rule. This field denotes whether to include or exclude metadata for firewall logs. 451 }, 452 "disabled": True or False, # Denotes whether the firewall rule is disabled. When set to true, the firewall rule is not enforced and the network behaves as if it did not exist. If this is unspecified, the firewall rule will be enabled. 453 "network": "A String", # URL of the network resource for this firewall rule. If not specified when creating a firewall rule, the default network is used: 454 # global/networks/default 455 # If you choose to specify this field, you can specify the network as a full or partial URL. For example, the following are all valid URLs: 456 # - https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network 457 # - projects/myproject/global/networks/my-network 458 # - global/networks/default 459 "targetServiceAccounts": [ # A list of service accounts indicating sets of instances located in the network that may make network connections as specified in allowed[]. targetServiceAccounts cannot be used at the same time as targetTags or sourceTags. If neither targetServiceAccounts nor targetTags are specified, the firewall rule applies to all instances on the specified network. 460 "A String", 461 ], 462 "targetTags": [ # A list of tags that controls which instances the firewall rule applies to. If targetTags are specified, then the firewall rule applies only to instances in the VPC network that have one of those tags. If no targetTags are specified, the firewall rule applies to all instances on the specified network. 463 "A String", 464 ], 465 "denied": [ # The list of DENY rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a denied connection. 466 { 467 "IPProtocol": "A String", # The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp) or the IP protocol number. 468 "ports": [ # An optional list of ports to which this rule applies. This field is only applicable for the UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. 469 # 470 # Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. 471 "A String", 472 ], 473 }, 474 ], 475 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id. 476 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. 477 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 478 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 479 "name": "A String", # Name of the resource; provided by the client when the resource is created. 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])?. The first character must be a lowercase letter, and all following characters (except for the last character) must be a dash, lowercase letter, or digit. The last character must be a lowercase letter or digit. 480 }, 481 ], 482 "warning": { # [Output Only] Informational warning message. 483 "message": "A String", # [Output Only] A human-readable description of the warning code. 484 "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. 485 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 486 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 487 { 488 "value": "A String", # [Output Only] A warning data value corresponding to the key. 489 "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). 490 }, 491 ], 492 }, 493 "id": "A String", # [Output Only] Unique identifier for the resource; defined by the server. 494 "selfLink": "A String", # [Output Only] Server-defined URL for this resource. 495 }</pre> 496</div> 497 498<div class="method"> 499 <code class="details" id="list_next">list_next(previous_request, previous_response)</code> 500 <pre>Retrieves the next page of results. 501 502Args: 503 previous_request: The request for the previous page. (required) 504 previous_response: The response from the request for the previous page. (required) 505 506Returns: 507 A request object that you can call 'execute()' on to request the next 508 page. Returns None if there are no more items in the collection. 509 </pre> 510</div> 511 512<div class="method"> 513 <code class="details" id="patch">patch(project, firewall, body, requestId=None)</code> 514 <pre>Updates the specified firewall rule with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules. 515 516Args: 517 project: string, Project ID for this request. (required) 518 firewall: string, Name of the firewall rule to patch. (required) 519 body: object, The request body. (required) 520 The object takes the form of: 521 522{ # Represents a Firewall Rule resource. 523 # 524 # Firewall rules allow or deny ingress traffic to, and egress traffic from your instances. For more information, read Firewall rules. 525 "priority": 42, # Priority for this rule. This is an integer between `0` and `65535`, both inclusive. The default value is `1000`. Relative priorities determine which rule takes effect if multiple rules apply. Lower values indicate higher priority. For example, a rule with priority `0` has higher precedence than a rule with priority `1`. DENY rules take precedence over ALLOW rules if they have equal priority. Note that VPC networks have implied rules with a priority of `65535`. To avoid conflicts with the implied rules, use a priority number less than `65535`. 526 "direction": "A String", # Direction of traffic to which this firewall applies, either `INGRESS` or `EGRESS`. The default is `INGRESS`. For `INGRESS` traffic, you cannot specify the destinationRanges field, and for `EGRESS` traffic, you cannot specify the sourceRanges or sourceTags fields. 527 "sourceRanges": [ # If source ranges are specified, the firewall rule applies only to traffic that has a source IP address in these ranges. These ranges must be expressed in CIDR format. One or both of sourceRanges and sourceTags may be set. If both fields are set, the rule applies to traffic that has a source IP address within sourceRanges OR a source IP from a resource with a matching tag listed in the sourceTags field. The connection does not need to match both fields for the rule to apply. Only IPv4 is supported. 528 "A String", 529 ], 530 "sourceServiceAccounts": [ # If source service accounts are specified, the firewall rules apply only to traffic originating from an instance with a service account in this list. Source service accounts cannot be used to control traffic to an instance's external IP address because service accounts are associated with an instance, not an IP address. sourceRanges can be set at the same time as sourceServiceAccounts. If both are set, the firewall applies to traffic that has a source IP address within the sourceRanges OR a source IP that belongs to an instance with service account listed in sourceServiceAccount. The connection does not need to match both fields for the firewall to apply. sourceServiceAccounts cannot be used at the same time as sourceTags or targetTags. 531 "A String", 532 ], 533 "description": "A String", # An optional description of this resource. Provide this field when you create the resource. 534 "destinationRanges": [ # If destination ranges are specified, the firewall rule applies only to traffic that has destination IP address in these ranges. These ranges must be expressed in CIDR format. Only IPv4 is supported. 535 "A String", 536 ], 537 "sourceTags": [ # If source tags are specified, the firewall rule applies only to traffic with source IPs that match the primary network interfaces of VM instances that have the tag and are in the same VPC network. Source tags cannot be used to control traffic to an instance's external IP address, it only applies to traffic between instances in the same virtual network. Because tags are associated with instances, not IP addresses. One or both of sourceRanges and sourceTags may be set. If both fields are set, the firewall applies to traffic that has a source IP address within sourceRanges OR a source IP from a resource with a matching tag listed in the sourceTags field. The connection does not need to match both fields for the firewall to apply. 538 "A String", 539 ], 540 "allowed": [ # The list of ALLOW rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection. 541 { 542 "IPProtocol": "A String", # The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp) or the IP protocol number. 543 "ports": [ # An optional list of ports to which this rule applies. This field is only applicable for the UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. 544 # 545 # Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. 546 "A String", 547 ], 548 }, 549 ], 550 "enableLogging": True or False, # Deprecated in favor of enable in LogConfig. This field denotes whether to enable logging for a particular firewall rule. If logging is enabled, logs will be exported to Stackdriver. 551 "kind": "compute#firewall", # [Output Only] Type of the resource. Always compute#firewall for firewall rules. 552 "logConfig": { # The available logging options for a firewall rule. # This field denotes the logging options for a particular firewall rule. If logging is enabled, logs will be exported to Stackdriver. 553 "enable": True or False, # This field denotes whether to enable logging for a particular firewall rule. 554 "metadata": "A String", # This field can only be specified for a particular firewall rule if logging is enabled for that rule. This field denotes whether to include or exclude metadata for firewall logs. 555 }, 556 "disabled": True or False, # Denotes whether the firewall rule is disabled. When set to true, the firewall rule is not enforced and the network behaves as if it did not exist. If this is unspecified, the firewall rule will be enabled. 557 "network": "A String", # URL of the network resource for this firewall rule. If not specified when creating a firewall rule, the default network is used: 558 # global/networks/default 559 # If you choose to specify this field, you can specify the network as a full or partial URL. For example, the following are all valid URLs: 560 # - https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network 561 # - projects/myproject/global/networks/my-network 562 # - global/networks/default 563 "targetServiceAccounts": [ # A list of service accounts indicating sets of instances located in the network that may make network connections as specified in allowed[]. targetServiceAccounts cannot be used at the same time as targetTags or sourceTags. If neither targetServiceAccounts nor targetTags are specified, the firewall rule applies to all instances on the specified network. 564 "A String", 565 ], 566 "targetTags": [ # A list of tags that controls which instances the firewall rule applies to. If targetTags are specified, then the firewall rule applies only to instances in the VPC network that have one of those tags. If no targetTags are specified, the firewall rule applies to all instances on the specified network. 567 "A String", 568 ], 569 "denied": [ # The list of DENY rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a denied connection. 570 { 571 "IPProtocol": "A String", # The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp) or the IP protocol number. 572 "ports": [ # An optional list of ports to which this rule applies. This field is only applicable for the UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. 573 # 574 # Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. 575 "A String", 576 ], 577 }, 578 ], 579 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id. 580 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. 581 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 582 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 583 "name": "A String", # Name of the resource; provided by the client when the resource is created. 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])?. The first character must be a lowercase letter, and all following characters (except for the last character) must be a dash, lowercase letter, or digit. The last character must be a lowercase letter or digit. 584 } 585 586 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. 587 588For 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. 589 590The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). 591 592Returns: 593 An object of the form: 594 595 { # Represents an Operation resource. 596 # 597 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses. 598 # 599 # Operations can be global, regional or zonal. 600 # - For global operations, use the globalOperations resource. 601 # - For regional operations, use the regionOperations resource. 602 # - For zonal operations, use the zonalOperations resource. 603 # 604 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) 605 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 606 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. 607 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 608 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 609 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. 610 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 611 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 612 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 613 "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. 614 "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. 615 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 616 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 617 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 618 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 619 { 620 "message": "A String", # [Output Only] A human-readable description of the warning code. 621 "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. 622 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 623 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 624 { 625 "value": "A String", # [Output Only] A warning data value corresponding to the key. 626 "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). 627 }, 628 ], 629 }, 630 ], 631 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id. 632 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. 633 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 634 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 635 "name": "A String", # [Output Only] Name of the resource. 636 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. 637 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 638 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 639 { 640 "message": "A String", # [Output Only] An optional, human-readable error message. 641 "code": "A String", # [Output Only] The error type identifier for this error. 642 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 643 }, 644 ], 645 }, 646 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 647 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 648 "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. 649 }</pre> 650</div> 651 652<div class="method"> 653 <code class="details" id="testIamPermissions">testIamPermissions(project, resource, body)</code> 654 <pre>Returns permissions that a caller has on the specified resource. 655 656Args: 657 project: string, Project ID for this request. (required) 658 resource: string, Name or id of the resource for this request. (required) 659 body: object, The request body. (required) 660 The object takes the form of: 661 662{ 663 "permissions": [ # The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. 664 "A String", 665 ], 666 } 667 668 669Returns: 670 An object of the form: 671 672 { 673 "permissions": [ # A subset of `TestPermissionsRequest.permissions` that the caller is allowed. 674 "A String", 675 ], 676 }</pre> 677</div> 678 679<div class="method"> 680 <code class="details" id="update">update(project, firewall, body, requestId=None)</code> 681 <pre>Updates the specified firewall rule with the data included in the request. The PUT method can only update the following fields of firewall rule: allowed, description, sourceRanges, sourceTags, targetTags. 682 683Args: 684 project: string, Project ID for this request. (required) 685 firewall: string, Name of the firewall rule to update. (required) 686 body: object, The request body. (required) 687 The object takes the form of: 688 689{ # Represents a Firewall Rule resource. 690 # 691 # Firewall rules allow or deny ingress traffic to, and egress traffic from your instances. For more information, read Firewall rules. 692 "priority": 42, # Priority for this rule. This is an integer between `0` and `65535`, both inclusive. The default value is `1000`. Relative priorities determine which rule takes effect if multiple rules apply. Lower values indicate higher priority. For example, a rule with priority `0` has higher precedence than a rule with priority `1`. DENY rules take precedence over ALLOW rules if they have equal priority. Note that VPC networks have implied rules with a priority of `65535`. To avoid conflicts with the implied rules, use a priority number less than `65535`. 693 "direction": "A String", # Direction of traffic to which this firewall applies, either `INGRESS` or `EGRESS`. The default is `INGRESS`. For `INGRESS` traffic, you cannot specify the destinationRanges field, and for `EGRESS` traffic, you cannot specify the sourceRanges or sourceTags fields. 694 "sourceRanges": [ # If source ranges are specified, the firewall rule applies only to traffic that has a source IP address in these ranges. These ranges must be expressed in CIDR format. One or both of sourceRanges and sourceTags may be set. If both fields are set, the rule applies to traffic that has a source IP address within sourceRanges OR a source IP from a resource with a matching tag listed in the sourceTags field. The connection does not need to match both fields for the rule to apply. Only IPv4 is supported. 695 "A String", 696 ], 697 "sourceServiceAccounts": [ # If source service accounts are specified, the firewall rules apply only to traffic originating from an instance with a service account in this list. Source service accounts cannot be used to control traffic to an instance's external IP address because service accounts are associated with an instance, not an IP address. sourceRanges can be set at the same time as sourceServiceAccounts. If both are set, the firewall applies to traffic that has a source IP address within the sourceRanges OR a source IP that belongs to an instance with service account listed in sourceServiceAccount. The connection does not need to match both fields for the firewall to apply. sourceServiceAccounts cannot be used at the same time as sourceTags or targetTags. 698 "A String", 699 ], 700 "description": "A String", # An optional description of this resource. Provide this field when you create the resource. 701 "destinationRanges": [ # If destination ranges are specified, the firewall rule applies only to traffic that has destination IP address in these ranges. These ranges must be expressed in CIDR format. Only IPv4 is supported. 702 "A String", 703 ], 704 "sourceTags": [ # If source tags are specified, the firewall rule applies only to traffic with source IPs that match the primary network interfaces of VM instances that have the tag and are in the same VPC network. Source tags cannot be used to control traffic to an instance's external IP address, it only applies to traffic between instances in the same virtual network. Because tags are associated with instances, not IP addresses. One or both of sourceRanges and sourceTags may be set. If both fields are set, the firewall applies to traffic that has a source IP address within sourceRanges OR a source IP from a resource with a matching tag listed in the sourceTags field. The connection does not need to match both fields for the firewall to apply. 705 "A String", 706 ], 707 "allowed": [ # The list of ALLOW rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection. 708 { 709 "IPProtocol": "A String", # The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp) or the IP protocol number. 710 "ports": [ # An optional list of ports to which this rule applies. This field is only applicable for the UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. 711 # 712 # Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. 713 "A String", 714 ], 715 }, 716 ], 717 "enableLogging": True or False, # Deprecated in favor of enable in LogConfig. This field denotes whether to enable logging for a particular firewall rule. If logging is enabled, logs will be exported to Stackdriver. 718 "kind": "compute#firewall", # [Output Only] Type of the resource. Always compute#firewall for firewall rules. 719 "logConfig": { # The available logging options for a firewall rule. # This field denotes the logging options for a particular firewall rule. If logging is enabled, logs will be exported to Stackdriver. 720 "enable": True or False, # This field denotes whether to enable logging for a particular firewall rule. 721 "metadata": "A String", # This field can only be specified for a particular firewall rule if logging is enabled for that rule. This field denotes whether to include or exclude metadata for firewall logs. 722 }, 723 "disabled": True or False, # Denotes whether the firewall rule is disabled. When set to true, the firewall rule is not enforced and the network behaves as if it did not exist. If this is unspecified, the firewall rule will be enabled. 724 "network": "A String", # URL of the network resource for this firewall rule. If not specified when creating a firewall rule, the default network is used: 725 # global/networks/default 726 # If you choose to specify this field, you can specify the network as a full or partial URL. For example, the following are all valid URLs: 727 # - https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network 728 # - projects/myproject/global/networks/my-network 729 # - global/networks/default 730 "targetServiceAccounts": [ # A list of service accounts indicating sets of instances located in the network that may make network connections as specified in allowed[]. targetServiceAccounts cannot be used at the same time as targetTags or sourceTags. If neither targetServiceAccounts nor targetTags are specified, the firewall rule applies to all instances on the specified network. 731 "A String", 732 ], 733 "targetTags": [ # A list of tags that controls which instances the firewall rule applies to. If targetTags are specified, then the firewall rule applies only to instances in the VPC network that have one of those tags. If no targetTags are specified, the firewall rule applies to all instances on the specified network. 734 "A String", 735 ], 736 "denied": [ # The list of DENY rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a denied connection. 737 { 738 "IPProtocol": "A String", # The IP protocol to which this rule applies. The protocol type is required when creating a firewall rule. This value can either be one of the following well known protocol strings (tcp, udp, icmp, esp, ah, ipip, sctp) or the IP protocol number. 739 "ports": [ # An optional list of ports to which this rule applies. This field is only applicable for the UDP or TCP protocol. Each entry must be either an integer or a range. If not specified, this rule applies to connections through any port. 740 # 741 # Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. 742 "A String", 743 ], 744 }, 745 ], 746 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id. 747 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. 748 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 749 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 750 "name": "A String", # Name of the resource; provided by the client when the resource is created. 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])?. The first character must be a lowercase letter, and all following characters (except for the last character) must be a dash, lowercase letter, or digit. The last character must be a lowercase letter or digit. 751 } 752 753 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. 754 755For 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. 756 757The request ID must be a valid UUID with the exception that zero UUID is not supported (00000000-0000-0000-0000-000000000000). 758 759Returns: 760 An object of the form: 761 762 { # Represents an Operation resource. 763 # 764 # You can use an operation resource to manage asynchronous API requests. For more information, read Handling API responses. 765 # 766 # Operations can be global, regional or zonal. 767 # - For global operations, use the globalOperations resource. 768 # - For regional operations, use the regionOperations resource. 769 # - For zonal operations, use the zonalOperations resource. 770 # 771 # For more information, read Global, Regional, and Zonal Resources. (== resource_for v1.globalOperations ==) (== resource_for beta.globalOperations ==) (== resource_for v1.regionOperations ==) (== resource_for beta.regionOperations ==) (== resource_for v1.zoneOperations ==) (== resource_for beta.zoneOperations ==) 772 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 773 "clientOperationId": "A String", # [Output Only] The value of `requestId` if you provided it in the request. Not present otherwise. 774 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 775 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 776 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only applicable when performing per-zone operations. 777 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 778 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 779 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 780 "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. 781 "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. 782 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 783 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 784 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 785 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 786 { 787 "message": "A String", # [Output Only] A human-readable description of the warning code. 788 "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. 789 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 790 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 791 { 792 "value": "A String", # [Output Only] A warning data value corresponding to the key. 793 "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). 794 }, 795 ], 796 }, 797 ], 798 "selfLinkWithId": "A String", # [Output Only] Server-defined URL for this resource with the resource id. 799 "user": "A String", # [Output Only] User who requested the operation, for example: user@example.com. 800 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 801 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 802 "name": "A String", # [Output Only] Name of the resource. 803 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only applicable when performing regional operations. 804 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 805 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 806 { 807 "message": "A String", # [Output Only] An optional, human-readable error message. 808 "code": "A String", # [Output Only] The error type identifier for this error. 809 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 810 }, 811 ], 812 }, 813 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 814 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 815 "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. 816 }</pre> 817</div> 818 819</body></html>