Data Transfer API
This API provides endpoints for managing and retrieving data transfer information within the network. It allows you to monitor bandwidth usage, transfer statistics, and other relevant network traffic metrics.
Endpoints
GET /net/api/data/bandwidth
Retrieves the current bandwidth usage across the network.
Parameters
| Name | Type | Description | Required |
|---|---|---|---|
interface |
string | The network interface to monitor (e.g., "eth0", "wlan0"). If omitted, returns aggregate bandwidth. | No |
start_time |
datetime | Start of the time range for statistics (ISO 8601 format). | No |
end_time |
datetime | End of the time range for statistics (ISO 8601 format). | No |
Example Request (Curl)
curl -X GET "https://api.example.com/net/api/data/bandwidth?interface=eth0&start_time=2023-10-27T10:00:00Z&end_time=2023-10-27T12:00:00Z"
Example Response (JSON)
{
"status": "success",
"data": {
"interface": "eth0",
"current_rx_mbps": 150.5,
"current_tx_mbps": 80.2,
"peak_rx_mbps": 180.0,
"peak_tx_mbps": 95.5,
"total_rx_bytes": 1234567890,
"total_tx_bytes": 987654321,
"time_range": {
"start": "2023-10-27T10:00:00Z",
"end": "2023-10-27T12:00:00Z"
}
}
}
GET /net/api/data/transfers
Retrieves a list of recent data transfer sessions.
Parameters
| Name | Type | Description | Required |
|---|---|---|---|
limit |
integer | Maximum number of transfer sessions to return. Defaults to 50. | No |
offset |
integer | Number of sessions to skip for pagination. Defaults to 0. | No |
protocol |
string | Filter by transfer protocol (e.g., "TCP", "UDP"). | No |
Example Request (Curl)
curl -X GET "https://api.example.com/net/api/data/transfers?limit=10&protocol=TCP"
Example Response (JSON)
{
"status": "success",
"data": [
{
"id": "transfer_abc123",
"source_ip": "192.168.1.100",
"destination_ip": "10.0.0.5",
"source_port": 54321,
"destination_port": 8080,
"protocol": "TCP",
"bytes_sent": 500000,
"bytes_received": 1000000,
"start_time": "2023-10-27T11:30:00Z",
"end_time": "2023-10-27T11:35:15Z"
},
{
"id": "transfer_def456",
"source_ip": "192.168.1.101",
"destination_ip": "8.8.8.8",
"source_port": 12345,
"destination_port": 53,
"protocol": "UDP",
"bytes_sent": 120,
"bytes_received": 120,
"start_time": "2023-10-27T11:32:00Z",
"end_time": "2023-10-27T11:32:01Z"
}
],
"pagination": {
"limit": 10,
"offset": 0,
"total": 150
}
}