Class: MistApi::SynthetictestDevice
- Defined in:
- lib/mist_api/models/synthetictest_device.rb
Overview
SynthetictestDevice Model.
Instance Attribute Summary collapse
-
#host ⇒ String
If ‘type`==`lan_connectivity`.
-
#hostname ⇒ String
If ‘type`==`dns`.
-
#ip ⇒ String
If ‘type`==`arp`.
-
#password ⇒ String
If ‘type`==`radius`.
-
#ping_count ⇒ Integer
If ‘type`==`lan_connectivity`.
-
#ping_details ⇒ TrueClass | FalseClass
If ‘type`==`lan_connectivity`.
-
#ping_size ⇒ Integer
If ‘type`==`lan_connectivity`.
-
#port_id ⇒ String
If ‘type`==`speedtest`, required for ssr.
-
#protocol ⇒ SynthetictestDeviceProtocolEnum
if ‘type`==`lan_connectivity`.
-
#tenant ⇒ String
If ‘type`==`curl` or `type`==`lan_connectivity`.
-
#timeout ⇒ Integer
If ‘type`==`curl`.
-
#traceroute_udp_port ⇒ Integer
SRX only, traceroute udp port.
-
#type ⇒ SynthetictestTypeEnum
enum: ‘arp`, `curl`, `dhcp`, `dhcp6`, `dns`, `lan_connectivity`, `radius`, `speedtest`.
-
#url ⇒ String
If ‘type`==`curl`.
-
#username ⇒ String
If ‘type`==`radius`.
-
#vlan_id ⇒ Object
Required for AP.
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.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(type = nil, host = SKIP, hostname = SKIP, ip = SKIP, password = SKIP, ping_count = 10, ping_details = false, ping_size = 56, port_id = SKIP, protocol = SynthetictestDeviceProtocolEnum::ENUM_PINGTRACEROUTE, tenant = SKIP, timeout = 60, traceroute_udp_port = 33434, url = SKIP, username = SKIP, vlan_id = SKIP, additional_properties = nil) ⇒ SynthetictestDevice
constructor
A new instance of SynthetictestDevice.
-
#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(type = nil, host = SKIP, hostname = SKIP, ip = SKIP, password = SKIP, ping_count = 10, ping_details = false, ping_size = 56, port_id = SKIP, protocol = SynthetictestDeviceProtocolEnum::ENUM_PINGTRACEROUTE, tenant = SKIP, timeout = 60, traceroute_udp_port = 33434, url = SKIP, username = SKIP, vlan_id = SKIP, additional_properties = nil) ⇒ SynthetictestDevice
Returns a new instance of SynthetictestDevice.
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
# File 'lib/mist_api/models/synthetictest_device.rb', line 126 def initialize( type = nil, host = SKIP, hostname = SKIP, ip = SKIP, password = SKIP, ping_count = 10, ping_details = false, ping_size = 56, port_id = SKIP, protocol = SynthetictestDeviceProtocolEnum::ENUM_PINGTRACEROUTE, tenant = SKIP, timeout = 60, traceroute_udp_port = 33434, url = SKIP, username = SKIP, vlan_id = SKIP, additional_properties = nil ) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @host = host unless host == SKIP @hostname = hostname unless hostname == SKIP @ip = ip unless ip == SKIP @password = password unless password == SKIP @ping_count = ping_count unless ping_count == SKIP @ping_details = ping_details unless ping_details == SKIP @ping_size = ping_size unless ping_size == SKIP @port_id = port_id unless port_id == SKIP @protocol = protocol unless protocol == SKIP @tenant = tenant unless tenant == SKIP @timeout = timeout unless timeout == SKIP @traceroute_udp_port = traceroute_udp_port unless traceroute_udp_port == SKIP @type = type @url = url unless url == SKIP @username = username unless username == SKIP @vlan_id = vlan_id unless vlan_id == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#host ⇒ String
If ‘type`==`lan_connectivity`
14 15 16 |
# File 'lib/mist_api/models/synthetictest_device.rb', line 14 def host @host end |
#hostname ⇒ String
If ‘type`==`dns`
18 19 20 |
# File 'lib/mist_api/models/synthetictest_device.rb', line 18 def hostname @hostname end |
#ip ⇒ String
If ‘type`==`arp`
22 23 24 |
# File 'lib/mist_api/models/synthetictest_device.rb', line 22 def ip @ip end |
#password ⇒ String
If ‘type`==`radius`
26 27 28 |
# File 'lib/mist_api/models/synthetictest_device.rb', line 26 def password @password end |
#ping_count ⇒ Integer
If ‘type`==`lan_connectivity`
30 31 32 |
# File 'lib/mist_api/models/synthetictest_device.rb', line 30 def ping_count @ping_count end |
#ping_details ⇒ TrueClass | FalseClass
If ‘type`==`lan_connectivity`
34 35 36 |
# File 'lib/mist_api/models/synthetictest_device.rb', line 34 def ping_details @ping_details end |
#ping_size ⇒ Integer
If ‘type`==`lan_connectivity`
38 39 40 |
# File 'lib/mist_api/models/synthetictest_device.rb', line 38 def ping_size @ping_size end |
#port_id ⇒ String
If ‘type`==`speedtest`, required for ssr
42 43 44 |
# File 'lib/mist_api/models/synthetictest_device.rb', line 42 def port_id @port_id end |
#protocol ⇒ SynthetictestDeviceProtocolEnum
if ‘type`==`lan_connectivity`. enum: `ping`, `traceroute`, `ping+traceroute`
47 48 49 |
# File 'lib/mist_api/models/synthetictest_device.rb', line 47 def protocol @protocol end |
#tenant ⇒ String
If ‘type`==`curl` or `type`==`lan_connectivity`
51 52 53 |
# File 'lib/mist_api/models/synthetictest_device.rb', line 51 def tenant @tenant end |
#timeout ⇒ Integer
If ‘type`==`curl`
55 56 57 |
# File 'lib/mist_api/models/synthetictest_device.rb', line 55 def timeout @timeout end |
#traceroute_udp_port ⇒ Integer
SRX only, traceroute udp port
59 60 61 |
# File 'lib/mist_api/models/synthetictest_device.rb', line 59 def traceroute_udp_port @traceroute_udp_port end |
#type ⇒ SynthetictestTypeEnum
enum: ‘arp`, `curl`, `dhcp`, `dhcp6`, `dns`, `lan_connectivity`, `radius`, `speedtest`
64 65 66 |
# File 'lib/mist_api/models/synthetictest_device.rb', line 64 def type @type end |
#url ⇒ String
If ‘type`==`curl`
68 69 70 |
# File 'lib/mist_api/models/synthetictest_device.rb', line 68 def url @url end |
#username ⇒ String
If ‘type`==`radius`
72 73 74 |
# File 'lib/mist_api/models/synthetictest_device.rb', line 72 def username @username end |
#vlan_id ⇒ Object
Required for AP
76 77 78 |
# File 'lib/mist_api/models/synthetictest_device.rb', line 76 def vlan_id @vlan_id end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 |
# File 'lib/mist_api/models/synthetictest_device.rb', line 156 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. type = hash.key?('type') ? hash['type'] : nil host = hash.key?('host') ? hash['host'] : SKIP hostname = hash.key?('hostname') ? hash['hostname'] : SKIP ip = hash.key?('ip') ? hash['ip'] : SKIP password = hash.key?('password') ? hash['password'] : SKIP ping_count = hash['ping_count'] ||= 10 ping_details = hash['ping_details'] ||= false ping_size = hash['ping_size'] ||= 56 port_id = hash.key?('port_id') ? hash['port_id'] : SKIP protocol = hash['protocol'] ||= SynthetictestDeviceProtocolEnum::ENUM_PINGTRACEROUTE tenant = hash.key?('tenant') ? hash['tenant'] : SKIP timeout = hash['timeout'] ||= 60 traceroute_udp_port = hash['traceroute_udp_port'] ||= 33434 url = hash.key?('url') ? hash['url'] : SKIP username = hash.key?('username') ? hash['username'] : SKIP vlan_id = hash.key?('vlan_id') ? APIHelper.deserialize_union_type( UnionTypeLookUp.get(:SynthetictestDeviceVlanId), hash['vlan_id'] ) : 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. SynthetictestDevice.new(type, host, hostname, ip, password, ping_count, ping_details, ping_size, port_id, protocol, tenant, timeout, traceroute_udp_port, url, username, vlan_id, additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
# File 'lib/mist_api/models/synthetictest_device.rb', line 79 def self.names @_hash = {} if @_hash.nil? @_hash['host'] = 'host' @_hash['hostname'] = 'hostname' @_hash['ip'] = 'ip' @_hash['password'] = 'password' @_hash['ping_count'] = 'ping_count' @_hash['ping_details'] = 'ping_details' @_hash['ping_size'] = 'ping_size' @_hash['port_id'] = 'port_id' @_hash['protocol'] = 'protocol' @_hash['tenant'] = 'tenant' @_hash['timeout'] = 'timeout' @_hash['traceroute_udp_port'] = 'traceroute_udp_port' @_hash['type'] = 'type' @_hash['url'] = 'url' @_hash['username'] = 'username' @_hash['vlan_id'] = 'vlan_id' @_hash end |
.nullables ⇒ Object
An array for nullable fields
122 123 124 |
# File 'lib/mist_api/models/synthetictest_device.rb', line 122 def self.nullables [] end |
.optionals ⇒ Object
An array for optional fields
101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/mist_api/models/synthetictest_device.rb', line 101 def self.optionals %w[ host hostname ip password ping_count ping_details ping_size port_id protocol tenant timeout traceroute_udp_port url username vlan_id ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
209 210 211 212 213 214 215 216 217 218 219 |
# File 'lib/mist_api/models/synthetictest_device.rb', line 209 def self.validate(value) if value.instance_of? self return APIHelper.valid_type?(value.type, ->(val) { SynthetictestTypeEnum.validate(val) }) end return false unless value.instance_of? Hash APIHelper.valid_type?(value['type'], ->(val) { SynthetictestTypeEnum.validate(val) }) end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
232 233 234 235 236 237 238 239 240 241 |
# File 'lib/mist_api/models/synthetictest_device.rb', line 232 def inspect class_name = self.class.name.split('::').last "<#{class_name} host: #{@host.inspect}, hostname: #{@hostname.inspect}, ip: #{@ip.inspect},"\ " password: #{@password.inspect}, ping_count: #{@ping_count.inspect}, ping_details:"\ " #{@ping_details.inspect}, ping_size: #{@ping_size.inspect}, port_id: #{@port_id.inspect},"\ " protocol: #{@protocol.inspect}, tenant: #{@tenant.inspect}, timeout: #{@timeout.inspect},"\ " traceroute_udp_port: #{@traceroute_udp_port.inspect}, type: #{@type.inspect}, url:"\ " #{@url.inspect}, username: #{@username.inspect}, vlan_id: #{@vlan_id.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
222 223 224 225 226 227 228 229 |
# File 'lib/mist_api/models/synthetictest_device.rb', line 222 def to_s class_name = self.class.name.split('::').last "<#{class_name} host: #{@host}, hostname: #{@hostname}, ip: #{@ip}, password: #{@password},"\ " ping_count: #{@ping_count}, ping_details: #{@ping_details}, ping_size: #{@ping_size},"\ " port_id: #{@port_id}, protocol: #{@protocol}, tenant: #{@tenant}, timeout: #{@timeout},"\ " traceroute_udp_port: #{@traceroute_udp_port}, type: #{@type}, url: #{@url}, username:"\ " #{@username}, vlan_id: #{@vlan_id}, additional_properties: #{@additional_properties}>" end |