OpenAPI metadata

更新时间:
复制 MD 格式

API metadata—such as API style, supported protocols, and parameter definitions—is required for self-signing Alibaba Cloud API requests. Learn how to read and retrieve this metadata.

Cloud product metadata overview

OpenAPI metadata is the set of descriptive information for a cloud product's APIs. During signing, extract the API style, supported protocols, request methods, parameter names, types, and locations from this metadata.

Product and version overview (Info)

Includes the API style, product code, and version.

Example:

{"style":"RPC","product":"Ecs","version":"2014-05-26"}

API summary collection (apis)

A Map keyed by API name, where each value is an API summary with the following parameters:

Parameter name

Description

Example

methods

Supported request methods.

["post","get"]

Both POST and GET return identical results.

schemes

Supported protocols.

["http","https" ]

Both HTTP and HTTPS are supported.

parameters

Request parameters.

{
    "name": "RegionId",
    "in": "query",
    "schema": {
        "description": "The region ID of the instance. You can call [DescribeRegions](~~25609~~) to view the latest list of Alibaba Cloud regions.",
        "type": "string",
        "required": true,
        "example": "cn-hangzhou"
    }
}

Describes each parameter's name, location (query, path, or body), type, and required status.

Metadata for DescribeInstanceStatus

{
    "code": 0,
    "data": {
        "methods": [
            "post",
            "get"
        ],
        "schemes": [
            "http",
            "https"
        ],
        "security": [
            {
                "AK": []
            }
        ],
        "deprecated": false,
        "systemTags": {
            "operationType": "get"
        },
        "parameters": [
            {
                "name": "RegionId",
                "in": "query",
                "schema": {
                    "description": "The region ID of the instance. You can call [DescribeRegions](~~25609~~) to view the latest list of Alibaba Cloud regions.",
                    "type": "string",
                    "required": true,
                    "example": "cn-hangzhou"
                }
            },
            {
                "name": "ZoneId",
                "in": "query",
                "schema": {
                    "description": "The zone ID of the instance. You can call [DescribeZones](~~25610~~) to view the latest list of Alibaba Cloud zones.",
                    "type": "string",
                    "required": false,
                    "example": "cn-hangzhou-d"
                }
            },
            {
                "name": "ClusterId",
                "in": "query",
                "schema": {
                    "description": "The cluster ID of the instance.\n\n><notice>This parameter is deprecated and not recommended for use!></notice>",
                    "type": "string",
                    "required": false,
                    "example": "cls-bp67acfmxazb4p****"
                }
            },
            {
                "name": "PageNumber",
                "in": "query",
                "schema": {
                    "description": "The page number of the instance status list.\n\nMinimum value: 1.\n\nDefault value: 1.",
                    "type": "integer",
                    "format": "int32",
                    "required": false,
                    "minimum": "1",
                    "example": "1",
                    "default": "1"
                }
            },
            {
                "name": "PageSize",
                "in": "query",
                "schema": {
                    "description": "The number of entries per page in paged queries. Valid values: 1 to 50.\n\nDefault value: 10.",
                    "type": "integer",
                    "format": "int32",
                    "required": false,
                    "maximum": "50",
                    "minimum": "1",
                    "example": "10",
                    "default": "10"
                }
            },
            {
                "name": "InstanceId",
                "in": "query",
                "style": "repeatList",
                "schema": {
                    "description": "An array of instance IDs. Array length: 1 to 100.\n\nExample: [\"i-bp1j4i2jdf3owlhe****\", \"i-bp1j4i2jdf3o1234****\"].",
                    "type": "array",
                    "items": {
                        "description": "The instance ID.",
                        "type": "string",
                        "required": false,
                        "example": "i-bp1j4i2jdf3owlhe****"
                    },
                    "required": false,
                    "example": "i-bp1j4i2jdf3owlhe****",
                    "maxItems": 100
                }
            }
        ],
        "responses": {
            "200": {
                "schema": {
                    "type": "object",
                    "properties": {
                        "PageSize": {
                            "description": "The number of entries per page specified in the request.",
                            "type": "integer",
                            "format": "int32",
                            "example": "1"
                        },
                        "RequestId": {
                            "description": "The request ID.",
                            "type": "string",
                            "example": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
                        },
                        "PageNumber": {
                            "description": "The page number of the instance list.",
                            "type": "integer",
                            "format": "int32",
                            "example": "1"
                        },
                        "TotalCount": {
                            "description": "The total number of instances.",
                            "type": "integer",
                            "format": "int32",
                            "example": "58"
                        },
                        "InstanceStatuses": {
                            "type": "object",
                            "itemNode": true,
                            "properties": {
                                "InstanceStatus": {
                                    "description": "A collection of instance IDs and their statuses.",
                                    "type": "array",
                                    "items": {
                                        "type": "object",
                                        "properties": {
                                            "Status": {
                                                "description": "The instance status. Valid values: \n\n- Pending: Creating.\n\n- Running: Running.\n\n- Starting: Starting.\n\n- Stopping: Stopping.\n\n- Stopped: Stopped.",
                                                "type": "string",
                                                "example": "Running"
                                            },
                                            "InstanceId": {
                                                "description": "The instance ID.",
                                                "type": "string",
                                                "example": "i-bp1j4i2jdf3owlhe****"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "errorCodes": {
            "403": [
                {
                    "errorCode": "InvalidParameter.TooManyInstanceIds",
                    "errorMessage": "Instance ids cannot be more than 100."
                },
                {
                    "errorCode": "Abs.InvalidInstanceIds.MalFormed",
                    "errorMessage": "The specified instanceIds is not valid."
                }
            ],
            "404": [
                {
                    "errorCode": "InvalidZoneId.NotFound",
                    "errorMessage": "The ZoneId provided does not exist in our records."
                }
            ]
        },
        "responseDemo": "[{\"type\":\"json\",\"example\":\"{\\n  \\\"PageSize\\\": 1,\\n  \\\"RequestId\\\": \\\"473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E\\\",\\n  \\\"PageNumber\\\": 1,\\n  \\\"TotalCount\\\": 58,\\n  \\\"InstanceStatuses\\\": {\\n    \\\"InstanceStatus\\\": [\\n      {\\n        \\\"Status\\\": \\\"Running\\\",\\n        \\\"InstanceId\\\": \\\"i-bp1j4i2jdf3owlhe****\\\"\\n      }\\n    ]\\n  }\\n}\",\"errorExample\":\"{\\n\\\"RequestId\\\": \\\"6EF60BEC-0242-43AF-BB20-270359FB54A7\\\",\\n\\\"TotalCount\\\": 2,\\n\\\"PageNumber\\\": 1,\\n\\\"PageSize\\\": 10,\\n\\\"InstanceStatuses\\\": {\\n    \\\"InstanceStatus\\\": [{\\n        \\\"InstanceId\\\": \\\"i-instance1\\\",\\n            \\\"Status\\\": \\\"Running\\\"\\n        },\\n        {\\n            \\\"InstanceId\\\": \\\"i-ae4r89pp\\\",\\n            \\\"Status\\\": \\\"Stopped\\\"\\n        }]\\n    }\\n}\"},{\"type\":\"xml\",\"example\":\"<DescribeInstanceStatusResponse>\\n    <PageNumber>1</PageNumber>\\n    <InstanceStatuses>\\n        <InstanceStatus>\\n            <Status>Running</Status>\\n            <InstanceId>i-bp1j4i2jdf3owlhe****</InstanceId>\\n        </InstanceStatus>\\n    </InstanceStatuses>\\n    <TotalCount>58</TotalCount>\\n    <PageSize>1</PageSize>\\n    <RequestId>746C3444-9A24-4D7D-B8A8-DCBF7AC8BD66</RequestId>\\n</DescribeInstanceStatusResponse>\",\"errorExample\":\"<DescribeInstanceStatusResponse>\\n    <RequestId>6EF60BEC-0242-43AF-BB20-270359FB54A7</RequestId>\\n    <TotalCount>2</TotalCount>\\n    <PageNumber>1</PageNumber>\\n    <PageSize>10</PageSize>\\n    <InstanceStatuses>\\n        <InstanceStatus>\\n            <InstanceId>i-instance1</InstanceId>\\n                <Status>Running</Status>\\n            </InstanceStatus>\\n            <InstanceStatus>\\n                <InstanceId>i-ae4r89pp</InstanceId>\\n                <Status>Stopped</Status>\\n        </InstanceStatus>\\n    </InstanceStatuses>\\n</DescribeInstanceStatusResponse>\"}]",
        "title": "Query the list of instance status information",
        "summary": "This operation queries the status of one or more specified ECS instances and supports listing instances based on specific conditions.",
        "description": "For ECS instance lifecycle states, see [Instance status table](~~25687~~). \n\n## Request examples\n- Query instances and their status by **region**. Example request parameter:\n```\n\"RegionID\": \"cn-hangzhou\"\n```\n\n- Query instances and their status by **zone** within a **region**. Example request parameters:\n```\n\"RegionID\": \"cn-hangzhou\",\n\"ZoneID\": \"cn-hangzhou-a\"\n```\n\n- Query instance status by **region** and **instance ID**. Example request parameters:\n```\n\"RegionID\": \"cn-hangzhou\",\n\"InstancesID\": [\"i-bp1f7c1zqp999zvp****\", \"i-bp1dqjv36biueg61****\"]\n```",
        "requestParamsDescription": " ",
        "responseParamsDescription": " ",
        "extraInfo": " "
    }
}

Endpoint collection (endpoints)

Service endpoints for the cloud product.

How to obtain metadata

Method 1: Get cloud product metadata

On the API documentation or page, select a cloud product such as Elastic Compute Service (ECS), and click Get Metadata below the product name.

Method 2: Get metadata for a specific API

On the API documentation or page, select a cloud product such as ECS, choose the target API, and click Get Metadata in the upper-right corner.

Method 3: Call the metadata API

The metadata API is publicly accessible without authentication. Use the following endpoints to retrieve metadata. The complete API reference is in the Metadata usage guide or .

API description

API URL

Request method

List all cloud product codes and versions

https://api.aliyun.com/meta/v1/products.json?language=EN_US

GET

Get metadata for a specific product and version

https://api.aliyun.com/meta/v1/products/{product}/versions/{version}/api-docs.json

GET

Get metadata for a specific API

https://api.aliyun.com/meta/v1/products/{product}/versions/{version}/apis/{api_name}/api.json

GET