Class: MistApi::GatewayPortConfigIpConfig

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/mist_api/models/gateway_port_config_ip_config.rb

Overview

Junos IP Config

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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, gateway6 = SKIP, ip = SKIP, ip6 = SKIP, netmask = SKIP, netmask6 = SKIP, network = SKIP, poser_password = SKIP, pppoe_auth = GatewayWanPpoeAuthEnum::NONE, pppoe_username = SKIP, type = GatewayWanTypeEnum::DHCP, type6 = GatewayWanType6Enum::AUTOCONF) ⇒ GatewayPortConfigIpConfig

Returns a new instance of GatewayPortConfigIpConfig.



118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
# File 'lib/mist_api/models/gateway_port_config_ip_config.rb', line 118

def initialize(dns = SKIP, dns_suffix = SKIP, gateway = SKIP,
               gateway6 = SKIP, ip = SKIP, ip6 = SKIP, netmask = SKIP,
               netmask6 = SKIP, network = SKIP, poser_password = SKIP,
               pppoe_auth = GatewayWanPpoeAuthEnum::NONE,
               pppoe_username = SKIP, type = GatewayWanTypeEnum::DHCP,
               type6 = GatewayWanType6Enum::AUTOCONF)
  @dns = dns unless dns == SKIP
  @dns_suffix = dns_suffix unless dns_suffix == SKIP
  @gateway = gateway unless gateway == SKIP
  @gateway6 = gateway6 unless gateway6 == SKIP
  @ip = ip unless ip == SKIP
  @ip6 = ip6 unless ip6 == SKIP
  @netmask = netmask unless netmask == SKIP
  @netmask6 = netmask6 unless netmask6 == SKIP
  @network = network unless network == SKIP
  @poser_password = poser_password unless poser_password == SKIP
  @pppoe_auth = pppoe_auth unless pppoe_auth == SKIP
  @pppoe_username = pppoe_username unless pppoe_username == SKIP
  @type = type unless type == SKIP
  @type6 = type6 unless type6 == SKIP
end

Instance Attribute Details

#dnsArray[String]

Except for out-of_band interface (vme/em0/fxp0)

Returns:

  • (Array[String])


14
15
16
# File 'lib/mist_api/models/gateway_port_config_ip_config.rb', line 14

def dns
  @dns
end

#dns_suffixArray[String]

Except for out-of_band interface (vme/em0/fxp0)

Returns:

  • (Array[String])


18
19
20
# File 'lib/mist_api/models/gateway_port_config_ip_config.rb', line 18

def dns_suffix
  @dns_suffix
end

#gatewayString

Except for out-of_band interface (vme/em0/fxp0). Interface Default Gateway IP Address (i.e. “192.168.1.1”) or a Variable (i.e. “{myvar}”)

Returns:

  • (String)


23
24
25
# File 'lib/mist_api/models/gateway_port_config_ip_config.rb', line 23

def gateway
  @gateway
end

#gateway6String

Except for out-of_band interface (vme/em0/fxp0). Interface Default Gateway IPv6 Address (i.e. “2001:db8::1”) or a Variable (i.e. “{myvar}”)

Returns:

  • (String)


28
29
30
# File 'lib/mist_api/models/gateway_port_config_ip_config.rb', line 28

def gateway6
  @gateway6
end

#ipString

Interface IP Address (i.e. “192.168.1.8”) or a Variable (i.e. “{myvar}”)

Returns:

  • (String)


32
33
34
# File 'lib/mist_api/models/gateway_port_config_ip_config.rb', line 32

def ip
  @ip
end

#ip6String

Interface IPv6 Address (i.e. “2001:db8::123”) or a Variable (i.e. “{myvar}”)

Returns:

  • (String)


37
38
39
# File 'lib/mist_api/models/gateway_port_config_ip_config.rb', line 37

def ip6
  @ip6
end

#netmaskString

Used only if ‘subnet` is not specified in `networks`. Interface Netmask (i.e. “/24”) or a Variable (i.e. “{myvar}”)

Returns:

  • (String)


42
43
44
# File 'lib/mist_api/models/gateway_port_config_ip_config.rb', line 42

def netmask
  @netmask
end

#netmask6String

Used only if ‘subnet` is not specified in `networks`. Interface IPv6 Netmask (i.e. “/64”) or a Variable (i.e. “{myvar}”)

Returns:

  • (String)


47
48
49
# File 'lib/mist_api/models/gateway_port_config_ip_config.rb', line 47

def netmask6
  @netmask6
end

#networkString

Optional, the network to be used for mgmt

Returns:

  • (String)


51
52
53
# File 'lib/mist_api/models/gateway_port_config_ip_config.rb', line 51

def network
  @network
end

#poser_passwordString

If ‘type`==`pppoe`

Returns:

  • (String)


55
56
57
# File 'lib/mist_api/models/gateway_port_config_ip_config.rb', line 55

def poser_password
  @poser_password
end

#pppoe_authGatewayWanPpoeAuthEnum

if ‘type`==`pppoe`. enum: `chap`, `none`, `pap`



59
60
61
# File 'lib/mist_api/models/gateway_port_config_ip_config.rb', line 59

def pppoe_auth
  @pppoe_auth
end

#pppoe_usernameString

If ‘type`==`pppoe`

Returns:

  • (String)


63
64
65
# File 'lib/mist_api/models/gateway_port_config_ip_config.rb', line 63

def pppoe_username
  @pppoe_username
end

#typeGatewayWanTypeEnum

enum: ‘dhcp`, `pppoe`, `static`

Returns:



67
68
69
# File 'lib/mist_api/models/gateway_port_config_ip_config.rb', line 67

def type
  @type
end

#type6GatewayWanType6Enum

enum: ‘autoconf`, `dhcp`, `static`

Returns:



71
72
73
# File 'lib/mist_api/models/gateway_port_config_ip_config.rb', line 71

def type6
  @type6
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
# File 'lib/mist_api/models/gateway_port_config_ip_config.rb', line 141

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
  gateway6 = hash.key?('gateway6') ? hash['gateway6'] : SKIP
  ip = hash.key?('ip') ? hash['ip'] : SKIP
  ip6 = hash.key?('ip6') ? hash['ip6'] : SKIP
  netmask = hash.key?('netmask') ? hash['netmask'] : SKIP
  netmask6 = hash.key?('netmask6') ? hash['netmask6'] : SKIP
  network = hash.key?('network') ? hash['network'] : SKIP
  poser_password =
    hash.key?('poser_password') ? hash['poser_password'] : SKIP
  pppoe_auth = hash['pppoe_auth'] ||= GatewayWanPpoeAuthEnum::NONE
  pppoe_username =
    hash.key?('pppoe_username') ? hash['pppoe_username'] : SKIP
  type = hash['type'] ||= GatewayWanTypeEnum::DHCP
  type6 = hash['type6'] ||= GatewayWanType6Enum::AUTOCONF

  # Create object from extracted values.
  GatewayPortConfigIpConfig.new(dns,
                                dns_suffix,
                                gateway,
                                gateway6,
                                ip,
                                ip6,
                                netmask,
                                netmask6,
                                network,
                                poser_password,
                                pppoe_auth,
                                pppoe_username,
                                type,
                                type6)
end

.namesObject

A mapping from model property names to API property names.



74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/mist_api/models/gateway_port_config_ip_config.rb', line 74

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['dns'] = 'dns'
  @_hash['dns_suffix'] = 'dns_suffix'
  @_hash['gateway'] = 'gateway'
  @_hash['gateway6'] = 'gateway6'
  @_hash['ip'] = 'ip'
  @_hash['ip6'] = 'ip6'
  @_hash['netmask'] = 'netmask'
  @_hash['netmask6'] = 'netmask6'
  @_hash['network'] = 'network'
  @_hash['poser_password'] = 'poser_password'
  @_hash['pppoe_auth'] = 'pppoe_auth'
  @_hash['pppoe_username'] = 'pppoe_username'
  @_hash['type'] = 'type'
  @_hash['type6'] = 'type6'
  @_hash
end

.nullablesObject

An array for nullable fields



114
115
116
# File 'lib/mist_api/models/gateway_port_config_ip_config.rb', line 114

def self.nullables
  []
end

.optionalsObject

An array for optional fields



94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'lib/mist_api/models/gateway_port_config_ip_config.rb', line 94

def self.optionals
  %w[
    dns
    dns_suffix
    gateway
    gateway6
    ip
    ip6
    netmask
    netmask6
    network
    poser_password
    pppoe_auth
    pppoe_username
    type
    type6
  ]
end

.validate(value) ⇒ Object

Validates an instance of the object from a given value.

Parameters:



181
182
183
184
185
186
187
# File 'lib/mist_api/models/gateway_port_config_ip_config.rb', line 181

def self.validate(value)
  return true if value.instance_of? self

  return false unless value.instance_of? Hash

  true
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



199
200
201
202
203
204
205
206
207
# File 'lib/mist_api/models/gateway_port_config_ip_config.rb', line 199

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} dns: #{@dns.inspect}, dns_suffix: #{@dns_suffix.inspect}, gateway:"\
  " #{@gateway.inspect}, gateway6: #{@gateway6.inspect}, ip: #{@ip.inspect}, ip6:"\
  " #{@ip6.inspect}, netmask: #{@netmask.inspect}, netmask6: #{@netmask6.inspect}, network:"\
  " #{@network.inspect}, poser_password: #{@poser_password.inspect}, pppoe_auth:"\
  " #{@pppoe_auth.inspect}, pppoe_username: #{@pppoe_username.inspect}, type:"\
  " #{@type.inspect}, type6: #{@type6.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



190
191
192
193
194
195
196
# File 'lib/mist_api/models/gateway_port_config_ip_config.rb', line 190

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} dns: #{@dns}, dns_suffix: #{@dns_suffix}, gateway: #{@gateway}, gateway6:"\
  " #{@gateway6}, ip: #{@ip}, ip6: #{@ip6}, netmask: #{@netmask}, netmask6: #{@netmask6},"\
  " network: #{@network}, poser_password: #{@poser_password}, pppoe_auth: #{@pppoe_auth},"\
  " pppoe_username: #{@pppoe_username}, type: #{@type}, type6: #{@type6}>"
end