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_beta.html">Compute Engine API</a> . <a href="compute_beta.firewalls.html">firewalls</a></h1> 76 <h2>Instance Methods</h2> 77 <p class="toc_element"> 78 <code><a href="#delete">delete(project, firewall)</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)</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)</a></code></p> 94 <p class="firstline">Updates the specified firewall rule with the data included in the request. This method supports patch semantics.</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)</a></code></p> 100 <p class="firstline">Updates the specified firewall rule with the data included in the request. Using PUT method, can only update 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)</code> 104 <pre>Deletes the specified firewall. 105 106 Args: 107 project: string, Project ID for this request. (required) 108 firewall: string, Name of the firewall rule to delete. (required) 109 110 Returns: 111 An object of the form: 112 113 { # An Operation resource, used to manage asynchronous API requests. 114 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 115 "clientOperationId": "A String", # [Output Only] Reserved for future use. 116 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 117 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 118 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations. 119 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 120 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 121 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 122 "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. 123 "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. 124 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 125 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 126 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 127 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 128 { 129 "message": "A String", # [Output Only] A human-readable description of the warning code. 130 "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. 131 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 132 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 133 { 134 "value": "A String", # [Output Only] A warning data value corresponding to the key. 135 "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). 136 }, 137 ], 138 }, 139 ], 140 "user": "A String", # [Output Only] User who requested the operation, for example: user (a] example.com. 141 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 142 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 143 "name": "A String", # [Output Only] Name of the resource. 144 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations. 145 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 146 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 147 { 148 "message": "A String", # [Output Only] An optional, human-readable error message. 149 "code": "A String", # [Output Only] The error type identifier for this error. 150 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 151 }, 152 ], 153 }, 154 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 155 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 156 "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. 157 }</pre> 158 </div> 159 160 <div class="method"> 161 <code class="details" id="get">get(project, firewall)</code> 162 <pre>Returns the specified firewall. 163 164 Args: 165 project: string, Project ID for this request. (required) 166 firewall: string, Name of the firewall rule to return. (required) 167 168 Returns: 169 An object of the form: 170 171 { # Represents a Firewall resource. 172 "direction": "A String", # Direction of traffic to which this firewall applies; default is INGRESS. Note: For INGRESS traffic, it is NOT supported to specify destinationRanges; For EGRESS traffic, it is NOT supported to specify sourceRanges OR sourceTags. 173 "description": "A String", # An optional description of this resource. Provide this property when you create the resource. 174 "destinationRanges": [ # If destination ranges are specified, the firewall will apply only to traffic that has destination IP address in these ranges. These ranges must be expressed in CIDR format. Only IPv4 is supported. 175 "A String", 176 ], 177 "sourceTags": [ # If source tags are specified, the firewall will apply only to traffic with source IP that belongs to a tag listed in source tags. Source tags cannot be used to control traffic to an instance's external IP address. Because tags are associated with an instance, not an IP address. One or both of sourceRanges and sourceTags may be set. If both properties are set, the firewall will apply to traffic that has source IP address within sourceRanges OR the source IP that belongs to a tag listed in the sourceTags property. The connection does not need to match both properties for the firewall to apply. 178 "A String", 179 ], 180 "allowed": [ # The list of ALLOW rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection. 181 { 182 "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, sctp), or the IP protocol number. 183 "ports": [ # An optional list of ports to which this rule applies. This field is only applicable for 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. 184 # 185 # Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. 186 "A String", 187 ], 188 }, 189 ], 190 "kind": "compute#firewall", # [Output Only] Type of the resource. Always compute#firewall for firewall rules. 191 "sourceRanges": [ # If source ranges are specified, the firewall will apply only to traffic that has 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 properties are set, the firewall will apply to traffic that has source IP address within sourceRanges OR the source IP that belongs to a tag listed in the sourceTags property. The connection does not need to match both properties for the firewall to apply. Only IPv4 is supported. 192 "A String", 193 ], 194 "priority": 42, # Priority for this rule. This is an integer between 0 and 65535, both inclusive. When not specified, the value assumed is 1000. Relative priorities determine precedence of conflicting rules. Lower value of priority implies higher precedence (eg, a rule with priority 0 has higher precedence than a rule with priority 1). DENY rules take precedence over ALLOW rules having equal priority. 195 "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: 196 # global/networks/default 197 # If you choose to specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs: 198 # - https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network 199 # - projects/myproject/global/networks/my-network 200 # - global/networks/default 201 "targetTags": [ # A list of instance tags indicating sets of instances located in the network that may make network connections as specified in allowed[]. If no targetTags are specified, the firewall rule applies to all instances on the specified network. 202 "A String", 203 ], 204 "denied": [ # The list of DENY 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, sctp), or the IP protocol number. 207 "ports": [ # An optional list of ports to which this rule applies. This field is only applicable for 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 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. 215 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 216 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 217 "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])? 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. 218 }</pre> 219 </div> 220 221 <div class="method"> 222 <code class="details" id="insert">insert(project, body)</code> 223 <pre>Creates a firewall rule in the specified project using the data included in the request. 224 225 Args: 226 project: string, Project ID for this request. (required) 227 body: object, The request body. (required) 228 The object takes the form of: 229 230 { # Represents a Firewall resource. 231 "direction": "A String", # Direction of traffic to which this firewall applies; default is INGRESS. Note: For INGRESS traffic, it is NOT supported to specify destinationRanges; For EGRESS traffic, it is NOT supported to specify sourceRanges OR sourceTags. 232 "description": "A String", # An optional description of this resource. Provide this property when you create the resource. 233 "destinationRanges": [ # If destination ranges are specified, the firewall will apply only to traffic that has destination IP address in these ranges. These ranges must be expressed in CIDR format. Only IPv4 is supported. 234 "A String", 235 ], 236 "sourceTags": [ # If source tags are specified, the firewall will apply only to traffic with source IP that belongs to a tag listed in source tags. Source tags cannot be used to control traffic to an instance's external IP address. Because tags are associated with an instance, not an IP address. One or both of sourceRanges and sourceTags may be set. If both properties are set, the firewall will apply to traffic that has source IP address within sourceRanges OR the source IP that belongs to a tag listed in the sourceTags property. The connection does not need to match both properties for the firewall to apply. 237 "A String", 238 ], 239 "allowed": [ # The list of ALLOW rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection. 240 { 241 "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, sctp), or the IP protocol number. 242 "ports": [ # An optional list of ports to which this rule applies. This field is only applicable for 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. 243 # 244 # Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. 245 "A String", 246 ], 247 }, 248 ], 249 "kind": "compute#firewall", # [Output Only] Type of the resource. Always compute#firewall for firewall rules. 250 "sourceRanges": [ # If source ranges are specified, the firewall will apply only to traffic that has 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 properties are set, the firewall will apply to traffic that has source IP address within sourceRanges OR the source IP that belongs to a tag listed in the sourceTags property. The connection does not need to match both properties for the firewall to apply. Only IPv4 is supported. 251 "A String", 252 ], 253 "priority": 42, # Priority for this rule. This is an integer between 0 and 65535, both inclusive. When not specified, the value assumed is 1000. Relative priorities determine precedence of conflicting rules. Lower value of priority implies higher precedence (eg, a rule with priority 0 has higher precedence than a rule with priority 1). DENY rules take precedence over ALLOW rules having equal priority. 254 "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: 255 # global/networks/default 256 # If you choose to specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs: 257 # - https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network 258 # - projects/myproject/global/networks/my-network 259 # - global/networks/default 260 "targetTags": [ # A list of instance tags indicating sets of instances located in the network that may make network connections as specified in allowed[]. If no targetTags are specified, the firewall rule applies to all instances on the specified network. 261 "A String", 262 ], 263 "denied": [ # The list of DENY rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection. 264 { 265 "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, sctp), or the IP protocol number. 266 "ports": [ # An optional list of ports to which this rule applies. This field is only applicable for 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. 267 # 268 # Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. 269 "A String", 270 ], 271 }, 272 ], 273 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. 274 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 275 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 276 "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])? 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. 277 } 278 279 280 Returns: 281 An object of the form: 282 283 { # An Operation resource, used to manage asynchronous API requests. 284 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 285 "clientOperationId": "A String", # [Output Only] Reserved for future use. 286 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 287 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 288 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations. 289 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 290 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 291 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 292 "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. 293 "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. 294 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 295 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 296 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 297 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 298 { 299 "message": "A String", # [Output Only] A human-readable description of the warning code. 300 "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. 301 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 302 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 303 { 304 "value": "A String", # [Output Only] A warning data value corresponding to the key. 305 "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). 306 }, 307 ], 308 }, 309 ], 310 "user": "A String", # [Output Only] User who requested the operation, for example: user (a] example.com. 311 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 312 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 313 "name": "A String", # [Output Only] Name of the resource. 314 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations. 315 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 316 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 317 { 318 "message": "A String", # [Output Only] An optional, human-readable error message. 319 "code": "A String", # [Output Only] The error type identifier for this error. 320 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 321 }, 322 ], 323 }, 324 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 325 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 326 "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. 327 }</pre> 328 </div> 329 330 <div class="method"> 331 <code class="details" id="list">list(project, orderBy=None, maxResults=None, pageToken=None, filter=None)</code> 332 <pre>Retrieves the list of firewall rules available to the specified project. 333 334 Args: 335 project: string, Project ID for this request. (required) 336 orderBy: string, Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name. 337 338 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. 339 340 Currently, only sorting by name or creationTimestamp desc is supported. 341 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) 342 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. 343 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. 344 345 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. 346 347 For example, to filter for instances that do not have a name of example-instance, you would use filter=name ne example-instance. 348 349 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. 350 351 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. 352 353 Returns: 354 An object of the form: 355 356 { # Contains a list of firewalls. 357 "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. 358 "items": [ # [Output Only] A list of Firewall resources. 359 { # Represents a Firewall resource. 360 "direction": "A String", # Direction of traffic to which this firewall applies; default is INGRESS. Note: For INGRESS traffic, it is NOT supported to specify destinationRanges; For EGRESS traffic, it is NOT supported to specify sourceRanges OR sourceTags. 361 "description": "A String", # An optional description of this resource. Provide this property when you create the resource. 362 "destinationRanges": [ # If destination ranges are specified, the firewall will apply only to traffic that has destination IP address in these ranges. These ranges must be expressed in CIDR format. Only IPv4 is supported. 363 "A String", 364 ], 365 "sourceTags": [ # If source tags are specified, the firewall will apply only to traffic with source IP that belongs to a tag listed in source tags. Source tags cannot be used to control traffic to an instance's external IP address. Because tags are associated with an instance, not an IP address. One or both of sourceRanges and sourceTags may be set. If both properties are set, the firewall will apply to traffic that has source IP address within sourceRanges OR the source IP that belongs to a tag listed in the sourceTags property. The connection does not need to match both properties for the firewall to apply. 366 "A String", 367 ], 368 "allowed": [ # The list of ALLOW rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection. 369 { 370 "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, sctp), or the IP protocol number. 371 "ports": [ # An optional list of ports to which this rule applies. This field is only applicable for 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. 372 # 373 # Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. 374 "A String", 375 ], 376 }, 377 ], 378 "kind": "compute#firewall", # [Output Only] Type of the resource. Always compute#firewall for firewall rules. 379 "sourceRanges": [ # If source ranges are specified, the firewall will apply only to traffic that has 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 properties are set, the firewall will apply to traffic that has source IP address within sourceRanges OR the source IP that belongs to a tag listed in the sourceTags property. The connection does not need to match both properties for the firewall to apply. Only IPv4 is supported. 380 "A String", 381 ], 382 "priority": 42, # Priority for this rule. This is an integer between 0 and 65535, both inclusive. When not specified, the value assumed is 1000. Relative priorities determine precedence of conflicting rules. Lower value of priority implies higher precedence (eg, a rule with priority 0 has higher precedence than a rule with priority 1). DENY rules take precedence over ALLOW rules having equal priority. 383 "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: 384 # global/networks/default 385 # If you choose to specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs: 386 # - https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network 387 # - projects/myproject/global/networks/my-network 388 # - global/networks/default 389 "targetTags": [ # A list of instance tags indicating sets of instances located in the network that may make network connections as specified in allowed[]. If no targetTags are specified, the firewall rule applies to all instances on the specified network. 390 "A String", 391 ], 392 "denied": [ # The list of DENY rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection. 393 { 394 "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, sctp), or the IP protocol number. 395 "ports": [ # An optional list of ports to which this rule applies. This field is only applicable for 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. 396 # 397 # Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. 398 "A String", 399 ], 400 }, 401 ], 402 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. 403 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 404 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 405 "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])? 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. 406 }, 407 ], 408 "kind": "compute#firewallList", # [Output Only] Type of resource. Always compute#firewallList for lists of firewalls. 409 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 410 "selfLink": "A String", # [Output Only] Server-defined URL for this resource. 411 }</pre> 412 </div> 413 414 <div class="method"> 415 <code class="details" id="list_next">list_next(previous_request, previous_response)</code> 416 <pre>Retrieves the next page of results. 417 418 Args: 419 previous_request: The request for the previous page. (required) 420 previous_response: The response from the request for the previous page. (required) 421 422 Returns: 423 A request object that you can call 'execute()' on to request the next 424 page. Returns None if there are no more items in the collection. 425 </pre> 426 </div> 427 428 <div class="method"> 429 <code class="details" id="patch">patch(project, firewall, body)</code> 430 <pre>Updates the specified firewall rule with the data included in the request. This method supports patch semantics. 431 432 Args: 433 project: string, Project ID for this request. (required) 434 firewall: string, Name of the firewall rule to patch. (required) 435 body: object, The request body. (required) 436 The object takes the form of: 437 438 { # Represents a Firewall resource. 439 "direction": "A String", # Direction of traffic to which this firewall applies; default is INGRESS. Note: For INGRESS traffic, it is NOT supported to specify destinationRanges; For EGRESS traffic, it is NOT supported to specify sourceRanges OR sourceTags. 440 "description": "A String", # An optional description of this resource. Provide this property when you create the resource. 441 "destinationRanges": [ # If destination ranges are specified, the firewall will apply only to traffic that has destination IP address in these ranges. These ranges must be expressed in CIDR format. Only IPv4 is supported. 442 "A String", 443 ], 444 "sourceTags": [ # If source tags are specified, the firewall will apply only to traffic with source IP that belongs to a tag listed in source tags. Source tags cannot be used to control traffic to an instance's external IP address. Because tags are associated with an instance, not an IP address. One or both of sourceRanges and sourceTags may be set. If both properties are set, the firewall will apply to traffic that has source IP address within sourceRanges OR the source IP that belongs to a tag listed in the sourceTags property. The connection does not need to match both properties for the firewall to apply. 445 "A String", 446 ], 447 "allowed": [ # The list of ALLOW rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection. 448 { 449 "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, sctp), or the IP protocol number. 450 "ports": [ # An optional list of ports to which this rule applies. This field is only applicable for 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. 451 # 452 # Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. 453 "A String", 454 ], 455 }, 456 ], 457 "kind": "compute#firewall", # [Output Only] Type of the resource. Always compute#firewall for firewall rules. 458 "sourceRanges": [ # If source ranges are specified, the firewall will apply only to traffic that has 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 properties are set, the firewall will apply to traffic that has source IP address within sourceRanges OR the source IP that belongs to a tag listed in the sourceTags property. The connection does not need to match both properties for the firewall to apply. Only IPv4 is supported. 459 "A String", 460 ], 461 "priority": 42, # Priority for this rule. This is an integer between 0 and 65535, both inclusive. When not specified, the value assumed is 1000. Relative priorities determine precedence of conflicting rules. Lower value of priority implies higher precedence (eg, a rule with priority 0 has higher precedence than a rule with priority 1). DENY rules take precedence over ALLOW rules having equal priority. 462 "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: 463 # global/networks/default 464 # If you choose to specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs: 465 # - https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network 466 # - projects/myproject/global/networks/my-network 467 # - global/networks/default 468 "targetTags": [ # A list of instance tags indicating sets of instances located in the network that may make network connections as specified in allowed[]. If no targetTags are specified, the firewall rule applies to all instances on the specified network. 469 "A String", 470 ], 471 "denied": [ # The list of DENY rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection. 472 { 473 "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, sctp), or the IP protocol number. 474 "ports": [ # An optional list of ports to which this rule applies. This field is only applicable for 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. 475 # 476 # Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. 477 "A String", 478 ], 479 }, 480 ], 481 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. 482 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 483 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 484 "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])? 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. 485 } 486 487 488 Returns: 489 An object of the form: 490 491 { # An Operation resource, used to manage asynchronous API requests. 492 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 493 "clientOperationId": "A String", # [Output Only] Reserved for future use. 494 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 495 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 496 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations. 497 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 498 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 499 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 500 "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. 501 "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. 502 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 503 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 504 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 505 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 506 { 507 "message": "A String", # [Output Only] A human-readable description of the warning code. 508 "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. 509 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 510 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 511 { 512 "value": "A String", # [Output Only] A warning data value corresponding to the key. 513 "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). 514 }, 515 ], 516 }, 517 ], 518 "user": "A String", # [Output Only] User who requested the operation, for example: user (a] example.com. 519 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 520 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 521 "name": "A String", # [Output Only] Name of the resource. 522 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations. 523 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 524 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 525 { 526 "message": "A String", # [Output Only] An optional, human-readable error message. 527 "code": "A String", # [Output Only] The error type identifier for this error. 528 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 529 }, 530 ], 531 }, 532 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 533 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 534 "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. 535 }</pre> 536 </div> 537 538 <div class="method"> 539 <code class="details" id="testIamPermissions">testIamPermissions(project, resource, body)</code> 540 <pre>Returns permissions that a caller has on the specified resource. 541 542 Args: 543 project: string, Project ID for this request. (required) 544 resource: string, Name of the resource for this request. (required) 545 body: object, The request body. (required) 546 The object takes the form of: 547 548 { 549 "permissions": [ # The set of permissions to check for the 'resource'. Permissions with wildcards (such as '*' or 'storage.*') are not allowed. 550 "A String", 551 ], 552 } 553 554 555 Returns: 556 An object of the form: 557 558 { 559 "permissions": [ # A subset of `TestPermissionsRequest.permissions` that the caller is allowed. 560 "A String", 561 ], 562 }</pre> 563 </div> 564 565 <div class="method"> 566 <code class="details" id="update">update(project, firewall, body)</code> 567 <pre>Updates the specified firewall rule with the data included in the request. Using PUT method, can only update following fields of firewall rule: allowed, description, sourceRanges, sourceTags, targetTags. 568 569 Args: 570 project: string, Project ID for this request. (required) 571 firewall: string, Name of the firewall rule to update. (required) 572 body: object, The request body. (required) 573 The object takes the form of: 574 575 { # Represents a Firewall resource. 576 "direction": "A String", # Direction of traffic to which this firewall applies; default is INGRESS. Note: For INGRESS traffic, it is NOT supported to specify destinationRanges; For EGRESS traffic, it is NOT supported to specify sourceRanges OR sourceTags. 577 "description": "A String", # An optional description of this resource. Provide this property when you create the resource. 578 "destinationRanges": [ # If destination ranges are specified, the firewall will apply only to traffic that has destination IP address in these ranges. These ranges must be expressed in CIDR format. Only IPv4 is supported. 579 "A String", 580 ], 581 "sourceTags": [ # If source tags are specified, the firewall will apply only to traffic with source IP that belongs to a tag listed in source tags. Source tags cannot be used to control traffic to an instance's external IP address. Because tags are associated with an instance, not an IP address. One or both of sourceRanges and sourceTags may be set. If both properties are set, the firewall will apply to traffic that has source IP address within sourceRanges OR the source IP that belongs to a tag listed in the sourceTags property. The connection does not need to match both properties for the firewall to apply. 582 "A String", 583 ], 584 "allowed": [ # The list of ALLOW rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection. 585 { 586 "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, sctp), or the IP protocol number. 587 "ports": [ # An optional list of ports to which this rule applies. This field is only applicable for 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. 588 # 589 # Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. 590 "A String", 591 ], 592 }, 593 ], 594 "kind": "compute#firewall", # [Output Only] Type of the resource. Always compute#firewall for firewall rules. 595 "sourceRanges": [ # If source ranges are specified, the firewall will apply only to traffic that has 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 properties are set, the firewall will apply to traffic that has source IP address within sourceRanges OR the source IP that belongs to a tag listed in the sourceTags property. The connection does not need to match both properties for the firewall to apply. Only IPv4 is supported. 596 "A String", 597 ], 598 "priority": 42, # Priority for this rule. This is an integer between 0 and 65535, both inclusive. When not specified, the value assumed is 1000. Relative priorities determine precedence of conflicting rules. Lower value of priority implies higher precedence (eg, a rule with priority 0 has higher precedence than a rule with priority 1). DENY rules take precedence over ALLOW rules having equal priority. 599 "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: 600 # global/networks/default 601 # If you choose to specify this property, you can specify the network as a full or partial URL. For example, the following are all valid URLs: 602 # - https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network 603 # - projects/myproject/global/networks/my-network 604 # - global/networks/default 605 "targetTags": [ # A list of instance tags indicating sets of instances located in the network that may make network connections as specified in allowed[]. If no targetTags are specified, the firewall rule applies to all instances on the specified network. 606 "A String", 607 ], 608 "denied": [ # The list of DENY rules specified by this firewall. Each rule specifies a protocol and port-range tuple that describes a permitted connection. 609 { 610 "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, sctp), or the IP protocol number. 611 "ports": [ # An optional list of ports to which this rule applies. This field is only applicable for 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. 612 # 613 # Example inputs include: ["22"], ["80","443"], and ["12345-12349"]. 614 "A String", 615 ], 616 }, 617 ], 618 "creationTimestamp": "A String", # [Output Only] Creation timestamp in RFC3339 text format. 619 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 620 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 621 "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])? 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. 622 } 623 624 625 Returns: 626 An object of the form: 627 628 { # An Operation resource, used to manage asynchronous API requests. 629 "targetId": "A String", # [Output Only] The unique target ID, which identifies a specific incarnation of the target resource. 630 "clientOperationId": "A String", # [Output Only] Reserved for future use. 631 "creationTimestamp": "A String", # [Deprecated] This field is deprecated. 632 "id": "A String", # [Output Only] The unique identifier for the resource. This identifier is defined by the server. 633 "zone": "A String", # [Output Only] The URL of the zone where the operation resides. Only available when performing per-zone operations. 634 "insertTime": "A String", # [Output Only] The time that this operation was requested. This value is in RFC3339 text format. 635 "operationType": "A String", # [Output Only] The type of operation, such as insert, update, or delete, and so on. 636 "httpErrorMessage": "A String", # [Output Only] If the operation fails, this field contains the HTTP error message that was returned, such as NOT FOUND. 637 "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. 638 "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. 639 "statusMessage": "A String", # [Output Only] An optional textual description of the current status of the operation. 640 "status": "A String", # [Output Only] The status of the operation, which can be one of the following: PENDING, RUNNING, or DONE. 641 "description": "A String", # [Output Only] A textual description of the operation, which is set when the operation is created. 642 "warnings": [ # [Output Only] If warning messages are generated during processing of the operation, this field will be populated. 643 { 644 "message": "A String", # [Output Only] A human-readable description of the warning code. 645 "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. 646 "data": [ # [Output Only] Metadata about this warning in key: value format. For example: 647 # "data": [ { "key": "scope", "value": "zones/us-east1-d" } 648 { 649 "value": "A String", # [Output Only] A warning data value corresponding to the key. 650 "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). 651 }, 652 ], 653 }, 654 ], 655 "user": "A String", # [Output Only] User who requested the operation, for example: user (a] example.com. 656 "startTime": "A String", # [Output Only] The time that this operation was started by the server. This value is in RFC3339 text format. 657 "kind": "compute#operation", # [Output Only] Type of the resource. Always compute#operation for Operation resources. 658 "name": "A String", # [Output Only] Name of the resource. 659 "region": "A String", # [Output Only] The URL of the region where the operation resides. Only available when performing regional operations. 660 "error": { # [Output Only] If errors are generated during processing of the operation, this field will be populated. 661 "errors": [ # [Output Only] The array of errors encountered while processing this operation. 662 { 663 "message": "A String", # [Output Only] An optional, human-readable error message. 664 "code": "A String", # [Output Only] The error type identifier for this error. 665 "location": "A String", # [Output Only] Indicates the field in the request that caused the error. This property is optional. 666 }, 667 ], 668 }, 669 "endTime": "A String", # [Output Only] The time that this operation was completed. This value is in RFC3339 text format. 670 "selfLink": "A String", # [Output Only] Server-defined URL for the resource. 671 "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. 672 }</pre> 673 </div> 674 675 </body></html>