用于根据选定的存储大小,存储包以及Endurance Storage Type中的位置获取快照空间大小的API [英] API used for getting Snapshot Space Size on the basis of selected Storage Size, Storage Package, location in Endurance Storage Type

查看:67
本文介绍了用于根据选定的存储大小,存储包以及Endurance Storage Type中的位置获取快照空间大小的API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用ICO(IBM Cloud Orchestrator)上的BPM在我的应用程序中实现耐久存储的订购.我们需要以下参数 创建下订单的休息电话:

I need to implement placing order for endurance storage in my Application using BPM over ICO (IBM Cloud Orchestrator). We needed following parameters for creating rest call for placing order:

  1. 要使用的软件包
  2. 存储类型
  3. 位置
  4. 存储包
  5. 存储空间
  6. 快照空间大小
  7. 操作系统类型

我可以使用以下调用根据所选的存储类型,位置和存储包来提取数据直到存储大小:

I am able to fetch data till storage size on the basis of selected storage type, location and storage package using below call:

https://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Product_Package/240/getItemPrices?objectMask=mask[id,item[keyName,description],pricingLocationGroup[locations[id, name, longName]]]&objectFilter={"items":{"prices":{"pricingLocationGroup":{"locations":{"item":{"operation":"che01"}}}}}}

但是不知道如何获取快照空间大小.抓取快照空间大小的方法或API是什么?

But don't have any idea how to get the snapshot space size. What will be the method or API for fetching snapshot space size?

推荐答案

获取快照空间大小的方法是SoftLayer_Product_Package :: getItemPrices,它返回包中的所有价格,请参见文档.

The method to fetch snapshot space size is the SoftLayer_Product_Package::getItemPrices, it returns all the prices in the package see documentation.

之所以看不到快照空间是因为您使用的软件包没有这种项目(或类别).您可以使用此RestFul查看包装所含物品的种类

The reason you don't see the snaspshot spaces is because the package you are using does not have that kind of items (or categories). You can see the kind of items that the package has using this RestFul

GET https://api.softlayer.com/rest/v3.1/SoftLayer_Product_Package/222/getConfiguration?objectMask=mask[itemCategory]

有关详细信息,请参阅文档

See documentation for more details

因此,您必须使用另一个软件包,用于持久存储的软件包为240,您可以看到使用此RestFUl:

SO you have to use another package, the package for endurance storage is 240, you can see that using this RestFUl:

Get https://api.softlayer.com/rest/v3.1/SoftLayer_Product_Package/getAllObjects

有关详细信息,请参阅文档

See documentation for more details

由于您会注意到SoftLayer_Product_Package :: getItemPrices列出的项目包含一个名为category的属性,您可以使用此属性来过滤数据(有关更多详细信息,请参阅文档). 因此,为了仅获取快照空间大小,请使用以下命令:

As you will notice the items listed by the SoftLayer_Product_Package::getItemPrices contains a property called category, you can use this property to filter the data (See documentation for more detail). So in order to get only the snapshot space size use this:

GET https://api.softlayer.com/rest/v3.1/SoftLayer_Product_Package/240/getItemPrices?objectFilter={"itemPrices": {"categories": {"categoryCode": {"operation": "storage_snapshot_space"}}}}

有关详细信息,请参阅文档

see documentation for more details

您正在使用的过滤器也不起作用,无法使用名称来过滤位置(我不知道为什么,但是这样工作), 当前,您的请求正在获取忽略过滤器的所有数据,您需要使用"locationGroupId"过滤位置,有关更多详细信息,请参见文档

Also the filter you are using does not work, it is not possible to filter the location using the name (I do not know why, but it is working like that), currently your request is fetching all the data ignoring the filter, you need to filter the locations using the "locationGroupId" see documentation for more details

下面是一个简单的示例,用于获取位置"che01"的商品价格

Here a simple example to fetch the item prices for the location "che01"

GET https://api.softlayer.com/rest/v3/SoftLayer_Product_Package/240/getItemPrices?objectFilter={"itemPrices": {"locationGroupId": {"operation": "in", "options": [{"name": "data", "value": [585,583]}]}}}

您可能会问自己如何获取值585和583,请参阅文档.

You may asking yourself how to get the values 585 and 583, weel see documentation for that.

这里是获取这些值的示例

here an example to get those values

GET https://api.softlayer.com/rest/v3.1/SoftLayer_Product_Package/240/getRegions?objectMask=mask[location[location[priceGroups]]]

现在,您可以混合使用过滤器来获取像这样的位置的所有快照空间大小:

Now you can mix the filters to get all snapshot sapace size for a location like this:

GET https://api.softlayer.com/rest/v3/SoftLayer_Product_Package/240/getItemPrices?objectFilter={"itemPrices": { "categories": {"categoryCode": {"operation": "storage_snapshot_space"}}   , "locationGroupId": {"operation": "in", "options": [{"name": "data", "value": [585,583]}]}}}

我希望这对您有所帮助,您不需要多次询问相同的问题,但是如果您有更多问题,请参阅文档,其中有很多关于订单和其他内容的良好信息

I hope this help you and you do not need ask more times about the same, but if you have more question please see documentation there are plenty of good information about orders and other stuff http://sldn.softlayer.com/

致谢

这篇关于用于根据选定的存储大小,存储包以及Endurance Storage Type中的位置获取快照空间大小的API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆