更新时间:2024-06-18 GMT+08:00
分享

查询规格销售策略

功能介绍

查询竞价计费模式以及IES场景的规格销售策略列表。

接口约束

本接口仅适用于查询IES和竞价计费型规格的销售策略。

调试

您可以在API Explorer中调试该接口。

URI

GET /v1/{project_id}/cloudservers/flavor-sell-policies?flavor_id={flavor_id}

参数说明请参见表1
表1 路径参数

参数

是否必选

描述

project_id

项目ID。

获取方法请参见获取项目ID

表2 查询参数

参数

是否必选

参数类型

描述

flavor_id

String

云服务器的系统规格的ID。

已上线的规格请参见实例类型章节。

说明:

该字段支持模糊搜索(前缀匹配)、精确搜索。

sell_status

String

云服务器的系统规格销售状态。

取值范围:

  • available:正常售卖
  • sellout:售罄

sell_mode

String

计费模式。

取值范围:

  • postPaid:按需计费实例,暂不支持
  • prePaid:包年/包月计费实例,暂不支持
  • spot:竞价实例
  • ri:预留实例,暂不支持

availability_zone_id

String

可用区,需要指定可用区(AZ)。

请参考地区和终端节点获取。

longest_spot_duration_hours_gt

Integer

查询竞价实例时长大于设置值的策略。

largest_spot_duration_count_gt

Integer

查询“竞价实例时长”的个数大于设置值的策略。

longest_spot_duration_hours

Integer

查询竞价实例时长等于设置值的策略。

largest_spot_duration_count

Integer

查询“竞价实例时长”的个数等于设置值的策略。

interruption_policy

String

中断策略。

取值范围:

  • immediate:立即释放
  • delay:延迟释放

limit

Integer

单页面可显示的策略条数最大值,默认是1000。

marker

String

以单页最后一条策略的id作为分页标记。

请求消息

响应消息

响应参数如表3所示。
表3 响应参数

参数

参数类型

描述

count

Integer

云服务器规格销售策略数量。

sell_policies

Array of objects

云服务器规格销售策略,请参考表4

表4 sell_policies字段数据结构说明

参数

参数类型

描述

id

Integer

云服务器规格的索引。

flavor_id

String

云服务器规格的ID。

sell_status

String

云服务器规格的售卖状态。

  • sellout:售罄
  • available:可用

availability_zone_id

String

云服务器规格的可用区。

sell_mode

String

云服务器规格的付费模式。

  • postPaid:按需计费
  • prePaid:包年/包月计费
  • spot:竞价实例
  • ri:预留实例

spot_options

object

云服务器规格竞价实例的销售策略详情。请参考表5

表5 spot_options字段数据结构说明

参数

参数类型

描述

longest_spot_duration_hours

Integer

购买的竞价实例时长。

largest_spot_duration_count

Integer

购买的“竞价实例时长”的个数。

interruption_policy

String

竞价实例中断策略。

  • immediate:立即释放
  • delay:延迟释放

请求示例

查询云服务器规格“s3.small.1”的销售策略列表。

GET https://{endpoint}/v1/{project_id}/cloudservers/flavor-sell-policies?flavor_id=s3.small.1

响应示例

{
    "count":2,
    "sell_policies":[
        {
            "id":1,
            "flavor_id":"s3.small.1",
            "sell_status":"available",
            "availability_zone_id":"az1",
            "sell_mode":"spot",
            "spot_options":{
                "longest_spot_duration_hours":6,
                "largest_spot_duration_count":1,
                "interruption_policy":"immediate"
            }
        },
        {
            "id":2,
            "flavor_id":"s3.small.1",
            "sell_status":"available",
            "availability_zone_id":"az1",
            "sell_mode":"spot",
            "spot_options":{
                "longest_spot_duration_hours":6,
                "largest_spot_duration_count":1,
                "interruption_policy":"immediate"
            }
        }
    ]
}


返回值

请参考通用请求返回值

错误码

请参考错误码

分享:

    相关文档

    相关产品