Class: MistApi::StatsMxedgeIpStat

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

Overview

IP stats

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(ip = SKIP, ip6 = SKIP, ips = SKIP, macs = SKIP, netmask = SKIP, netmask6 = SKIP) ⇒ StatsMxedgeIpStat

Returns a new instance of StatsMxedgeIpStat.



65
66
67
68
69
70
71
72
73
# File 'lib/mist_api/models/stats_mxedge_ip_stat.rb', line 65

def initialize(ip = SKIP, ip6 = SKIP, ips = SKIP, macs = SKIP,
               netmask = SKIP, netmask6 = SKIP)
  @ip = ip unless ip == SKIP
  @ip6 = ip6 unless ip6 == SKIP
  @ips = ips unless ips == SKIP
  @macs = macs unless macs == SKIP
  @netmask = netmask unless netmask == SKIP
  @netmask6 = netmask6 unless netmask6 == SKIP
end

Instance Attribute Details

#ipString

TODO: Write general description for this method

Returns:

  • (String)


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

def ip
  @ip
end

#ip6String

TODO: Write general description for this method

Returns:

  • (String)


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

def ip6
  @ip6
end

#ipsHash[String, String]

Property key is the interface name. IPs for each net interface

Returns:

  • (Hash[String, String])


22
23
24
# File 'lib/mist_api/models/stats_mxedge_ip_stat.rb', line 22

def ips
  @ips
end

#macsHash[String, String]

Property key is the interface name. MAC for each net interface

Returns:

  • (Hash[String, String])


26
27
28
# File 'lib/mist_api/models/stats_mxedge_ip_stat.rb', line 26

def macs
  @macs
end

#netmaskString

Property key is the interface name. MAC for each net interface

Returns:

  • (String)


30
31
32
# File 'lib/mist_api/models/stats_mxedge_ip_stat.rb', line 30

def netmask
  @netmask
end

#netmask6String

Property key is the interface name. MAC for each net interface

Returns:

  • (String)


34
35
36
# File 'lib/mist_api/models/stats_mxedge_ip_stat.rb', line 34

def netmask6
  @netmask6
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/mist_api/models/stats_mxedge_ip_stat.rb', line 76

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  ip = hash.key?('ip') ? hash['ip'] : SKIP
  ip6 = hash.key?('ip6') ? hash['ip6'] : SKIP
  ips = hash.key?('ips') ? hash['ips'] : SKIP
  macs = hash.key?('macs') ? hash['macs'] : SKIP
  netmask = hash.key?('netmask') ? hash['netmask'] : SKIP
  netmask6 = hash.key?('netmask6') ? hash['netmask6'] : SKIP

  # Create object from extracted values.
  StatsMxedgeIpStat.new(ip,
                        ip6,
                        ips,
                        macs,
                        netmask,
                        netmask6)
end

.namesObject

A mapping from model property names to API property names.



37
38
39
40
41
42
43
44
45
46
# File 'lib/mist_api/models/stats_mxedge_ip_stat.rb', line 37

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['ip'] = 'ip'
  @_hash['ip6'] = 'ip6'
  @_hash['ips'] = 'ips'
  @_hash['macs'] = 'macs'
  @_hash['netmask'] = 'netmask'
  @_hash['netmask6'] = 'netmask6'
  @_hash
end

.nullablesObject

An array for nullable fields



61
62
63
# File 'lib/mist_api/models/stats_mxedge_ip_stat.rb', line 61

def self.nullables
  []
end

.optionalsObject

An array for optional fields



49
50
51
52
53
54
55
56
57
58
# File 'lib/mist_api/models/stats_mxedge_ip_stat.rb', line 49

def self.optionals
  %w[
    ip
    ip6
    ips
    macs
    netmask
    netmask6
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



104
105
106
107
108
# File 'lib/mist_api/models/stats_mxedge_ip_stat.rb', line 104

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} ip: #{@ip.inspect}, ip6: #{@ip6.inspect}, ips: #{@ips.inspect}, macs:"\
  " #{@macs.inspect}, netmask: #{@netmask.inspect}, netmask6: #{@netmask6.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



97
98
99
100
101
# File 'lib/mist_api/models/stats_mxedge_ip_stat.rb', line 97

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} ip: #{@ip}, ip6: #{@ip6}, ips: #{@ips}, macs: #{@macs}, netmask:"\
  " #{@netmask}, netmask6: #{@netmask6}>"
end