華為云計算 云知識 查詢彈性伸縮配置列表ListScalingConfigs
查詢彈性伸縮配置列表ListScalingConfigs

 

功能介紹

根據(jù)輸入條件過濾查詢 彈性伸縮 配置。查詢結果分頁顯示。

  • 可以根據(jù)伸縮配置名稱, 鏡像 ID,起始行號,記錄條數(shù)進行條件過濾查詢。
  • 若不加過濾條件默認最多查詢租戶下20條伸縮配置信息。

調試

您可以在API Explorer中調試該接口。

URI

GET /autoscaling-api/v1/{project_id}/scaling_configuration

可以在URI后面用‘?’和‘&’添加不同的查詢條件組合。支持參數(shù)說明中所有非必選參數(shù)過濾,請參考請求示例。

表1 參數(shù)說明

參數(shù)

是否必選

參數(shù)類型

描述

project_id

String

項目ID。

scaling_configuration_name

String

伸縮配置名稱。

支持模糊匹配。

image_id

String

鏡像ID,同imageRef。

start_number

Integer

查詢的起始行號,默認為0。最小值為0。

limit

Integer

查詢的記錄條數(shù),默認為20。取值范圍為:0~100。

請求參數(shù)

請求示例

查詢使用了鏡像ID為37ca2b35-6fc7-47ab-93c7-900324809c5c的伸縮配置。

GET https://{Endpoint}/autoscaling-api/v1/{project_id}/scaling_configuration?image_id=37ca2b35-6fc7-47ab-93c7-900324809c5c

響應參數(shù)

表2 響應參數(shù)

參數(shù)

參數(shù)類型

描述

total_number

Integer

總記錄數(shù)。

start_number

Integer

查詢的起始行號。

limit

Integer

查詢記錄數(shù)。

scaling_configurations

Array of scaling_configurations objects

伸縮配置列表。

表3 scaling_configurations字段數(shù)據(jù)結構說明

參數(shù)

參數(shù)類型

描述

scaling_configuration_id

String

伸縮配置ID,全局唯一。

tenant

String

租戶ID。

scaling_configuration_name

String

伸縮配置名稱。

支持模糊匹配。

instance_config

instance_config object

實例配置信息。

create_time

String

創(chuàng)建伸縮配置時間,遵循UTC時間。

scaling_group_id

String

綁定該伸縮配置的伸縮組ID。

表4 instance_config字段數(shù)據(jù)結構說明

參數(shù)

參數(shù)類型

描述

flavorRef

String

云服務器 的規(guī)格ID。

imageRef

String

鏡像ID,同image_id。

disk

Array of disk objects

磁盤組信息。

key_name

String

登錄云服務器的SSH密鑰名稱。

key_fingerprint

String

登錄云服務器的SSH密鑰指紋。

instance_name

String

該參數(shù)為預留字段。

instance_id

String

該參數(shù)為預留字段。

adminPass

String

該參數(shù)為預留字段。

personality

Array of personality objects

注入文件信息。

public_ip

public_ip object

云服務器的彈性IP信息。

user_data

String

cloud-init用戶數(shù)據(jù),base64格式編碼。

metadata

metadata object

創(chuàng)建云服務器元數(shù)據(jù),詳情見表11。

security_groups

Array of security_groups objects

安全組信息。

server_group_id

String

云服務器組ID。

tenancy

String

專屬主機 上創(chuàng)建彈性云服務器。

dedicated_host_id

String

專屬主機的ID。

market_type

String

云服務器的計費模式,可以選擇競價計費或按需計費。

multi_flavor_priority_policy

String

使用伸縮配置創(chuàng)建云主機的時候,多規(guī)格使用的優(yōu)先級策略。

。

表5 disk字段數(shù)據(jù)結構說明

參數(shù)

參數(shù)類型

描述

size

Integer

磁盤大小,容量單位為GB。

volume_type

String

磁盤類型。

disk_type

String

系統(tǒng)盤還是數(shù)據(jù)盤,DATA表示為數(shù)據(jù)盤,SYS表示為系統(tǒng)盤。

dedicated_storage_id

String

磁盤所屬的專屬存儲ID。

data_disk_image_id

String

導入數(shù)據(jù)盤的數(shù)據(jù)盤鏡像ID。

snapshot_id

String

磁盤備份的快照ID。

metadata

metadata object

創(chuàng)建磁盤的元數(shù)據(jù),詳情見表6。

表6 創(chuàng)建磁盤的metadata字段數(shù)據(jù)結構說明

參數(shù)

參數(shù)類型

描述

__system__encrypted

String

metadata中的表示加密功能的字段,0代表不加密,1代表加密。

該字段不存在時, 云硬盤 默認為不加密。

__system__cmkid

String

用戶主密鑰ID,是metadata中的表示加密功能的字段,與__system__encrypted配合使用。

說明:

請參考查詢密鑰列表,通過HTTPS請求獲取密鑰ID。

表7 personality字段數(shù)據(jù)結構說明

參數(shù)

參數(shù)類型

描述

path

String

注入文件路徑信息。

content

String

注入文件內容,base64格式編碼。

表8 public_ip字段數(shù)據(jù)結構說明

參數(shù)

參數(shù)類型

描述

eip

eip object

云服務器自動分配彈性IP時,創(chuàng)建彈性IP的配置參數(shù)。

表9 eip字段數(shù)據(jù)結構說明

參數(shù)

參數(shù)類型

描述

ip_type

String

IP地址類型。

bandwidth

bandwidth object

IP地址帶寬參數(shù)。

表10 bandwidth字段數(shù)據(jù)結構說明

參數(shù)

參數(shù)類型

描述

size

Integer

帶寬(Mbit/s)。

share_type

String

帶寬的共享類型。

共享類型枚舉:

  • PER:獨享型。
  • WHOLE:共享型。

charging_mode

String

帶寬的計費類型。

  • bandwidth:按帶寬計費。
  • traffic:按流量計費。

id

String

帶寬ID,創(chuàng)建WHOLE類型帶寬的彈性IP時指定的共享帶寬。

表11 metadata字段數(shù)據(jù)結構說明

參數(shù)

參數(shù)類型

描述

admin_pass

String

Windows彈性云服務器Administrator用戶的密碼。

表12 security_groups字段數(shù)據(jù)結構說明

參數(shù)

參數(shù)類型

描述

id

String

安全組ID

響應示例

{
    "limit": 20,
    "total_number": 2,
    "start_number": 0,
    "scaling_configurations": [
        {
            "tenant": "ce061903a53545d cad db300093b477d2",
            "scaling_configuration_id": "6afe46f9-7d3d-4046-8748-3b2a1085ad86",
            "scaling_configuration_name": " config_name_1",
            "instance_config": {
                "disk": [
                    {
                        "size": 40,
                        "volume_type": "SATA",
                        "disk_type": "SYS"
                    },
                    {
                        "size": 100,
                        "volume_type": "SATA",
                        "disk_type": "DATA"
                    }
                ],
                "personality": null,
                "instance_name": null,
                "instance_id": null,
                "flavorRef": "103",
                "imageRef": "37ca2b35-6fc7-47ab-93c7-900324809c5c",
                "key_name": "keypair01",
                "public_ip": null,
                "user_data": null,
                "metadate": {},
                "security_groups": [{
                     "id": "6c22a6c0-b5d2-4a84-ac56-51090dcc33be"
                }],
            },
            "create_time": "2015-07-23T01:04:07Z"
        },
        {
            "tenant": "ce061903a53545dcaddb300093b477d2",
            "scaling_configuration_id": "24a8c5f3-c713-4aba-ac29-c17101009e5d",
            "scaling_configuration_name": "config_name_2",
            "instance_config": {
                "disk": [
                    {
                        "size": 40,
                        "volume_type": "SATA",
                        "disk_type": "SYS"
                    }
                ],
                "personality": null,
                "instance_name": null,
                "instance_id": null,
                "flavorRef": "103",
                "imageRef": "37ca2b35-6fc7-47ab-93c7-900324809c5c",
                "key_name": "keypair01",
                "public_ip": null,
                "user_data": null,
                "metadata": {},
                "security_groups": [{
                     "id": "6c22a6c0-b5d2-4a84-ac56-51090dcc33be"
                }],
                "multi_flavor_priority_policy": "PICK_FIRST"
            },
            "create_time": "2015-07-22T01:08:41Z"
        }
    ]
}

返回值

  • 正常

    200

  • 異常

    返回值

    說明

    400 Bad Request

    服務器未能處理請求。

    401 Unauthorized

    被請求的頁面需要用戶名和密碼。

    403 Forbidden

    對被請求的頁面訪問禁止。

    404 Not Found

    服務器無法找到被請求的頁面。

    405 Method Not Allowed

    請求中指定的方法不被允許。

    406 Not Acceptable

    服務器生成的響應無法被客戶端所接受。

    407 Proxy Authentication Required

    用戶必須首先使用代理服務器進行驗證,這樣請求才會被處理。

    408 Request Timeout

    請求超出了服務器的等待時間。

    409 Conflict

    由于沖突,請求無法被完成。

    500 Internal Server Error

    請求未完成。服務異常。

    501 Not Implemented

    請求未完成。服務器不支持所請求的功能。

    502 Bad Gateway

    請求未完成。服務器從上游服務器收到一個無效的響應。

    503 Service Unavailable

    請求未完成。系統(tǒng)暫時異常。

    504 Gateway Timeout

    網(wǎng)關超時。

錯誤碼

請參考錯誤碼