此操作用來創建QoS策略。
請求語法
POST /rest/v1/system/qos HTTP/1.1
Date: date
Content-Type: application/json; charset=utf-8
Content-Length: length
Host: ip:port
Authorization: authorization
{
"qosName": qosName,
"IOPS": IPOS,
"readIOPS": readIOPS,
"writeIOPS": writeIOPS,
"Bps": Bps,
"readBps": readBps,
"writeBps": writeBps,
"IOPSBurst": IOPSBurst,
"readIOPSBurst": readIOPSBurst,
"writeIOPSBurst": writeIOPSBurst,
"BpsBurst": BpsBurst,
"readBpsBurst": readBpsBurst,
"writeBpsBurst": writeBpsBurst,
"IOPSBurstSecs": IOPSBurstSecs,
"readIOPSBurstSecs": readIOPSBurstSecs,
"writeIOPSBurstSecs": writeIOPSBurstSecs,
"BpsBurstSecs": BpsBurstSecs,
"readBpsBurstSecs": readBpsBurstSecs,
"writeBpsBurstSecs": writeBpsBurstSecs,
"reclaimPolicy": reclaimPolicy,
"description": description
}請求參數
| 參數 | 類型 | 描述 | 是否必須 |
|---|---|---|---|
| qosName | String | 指定QoS策略名稱。 取值:長度范圍1~64,只能由字母、數字和短橫線(-)組成,區分大小寫,且僅支持以字母或數字開頭。 | 是 |
| IOPS | Long | 每秒能夠進行讀寫操作次數的最大值。 取值:取值范圍為[-1, 999999999],默認值為-1。-1表示不限制。 | 否 |
| readIOPS | Long | 每秒能夠進行讀操作次數的最大值。 取值:取值范圍為[-1, 999999999],默認值為-1。-1表示不限制。 | 否 |
| writeIOPS | Long | 每秒能夠進行寫操作次數的最大值。 取值:取值范圍為[-1, 999999999],默認值為-1。-1表示不限制。 | 否 |
| Bps | Long | 每秒可傳輸數據量的最大值。 取值:取值范圍為[-1, 4096000000000],默認值為-1,單位是Bytes/s。-1表示不限制。 | 否 |
| readBps | Long | 讀帶寬上限。 取值:取值范圍為[-1, 4096000000000],默認值為-1,單位是Bytes/s。-1表示不限制。 | 否 |
| writeBps | Long | 寫帶寬上限。 取值:取值范圍為[-1, 4096000000000],默認值為-1,單位是Bytes/s。-1表示不限制。 | 否 |
| IOPSBurst | Long | 使用Burst功能時,每秒能夠進行讀寫操作次數的最大值。 取值:只有當IOPS大于等于1時,此項設置為-1或(IOPS, 999999999]內的正整數方可生效。默認值為-1,表示不限制。 | 否 |
| readIOPSBurst | Long | 使用Burst功能時,每秒能夠進行讀操作次數的最大值。 取值:只有當readIOPS大于等于1時,此項設置為-1或(readIOPS, 999999999]內的正整數方可生效。默認值為-1,表示不限制。 | 否 |
| writeIOPSBurst | Long | 使用Burst功能時,每秒能夠進行寫操作次數的最大值。 取值:只有當writeIOPS大于等于1時,此項設置為-1或(writeIOPS, 999999999]內的正整數方可生效。默認值為-1,表示不限制。 | 否 |
| BpsBurst | Long | 使用Burst功能時,每秒可傳輸的數據量最大值。 取值:只有當Bps大于等于1時,此項設置為-1或(Bps, 4096000000000]內的正整數方可生效,默認值為-1,單位是Bytes/s。-1表示不限制。 | 否 |
| readBpsBurst | Long | 使用Burst功能時,讀帶寬上限。 取值:只有當readBps大于等于1時,此項設置為-1或(readBps, 4096000000000]內的正整數方可生效,默認值為-1,單位是Bytes/s。-1表示不限制。 | 否 |
| writeBpsBurst | Long | 使用Burst功能時,寫帶寬上限。 取值:只有當writeBps大于等于1時,此項設置為-1或(writeBps, 4096000000000]內的正整數方可生效,默認值為-1,單位是Bytes/s。-1表示不限制。 | 否 |
| IOPSBurstSecs | Long | 使用Burst功能時,按照Burst上限的能力進行讀寫操作所能持續的時間。 注意 只有在IOPS Burst功能啟用時,此配置才生效。 取值:取值范圍為[1, 999999999],默認值為1,單位是秒。 | 否 |
| readIOPSBurstSecs | Long | 使用Burst功能時,按照Burst上限的能力進行讀操作所能持續的時間。 注意 只有在read IOPS Burst功能啟用時,此配置才生效。 取值:取值范圍為[1, 999999999],默認值為1,單位是秒。 | 否 |
| writeIOPSBurstSecs | Long | 使用Burst功能時,按照Burst上限的能力進行寫操作所能持續的時間。 注意 只有在write IOPS Burst功能啟用時,此配置才生效。 取值:取值范圍為[1, 999999999],默認值為1,單位是秒。 | 否 |
| BpsBurstSecs | Long | 使用Burst功能時,按照Burst上限的流量能力所能持續的時間。 注意 只有在Bps Burst功能啟用時,此配置才生效。 取值:取值范圍為[1, 999999999],默認值為1,單位是秒。 | 否 |
| readBpsBurstSecs | Long | 使用Burst功能時,按照Burst上限的讀流量能力所能持續的時間,單位是秒。 注意 只有在read Bps Burst功能啟用時,此配置才生效。 取值:取值范圍為[1, 999999999],默認值為1,單位是秒。 | 否 |
| writeBpsBurstSecs | Long | 使用Burst功能時,按照Burst上限的寫流量能力所能持續的時間。 注意 只有在write Bps Burst功能啟用時,此配置才生效。 取值:取值范圍為[1, 999999999],默認值為1,單位是秒。 | 否 |
| reclaimPolicy | String | QoS策略的回收策略。 取值:
默認值為Retain。 | 否 |
| description | String | QoS策略的描述信息。 取值:1~256位字符串。 | 否 |
請求示例
創建QoS策略QoStest6。
POST /rest/v1/system/qos HTTP/1.1
Date: Tue, 01 Jul 2025 07:57:43 GMT
Content-Type: application/json; charset=utf-8
Authorization: HBlock userName:signature
Content-Length: 650
Host: 192.168.0.64:1443
{
"qosName": "QoStest6",
"IOPS": 5000000,
"readIOPS": 5000000,
"writeIOPS": 6000000,
"Bps": 40960000000,
"readBps": 40960000000,
"writeBps": 40960000000,
"IOPSBurst": 999999999,
"readIOPSBurst": 999999999,
"writeIOPSBurst": 999999999,
"BpsBurst": -1,
"readBpsBurst": -1,
"writeBpsBurst": -1,
"IOPSBurstSecs": 999999999,
"readIOPSBurstSecs": 999999999,
"writeIOPSBurstSecs": 999999999,
"BpsBurstSecs": 99999999,
"readBpsBurstSecs": 99999999,
"writeBpsBurstSecs": 99999999,
"reclaimPolicy": "Delete",
"description": "It is a test Qos policy"
}響應示例
HTTP/1.1 204 No Content
x-hblock-request-id: 9f8da64f4a1947cf837a1eca46ce08da
Connection: keep-alive
Date: Tue, 01 Jul 2025 07:57:43 GMT
Server: HBlock