How to create duplicate block storage from snapshot using Softlayer rest api

一曲冷凌霜 提交于 2021-02-17 05:54:51

问题


I have created snapshot but unable to create block storage from snapshot. We cant find any Api document. Anyone help me on this request


回答1:


Try using the following slcli command to order a duplicate volume:

slcli block volume-duplicate --origin-snapshot-id 11111 --billing monthly 22222

Replace 11111 for your snapshot id and 22222 for your volume id.

To get the list of the snapshot ids for your volume you can use the following command:

slcli block snapshot-list 1234

Replace 1234 for your volume id.

You can order a duplicate volume through rest call too see the below example:

Method: POST

https://[username]:[apiKey]@api.softlayer.com/rest/v3.1/SoftLayer_Product_Order/verifyOrder

Body: Json

{"parameters": [{
"complexType":"SoftLayer_Container_Product_Order_Network_Storage_AsAService",
"packageId": 759,
"location":449600,
"quantity": 1,
"prices": [ 
        { "id": 225129,
          "item": {
              "id": 13215,
              "description": "Storage space for 2 IOPS per GB"
          }},
        { "id": 192043,
          "item": {
              "id": 5938,
              "description": "0.25 IOPS per GB"
          }},            
        {"id": 192473,
        "item": {
              "id": 5130,
              "description": "20 GB Storage Space"
          }}, 
        {"id":189433,
         "item": {
              "id": 9571,
              "description": "Storage as a Service"
          }},
        {"id":189443,
         "item": {
              "id": 5944,
              "description": "Block Storage"
          }}],
"useHourlyPricing": false,
"duplicateOriginSnapshotId": 11111,
"duplicateOriginVolumeId": 22222,
"osFormatType": {  
        "id":12,
        "keyName":"LINUX"
        },
"volumeSize": 16000
}
]}

Replace 11111 for your snapshot id and 22222 for your volume id.



来源:https://stackoverflow.com/questions/65610081/how-to-create-duplicate-block-storage-from-snapshot-using-softlayer-rest-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!