Class: OCI::Core::Models::DhcpDnsOption
- Inherits:
-
DhcpOption
- Object
- DhcpOption
- OCI::Core::Models::DhcpDnsOption
- Defined in:
- lib/oci/core/models/dhcp_dns_option.rb
Overview
DHCP option for specifying how DNS (hostname resolution) is handled in the subnets in the VCN. For more information, see [DNS in Your Virtual Cloud Network](docs.cloud.oracle.com/Content/Network/Concepts/dns.htm).
Constant Summary collapse
- SERVER_TYPE_ENUM =
[ SERVER_TYPE_VCN_LOCAL = 'VcnLocal'.freeze, SERVER_TYPE_VCN_LOCAL_PLUS_INTERNET = 'VcnLocalPlusInternet'.freeze, SERVER_TYPE_CUSTOM_DNS_SERVER = 'CustomDnsServer'.freeze, SERVER_TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze ].freeze
Instance Attribute Summary collapse
-
#custom_dns_servers ⇒ Array<String>
If you set ‘serverType` to `CustomDnsServer`, specify the IP address of at least one DNS server of your choice (three maximum).
-
#server_type ⇒ String
[Required] * VcnLocal: Reserved for future use.
Attributes inherited from DhcpOption
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(other) ⇒ Object
Checks equality by comparing each attribute.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(other) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ DhcpDnsOption
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.
Methods inherited from DhcpOption
Constructor Details
#initialize(attributes = {}) ⇒ DhcpDnsOption
Initializes the object
76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/oci/core/models/dhcp_dns_option.rb', line 76 def initialize(attributes = {}) return unless attributes.is_a?(Hash) attributes['type'] = 'DomainNameServer' super(attributes) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } self.custom_dns_servers = attributes[:'customDnsServers'] if attributes[:'customDnsServers'] raise 'You cannot provide both :customDnsServers and :custom_dns_servers' if attributes.key?(:'customDnsServers') && attributes.key?(:'custom_dns_servers') self.custom_dns_servers = attributes[:'custom_dns_servers'] if attributes[:'custom_dns_servers'] self.server_type = attributes[:'serverType'] if attributes[:'serverType'] raise 'You cannot provide both :serverType and :server_type' if attributes.key?(:'serverType') && attributes.key?(:'server_type') self.server_type = attributes[:'server_type'] if attributes[:'server_type'] end |
Instance Attribute Details
#custom_dns_servers ⇒ Array<String>
If you set ‘serverType` to `CustomDnsServer`, specify the IP address of at least one DNS server of your choice (three maximum).
25 26 27 |
# File 'lib/oci/core/models/dhcp_dns_option.rb', line 25 def custom_dns_servers @custom_dns_servers end |
#server_type ⇒ String
[Required] * VcnLocal: Reserved for future use.
-
VcnLocalPlusInternet: Also referred to as "Internet and VCN Resolver".
Instances can resolve internet hostnames (no internet gateway is required), and can resolve hostnames of instances in the VCN. This is the default value in the default set of DHCP options in the VCN. For the Internet and VCN Resolver to work across the VCN, there must also be a DNS label set for the VCN, a DNS label set for each subnet, and a hostname for each instance. The Internet and VCN Resolver also enables reverse DNS lookup, which lets you determine the hostname corresponding to the private IP address. For more information, see [DNS in Your Virtual Cloud Network](docs.cloud.oracle.com/Content/Network/Concepts/dns.htm).
-
CustomDnsServer: Instances use a DNS server of your choice (three
maximum).
44 45 46 |
# File 'lib/oci/core/models/dhcp_dns_option.rb', line 44 def server_type @server_type end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
47 48 49 50 51 52 53 54 55 |
# File 'lib/oci/core/models/dhcp_dns_option.rb', line 47 def self.attribute_map { # rubocop:disable Style/SymbolLiteral 'type': :'type', 'custom_dns_servers': :'customDnsServers', 'server_type': :'serverType' # rubocop:enable Style/SymbolLiteral } end |
.swagger_types ⇒ Object
Attribute type mapping.
58 59 60 61 62 63 64 65 66 |
# File 'lib/oci/core/models/dhcp_dns_option.rb', line 58 def self.swagger_types { # rubocop:disable Style/SymbolLiteral 'type': :'String', 'custom_dns_servers': :'Array<String>', 'server_type': :'String' # rubocop:enable Style/SymbolLiteral } end |
Instance Method Details
#==(other) ⇒ Object
Checks equality by comparing each attribute.
119 120 121 122 123 124 125 126 |
# File 'lib/oci/core/models/dhcp_dns_option.rb', line 119 def ==(other) return true if equal?(other) self.class == other.class && type == other.type && custom_dns_servers == other.custom_dns_servers && server_type == other.server_type end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 |
# File 'lib/oci/core/models/dhcp_dns_option.rb', line 151 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) public_method("#{key}=").call( attributes[self.class.attribute_map[key]] .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) } ) end elsif !attributes[self.class.attribute_map[key]].nil? public_method("#{key}=").call( OCI::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) ⇒ Boolean
131 132 133 |
# File 'lib/oci/core/models/dhcp_dns_option.rb', line 131 def eql?(other) self == other end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
140 141 142 |
# File 'lib/oci/core/models/dhcp_dns_option.rb', line 140 def hash [type, custom_dns_servers, server_type].hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
184 185 186 187 188 189 190 191 192 193 |
# File 'lib/oci/core/models/dhcp_dns_option.rb', line 184 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = public_method(attr).call next if value.nil? && !instance_variable_defined?("@#{attr}") hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
178 179 180 |
# File 'lib/oci/core/models/dhcp_dns_option.rb', line 178 def to_s to_hash.to_s end |