3. API for spp_primary¶
3.1. GET /v1/primary/status¶
Show statistical information.
- Normal response codes: 200
3.1.1. Request example¶
$ curl -X GET -H 'application/json' \
http://127.0.0.1:7777/v1/primary/status
3.1.2. Response¶
Name | Type | Description |
---|---|---|
lcores | array | Array of lcores spp_primary is using. |
phy_ports | array | Array of statistics of physical ports. |
ring_ports | array | Array of statistics of ring ports. |
Physical port object.
Name | Type | Description |
---|---|---|
id | integer | Port ID of the physical port. |
rx | integer | The total number of received packets. |
tx | integer | The total number of transferred packets. |
tx_drop | integer | The total number of dropped packets of transferred. |
eth | string | MAC address of the port. |
Ring port object.
Name | Type | Description |
---|---|---|
id | integer | Port ID of the ring port. |
rx | integer | The total number of received packets. |
rx_drop | integer | The total number of dropped packets of received. |
tx | integer | The total number of transferred packets. |
tx_drop | integer | The total number of dropped packets of transferred. |
3.1.3. Response example¶
{
"lcores": [
0
],
"phy_ports": [
{
"id": 0,
"rx": 0,
"tx": 0,
"tx_drop": 0,
"eth": "56:48:4f:53:54:00"
},
{
"id": 1,
"rx": 0,
"tx": 0,
"tx_drop": 0,
"eth": "56:48:4f:53:54:01"
}
],
"ring_ports": [
{
"id": 0,
"rx": 0,
"rx_drop": 0,
"tx": 0,
"tx_drop": 0
},
{
"id": 1,
"rx": 0,
"rx_drop": 0,
"tx": 0,
"tx_drop": 0
},
{
"id": 2,
"rx": 0,
"rx_drop": 0,
"tx": 0,
"tx_drop": 0
}
]
}
3.2. DELETE /v1/primary/status¶
Clear statistical information.
- Normal response codes: 204
3.2.1. Request example¶
$ curl -X DELETE -H 'application/json' \
http://127.0.0.1:7777/v1/primary/status
3.2.2. Response¶
There is no body content for the response of a successful DELETE
request.
3.3. DELETE /v1/primary¶
Terminate primary process.
- Normal response codes: 204
3.3.1. Request example¶
$ curl -X DELETE -H 'application/json' \
http://127.0.0.1:7777/v1/primary
3.3.2. Response¶
There is no body content for the response of a successful DELETE
request.
3.4. PUT /v1/primary/launch¶
Launch a secondary process.
- Normal response codes: 204
- Error response codes: 400, 404
3.4.1. Request (path)¶
There is no params in this API.
3.4.2. Request (body)¶
There are four params for launching secondary process. eal
object
contains a set of EAL options, and app
contains options of teh process.
Name | Type | Description |
---|---|---|
proc_name | string | Process name such as spp_nfv or spp_vf . |
client_id | integer | Secondary ID for the process. |
eal | object | Hash obj of DPDK’s EAL options. |
app | object | Hash obj of options of secondary process. |
eal
object is a hash of EAL options and its values. All of EAL options
are referred in
EAL parameters
in DPDK’s
Getting Started Guide for Linux.
app
object is a hash of options of secondary process, and you can refer
options of each of processes in
How to Use
section.
3.4.3. Request example¶
Launch spp_nfv
with secondary ID 1 and lcores 1,2
.
$ curl -X PUT -H 'application/json' \
-d "{'proc_name': 'spp_nfv', 'client_id': '1', \
'eal': {'-m': '512', '-l': '1,2', '--proc-type': 'secondary'}, \
'app': {'-s': '192.168.11.59:6666', '-n': '1'}}"
http://127.0.0.1:7777/v1/primary/launch
Launch spp_vf
with secondary ID 2 and lcores 1,4-7
.
$ curl -X PUT -H 'application/json' \
-d "{'proc_name': 'spp_vf', 'client_id': '2', \
'eal': {'-m': '512', '-l': '1,4-7', '--proc-type': 'secondary'}, \
'app': {'-s': '192.168.11.59:6666', '--client-id': '2'}}"
http://127.0.0.1:7777/v1/primary/launch
3.4.4. Response¶
There is no body content for the response of a successful PUT
request.
3.4.5. Equivalent CLI command¶
proc_type
is nfv
, vf
or mirror
or so.
eal_opts
and app_opts
are the same as launching from command line.
pri; launch {proc_type} {sec_id} {eal_opts} -- {app_opts}