Manage Profishark interfaces
/interfaces
GET
Response:
[
{
"pretty_mac": "aabbccddeeff",
"interface":
{
"name": "IOTA-10G",
"mac": "aa:bb:cc:dd:ee:ff",
"device_type": 17,
"capture_enabled": true,
"physical_state":"idle"
}
}
]
pretty_mac
is a special format of MAC address, which is used in any other request in this API; see const.html for more informationdevice_type
is a numerical value, standing for the type of the devicephysical_state
== error
, all other requests except for /firmware/update
are forbidden/interfaces/{PRETTY_MAC}
GET
response:
{
"device_type": 17,
"link_up_port_a": true,
"link_up_port_b": false,
"available_firmware_versions":
[
{
"sw_version": "0.2.3",
"hw_version": "2.2.7"
}
],
"capture_enabled": true,
"physical_state":
{
"state": "idle",
"comment": "",
"last_error_time": 47345243,
"last_error": "could not enable capture"
}
}
physical_state.state == 'idle' && capture_enabled == false
physical_state.state
:
/interfaces/{PRETTY_MAC}/reset
POST
message
/interfaces/{PRETTY_MAC}/capture
POST
capture_status
object json { "capture_enabled": true }
message
+ new capture_status
object/interfaces/{PRETTY_MAC}/capture/toggle
POST
message
+ capture_status
object/interfaces/{PRETTY_MAC}/configuration
GET
response:
{
"transmit_crc_errors": true,
"keep_crc32": true,
"disable_port_a": true,
"disable_port_b": true,
"packet_slicing_bytes": 50,
"inline_mode": true,
"loopback": true,
"timestamps_in_packets": true,
"synchronized_timestamps": true,
"autonegotiation_port_a": true,
"autonegotiation_port_b": false,
"firmware_mode": "1g"
}
null
is to be passed if value is not present):
inline_mode
loopback
firmware_mode
autonegotiation_port_a
autonegotiation_port_b
packet_slicing_bytes
== 0, it means, that slicing feature is disabledinline_mode
may only be changed if capabilities.span_mode == true
loopback
may only be changed if capabilities.loopback == true
autonegotiation_port_a
or autonegotiation_port_b
may only be changed if capabilities.autoneg_10g_1g == true
and configuration.firmware_mode == 1g
firmware_mode
:
capabilities.multiple_hw == true
/interfaces/{PRETTY_MAC}/configuration
PUT
configuration
objectmessage
+ new configuration
objectport control
/interfaces/{PRETTY_MAC}/portcontrol
GET
response:
{
"port_control_a":
{
"gigabit_ethernet": true,
"fast_ethernet_fd": true,
"fast_ethernet_hd": true,
"ethernet_fd": true,
"ethernet_hd": true,
"autonegotiation": false,
"symmetric_pause": true,
"asymmetric_pause": true,
"prefer_master": true,
"force_preferred_role": true
},
"port_control_b":
{
"gigabit_ethernet": false,
"fast_ethernet_fd": true,
"fast_ethernet_hd": true,
"ethernet_fd": true,
"ethernet_hd": true,
"autonegotiation": false,
"symmetric_pause": true,
"asymmetric_pause": true,
"prefer_master": true,
"force_preferred_role": true
}
}
autonegotiation
is false
, one and only one of the following shall be true
:
fast_ethernet_fd
fast_ethernet_hd
ethernet_fd
ethernet_hd
autonegotiation
is false
, gigabit_ethernet
shall never be true
configuration.inline_mode
is true
, port_control_b
settings are ignoredavailable only if capabilities.port_control == true
/interfaces/{PRETTY_MAC}/portcontrol
PUT
portcontrol
objectmessage
+ new portcontrol
objectconfiguration
capabilities.port_control == true
/interfaces/{PRETTY_MAC}/portsinfo
GET
response:
[
{
"label": "link_speed",
"type": "general_status",
"value_a": null,
"value_b": "10Gbps HDX"
},
...
]
label
:
Down, 10Gbps_FDX, 10Gbps_HDX, 1Gbps_FDX, 1Gbps_HDX, 100Mbps_FDX, 100Mbps_HDX, 10Mbps_FDX, 10Mbps_HDX
idle_error_count
can be null
; it means that it should be reported as N/A
type
:
available only if capabilities.port_control == true
/interfaces/{PRETTY_MAC}/capabilities
GET
response:
{
"basic": true,
"dual_ports": true,
"span_mode": true,
"gps": true,
"update": true,
"poe": true,
"sfp": true,
"filtering": true,
"statistics_v1": true,
"statistics_v2": true,
"port_control": true,
"loopback": true,
"phy1": true,
"phy2": true,
"pcap_ng": true,
"slicing_length": true,
"phy3": true,
"multiple_hw": true,
"capture_full_frames": true,
"ntp_disciplined_timestamp": true,
"packet_type_filter": false,
"pps_resolution_5ns": true,
"pps_resolution_8ns": true,
"autoneg_10g_1g": true
}
/interfaces/{PRETTY_MAC}/sfp
GET
response:
[
{
"label": "link_up",
"type": "general_information",
"value_a": true,
"value_b": false
},
...
]
label
with their types:
type
:
link_up
is false
on the port, it means there will be no SFP information for that port; the full default object will still be sent as a responseavailable only if capabilities.sfp == true
/interfaces/{PRETTY_MAC}/packet_type_filters
GET
response:
{
"ipv4": true,
"ipv6": true,
"arp": true,
"tcp": true,
"udp": true,
"icmp": true,
"igmp": true,
"https": false,
"http": true,
"ftp": true,
"dns": true,
"smtp": true,
"pop3": true,
"dhcp": true,
"ssh": false,
"sip": true,
"smb": true,
"tcp_fin": true,
"tcp_syn": true,
"tcp_rst": true,
"tcp_psh": false,
"tcp_ack": true,
"zero_window": true,
"quic": true,
"l2_other": true,
"l4_other": false
}
available only if capabilities.packet_type_filter == true
/interfaces/{PRETTY_MAC}/packet_type_filters
PUT
packet_type_filters
objectmessage
+ new packet_type_filter
objectcapabilities.packet_type_filter == true
/interfaces/{PRETTY_MAC}/timing
GET
response:
{
"deviation": 524280.0,
"external_pps_detected": true,
"gps_pps_detected": false,
"gps_sync": false,
"pps_output": true,
"time_source": "system_pps"
}
time_source
:
available only if capabilities.gps == true
/interfaces/{PRETTY_MAC}/timing
PUT
timing
object with some restrictions:
pps_output
and time_source
are ignoredtime_source
may not be set to the value other
message
+ new timing
objectconfiguration
capabilities.gps == true
/interfaces/{PRETTY_MAC}/statistics
GET
response:
{
"error_code": 4,
"sw_dropped_packets": 8,
"hw_dropped_packets": 8,
"cache_used_bytes": 15,
"maximum_cache_bytes": 16,
"written_bytes": 23,
"written_files": 42,
"timestamp_ms": 47398745629,
"1g":
{
"link_up_ms": 123456,
"link_down_ms": 7890,
"port_a":
{
"less_than_64_packets": 1,
"between_64_1518_packets": 2,
"more_than_1518_packets": 3,
"collisions": 4,
"crc_error_packets": 5,
"jabber_packets": 6,
"total_bytes": 7,
"total_valid_packets": 8,
"total_invalid_packets": 9,
"hw_dropped_packets": 10
},
"port_b":
{
"less_than_64_packets": 1,
"between_64_1518_packets": 2,
"more_than_1518_packets": 3,
"collisions": 4,
"crc_error_packets": 5,
"jabber_packets": 6,
"total_bytes": 7,
"total_valid_packets": 8,
"total_invalid_packets": 9,
"hw_dropped_packets": 10
}
},
"10g": null
}
1g
or 10g
field can be set at one time; the other will be null
explicitly/interfaces/{PRETTY_MAC}/statistics
DELETE
message
/interfaces/{PRETTY_MAC}/firmware
GET
response:
{
"cmd_utility_v": "1.17",
"profishark_api_v": "2.3.26.0",
"driver_v": "1.9.34.0",
"sw_firmware_v": "0.2.3.46",
"hw_firmware_v": "0319"
}
/interfaces/{PRETTY_MAC}/firmware/update
GET
response:
[
{
"sw_version": "0.2.3",
"hw_version": "2.2.7"
}
]
/interfaces/{PRETTY_MAC}/firmware/update
POST
versions
object defined upwardsmessage
+ versions
objectstate.physical_state == "idle" && general_state.state == "idle"
, see General state