性能和耐久性存储API(块存储)

时间:2016-02-17 10:29:03

标签: asp.net-web-api ibm-cloud-infrastructure

我们是DST India团队的一员,目前我们正在为我们的客户提供服务,我们正在尝试使用SoftLayer提供的REST API在ICO中集成性能和耐久性存储功能(SoftLayer)。我已经阅读了SoftLayer文档,但我找不到相同的文档。

那么,您能否向我们提供以下信息?

  1. 请提供创建耐力储存的API(以及 所需参数)
  2. 请提供用于创建效果的API 存储(连同所需的参数)
  3. 请提供API 用于附加耐久性存储(以及所需的参数)
  4. 请提供附加性能存储的API(以及 所需参数)

1 个答案:

答案 0 :(得分:3)

要订购Endurance,请执行:

<强>配置:

Package to use = 240
Storage Type: Endurance
Location: Dal06
Storage Package: 0.25 IOPS/GB
Storage Size: 20GB
Snapshot Space Size: 0GB
OS Type: Linux

网址:

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

方法:POST

Json Payload:

{
  "parameters": [
    {
      "location": 154820,  //Dallas 06
      "packageId": 240,
      "osFormatType": {
        "id": 12,
        "keyName": "LINUX"
      },
      "complexType": "SoftLayer_Container_Product_Order_Network_Storage_Enterprise",
      "prices": [
        {
          "id": 45058   # Endurance Storage
        },
        {
          "id": 45098   # Block Storage
        },
        {
          "id": 45068   # 0.25 IOPS per GB
        },
        {
          "id": 45118   # 20 GB Storage Space
        },
        {
          "id": 46120   # 5 GB Storage Space - Snapshot
        }
      ],
      "quantity": 1
    }
  ]
}

注意:

  • 从&#34; verifyOrder&#34;更改方法和#34; placeOrder&#34;一旦你的配置准备就绪
  • 删除价格ID中设置的评论以获取有效的Json(例如,删除 - &gt;#Endurance存储)

如何获得有效商品价格以订购Endurance / Performance Storage

根据要使用的包执行以下操作:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Product_Package/[package_id]/getItemPrices?objectMask=mask[id,item[keyName,description],pricingLocationGroup[locations[id, name, longName]]]

Method: GET

Where:
 A price id with a locationGroupId = null is considered "A standard price" and the API will internally switch the prices for the customer. But we recommend to execute first the verifyOrder in order to see if the wanted order is ok (the fee can vary).

订购效果存储:

配置:

Package to use: 222
Storage Type: Performance
Location: Dallas 06
Storage Size: 20GB – 100 to 1000 IOPS
Specify IOPS: 100
Select OS Type: Linux

URL:

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

方法:POST

Json Payload:

{
  "parameters": [
    {
      "packageId": 222,
      "location": 154820,
      "osFormatType": {
        "id": 12,
        "keyName": "LINUX"
      },
      "complexType": "SoftLayer_Container_Product_Order_Network_PerformanceStorage_Iscsi",
      "prices": [
        {
          "id": 40672   # Block Storage (Performance)
        },
        {
          "id": 40682   # 20 GB Storage Space
        },
        {
          "id": 40792   # 100 IOPS
        }
      ],
      "quantity": 1
    }
  ]
}

要授权/允许主机,请执行:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Network_Storage/[Storage_id]/allowAccessFromHostList

方法:POST

{
  "parameters": [
    [
      {
        "id": 13548553,
        "objectType": "SoftLayer_Virtual_Guest"
      }
    ]
  ]
}

以上请求用于授权“耐力”和“表现” 如果您要授权“虚拟访客”,“ IpAddress ”或“硬件”,则“objectType”的有效值为:

分别

“SoftLayer_Virtual_Guest”,“SoftLayer_Network_Subnet_IpAddress”,“SoftLayer_Hardware”

<强>参考:

  

http://sldn.softlayer.com/reference/services/SoftLayer_Network_Storage/allowAccessFromHostList

“网络存储”和VSI / Bar Metal / Subnet必须位于同一位置/数据中心。 这些请求有助于我们获取可用主机,可以授权给特定的“网络存储”,如门户网站所示:

要获取具有关联IP地址的有效可用子网,请执行:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Network_Storage/[storage_id]/ getAllowableSubnets?objectMask=mask[id,networkIdentifier,cidr,subnetType,ipAddresses[id,ipAddress]]

Method: GET

要获得有效的虚拟访客,请执行:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Network_Storage_Iscsi/[storage_id]/getAllowableVirtualGuests?objectMask=mask[id,fullyQualifiedDomainName] 

Method: GET

可用的金属条:

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Network_Storage/[storage_id]/getAllowableHardware
Method: GET

更新1:

此外,要获取网络存储列表,请参阅:  SoftLayer_Account::getNetworkStorage

这是一个示例,其中结果使用object Masks显示以下属性:“location”“网络存储类型”

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Account/getNetworkStorage?objectMask=mask[storageType, billingItem[description,location[id,longName]]]

Method: GET

使用过滤器:

按网络过滤存储类型:“Endurance Storage”“Block Storage (Performance)”

https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Account/getNetworkStorage?objectMask=mask[id,username,nasType,storageType, billingItem[description,location[id,longName]]]&objectFilter={"networkStorage":{"nasType":{"operation":"ISCSI"},"billingItem":{"description":{"operation":"Endurance Storage"}}}}
Method: GET

其他链接可以帮助您:

API for Listing All Performance Storages for a user