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