7. API for spp_pcap¶
7.1. GET /v1/pcaps/{client_id}¶
Get the information of the spp_pcap
process.
- Normal response codes: 200
- Error response codes: 400, 404
7.1.2. Request example¶
$ curl -X GET -H 'application/json' \
http://127.0.0.1:7777/v1/pcaps/1
7.1.3. Response¶
Name | Type | Description |
---|---|---|
client-id | integer | client id. |
status | string | status of the process. “running” or “idle”. |
core | array | an array of core objects in the process. |
Core objects:
Name | Type | Description |
---|---|---|
core | integer | core id |
role | string | role of the task running on the core. “receive” or “write”. |
rx_port | array | an array of port object for caputure. This member exists if role is “recieve”. Note that there is only a port object in the array. |
filename | string | a path name of output file. This member exists if role is “write”. |
There is only a port object in the array.
Port object:
Name | Type | Description |
---|---|---|
port | string | port id. port id is the form {interface_type}:{interface_id}. |
7.1.4. Response example¶
{
"client-id": 1,
"status": "running",
"core": [
{
"core": 2,
"role": "receive",
"rx_port": [
{
"port": "phy:0"
}
]
},
{
"core": 3,
"role": "write",
"filename": "/tmp/spp_pcap.20181108110600.ring0.1.2.pcap"
}
]
}
7.1.5. Equivalent CLI command¶
spp > pcap {client_id}; status
7.2. PUT /v1/pcaps/{client_id}/capture¶
Start or Stop capturing.
- Normal response codes: 204
- Error response codes: 400, 404
7.2.3. Request example¶
$ curl -X PUT -H 'application/json' \
-d '{"action": "start"}' \
http://127.0.0.1:7777/v1/pcaps/1/capture
7.2.4. Response¶
There is no body content for the response of a successful PUT
request.
7.2.5. Equivalent CLI command¶
Action is start
.
spp > pcap {client_id}; start
Action is stop
.
spp > pcap {client_id}; stop
7.3. DELETE /v1/pcaps/{client_id}¶
Terminate spp_pcap
process.
- Normal response codes: 204
- Error response codes: 400, 404
7.3.2. Request example¶
$ curl -X DELETE -H 'application/json' \
http://127.0.0.1:7777/v1/pcaps/1
7.3.3. Response example¶
There is no body content for the response of a successful DELETE
request.
7.3.4. Equivalent CLI command¶
spp > pcap {client_id}; exit