Class: MistApi::CaptureScan
- Defined in:
- lib/mist_api/models/capture_scan.rb
Overview
Initiate a Scan Radio Packet Capture
Instance Attribute Summary collapse
-
#ap_mac ⇒ String
Filter by ap_mac.
-
#aps ⇒ Hash[String, CaptureScanAps]
Dictionary key is AP mac and value is a dictionary which contains key “band”, “bandwidth”, “channel” and “tcpdump_expression”.
-
#band ⇒ CaptureScanBandEnum
Only Single value allowed, default value gets applied when user provides wrong values.
-
#bandwidth ⇒ Dot11BandwidthEnum
channel width for the band.enum: ‘0`(disabled, response only), `20`, `40`, `80` (only applicable for band_5 and band_6), `160` (only for band_6).
-
#channel ⇒ Integer
Specify the channel value where scan PCAP has to be started, default value gets applied when user provides wrong values.
-
#client_mac ⇒ String
Filter by client mac.
-
#duration ⇒ Integer
Duration of the capture, in seconds.
-
#format ⇒ CaptureScanFormatEnum
enum: ‘pcap`, `stream`.
-
#max_pkt_len ⇒ Integer
enum: ‘pcap`, `stream`.
-
#num_packets ⇒ Integer
number of packets to capture, 0 for unlimited, default is 1024, maximum is 10000.
-
#tcpdump_expression ⇒ String
tcpdump expression, port specific if specified under ports dict, otherwise applicable across ports if specified at top level of payload.
-
#type ⇒ String
readonly
enum: ‘scan`.
-
#width ⇒ String
Specify the bandwidth value with respect to the channel.
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(ap_mac = SKIP, aps = SKIP, band = CaptureScanBandEnum::ENUM_5, bandwidth = SKIP, channel = 1, client_mac = SKIP, duration = 600, format = CaptureScanFormatEnum::PCAP, max_pkt_len = 512, num_packets = 1024, tcpdump_expression = SKIP, width = SKIP) ⇒ CaptureScan
constructor
A new instance of CaptureScan.
-
#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(ap_mac = SKIP, aps = SKIP, band = CaptureScanBandEnum::ENUM_5, bandwidth = SKIP, channel = 1, client_mac = SKIP, duration = 600, format = CaptureScanFormatEnum::PCAP, max_pkt_len = 512, num_packets = 1024, tcpdump_expression = SKIP, width = SKIP) ⇒ CaptureScan
Returns a new instance of CaptureScan.
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 |
# File 'lib/mist_api/models/capture_scan.rb', line 122 def initialize(ap_mac = SKIP, aps = SKIP, band = CaptureScanBandEnum::ENUM_5, bandwidth = SKIP, channel = 1, client_mac = SKIP, duration = 600, format = CaptureScanFormatEnum::PCAP, max_pkt_len = 512, num_packets = 1024, tcpdump_expression = SKIP, width = SKIP) @ap_mac = ap_mac unless ap_mac == SKIP @aps = aps unless aps == SKIP @band = band unless band == SKIP @bandwidth = bandwidth unless bandwidth == SKIP @channel = channel unless channel == SKIP @client_mac = client_mac unless client_mac == SKIP @duration = duration unless duration == SKIP @format = format unless format == SKIP @max_pkt_len = max_pkt_len unless max_pkt_len == SKIP @num_packets = num_packets unless num_packets == SKIP @tcpdump_expression = tcpdump_expression unless tcpdump_expression == SKIP @type = 'scan' @width = width unless width == SKIP end |
Instance Attribute Details
#ap_mac ⇒ String
Filter by ap_mac
14 15 16 |
# File 'lib/mist_api/models/capture_scan.rb', line 14 def ap_mac @ap_mac end |
#aps ⇒ Hash[String, CaptureScanAps]
Dictionary key is AP mac and value is a dictionary which contains key “band”, “bandwidth”, “channel” and “tcpdump_expression”. In case keys are missed we will take parent value if parent values are not set we will use default value
21 22 23 |
# File 'lib/mist_api/models/capture_scan.rb', line 21 def aps @aps end |
#band ⇒ CaptureScanBandEnum
Only Single value allowed, default value gets applied when user provides wrong values. enum: ‘24`, `5`, `6`
26 27 28 |
# File 'lib/mist_api/models/capture_scan.rb', line 26 def band @band end |
#bandwidth ⇒ Dot11BandwidthEnum
channel width for the band.enum: ‘0`(disabled, response only), `20`, `40`, `80` (only applicable for band_5 and band_6), `160` (only for band_6)
31 32 33 |
# File 'lib/mist_api/models/capture_scan.rb', line 31 def bandwidth @bandwidth end |
#channel ⇒ Integer
Specify the channel value where scan PCAP has to be started, default value gets applied when user provides wrong values
36 37 38 |
# File 'lib/mist_api/models/capture_scan.rb', line 36 def channel @channel end |
#client_mac ⇒ String
Filter by client mac
40 41 42 |
# File 'lib/mist_api/models/capture_scan.rb', line 40 def client_mac @client_mac end |
#duration ⇒ Integer
Duration of the capture, in seconds
44 45 46 |
# File 'lib/mist_api/models/capture_scan.rb', line 44 def duration @duration end |
#format ⇒ CaptureScanFormatEnum
enum: ‘pcap`, `stream`
48 49 50 |
# File 'lib/mist_api/models/capture_scan.rb', line 48 def format @format end |
#max_pkt_len ⇒ Integer
enum: ‘pcap`, `stream`
52 53 54 |
# File 'lib/mist_api/models/capture_scan.rb', line 52 def max_pkt_len @max_pkt_len end |
#num_packets ⇒ Integer
number of packets to capture, 0 for unlimited, default is 1024, maximum is 10000
57 58 59 |
# File 'lib/mist_api/models/capture_scan.rb', line 57 def num_packets @num_packets end |
#tcpdump_expression ⇒ String
tcpdump expression, port specific if specified under ports dict, otherwise applicable across ports if specified at top level of payload. Port specific value overrides top level value when both exist.
63 64 65 |
# File 'lib/mist_api/models/capture_scan.rb', line 63 def tcpdump_expression @tcpdump_expression end |
#type ⇒ String (readonly)
enum: ‘scan`
67 68 69 |
# File 'lib/mist_api/models/capture_scan.rb', line 67 def type @type end |
#width ⇒ String
Specify the bandwidth value with respect to the channel.
71 72 73 |
# File 'lib/mist_api/models/capture_scan.rb', line 71 def width @width end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 |
# File 'lib/mist_api/models/capture_scan.rb', line 143 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. ap_mac = hash.key?('ap_mac') ? hash['ap_mac'] : SKIP aps = CaptureScanAps.from_hash(hash['aps']) if hash['aps'] aps = SKIP unless hash.key?('aps') band = hash['band'] ||= CaptureScanBandEnum::ENUM_5 bandwidth = hash.key?('bandwidth') ? hash['bandwidth'] : SKIP channel = hash['channel'] ||= 1 client_mac = hash.key?('client_mac') ? hash['client_mac'] : SKIP duration = hash['duration'] ||= 600 format = hash['format'] ||= CaptureScanFormatEnum::PCAP max_pkt_len = hash['max_pkt_len'] ||= 512 num_packets = hash['num_packets'] ||= 1024 tcpdump_expression = hash.key?('tcpdump_expression') ? hash['tcpdump_expression'] : SKIP width = hash.key?('width') ? hash['width'] : SKIP # Create object from extracted values. CaptureScan.new(ap_mac, aps, band, bandwidth, channel, client_mac, duration, format, max_pkt_len, num_packets, tcpdump_expression, width) end |
.names ⇒ Object
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 |
# File 'lib/mist_api/models/capture_scan.rb', line 74 def self.names @_hash = {} if @_hash.nil? @_hash['ap_mac'] = 'ap_mac' @_hash['aps'] = 'aps' @_hash['band'] = 'band' @_hash['bandwidth'] = 'bandwidth' @_hash['channel'] = 'channel' @_hash['client_mac'] = 'client_mac' @_hash['duration'] = 'duration' @_hash['format'] = 'format' @_hash['max_pkt_len'] = 'max_pkt_len' @_hash['num_packets'] = 'num_packets' @_hash['tcpdump_expression'] = 'tcpdump_expression' @_hash['type'] = 'type' @_hash['width'] = 'width' @_hash end |
.nullables ⇒ Object
An array for nullable fields
111 112 113 114 115 116 117 118 119 120 |
# File 'lib/mist_api/models/capture_scan.rb', line 111 def self.nullables %w[ ap_mac band client_mac duration max_pkt_len num_packets ] end |
.optionals ⇒ Object
An array for optional fields
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/mist_api/models/capture_scan.rb', line 93 def self.optionals %w[ ap_mac aps band bandwidth channel client_mac duration format max_pkt_len num_packets tcpdump_expression width ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
188 189 190 191 192 193 194 195 196 |
# File 'lib/mist_api/models/capture_scan.rb', line 188 def inspect class_name = self.class.name.split('::').last "<#{class_name} ap_mac: #{@ap_mac.inspect}, aps: #{@aps.inspect}, band: #{@band.inspect},"\ " bandwidth: #{@bandwidth.inspect}, channel: #{@channel.inspect}, client_mac:"\ " #{@client_mac.inspect}, duration: #{@duration.inspect}, format: #{@format.inspect},"\ " max_pkt_len: #{@max_pkt_len.inspect}, num_packets: #{@num_packets.inspect},"\ " tcpdump_expression: #{@tcpdump_expression.inspect}, type: #{@type.inspect}, width:"\ " #{@width.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
179 180 181 182 183 184 185 |
# File 'lib/mist_api/models/capture_scan.rb', line 179 def to_s class_name = self.class.name.split('::').last "<#{class_name} ap_mac: #{@ap_mac}, aps: #{@aps}, band: #{@band}, bandwidth: #{@bandwidth},"\ " channel: #{@channel}, client_mac: #{@client_mac}, duration: #{@duration}, format:"\ " #{@format}, max_pkt_len: #{@max_pkt_len}, num_packets: #{@num_packets},"\ " tcpdump_expression: #{@tcpdump_expression}, type: #{@type}, width: #{@width}>" end |