Get the Node Usage Related Metrics
/console/admin/api/v2/dashboard/statistics/nodeRes
Request
- application/json
-
nodeID: string
Node ID of a specific peer, orderer, proxy, or console itself
Response
- application/json
200 Response
400 Response
Default Response
Examples
This endpoint is used to get the node usage related metrics such as CPU, memory, and disk usage percentages, reflecting the health metrics you can see on the console. The result is a JSON body which contains a series of usage records for the specified nodes.
If nodeID
is not specified, it returns this information for all nodes in the instance.
The following example shows how to generate the node metrics by submitting a GET request on the REST resource using cURL.
curl -X GET -u username:password -k "http://<rest_server_url>:port/console/admin/api/v2/dashboard/statistics/nodeRes?nodeID=<nodeID>"
For example,
curl -X GET -u myname@oracle.com:mypswd -k "http://server.oracle.com:10000/console/admin/api/v2/dashboard/statistics/nodeRes?nodeID=orderer0"
Example of the Response Body
The following example shows the contents of the response body in JSON format:
{ "data": [ { "nodeId": "orderer0", "nodeType": "orderer", "resUsage": { "cpu": 0.76, "memory": 0.656, "disk": 2.772 } } ] }
This is an example of the output for the node orderer0
. The resource usage disk : 2.772
means that orderer0
occupies 2.772% of total disk storage (/u01
). Note that this does not mean that there is 97.228% (100% - 2.772%) free space available for orderer0
; disk storage (/u01
) is shared by all the orderers and peers running on the VM.