openstack.network.v2.security_group_rule¶
The SecurityGroupRule Class¶
The SecurityGroupRule
class inherits from Resource
.
-
class
openstack.network.v2.security_group_rule.
SecurityGroupRule
(attrs=None, loaded=False)¶ Construct a Resource to interact with a service’s REST API.
The Resource class offers two class methods to construct resource objects, which are preferrable to entering through this initializer. See
Resource.new()
andResource.existing()
.Parameters: - attrs (dict) – The attributes to set when constructing this Resource.
- loaded (bool) –
True
if this Resource exists on the server,False
if it does not.
-
direction
= None¶ ingress
oregress
: The direction in which the security group rule is applied. For a compute instance, an ingress security group rule is applied to incoming ingress traffic for that instance. An egress rule is applied to traffic leaving the instance.
-
description
= None¶ The security group rule description.
-
ethertype
= None¶ Must be IPv4 or IPv6, and addresses represented in CIDR must match the ingress or egress rules.
-
port_range_max
= None¶ The maximum port number in the range that is matched by the security group rule. The port_range_min attribute constrains the port_range_max attribute. If the protocol is ICMP, this value must be an ICMP type.
-
port_range_min
= None¶ The minimum port number in the range that is matched by the security group rule. If the protocol is TCP or UDP, this value must be less than or equal to the value of the port_range_max attribute. If the protocol is ICMP, this value must be an ICMP type.
-
project_id
= None¶ The ID of the project this security group rule is associated with.
-
protocol
= None¶ The protocol that is matched by the security group rule. Valid values are
null
,tcp
,udp
, andicmp
.
-
remote_group_id
= None¶ The remote security group ID to be associated with this security group rule. You can specify either
remote_group_id
orremote_ip_prefix
in the request body.
-
remote_ip_prefix
= None¶ The remote IP prefix to be associated with this security group rule. You can specify either
remote_group_id
orremote_ip_prefix
in the request body. This attribute matches the specified IP prefix as the source IP address of the IP packet.
-
security_group_id
= None¶ The security group ID to associate with this security group rule.