Get the Number of Endorsements

get

/console/admin/api/v2/dashboard/statistics/endorsements

Get the number of endorsements.

Request

Supported Media Types
Query Parameters
Back to Top

Response

Supported Media Types

200 Response

Response with a series of endorsements by restriction
Body ()
Root Schema : schema
Type: object
Show Source
Nested Schema : StatsEndorsements
Type: object
Show Source
Nested Schema : endorsements
Type: array
Show Source
Nested Schema : StatsTransInfo
Type: object
Show Source

400 Response

Invalid arguments
Body ()
Root Schema : 400errorModels
Type: object
Show Source
Example:
{
    "respMesg":"invalid argument"
}

Default Response

Unexpected error
Body ()
Root Schema : errorModel
Type: object
Show Source
Back to Top

Examples

This endpoint is used to get the number of endorsements for a peer or channel in a specified time range. Parameters nodeID and channel are used to set the scope of the query. The result is a JSON file including the total number of endorsements for the specified scope in the specified time range.
  • If a peer is specified using nodeID but not channel, it returns the total number of endorsements on this peer on all channels.
  • If a channel is specified using channel but not nodeID, it returns the total number of endorsements on this channel on all peers.
  • If both nodeID and channel are specified, the result is applicable to only the specified peer on the specified channel.

The following example shows how to generate the endorsement 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/endorsements?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/2/dashboard/endorsements?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",
    "endorsements": [
      {
        "channelName": "tfzch01",
        "startTime": "Sun, 24 Feb 2021 03:00:00 GMT",
        "endTime": "Sun, 24 Feb 2021 05:00:00 GMT",
        "trans": 1
      }
    ]
  }
}
Back to Top