Class: MistApi::UtilsPing
- Defined in:
- lib/mist_api/models/utils_ping.rb
Overview
UtilsPing Model.
Instance Attribute Summary collapse
-
#count ⇒ Integer
TODO: Write general description for this method.
-
#egress_interface ⇒ String
Interface through which packet needs to egress.
-
#host ⇒ String
can be ip, ipv6, hostname.
-
#node ⇒ HaClusterNodeEnum
only for HA.
-
#size ⇒ Integer
only for HA.
-
#use_ipv6 ⇒ TrueClass | FalseClass
applicable when host is hostname.
-
#vrf ⇒ String
VRF/Routing instance through which the packet needs to be sent.
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(host = nil, count = 10, egress_interface = SKIP, node = SKIP, size = 56, use_ipv6 = false, vrf = SKIP, additional_properties = nil) ⇒ UtilsPing
constructor
A new instance of UtilsPing.
-
#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(host = nil, count = 10, egress_interface = SKIP, node = SKIP, size = 56, use_ipv6 = false, vrf = SKIP, additional_properties = nil) ⇒ UtilsPing
Returns a new instance of UtilsPing.
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/mist_api/models/utils_ping.rb', line 70 def initialize(host = nil, count = 10, egress_interface = SKIP, node = SKIP, size = 56, use_ipv6 = false, vrf = SKIP, additional_properties = nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @count = count unless count == SKIP @egress_interface = egress_interface unless egress_interface == SKIP @host = host @node = node unless node == SKIP @size = size unless size == SKIP @use_ipv6 = use_ipv6 unless use_ipv6 == SKIP @vrf = vrf unless vrf == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#count ⇒ Integer
TODO: Write general description for this method
14 15 16 |
# File 'lib/mist_api/models/utils_ping.rb', line 14 def count @count end |
#egress_interface ⇒ String
Interface through which packet needs to egress
18 19 20 |
# File 'lib/mist_api/models/utils_ping.rb', line 18 def egress_interface @egress_interface end |
#host ⇒ String
can be ip, ipv6, hostname
22 23 24 |
# File 'lib/mist_api/models/utils_ping.rb', line 22 def host @host end |
#node ⇒ HaClusterNodeEnum
only for HA. enum: ‘node0`, `node1`
26 27 28 |
# File 'lib/mist_api/models/utils_ping.rb', line 26 def node @node end |
#size ⇒ Integer
only for HA. enum: ‘node0`, `node1`
30 31 32 |
# File 'lib/mist_api/models/utils_ping.rb', line 30 def size @size end |
#use_ipv6 ⇒ TrueClass | FalseClass
applicable when host is hostname
34 35 36 |
# File 'lib/mist_api/models/utils_ping.rb', line 34 def use_ipv6 @use_ipv6 end |
#vrf ⇒ String
VRF/Routing instance through which the packet needs to be sent
38 39 40 |
# File 'lib/mist_api/models/utils_ping.rb', line 38 def vrf @vrf end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/mist_api/models/utils_ping.rb', line 87 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. host = hash.key?('host') ? hash['host'] : nil count = hash['count'] ||= 10 egress_interface = hash.key?('egress_interface') ? hash['egress_interface'] : SKIP node = hash.key?('node') ? hash['node'] : SKIP size = hash['size'] ||= 56 use_ipv6 = hash['use_ipv6'] ||= false vrf = hash.key?('vrf') ? hash['vrf'] : SKIP # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. UtilsPing.new(host, count, egress_interface, node, size, use_ipv6, vrf, additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/mist_api/models/utils_ping.rb', line 41 def self.names @_hash = {} if @_hash.nil? @_hash['count'] = 'count' @_hash['egress_interface'] = 'egress_interface' @_hash['host'] = 'host' @_hash['node'] = 'node' @_hash['size'] = 'size' @_hash['use_ipv6'] = 'use_ipv6' @_hash['vrf'] = 'vrf' @_hash end |
.nullables ⇒ Object
An array for nullable fields
66 67 68 |
# File 'lib/mist_api/models/utils_ping.rb', line 66 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
54 55 56 57 58 59 60 61 62 63 |
# File 'lib/mist_api/models/utils_ping.rb', line 54 def self.optionals %w[ count egress_interface node size use_ipv6 vrf ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
127 128 129 130 131 132 133 |
# File 'lib/mist_api/models/utils_ping.rb', line 127 def inspect class_name = self.class.name.split('::').last "<#{class_name} count: #{@count.inspect}, egress_interface: #{@egress_interface.inspect},"\ " host: #{@host.inspect}, node: #{@node.inspect}, size: #{@size.inspect}, use_ipv6:"\ " #{@use_ipv6.inspect}, vrf: #{@vrf.inspect}, additional_properties:"\ " #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
119 120 121 122 123 124 |
# File 'lib/mist_api/models/utils_ping.rb', line 119 def to_s class_name = self.class.name.split('::').last "<#{class_name} count: #{@count}, egress_interface: #{@egress_interface}, host: #{@host},"\ " node: #{@node}, size: #{@size}, use_ipv6: #{@use_ipv6}, vrf: #{@vrf},"\ " additional_properties: #{@additional_properties}>" end |