Class: OracleBMC::Core::Models::IngressSecurityRule
- Inherits:
-
Object
- Object
- OracleBMC::Core::Models::IngressSecurityRule
- Defined in:
- lib/oraclebmc/core/models/ingress_security_rule.rb
Instance Attribute Summary collapse
-
#icmp_options ⇒ OracleBMC::Core::Models::IcmpOptions
Optional and valid only for ICMP.
-
#is_stateless ⇒ BOOLEAN
A stateless rule allows traffic in one direction.
-
#protocol ⇒ String
The transport protocol.
-
#source ⇒ String
The source CIDR block for the ingress rule.
-
#tcp_options ⇒ OracleBMC::Core::Models::TcpOptions
Optional and valid only for TCP.
-
#udp_options ⇒ OracleBMC::Core::Models::UdpOptions
Optional and valid only for UDP.
Instance Method Summary collapse
-
#==(other_object) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other_object) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ IngressSecurityRule
constructor
Initializes the object.
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
Constructor Details
#initialize(attributes = {}) ⇒ IngressSecurityRule
Initializes the object
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
# File 'lib/oraclebmc/core/models/ingress_security_rule.rb', line 57 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v} if attributes[:'icmpOptions'] self. = attributes[:'icmpOptions'] end if attributes[:'isStateless'] self.is_stateless = attributes[:'isStateless'] end if attributes[:'protocol'] self.protocol = attributes[:'protocol'] end if attributes[:'source'] self.source = attributes[:'source'] end if attributes[:'tcpOptions'] self. = attributes[:'tcpOptions'] end if attributes[:'udpOptions'] self. = attributes[:'udpOptions'] end end |
Instance Attribute Details
#icmp_options ⇒ OracleBMC::Core::Models::IcmpOptions
Optional and valid only for ICMP. Use to specify a particular ICMP type and code as defined in [ICMP Parameters](www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml). If you specify ICMP as the protocol but omit this object, then all ICMP types and codes are allowed. If you do provide this object, the type is required and the code is optional. To enable MTU negotiation for ingress internet traffic, make sure to allow type 3 ("Destination Unreachable") code 4 ("Fragmentation Needed and Don’t Fragment was Set"). If you need to specify multiple codes for a single type, create a separate security list rule for each.
17 18 19 |
# File 'lib/oraclebmc/core/models/ingress_security_rule.rb', line 17 def @icmp_options end |
#is_stateless ⇒ BOOLEAN
A stateless rule allows traffic in one direction. Remember to add a corresponding stateless rule in the other direction if you need to support bidirectional traffic. For example, if ingress traffic allows TCP destination port 80, there should be an egress rule to allow TCP source port 80. Defaults to false, which means the rule is stateful and a corresponding rule is not necessary for bidirectional traffic.
26 27 28 |
# File 'lib/oraclebmc/core/models/ingress_security_rule.rb', line 26 def is_stateless @is_stateless end |
#protocol ⇒ String
The transport protocol. Specify either ‘all` or an IPv4 protocol number as defined in [Protocol Numbers](www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml). Options are supported only for ICMP ("1"), TCP ("6"), and UDP ("17").
34 35 36 |
# File 'lib/oraclebmc/core/models/ingress_security_rule.rb', line 34 def protocol @protocol end |
#source ⇒ String
The source CIDR block for the ingress rule. This is the range of IP addresses that a packet coming into the instance can come from.
40 41 42 |
# File 'lib/oraclebmc/core/models/ingress_security_rule.rb', line 40 def source @source end |
#tcp_options ⇒ OracleBMC::Core::Models::TcpOptions
Optional and valid only for TCP. Use to specify particular destination ports for TCP rules. If you specify TCP as the protocol but omit this object, then all destination ports are allowed.
46 47 48 |
# File 'lib/oraclebmc/core/models/ingress_security_rule.rb', line 46 def @tcp_options end |
#udp_options ⇒ OracleBMC::Core::Models::UdpOptions
Optional and valid only for UDP. Use to specify particular destination ports for UDP rules. If you specify UDP as the protocol but omit this object, then all destination ports are allowed.
52 53 54 |
# File 'lib/oraclebmc/core/models/ingress_security_rule.rb', line 52 def @udp_options end |
Instance Method Details
#==(other_object) ⇒ Object
Checks equality by comparing each attribute.
92 93 94 95 96 97 98 99 100 101 |
# File 'lib/oraclebmc/core/models/ingress_security_rule.rb', line 92 def ==(other_object) return true if self.equal?(other_object) self.class == other_object.class && == other_object. && is_stateless == other_object.is_stateless && protocol == other_object.protocol && source == other_object.source && == other_object. && == other_object. end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
# File 'lib/oraclebmc/core/models/ingress_security_rule.rb', line 118 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /^Array<(.*)>/i # check to ensure the input is an array given that the the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| OracleBMC::Internal::Util.convert_to_type($1, v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", OracleBMC::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(other_object) ⇒ Boolean
105 106 107 |
# File 'lib/oraclebmc/core/models/ingress_security_rule.rb', line 105 def eql?(other_object) self == other_object end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
111 112 113 |
# File 'lib/oraclebmc/core/models/ingress_security_rule.rb', line 111 def hash [, is_stateless, protocol, source, , ].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
143 144 145 146 147 148 149 150 151 |
# File 'lib/oraclebmc/core/models/ingress_security_rule.rb', line 143 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
137 138 139 |
# File 'lib/oraclebmc/core/models/ingress_security_rule.rb', line 137 def to_s to_hash.to_s end |