Help Center/ Blockchain Service/ API Reference/ APIs (Enhanced Hyperledger Fabric)/ BCS Monitoring/ Querying Entity Monitoring Details of a BCS Service
Updated on 2023-04-26 GMT+08:00

Querying Entity Monitoring Details of a BCS Service

Function

This API is used to query the monitoring details of entities of a specified BCS service.

URI

POST /v2/{project_id}/blockchains/{blockchain_id}/entity/instance/metric/list

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID obtained from IAM. Generally, a project ID contains 32 characters.

blockchain_id

Yes

String

BCS service ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. You can obtain the token by calling the IAM API used to obtain a user token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

type

Yes

String

Entity type. [Options: org: baas-agent, orderer, and peer plugin: add-on] org is used by default.

entity_name

Yes

String

Names of the entities (baas-agent, orderer, and peer), which can be obtained in the Blockchain Organizations area on the service details page.

instance_name

Yes

String

Instance names. If the BCS service is deployed in a CCE cluster, the instance names are the workload (pod) name of each node. If the BCS service is deployed in an IEF cluster, go to the IEF console, choose Edge Applications > Containerized Applications to query the workload instance names.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

metrics

Array of MetricItemResultAPI objects

Request result.

Table 5 MetricItemResultAPI

Parameter

Type

Description

metric

MetricDemision object

Operation record ID.

dataPoints

Array of MetricDataPoints objects

Basic information of the monitoring data.

Table 6 MetricDemision

Parameter

Type

Description

namespace

String

Namespace.

metricName

String

Metric name.

dimensions

Array of Dimension objects

Dimension list.

Table 7 Dimension

Parameter

Type

Description

name

String

Dimension name.

value

String

Dimension value.

Table 8 MetricDataPoints

Parameter

Type

Description

timestamp

Long

Timestamp.

unit

String

Metric unit.

statistics

Array of StatisticValue objects

Statistical method.

Table 9 StatisticValue

Parameter

Type

Description

statistic

String

Statistical method.

value

Double

Statistics.

Status code: 400

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 8

Maximum: 36

error_msg

String

Error message.

Minimum: 2

Maximum: 512

Status code: 401

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 8

Maximum: 36

error_msg

String

Error message.

Minimum: 2

Maximum: 512

Status code: 403

Table 12 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 8

Maximum: 36

error_msg

String

Error message.

Minimum: 2

Maximum: 512

Status code: 404

Table 13 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 8

Maximum: 36

error_msg

String

Error message.

Minimum: 2

Maximum: 512

Status code: 500

Table 14 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

Minimum: 8

Maximum: 36

error_msg

String

Error message.

Minimum: 2

Maximum: 512

Example Requests

{
  "type" : "org",
  "entity_name" : "baas-agent",
  "instance_name" : "baas-agent-868946786c-sswcn"
}

Example Responses

Status code: 200

Ok

{
  "metrics" : [ {
    "metric" : {
      "namespace" : "abc",
      "metricName" : "def",
      "dimensions" : [ {
        "name" : "ghi",
        "value" : "lmn"
      } ]
    },
    "dataPoints" : [ {
      "timestamp" : "1467892800000",
      "unit" : "Percent",
      "statistics" : [ {
        "statistic" : "maximum",
        "value" : "23"
      } ]
    } ]
  } ]
}

Status code: 400

Bad Request

{
  "error_code" : "BCS.4004021",
  "error_msg" : "GetOrgInstanceMetricDetail operation does not support IEF cluster type"
}

Status code: 401

Unauthorized

{
  "error_code" : "BCS.4010401",
  "error_msg" : "Incorrect token or token resolution failed"
}

Status code: 403

Forbidden

{
  "error_code" : "BCS.4030403",
  "error_msg" : "No permissions to request this method"
}

Status code: 404

Not Found

{
  "error_code" : "BCS.4040404",
  "error_msg" : "Not Found:the url is not found"
}

Status code: 500

InternalServerError

{
  "error_code" : "BCS.5000500",
  "error_msg" : "Internal Server Error"
}

Status Codes

Status Code

Description

200

Ok

400

Bad Request

401

Unauthorized

403

Forbidden

404

Not Found

500

InternalServerError

Error Codes

See Error Codes.