跳到主要内容

POST – 创建卷

使用 POST 方法初始化卷。

请求 URL

POST https://<BMC_IPADDR>/redfish/v1/Systems/1/Storage/{Id}/Volumes

请求正文

字段

类型

描述

Name

注 1
字符串

最多包含 15 个字符的新名称。

RAIDType

注 1
字符串

RAID 控制器和当前环境支持的 RAID 类型。

CapacityBytes

注 2
字符串

至少 1048576。

ReadCachePolicy

字符串

“Off”或“ReadAhead”

WriteCachePolicy

字符串

“WriteThrough”、“UnprotectedWriteBack”或“ProtectedWriteBack”

Oem/Lenovo/IOPolicy

字符串

“DirectIO”或“CachedIO”

Oem/Lenovo/AccessPolicy

字符串

“ReadWrite”、“ReadOnly”或“Blocked”

Oem/Lenovo/DriveCachePolicy

字符串

“Unchanged”、“Disable”或“Enable”

注 1:此属性是必需的,在创建卷时不应为空字符串。

注 2:此属性在后端会转换为兆字节单位,因此 GET 操作中的属性可能与 POST 操作中的输入值不同。此值的最小值为 1048576(1 MB = 1024 * 1024)。

响应

响应返回创建的卷信息。

状态代码

HTTP 状态代码错误消息 ID
201Created
500InternalError

示例

以下示例是 POST 正文

{
"Name": "VD_4",
"RAIDType": "RAID0"
}

返回以下示例 JSON 响应。

{
"@odata.id": "/redfish/v1/Systems/1/Storage/RAID_Slot2/Volumes/23",
"Status": {
"State": "Enabled",
"Health": "OK"
},
"ReadCachePolicy@Redfish.AllowableValues": [
"Off",
"ReadAhead"
],
"WriteCachePolicy@Redfish.AllowableValues": [
"WriteThrough",
"UnprotectedWriteBack",
"ProtectedWriteBack"
],
"Oem": {
"Lenovo": {}
},
"@odata.type": "#Volume.v1_4_1.Volume",
"Links": {
"Drives": []
},
"Description": "This resource is used to represent a volume for a Redfish implementation.",
"@odata.etag": "\"4eebd9cca6bc25aae12\"",
"Actions": {
"#Volume.Initialize": {
"target": "/redfish/v1/Systems/1/Storage/RAID_Slot2/Volumes/23/Actions/Volume.Initialize",
"title": "Initialize",
"InitializeType@Redfish.AllowableValues": [
"Fast"
]
}
},
"AccessCapabilities": []
}