Class: MistApi::JunosIpConfig
- Defined in:
- lib/mist_api/models/junos_ip_config.rb
Overview
Junos IP Config
Instance Attribute Summary collapse
-
#dns ⇒ Array[String]
TODO: Write general description for this method.
-
#dns_suffix ⇒ Array[String]
TODO: Write general description for this method.
-
#gateway ⇒ String
TODO: Write general description for this method.
-
#ip ⇒ String
TODO: Write general description for this method.
-
#netmask ⇒ String
Used only if ‘subnet` is not specified in `networks`.
-
#network ⇒ String
Network where this mgmt IP reside, this will be used as default network for outbound-ssh, dns, ntp, dns, tacplus, radius, syslog, snmp.
-
#type ⇒ IpTypeEnum
enum: ‘dhcp`, `static`.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(dns = SKIP, dns_suffix = SKIP, gateway = SKIP, ip = SKIP, netmask = SKIP, network = SKIP, type = IpTypeEnum::DHCP) ⇒ JunosIpConfig
constructor
A new instance of JunosIpConfig.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(dns = SKIP, dns_suffix = SKIP, gateway = SKIP, ip = SKIP, netmask = SKIP, network = SKIP, type = IpTypeEnum::DHCP) ⇒ JunosIpConfig
Returns a new instance of JunosIpConfig.
72 73 74 75 76 77 78 79 80 81 |
# File 'lib/mist_api/models/junos_ip_config.rb', line 72 def initialize(dns = SKIP, dns_suffix = SKIP, gateway = SKIP, ip = SKIP, netmask = SKIP, network = SKIP, type = IpTypeEnum::DHCP) @dns = dns unless dns == SKIP @dns_suffix = dns_suffix unless dns_suffix == SKIP @gateway = gateway unless gateway == SKIP @ip = ip unless ip == SKIP @netmask = netmask unless netmask == SKIP @network = network unless network == SKIP @type = type unless type == SKIP end |
Instance Attribute Details
#dns ⇒ Array[String]
TODO: Write general description for this method
14 15 16 |
# File 'lib/mist_api/models/junos_ip_config.rb', line 14 def dns @dns end |
#dns_suffix ⇒ Array[String]
TODO: Write general description for this method
18 19 20 |
# File 'lib/mist_api/models/junos_ip_config.rb', line 18 def dns_suffix @dns_suffix end |
#gateway ⇒ String
TODO: Write general description for this method
22 23 24 |
# File 'lib/mist_api/models/junos_ip_config.rb', line 22 def gateway @gateway end |
#ip ⇒ String
TODO: Write general description for this method
26 27 28 |
# File 'lib/mist_api/models/junos_ip_config.rb', line 26 def ip @ip end |
#netmask ⇒ String
Used only if ‘subnet` is not specified in `networks`
30 31 32 |
# File 'lib/mist_api/models/junos_ip_config.rb', line 30 def netmask @netmask end |
#network ⇒ String
Network where this mgmt IP reside, this will be used as default network for outbound-ssh, dns, ntp, dns, tacplus, radius, syslog, snmp
35 36 37 |
# File 'lib/mist_api/models/junos_ip_config.rb', line 35 def network @network end |
#type ⇒ IpTypeEnum
enum: ‘dhcp`, `static`
39 40 41 |
# File 'lib/mist_api/models/junos_ip_config.rb', line 39 def type @type end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/mist_api/models/junos_ip_config.rb', line 84 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. dns = hash.key?('dns') ? hash['dns'] : SKIP dns_suffix = hash.key?('dns_suffix') ? hash['dns_suffix'] : SKIP gateway = hash.key?('gateway') ? hash['gateway'] : SKIP ip = hash.key?('ip') ? hash['ip'] : SKIP netmask = hash.key?('netmask') ? hash['netmask'] : SKIP network = hash.key?('network') ? hash['network'] : SKIP type = hash['type'] ||= IpTypeEnum::DHCP # Create object from extracted values. JunosIpConfig.new(dns, dns_suffix, gateway, ip, netmask, network, type) end |
.names ⇒ Object
A mapping from model property names to API property names.
42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/mist_api/models/junos_ip_config.rb', line 42 def self.names @_hash = {} if @_hash.nil? @_hash['dns'] = 'dns' @_hash['dns_suffix'] = 'dns_suffix' @_hash['gateway'] = 'gateway' @_hash['ip'] = 'ip' @_hash['netmask'] = 'netmask' @_hash['network'] = 'network' @_hash['type'] = 'type' @_hash end |
.nullables ⇒ Object
An array for nullable fields
68 69 70 |
# File 'lib/mist_api/models/junos_ip_config.rb', line 68 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/mist_api/models/junos_ip_config.rb', line 55 def self.optionals %w[ dns dns_suffix gateway ip netmask network type ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
114 115 116 117 118 119 |
# File 'lib/mist_api/models/junos_ip_config.rb', line 114 def inspect class_name = self.class.name.split('::').last "<#{class_name} dns: #{@dns.inspect}, dns_suffix: #{@dns_suffix.inspect}, gateway:"\ " #{@gateway.inspect}, ip: #{@ip.inspect}, netmask: #{@netmask.inspect}, network:"\ " #{@network.inspect}, type: #{@type.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
107 108 109 110 111 |
# File 'lib/mist_api/models/junos_ip_config.rb', line 107 def to_s class_name = self.class.name.split('::').last "<#{class_name} dns: #{@dns}, dns_suffix: #{@dns_suffix}, gateway: #{@gateway}, ip: #{@ip},"\ " netmask: #{@netmask}, network: #{@network}, type: #{@type}>" end |