1. 云服务器实例规格列表

1.1. 描述

实例规格:为满足用户在不同应用场景、不同业务负载下的性能需求设定的已有配置,包括vCPU、内存等;实例规格决定了实例的计算和存储能力。

1.2. 请求地址

请求地址的格式如下:

https://<区域服务地址>/v1/vm/flavor/list

1.3. 请求参数

Name Type Description Required
feeType String 计费类型(按需计费:FEE_TYPE_NEED,包年包月:FEE_TYPE_MONTH_YEAR)
azSn String azSn
name String flavor名称
curPage Integer 当前页码,默认值1
perPage Integer 每页显示条数,默认值10

1.4. 请求示例

以查询华东一区计费类型为按需计费的云服务器实例规格列表为例:

1.4.1. 请求地址

POST https://cn-east-1.api.yovole.com/v1/vm/flavor/list HTTP/1.1
  x-ycs-timestamp: 2019-06-19T14:26:26Z
  x-ycs-requestid: 2a49cfa2-925b-11e9-bb3a-6c96cfdcd6b9
  x-ycs-security-authorization: Authorization: YCS1-HMAC-SHA1 Credential=08e206fb-7b41-45b7-8076-8d43e8aeea89,SignedHeaders=content-type;x-ycs-requestid;x-ycs-timestamp,Signature=2RFjU7C9gICCrQfpAIfAJHqRRlQ=

1.4.2. 接口请求参数

{
  "feeType": "FEE_TYPE_NEED",
  "azSn": "CN-EAST-1-A",
  "curPage":1,
  "perPage":10
}

1.5. 返回结果示例

1.5.1. 返回正确结果示例

{
    "success":true,
    "code":0,
    "pager":{
        "curPage":1,
        "perPage":10,
        "totalRecords":25,
        "totalPages":3,
        "pageData":[
            {
                "id":"ecs.c1.2xlarge",
                "name":"ecs.c1.2xlarge",
                "cpu":"16",
                "memory":"16",
                "category":"通用 I型",
                "regionSn":"CN-EAST-1",
                "azSn":"CN-EAST-1-A"
            },
            {
                "id":"ecs.c1.large",
                "name":"ecs.c1.large",
                "cpu":"4",
                "memory":"4",
                "category":"通用 I型",
                "regionSn":"CN-EAST-1",
                "azSn":"CN-EAST-1-A"
            },
            {
                "id":"ecs.c1.medium",
                "name":"ecs.c1.medium",
                "cpu":"2",
                "memory":"2",
                "category":"通用 I型",
                "regionSn":"CN-EAST-1",
                "azSn":"CN-EAST-1-A"
            },
            {
                "id":"ecs.c1.small",
                "name":"ecs.c1.small",
                "cpu":"1",
                "memory":"1",
                "category":"通用 I型",
                "regionSn":"CN-EAST-1",
                "azSn":"CN-EAST-1-A"
            },
            {
                "id":"ecs.c1.xlarge",
                "name":"ecs.c1.xlarge",
                "cpu":"8",
                "memory":"8",
                "category":"通用 I型",
                "regionSn":"CN-EAST-1",
                "azSn":"CN-EAST-1-A"
            },
            {
                "id":"ecs.c2.large",
                "name":"ecs.c2.large",
                "cpu":"4",
                "memory":"8",
                "category":"通用 I型",
                "regionSn":"CN-EAST-1",
                "azSn":"CN-EAST-1-A"
            },
            {
                "id":"ecs.c2.medium",
                "name":"ecs.c2.medium",
                "cpu":"2",
                "memory":"4",
                "category":"通用 I型",
                "regionSn":"CN-EAST-1",
                "azSn":"CN-EAST-1-A"
            },
            {
                "id":"ecs.c2.small",
                "name":"ecs.c2.small",
                "cpu":"1",
                "memory":"2",
                "category":"通用 I型",
                "regionSn":"CN-EAST-1",
                "azSn":"CN-EAST-1-A"
            },
            {
                "id":"ecs.c2.xlarge",
                "name":"ecs.c2.xlarge",
                "cpu":"8",
                "memory":"16",
                "category":"通用 I型",
                "regionSn":"CN-EAST-1",
                "azSn":"CN-EAST-1-A"
            },
            {
                "id":"ecs.c3.large",
                "name":"ecs.c3.large",
                "cpu":"4",
                "memory":"12",
                "category":"通用 I型",
                "regionSn":"CN-EAST-1",
                "azSn":"CN-EAST-1-A"
            }
        ]
    }
}

1.5.2. 返回错误结果示例

{
  "requestId": "2a49cfa2-925b-11e9-bb3a-6c96cfdcd6b9",
  "success": false,
  "code": 400,
  "message": "Required attribute 'azSN' not specified",
  "errorCode": "Invalid argument"
}

1.6. 错误码

可以通过错误返回结果中的code、errorCode和message字段了解错误分类和具体的错误原因。

该接口没有特殊错误码,错误码信息和简单的错误分析方法可以参考公共错误码

results matching ""

    No results matching ""