創建保障型負載均衡實例
更新時間 2025-05-23 22:34:34
最近更新時間: 2025-05-23 22:34:34
分享文章
接口功能介紹
保障型負載均衡創建
接口約束
無
URI
POST /v4/elb/create-pgelb
路徑參數
無
Query參數
無
請求參數
請求頭header參數
無
請求體body參數
| 參數 | 是否必填 | 參數類型 | 說明 | 示例 | 下級對象 |
|---|---|---|---|---|---|
| clientToken | 是 | String | 客戶端存根,用于保證訂單冪等性, 長度 1 - 64 | 79fa97e3-c48b-xxxx-9f46-6a13d8163678 | |
| regionID | 是 | String | 區域ID | ||
| projectID | 否 | String | 企業項目 ID,默認為'0' | 0 | |
| vpcID | 否 | String | vpc的ID | ||
| subnetID | 是 | String | 子網的ID | ||
| name | 是 | String | 唯一。支持拉丁字母、中文、數字,下劃線,連字符,中文 / 英文字母開頭,不能以 http: / https: 開頭,長度 2 - 32 | acl11 | |
| description | 否 | String | 支持拉丁字母、中文、數字, 特殊字符:~!@#$%^&*()_-+= <>?:'{},./;'[]·!@#¥%……&*() —— -+={}, | 《》?:“”【】、;‘',。、,不能以 http: / https: 開頭,長度 0 - 128 | acl |
| eipID | 否 | String | 彈性公網IP的ID。當resourceType=external為必填 | ||
| slaName | 是 | String | lb的規格名稱, 支持:elb.s2.small,elb.s3.small,elb.s4.small,elb.s5.small,elb.s2.large,elb.s3.large,elb.s4.large,elb.s5.large——"elb.s2.small": "standardI"(標準型Ⅰ), "elb.s2.large": "standardII"(標準型Ⅱ)、"elb.s3.small": "enhancedI"(增強型Ⅰ), "elb.s3.large": "enhancedII"(增強型Ⅱ)、"elb.s4.small": "higherI"(高階型Ⅰ), "elb.s4.large": "higherII"(高階型Ⅱ)、"elb.s5.small": "superI"(超強型Ⅰ), "elb.s5.large": "superII"(超強型Ⅱ) | elb.s2.small | |
| resourceType | 是 | String | 資源類型。internal:內網負載均衡,external:公網負載均衡 | internal | |
| privateIpAddress | 否 | String | 負載均衡的私有IP地址,不指定則自動分配 | ||
| cycleType | 是 | String | 訂購類型:month(包月) / year(包年) / on_demand (按需) | month | |
| cycleCount | 否 | Integer | 訂購時長, 當 cycleType = month, 支持續訂 1 - 11 個月; 當 cycleType = year, 支持續訂 1 - 3 年,當 cycleType = on_demand 可以不傳 | 1 | |
| payVoucherPrice | 否 | String | 代金券金額,支持到小數點后兩位 | 1 |
響應參數
| 參數 | 參數類型 | 說明 | 示例 | 下級對象 |
|---|---|---|---|---|
| statusCode | Integer | 返回狀態碼(800為成功,900為失敗) | 800 | |
| message | String | statusCode為900時的錯誤信息; statusCode為800時為success, 英文 | success | |
| description | String | statusCode為900時的錯誤信息; statusCode為800時為成功, 中文 | 成功 | |
| errorCode | String | statusCode為900時為業務細分錯誤碼,三段式:product.module.code; statusCode為800時為SUCCESS | SUCCESS | |
| returnObj | Object | 業務數據 | 見下表 | returnObj |
| error | String | statusCode為900時為業務細分錯誤碼,三段式:product.module.code; statusCode為800時為SUCCESS |
表 returnObj
| 參數 | 參數類型 | 說明 | 示例 | 下級對象 |
|---|---|---|---|---|
| masterOrderID | String | 訂單id。 | 55d531d7bf2d47658897c42ffb918423 | |
| masterOrderNO | String | 訂單編號, 可以為 null。 | 20221021191602644224 | |
| masterResourceStatus | String | 資源狀態: started(啟用) / renewed(續訂) / refunded(退訂) / destroyed(銷毀) / failed(失敗) / starting(正在啟用) / changed(變配)/ expired(過期)/ unknown(未知) | started | |
| masterResourceID | String | 資源 ID 可以為 null。 | d48cace2da7b4c81b4c0444768a04608 | |
| regionID | String | 可用區id。 | 81f7728662dd11ec810800155d307d5b | |
| elbID | String | 負載均衡 ID | 當 masterResourceStatus 不為 started 時,該取值為 null |
枚舉參數
無
請求示例
請求url
POST /v4/elb/create-pgelb
請求頭header
無
請求體body
{
"clientToken": "xxxx",
"regionID": "81f7728662dd11ec810800155d307d5b",
"subnetID": "subnet-23k8nuci7z",
"name": "yacos_lb_test_ipv6",
"description": "yacos_lb_test_ipv6",
"resourceType": "internal",
"privateIpAddress": "10.10.0.10",
"slaName": "elb.s2.small",
"cycleType": "month",
"cycleCount": 1
}
響應示例
{
"statusCode": 800,
"message": "success",
"description": "成功",
"errorCode": "SUCCESS",
"returnObj": {
"masterOrderID": "ee508bcc586211ed961bacde48001122",
"masterOrderNO": null,
"masterResourceID": "d48cace2da7b4c81b4c0444768a04608",
"masterResourceStatus": "started",
"regionID": "81f7728662dd11ec810800155d307d5b",
"elbID": "lb-xxxxx"
}
}
狀態碼
請參考
錯誤碼
請參考