EMI.STAT.GET

September 18th, 2009 Leave a comment Go to comments

This method retrieves the statistical information from the system. There are two types of statistics requests: long-running and short running. Long-running requests will initially return the task id that could be used to later retrieve the status or the final result of the request. If it is the initial request then the “task” parameter is omitted.

NOTE! Parameter “key” value can contain wildcard “*”.

The returned information will contain a key-value pair for each key in question.

Request Parameters

Name Type Mandatory Description
session JSON String yes Session ID
key JSON String or JSON Array of Strings yes Specify EMI.STAT key to be cleaned
task JSON Int no Identification number for the long-running task.
refresh JSON Boolean no Specify if the statistics data is to be refreshed. Default: “FALSE”
rec JSON Boolean no Specify if the keys are traversed recursively. If set to “TRUE”, all sub keys of the specified key will be cleaned as well. Default: “FALSE”.

Response

Name Type Description
task JSON Int Task ID for request (omitted if the task is complete)
data JSON Array Result array (omitted if task is still in progress)

Result Array is JSON Array which contains JSON Objects. The contained JSON Object(s) Structure:

{
  data:
  [
    {
      "key": _JSON String_,
      "value": _JSON String_
    }, ...
  ]
}

Error Codes

Reference Description
EOK No errors (contains warnings)
EBADPARAM Error in parameters
ENOTFOUND The specified EMI.STAT key not found
ELATER Request is not complete yet
EGENERAL Some other error
ESESSION Session with the given ID is not found

Examples

1st Request to EMI-RPC Server:

{
 "EMI-RPC": "1.0",
 "id": 1,
 "method": "emi.stat.get",
 "params":
	{
	"session":"",
	"key":"mod.a.*.c",
	"refresh":TRUE,
	"rec":TRUE
	}
}

Response from EMI-RPC Server:

{
 "EMI-RPC": "1.0",
 "id": 1,
 "result": {"task":34502}
}

2nd Request to EMI-RPC Server:

{
 "EMI-RPC": "1.0",
 "id": 2,
 "method": "emi.stat.get",
 "params":
	{	"session":"", "task":34502 }
}

Response from EMI-RPC Server:

{
 "EMI-RPC": "1.0",
 "id": 2,
 "error": {"code":"600" , "message":"In progress..." }
}

3rd Request to EMI-RPC Server:

{
 "EMI-RPC": "1.0",
 "id": 3,
 "method": "emi.stat.get",
 "params":
	{	"session":"", "task":34502 }
}

Response from EMI-RPC Server:

{
 "EMI-RPC": "1.0",
 "id": 3,
 "result":{ "data": [ {"key": " mod.a.1.c.d ", "value" : 1 } ,{"key": " mod.a.2.c.d " ,"value": 2 } ] }
}
  1. No comments yet.
  1. No trackbacks yet.