Get All Metric Metadata

GET/zstack/v1/zwatch/metrics/meta-data

Headers

Authorization: OAuth the-session-uuid

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/zwatch/metrics/meta-data?name=VMHAProcess

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
name (optional)StringqueryMetric name 3.9.0
namespace (optional)StringqueryMetric namespace 3.9.0
systemTags (optional)ListquerySystem tags 2.3
userTags (optional)ListqueryUser tags 2.3

API Response

Response Example

{
  "metrics": [
    {
      "namespace": "ZStack/VM",
      "name": "org.zstack.zwatch.datatype.Metric@4efa6b58",
      "description": "CPUIdleUtilization",
      "labelNames": [
        "VMUuid",
        "CPUNum"
      ],
      "driver": "PrometheusDatabaseDriver"
    }
  ]
}
NameTypeDescriptionStarting Version
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error2.3
metricsListFor details, see metrics2.3

error

NameTypeDescriptionStarting Version
codeStringError code. The globally unique error identifier, for example, SYS.1000, HOST.10010.6
descriptionStringBrief description of the error0.6
detailsStringDetailed error information0.6
elaborationStringReserved field. Default is null0.6
opaqueLinkedHashMapReserved field. Default is null0.6
causeErrorCodeRoot error. The source error that caused the current error. This field is null if no root error exists0.6

metrics

NameTypeDescriptionStarting Version
namespaceStringNamespace2.3
nameStringResource name2.3
descriptionStringDescription3.9.0
labelNamesListLabel names2.3

SDK Examples

Java SDK

GetAllMetricMetadataAction action = new GetAllMetricMetadataAction();
action.name = "VMHAProcess";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetAllMetricMetadataAction.Result res = action.call();

Python SDK

GetAllMetricMetadataAction action = GetAllMetricMetadataAction()
action.name = "VMHAProcess"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetAllMetricMetadataAction.Result res = action.call()