Memory and CPU Usage Report

Resource Summary for Memory and CPU

 

HTTP Method
Resource
URL (BaseURL)
GET
POST
PUT
DELETE

Memory

/api/v1/global/memory/processes

Y

N

N

N

CPU

/api/v1/global/cpu

Y

N

N

N

Memory Usage

The table below lists the fields and descriptions in the show processes memory command output.

History

 

Release
Modification

IOS XE 3.10

Introduced for the CSR1000V platform

IOS XE 3.14

Introduced for ASR1001-X and ASR1002-X platforms

Properties

 

Property
Type
Description

total-used

number

Total amount of used memory

total-free

number

Total amount of free memory

processes

array

List of processes

process-id

number

(sub-property of processes)

Process ID

process-name

string

(sub-property of processes)

Process name

memory-used

number

(sub-property of processes)

Bytes of memory allocated by the process

JSON Representation of Memory

{
"kind": "object#memory-processes",
"total-used": {number},
"total-free": {number},
"processes": [
{
"process-id" : {number},
"process-name" : "{string}",
"memory-used" : {number}
}
]
}

Retrieve the Memory Usage

Resource URI

 

Verb
URI

GET

/api/v1/global/memory/processes

Example

JSON Request

GET /api/v1/global/memory/processes
 
Accept: application/json

JSON Response

200 OK
 
Content-Type: application/json
 
{
"kind": "object#memory-process",
"total-used": "6294296",
"total-free": "832",
"processes": [
{
"process-id": 0,
"process-name": "Init",
"memory-used": 340949904
},
{
"process-id": 2,
"process-name": "Load Meter",
"memory-used": 448
},
]
}

CPU Utilization

The REST API provides the total CPU consumption.

History

 

Release
Modification

IOS XE 3.10

Introduced for the CSR1000V platform

IOS XE 3.14

Introduced for ASR1001-X and ASR1002-X platforms

Properties

 

Property
Type
Required for POST and PUT
Description

kind

string

Mandatory

Must be “object#cpu”

last-five-secs-utilization

string

Mandatory

The percent of CPU utilization for the last five seconds

last-one-mn-utilization

string

Mandatory

The percent of CPU utilization for the last minute

last-five-mns-utilization

string

Mandatory

The percent of CPU utilization for the last five minutes

JSON Representation

{
"kind": "object#cpu",
"last-5-secs-utilization": "{string}",
"last-1-mn-utilization": "{string}",
"last-5-mns-utilization": "{string}"
}
 

Retrieve the CPU Utilization

Resource URI

 

Verb
URI

GET

/api/v1/global/memory/cpu

Example

JSON Request

GET /api/v1/global/cpu
 
Accept: application/json

JSON Response

200 OK
 
Content-Type: application/json
 
{
"kind": "object#cpu",
"last-5-secs-utilization": "8%",
"last-1-mn-utilization": "6%",
"last-5-mns-utilization": "5%"
}