asp.net-web-api - 性能和耐久性存储API( block 存储)

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

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

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

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

最佳答案

要订购耐力,请执行:

配置:

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 负载:

{
  "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
    }
  ]
}

注释:

  • 配置准备就绪后,从“verifyOrder”方法更改为“placeOrder”
  • 删除价格 ID 中设置的注释以获取有效的 Json(例如删除 --> # Endurance 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

网址:

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

方法:POST

Json 负载:

{
  "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"
      }
    ]
  ]
}

以上请求用于授权“Endurance”和“Performance” 如果您想授权“Virtual Guest”、“IpAddress”或“Hardware”,“objectType”的有效值为:

分别为“SoftLayer_Virtual_Guest”、“SoftLayer_Network_Subnet_IpAddress”、“SoftLayer_Hardware”

引用:

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

“网络存储”和 VSI/Bar Metal/子网必须位于同一位置/数据中心。 这些请求帮助我们获得可以授权特定“网络存储”的可用主机,正如我们在门户中看到的那样:

要获取具有关联 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

这是一个示例,其中结果使用对象掩码显示如下属性:“位置”“网络存储类型”

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

Method: GET

使用过滤器:

按网络存储类型过滤:“持久存储”“ block 存储(性能)”

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

关于asp.net-web-api - 性能和耐久性存储API( block 存储),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35454059/

相关文章:

javascript - $scope-less Controller 从 webapi 检索数据不会更新 AngularJS 1.3 中的绑定(bind)

rest - Odata(V4) 操作是否只能通过 POST 调用?

go - 您可以通过 virtual.go :EditObject()? 编辑 vdi 带宽分配吗

http - 已将 ssl 证书复制到测试站点,如何删除它?

iis-7.5 - 无法使用 HttpClient 对 ASP.NET Web Api 服务进行身份验证

c# - AngularJS Web Api AntiForgeryToken CSRF

javascript - Angular 仅显示结果数据数组的一部分

python - 如何在 SoftLayer 中访问已删除的 VSI 数据

go - 如何添加对象掩码以使用 golang 调用 GetNetworkVlans