特惠算力专区-使用API方式购买:请求示例

时间:2024-08-01 11:28:41

请求示例

  • 请求URL示例
    POST https://{endpoint}/v1/{project_id}/cloudservers
  • 假设需要创建规格ID为“c6.large.2”的竞享实例,其中,镜像ID为“1189efbf-d48b-46ad-a823-94b942e2a000”、磁盘类型为“SATA”、VPC ID为“0dae26c9-9a70-4392-93f3-87d53115d171”,请求示例参考如下:
    {
        "server": {
            "availability_zone": "cn-east-3b",
            "name": "newserver",
            "imageRef": "1189efbf-d48b-46ad-a823-94b942e2a000",
            "flavorRef": "c6.large.2",
            "root_volume": {
                "volumetype": "SATA",
                "size": 40
            },
            "vpcid": "0dae26c9-9a70-4392-93f3-87d53115d171",
            "security_groups": [
                {
                    "id": "507ca48f-814c-4293-8706-300564d54620"
                }
            ],
            "nics": [
                {
                    "subnet_id": "157ee789-03ea-45b1-a698-76c92660dd83"
                }
            ],
            "count": 2,
            "extendparam": {
                "chargingMode": 0,
                "marketType": "spot",
                "spot_duration_hours": "3",
                "spot_duration_count": 1,
                "interruption_policy": "immediate"
            }
        }
    }
support.huaweicloud.com/usermanual-ceci/ceci_02_0004.html