Get the Number of User Transactions for Peer, Channel, or Network
get
/console/admin/api/v2/dashboard/statistics/userTrans
Get the number of user transactions for a peer or channel or the entire network. Note that you cannot query a node and the orderer in the same request.
Request
Supported Media Types
- application/json
Query Parameters
-
channel: string
Channel name
-
endTime: string
The end time of a time range in the format 'yyyyMMddhhmmss'
-
nodeID: string
Node ID of a specific peer. You cannot request this at the same time as the orderer.
-
orderer: string
The value is Y or N to indicate whether the metrics collected by orderer for whole network or the metrics for founder only needs to be returned. You cannot request this at the same time as a node.
-
startTime: string
The start time of a time range in the format 'yyyyMMddhhmmss'
Response
Supported Media Types
- application/json
200 Response
Response with a series of user transactions by restriction
400 Response
Invalid arguments
Default Response
Unexpected error
Examples
This endpoint is used to get the number of user transactions for peer or channel or the entire network. Parameters
nodeID
, channel
, and orderer
will impact its behavior. The result is a JSON file including the total number of user transactions for the specified scope in the specified time range.
- If a peer is specified using
nodeID
but notchannel
, it returns the total number of this peer on all channels. - If a channel is specified using
channel
but notnodeID
, it returns the total number of this channel on all peers. - If both
nodeID
andchannel
are specified, the result is applicable to only the specified peer on the specified channel. - If
orderer
is set toY
, and nonodeID
is specified, it returns the total number of transactions of the whole network including participant organizations. - Parameters
orderer
andpeer
can't be specified at the same time.
The following example shows how to generate the user transaction 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/userTrans?nodeID=<nodeID>&channel=<channel>&startTime=<yyyymmddhhmmss>&endTime=<yyyymmddhhmmss>"
For example,
curl -X GET -u myname@oracle.com:mypswd -k "http://server.oracle.com:10000/console/admin/api/v2/dashboard/userTrans?nodeID=peer1&channel=tfzch01&startTime=20210224030000&endTime=20210224050000"
Example of the Response Body
The following example shows the contents of the response body in JSON format:
{ "data": { "nodeId": "peer1", "userTrans": [ { "channelName": "tfzch01", "startTime": "Sun, 24 Feb 2021 03:00:00 GMT", "endTime": "Sun, 24 Feb 2021 05:00:00 GMT", "trans": 1 } ] } }