Post by erikxu on Sept 11, 2019 6:49:09 GMT
I am confused how to developing the swordfish api. For example, we can create a volume in different ways according to Swordfish User Guide:
1. Create Volume from an Existing Storage Pool
Request: POST /redfish/v1/Storage/1/StoragePools/PrimaryPool
Headers: No additional headers required.
Body:
{
"Name" : "MyVolume",
"CapacityBytes" : 1099511627776,
"RAIDType" : "RAID1"
}
Response:
{
"@ssm.Copyright": "Copyright (c) 2014-2019 SNIA. All rights reserved.",
"@odata.context": "/redfish/v1/$metadata#Volume.Volume",
"@odata.id": "/redfish/v1/Storage/1/Volumes/1",
"@odata.type": "#Volume_1_4_0.Volume",
"Name": "MyVolume",
"Id": "1",
"Description": "",
"RAIDType": "RAID1",
"Identifiers": [
{
"DurableNameFormat": "NAA",
"DurableName": "65456765456761001234076100123487"
}
],
"Status": {
"State": "Enabled",
"Health": "OK"
},
"CapacityBytes": 1099511627776,
"Links": {
"StoragePool": "/redfish/v1/Storage/1/StoragePools/1"
}
}
2. Create Volume specifying Class of Service
Request: POST /redfish/v1/StorageServices/1/Volumes/Members
Body:
{
"Name": "Snapshot1",
"CapacityBytes": 1099511627776,
"Links": {
"ClassOfService": {"odata.id":
"/redfish/v1/StorageServices/1/ClassesofService/BostonBunker"}
}
}
Response:
{
"\@ssm.Copyright": "Copyright (c) 2014-2016 SNIA. All rights reserved.",
"\@odata.context": "/redfish/v1/\$metadata\#Volume.Volume",
"\@odata.id": "/redfish/v1/StorageServices/1/Volumes/3",
"\@odata.type": "\#Volume_1_0_0.Volume",
"Name": "Snapshot1",
"Id": "3",
"Description": "",
"Identifiers": [
{
"DurableNameFormat": "NAA6",
"DurableName": "65456765456761001234076100123487"
}
],
"Manufacturer": "SuperDuperSSD",
"Model": "Drive Model string",
"Status": {
"State": "Enabled",
"Health": "OK"
},
"AccessCapabilities": [
"Read",
"Write",
"Append",
"Streaming"
],
"BlockSizeBytes": 512,
"CapacitySources": [
{
"ConsumedBytes": 0,
"AllocatedBytes": 10737418240,
"GuaranteedBytes": 536870912,
"ProvisionedBytes": 1099511627776,
"Links": {
"ClassOfService": {
"\@odata.id": "/redfish/v1/StorageServices/1/Links/ClassesOfService/SilverBoston"
},
"ProvidingPool": {
"\@odata.id": "/redfish/v1/StorageServices/1/StoragePools/SpecialPool"
}
}
}],
"CapacityBytes": 1099511627776,
"Capacity": {
"Data": {
"ConsumedBytes": 0,
"AllocatedBytes": 10737418240,
"GuaranteedBytes": 1099511627776,
"ProvisionedBytes": 1099511627776
},
"Metadata": {
"ConsumedBytes": 536870912,
"AllocatedBytes": 536870912
}
},
"Links": {
"ClassofService": {
"\@odata.id":
"/redfish/v1/StorageServices/1/Links/ClassesofService/BostonBunker"
}
}
}
So which parameters are required in request and response body when user creates a volume in different ways?
By the way, it's weird that `RAIDType` is read-only property in Swordfish Specification, but, as a input parameter in request body according to example 1.
1. Create Volume from an Existing Storage Pool
Request: POST /redfish/v1/Storage/1/StoragePools/PrimaryPool
Headers: No additional headers required.
Body:
{
"Name" : "MyVolume",
"CapacityBytes" : 1099511627776,
"RAIDType" : "RAID1"
}
Response:
{
"@ssm.Copyright": "Copyright (c) 2014-2019 SNIA. All rights reserved.",
"@odata.context": "/redfish/v1/$metadata#Volume.Volume",
"@odata.id": "/redfish/v1/Storage/1/Volumes/1",
"@odata.type": "#Volume_1_4_0.Volume",
"Name": "MyVolume",
"Id": "1",
"Description": "",
"RAIDType": "RAID1",
"Identifiers": [
{
"DurableNameFormat": "NAA",
"DurableName": "65456765456761001234076100123487"
}
],
"Status": {
"State": "Enabled",
"Health": "OK"
},
"CapacityBytes": 1099511627776,
"Links": {
"StoragePool": "/redfish/v1/Storage/1/StoragePools/1"
}
}
2. Create Volume specifying Class of Service
Request: POST /redfish/v1/StorageServices/1/Volumes/Members
Body:
{
"Name": "Snapshot1",
"CapacityBytes": 1099511627776,
"Links": {
"ClassOfService": {"odata.id":
"/redfish/v1/StorageServices/1/ClassesofService/BostonBunker"}
}
}
Response:
{
"\@ssm.Copyright": "Copyright (c) 2014-2016 SNIA. All rights reserved.",
"\@odata.context": "/redfish/v1/\$metadata\#Volume.Volume",
"\@odata.id": "/redfish/v1/StorageServices/1/Volumes/3",
"\@odata.type": "\#Volume_1_0_0.Volume",
"Name": "Snapshot1",
"Id": "3",
"Description": "",
"Identifiers": [
{
"DurableNameFormat": "NAA6",
"DurableName": "65456765456761001234076100123487"
}
],
"Manufacturer": "SuperDuperSSD",
"Model": "Drive Model string",
"Status": {
"State": "Enabled",
"Health": "OK"
},
"AccessCapabilities": [
"Read",
"Write",
"Append",
"Streaming"
],
"BlockSizeBytes": 512,
"CapacitySources": [
{
"ConsumedBytes": 0,
"AllocatedBytes": 10737418240,
"GuaranteedBytes": 536870912,
"ProvisionedBytes": 1099511627776,
"Links": {
"ClassOfService": {
"\@odata.id": "/redfish/v1/StorageServices/1/Links/ClassesOfService/SilverBoston"
},
"ProvidingPool": {
"\@odata.id": "/redfish/v1/StorageServices/1/StoragePools/SpecialPool"
}
}
}],
"CapacityBytes": 1099511627776,
"Capacity": {
"Data": {
"ConsumedBytes": 0,
"AllocatedBytes": 10737418240,
"GuaranteedBytes": 1099511627776,
"ProvisionedBytes": 1099511627776
},
"Metadata": {
"ConsumedBytes": 536870912,
"AllocatedBytes": 536870912
}
},
"Links": {
"ClassofService": {
"\@odata.id":
"/redfish/v1/StorageServices/1/Links/ClassesofService/BostonBunker"
}
}
}
So which parameters are required in request and response body when user creates a volume in different ways?
By the way, it's weird that `RAIDType` is read-only property in Swordfish Specification, but, as a input parameter in request body according to example 1.