
target.apidocs.com.google.api.services.compute.model.Firewall.html Maven / Gradle / Ivy
Firewall (Compute Engine API beta-rev20220312-1.32.1)
com.google.api.services.compute.model
Class Firewall
- java.lang.Object
-
- java.util.AbstractMap<String,Object>
-
- com.google.api.client.util.GenericData
-
- com.google.api.client.json.GenericJson
-
- com.google.api.services.compute.model.Firewall
-
public final class Firewall
extends GenericJson
Represents a Firewall Rule resource. Firewall rules allow or deny ingress traffic to, and egress
traffic from your instances. For more information, read Firewall rules.
This is the Java data model class that specifies how to parse/serialize into the JSON that is
transmitted over HTTP when working with the Compute Engine API. For a detailed explanation see:
https://developers.google.com/api-client-library/java/google-http-java-client/json
- Author:
- Google, Inc.
-
-
Nested Class Summary
Nested Classes
Modifier and Type
Class and Description
static class
Firewall.Allowed
Model definition for FirewallAllowed.
static class
Firewall.Denied
Model definition for FirewallDenied.
-
Nested classes/interfaces inherited from class com.google.api.client.util.GenericData
GenericData.Flags
-
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
-
Constructor Summary
Constructors
Constructor and Description
Firewall()
-
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
Firewall
clone()
List<Firewall.Allowed>
getAllowed()
The list of ALLOW rules specified by this firewall.
String
getCreationTimestamp()
[Output Only] Creation timestamp in RFC3339 text format.
List<Firewall.Denied>
getDenied()
The list of DENY rules specified by this firewall.
String
getDescription()
An optional description of this resource.
List<String>
getDestinationRanges()
If destination ranges are specified, the firewall rule applies only to traffic that has
destination IP address in these ranges.
String
getDirection()
Direction of traffic to which this firewall applies, either `INGRESS` or `EGRESS`.
Boolean
getDisabled()
Denotes whether the firewall rule is disabled.
Boolean
getEnableLogging()
Deprecated in favor of enable in LogConfig.
BigInteger
getId()
[Output Only] The unique identifier for the resource.
String
getKind()
[Output Only] Type of the resource.
FirewallLogConfig
getLogConfig()
This field denotes the logging options for a particular firewall rule.
String
getName()
Name of the resource; provided by the client when the resource is created.
String
getNetwork()
URL of the network resource for this firewall rule.
Integer
getPriority()
Priority for this rule.
String
getSelfLink()
[Output Only] Server-defined URL for the resource.
List<String>
getSourceRanges()
If source ranges are specified, the firewall rule applies only to traffic that has a source IP
address in these ranges.
List<String>
getSourceServiceAccounts()
If source service accounts are specified, the firewall rules apply only to traffic originating
from an instance with a service account in this list.
List<String>
getSourceTags()
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.
List<String>
getTargetServiceAccounts()
A list of service accounts indicating sets of instances located in the network that may make
network connections as specified in allowed[].
List<String>
getTargetTags()
A list of tags that controls which instances the firewall rule applies to.
Firewall
set(String fieldName,
Object value)
Firewall
setAllowed(List<Firewall.Allowed> allowed)
The list of ALLOW rules specified by this firewall.
Firewall
setCreationTimestamp(String creationTimestamp)
[Output Only] Creation timestamp in RFC3339 text format.
Firewall
setDenied(List<Firewall.Denied> denied)
The list of DENY rules specified by this firewall.
Firewall
setDescription(String description)
An optional description of this resource.
Firewall
setDestinationRanges(List<String> destinationRanges)
If destination ranges are specified, the firewall rule applies only to traffic that has
destination IP address in these ranges.
Firewall
setDirection(String direction)
Direction of traffic to which this firewall applies, either `INGRESS` or `EGRESS`.
Firewall
setDisabled(Boolean disabled)
Denotes whether the firewall rule is disabled.
Firewall
setEnableLogging(Boolean enableLogging)
Deprecated in favor of enable in LogConfig.
Firewall
setId(BigInteger id)
[Output Only] The unique identifier for the resource.
Firewall
setKind(String kind)
[Output Only] Type of the resource.
Firewall
setLogConfig(FirewallLogConfig logConfig)
This field denotes the logging options for a particular firewall rule.
Firewall
setName(String name)
Name of the resource; provided by the client when the resource is created.
Firewall
setNetwork(String network)
URL of the network resource for this firewall rule.
Firewall
setPriority(Integer priority)
Priority for this rule.
Firewall
setSelfLink(String selfLink)
[Output Only] Server-defined URL for the resource.
Firewall
setSourceRanges(List<String> sourceRanges)
If source ranges are specified, the firewall rule applies only to traffic that has a source IP
address in these ranges.
Firewall
setSourceServiceAccounts(List<String> 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.
Firewall
setSourceTags(List<String> 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.
Firewall
setTargetServiceAccounts(List<String> targetServiceAccounts)
A list of service accounts indicating sets of instances located in the network that may make
network connections as specified in allowed[].
Firewall
setTargetTags(List<String> targetTags)
A list of tags that controls which instances the firewall rule applies to.
-
Methods inherited from class com.google.api.client.json.GenericJson
getFactory, setFactory, toPrettyString, toString
-
Methods inherited from class com.google.api.client.util.GenericData
entrySet, equals, get, getClassInfo, getUnknownKeys, hashCode, put, putAll, remove, setUnknownKeys
-
Methods inherited from class java.util.AbstractMap
clear, containsKey, containsValue, isEmpty, keySet, size, values
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
-
Method Detail
-
getAllowed
public List<Firewall.Allowed> getAllowed()
The list of ALLOW rules specified by this firewall. Each rule specifies a protocol and port-
range tuple that describes a permitted connection.
- Returns:
- value or
null
for none
-
setAllowed
public Firewall setAllowed(List<Firewall.Allowed> allowed)
The list of ALLOW rules specified by this firewall. Each rule specifies a protocol and port-
range tuple that describes a permitted connection.
- Parameters:
allowed
- allowed or null
for none
-
getCreationTimestamp
public String getCreationTimestamp()
[Output Only] Creation timestamp in RFC3339 text format.
- Returns:
- value or
null
for none
-
setCreationTimestamp
public Firewall setCreationTimestamp(String creationTimestamp)
[Output Only] Creation timestamp in RFC3339 text format.
- Parameters:
creationTimestamp
- creationTimestamp or null
for none
-
getDenied
public List<Firewall.Denied> getDenied()
The list of DENY rules specified by this firewall. Each rule specifies a protocol and port-
range tuple that describes a denied connection.
- Returns:
- value or
null
for none
-
setDenied
public Firewall setDenied(List<Firewall.Denied> denied)
The list of DENY rules specified by this firewall. Each rule specifies a protocol and port-
range tuple that describes a denied connection.
- Parameters:
denied
- denied or null
for none
-
getDescription
public String getDescription()
An optional description of this resource. Provide this field when you create the resource.
- Returns:
- value or
null
for none
-
setDescription
public Firewall setDescription(String description)
An optional description of this resource. Provide this field when you create the resource.
- Parameters:
description
- description or null
for none
-
getDestinationRanges
public List<String> getDestinationRanges()
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. Both
IPv4 and IPv6 are supported.
- Returns:
- value or
null
for none
-
setDestinationRanges
public Firewall setDestinationRanges(List<String> 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. Both
IPv4 and IPv6 are supported.
- Parameters:
destinationRanges
- destinationRanges or null
for none
-
getDirection
public String getDirection()
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.
- Returns:
- value or
null
for none
-
setDirection
public Firewall setDirection(String direction)
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.
- Parameters:
direction
- direction or null
for none
-
getDisabled
public Boolean getDisabled()
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.
- Returns:
- value or
null
for none
-
setDisabled
public Firewall setDisabled(Boolean disabled)
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.
- Parameters:
disabled
- disabled or null
for none
-
getEnableLogging
public Boolean getEnableLogging()
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.
- Returns:
- value or
null
for none
-
setEnableLogging
public Firewall setEnableLogging(Boolean enableLogging)
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.
- Parameters:
enableLogging
- enableLogging or null
for none
-
getId
public BigInteger getId()
[Output Only] The unique identifier for the resource. This identifier is defined by the server.
- Returns:
- value or
null
for none
-
setId
public Firewall setId(BigInteger id)
[Output Only] The unique identifier for the resource. This identifier is defined by the server.
- Parameters:
id
- id or null
for none
-
getKind
public String getKind()
[Output Only] Type of the resource. Always compute#firewall for firewall rules.
- Returns:
- value or
null
for none
-
setKind
public Firewall setKind(String kind)
[Output Only] Type of the resource. Always compute#firewall for firewall rules.
- Parameters:
kind
- kind or null
for none
-
getLogConfig
public FirewallLogConfig getLogConfig()
This field denotes the logging options for a particular firewall rule. If logging is enabled,
logs will be exported to Cloud Logging.
- Returns:
- value or
null
for none
-
setLogConfig
public Firewall setLogConfig(FirewallLogConfig logConfig)
This field denotes the logging options for a particular firewall rule. If logging is enabled,
logs will be exported to Cloud Logging.
- Parameters:
logConfig
- logConfig or null
for none
-
getName
public String getName()
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.
- Returns:
- value or
null
for none
-
setName
public Firewall setName(String name)
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.
- Parameters:
name
- name or null
for none
-
getNetwork
public String getNetwork()
URL of the network resource for this firewall rule. If not specified when creating a firewall
rule, the default network is used: global/networks/default 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: - https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network -
projects/myproject/global/networks/my-network - global/networks/default
- Returns:
- value or
null
for none
-
setNetwork
public Firewall setNetwork(String network)
URL of the network resource for this firewall rule. If not specified when creating a firewall
rule, the default network is used: global/networks/default 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: - https://www.googleapis.com/compute/v1/projects/myproject/global/networks/my-network -
projects/myproject/global/networks/my-network - global/networks/default
- Parameters:
network
- network or null
for none
-
getPriority
public Integer getPriority()
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`.
- Returns:
- value or
null
for none
-
setPriority
public Firewall setPriority(Integer priority)
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`.
- Parameters:
priority
- priority or null
for none
-
getSelfLink
public String getSelfLink()
[Output Only] Server-defined URL for the resource.
- Returns:
- value or
null
for none
-
setSelfLink
public Firewall setSelfLink(String selfLink)
[Output Only] Server-defined URL for the resource.
- Parameters:
selfLink
- selfLink or null
for none
-
getSourceRanges
public List<String> getSourceRanges()
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. Both IPv4 and IPv6 are supported.
- Returns:
- value or
null
for none
-
setSourceRanges
public Firewall setSourceRanges(List<String> 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. Both IPv4 and IPv6 are supported.
- Parameters:
sourceRanges
- sourceRanges or null
for none
-
getSourceServiceAccounts
public List<String> getSourceServiceAccounts()
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.
- Returns:
- value or
null
for none
-
setSourceServiceAccounts
public Firewall setSourceServiceAccounts(List<String> 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.
- Parameters:
sourceServiceAccounts
- sourceServiceAccounts or null
for none
-
getSourceTags
public List<String> getSourceTags()
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.
- Returns:
- value or
null
for none
-
setSourceTags
public Firewall setSourceTags(List<String> 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.
- Parameters:
sourceTags
- sourceTags or null
for none
-
getTargetServiceAccounts
public List<String> getTargetServiceAccounts()
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.
- Returns:
- value or
null
for none
-
setTargetServiceAccounts
public Firewall setTargetServiceAccounts(List<String> 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.
- Parameters:
targetServiceAccounts
- targetServiceAccounts or null
for none
-
getTargetTags
public List<String> getTargetTags()
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.
- Returns:
- value or
null
for none
-
setTargetTags
public Firewall setTargetTags(List<String> 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.
- Parameters:
targetTags
- targetTags or null
for none
-
set
public Firewall set(String fieldName,
Object value)
- Overrides:
set
in class GenericJson
-
clone
public Firewall clone()
- Overrides:
clone
in class GenericJson
Copyright © 2011–2022 Google. All rights reserved.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy