Create Index

Last updated: 2020-06-05 21:43:32


    This is a legacy API which has been hidden and will no longer be updated.

    1. API Description

    This API (CreateMetric) is used to create a metric under a namespace for data analysis.
    For more information about the number of metrics and dimensions, please see Product Limitation page
    When you use this API to create a metric, you can also add the statistical type under the metric. Add statistical type when you enter statisticsType.m.period and statisticsType.m.statistics.

    Domain name:

    2. Input Parameters

    The following request parameter list only provides API request parameters. Common request parameters are also needed when the API is called.The Action field for this API is CreateMetric.

    Parameter Name Required Type Description
    namespace Yes String Namespace, which can be queried by calling the API Query Namespace (DescribeNamespace)
    metricName Yes String Metric name, which is comprised of letters, numbers and underscores
    metricCname Yes String Chinese name of the metric
    dimensionNames.n Yes Array Statistical dimension name of the metric
    unit No String The unit used when user reports data. Default is empty string
    statisticsType.m.period No Int Statistical period. The time interval for data collection. Currently, default is 300 seconds, which cannot be modified
    statisticsType.m.statistics No String Analyze the data set within a specified statistical period. Available analytical methods are: max (to take the maximum value in the data set), min (to take the minimum value in the data set), sum (to take the sum of all data in the data set), avg (to take the average value of all data in the data set), last (to take the last value in the data set)

    3. Output Parameters

    Parameter Name Type Description
    code Int Error code, 0: Successful; other values: Failed. For more information, please see Error Codes
    message String Error message

    4. Error Codes

    Error Code Error Description Error Message
    -503 Incorrect request parameter InvalidParameter
    -505 Parameter is missing InvalidParameter.MissingParameter
    -507 Limit has been exceeded OperationDenied.ExceedLimit
    -509 Incorrect dimension group InvalidParameter.DimensionGroupError
    -513 DB operation failed InternalError.DBoperationFail
    -514 Resource already exists OperationDenied.SourceAlreadyExists

    5. Example

    &<Common request parameters>
    &metricCname='Disk utilization'


      'code': 0,
      'message': ''

    Was this page helpful?

    Was this page helpful?

    • Not at all
    • Not very helpful
    • Somewhat helpful
    • Very helpful
    • Extremely helpful
    Send Feedback