2. Independent of Process Type

2.1. GET /v1/processes

Show SPP processes connected with spp-ctl.

2.1.1. Response

An array of dict of processes in which process type and secondary ID are defined. So, primary process does not have this ID.

Table 2.1 Response code of getting processes.
Value Description
200 Normal response code.
Table 2.2 Response params of getting processes.
Name Type Description
type string Process type such as primary, nfv or so.
client-id integer Secondary ID, so primary does not have it.

2.1.2. Examples

2.1.2.1. Request

$ curl -X GET -H 'application/json' \
http://127.0.0.1:7777/v1/processes

2.1.2.2. Response

[
  {
    "type": "primary"
  },
  {
    "type": "vf",
    "client-id": 1
  },
  {
    "type": "nfv",
    "client-id": 2
  }
]

2.2. GET /v1/cpu_layout

Show CPU layout of a server on which spp-ctl running.

2.2.1. Response

An array of CPU socket params which consists of each of physical core ID and logical cores if hyper threading is enabled.

Table 2.3 Response code of CPU layout.
Value Description
200 Normal response code.
Table 2.4 Response params of getting CPU layout.
Name Type Description
cores array Set of cores on a socket.
core_id integer ID of physical core.
lcores array Set of IDs of logical cores.
socket_id integer Socket ID.

2.2.2. Examples

2.2.2.1. Request

$ curl -X GET -H 'application/json' \
http://127.0.0.1:7777/v1/cpu_layout

2.2.2.2. Response

[
  {
    "cores": [
      {
        "core_id": 1,
        "lcores": [2, 3]
      },
      {
        "core_id": 0,
        "lcores": [0, 1]
      },
      {
        "core_id": 2,
        "lcores": [4, 5]
      }
      {
        "core_id": 3,
        "lcores": [6, 7]
      }
    ],
    "socket_id": 0
  }
]

2.3. GET /v1/cpu_usage

Show CPU usage of a server on which spp-ctl running.

2.3.1. Response

An array of CPU usage of each of SPP processes. This usage consists of two params, master lcore and lcore set including master and slaves.

Table 2.5 Response code of CPU layout.
Value Description
200 Normal response code.
Table 2.6 Response params of getting CPU layout.
Name Type Description
proc-type string Proc type such as primary, nfv or so.
master-lcore integer Lcore ID of master.
lcores array All of Lcore IDs including master and slaves.

2.3.2. Examples

2.3.2.1. Request

$ curl -X GET -H 'application/json' \
http://127.0.0.1:7777/v1/cpu_usage

2.3.2.2. Response

[
  {
    "proc-type": "primary",
    "master-lcore": 0,
    "lcores": [
      0
    ]
  },
  {
    "proc-type": "nfv",
    "client-id": 2,
    "master-lcore": 1,
    "lcores": [1, 2]
  },
  {
    "proc-type": "vf",
    "client-id": 3,
    "master-lcore": 1,
    "lcores": [1, 3, 4, 5]
  }
]