本文介绍了SoftLayer API:价格未根据Netscaler的位置进行调整的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在开发SL Portal,目前,我们发现,从SL控制页上,当我们尝试订购时,即使对于所有不同的数据中心,Netscaler的价格始终是相同的.但是,当我们通过API检索价格时,价格就不一样了.

We are under developing SL Portal, and for now, we've found that,from SL control page, when we try to order,the price of Netscaler is always same even for the all the different data centers.However when we retrieve the price through API then the price wasn't same.

请问每个数据中心的正确价格是多少,在建立新的门户网站时,我们必须遵循什么?

Please what's the right price for each data centers, and when making the new portal site, what do we have to follow ?

谢谢.

推荐答案

之所以看到相同的项目价格,是因为控制门户网站选择的价格可能是标准价格". 标准价格"表示可以在任何位置订购该商品.

The reason why you see the same item prices is because of the prices selected by Control Portal are "Standard prices" probably. A "Standard price" means that it can be used to order the item for any location.

但是,... 我们如何知道价格是否为标准价格"?

以下请求可帮助我们根据位置/数据中心获取价格.

The following request helps us to get prices according to location/datacenter.

REST示例:

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

Method: GET

位置:

用于NetScaler的软件包为192.

Package used for NetScaler is = 192.

locationGroupId = null的价格ID被视为标准价格",API将在内部为客户切换价格.但是建议您先执行"verifyOrder",以查看所需的订单是否正常(费用可能会有所不同).

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

有关更多信息,请查看:

For better information, please review:

这是使用标准价格的订单请求:

This is an order request using standard prices:

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

Method: POST

Json Payload:
=========================
{
  "parameters": [
    {
      "location": 138124,  // "DALLAS05"
      "packageId": 192,
      "complexType": "SoftLayer_Container_Product_Order_Network_Application_Delivery_Controller",
      "prices": [
        {
          "id": 22315 // "Citrix NetScaler VPX 10.1 10Mbps Standard"
        },
        {
          "id": 17238 // 2 Static Public IP Addresses
        }
      ],
      "quantity": 1
    }
  ]
}

=========================

Note: Remove the comments in order to get the request working.

以上请求可以与不同的数据中心一起使用.

The above request can work with different datacenters.

此外,我们可以使用非标准价格的价格ID.

Also, we can use price ids that are not standard prices.

例如,我们要获取:

  • 项目:"Citrix NetScaler VPX 10.1 10Mbps标准"
  • 位置:新加坡1"

最合适的商品价格ID为(SoftLayer_Product_Package :: getItemPrices):

The item price id that fits well is (SoftLayer_Product_Package::getItemPrices):

 …
    {
    "id": 51173
    "locationGroupId": 509
    "item": {
    "description": "Citrix NetScaler VPX 10.1 10Mbps Standard"
    "id": 4425
    "keyName": "CITRIX_NETSCALER_VPX_10_1_10MBPS_STANDARD"
    }-
    "pricingLocationGroup": {
    "description": "Location Group 5"
    "id": 509
    "locationGroupTypeId": 82
    "name": "Location Group 5"
    "securityLevelId": null
    "locations": [3]
    0:  {
    "id": 352494
    "longName": "Hong Kong 2"
    "name": "hkg02"
    }-
    1:  {
    "id": 449604
    "longName": "Tokyo 2"
    "name": "tok02"
    }-
    2:  {
    "id": 224092
    "longName": "Singapore 1"
    "name": "sng01"
    }-
    -
    }-
    } …

位置:此价格允许的位置是:香港2,托基奥2和新加坡1.

Where: The locations allowed for this price are: Hong kong 2,Tokio 2 and Singapore 1.

我们的订单将发生如下变化:

Our order will change something like this:

{
  "parameters": [
    {
      "location": 224092, // Singapore 1
      "packageId": 192,
      "complexType": "SoftLayer_Container_Product_Order_Network_Application_Delivery_Controller",
      "prices": [
        {
          "id": 51173
        },
        {
          "id": 17238
        }
      ],
      "quantity": 1
    }
  ]
}

参考:

希望这些信息对您有所帮助.

I hope this information help you.

这篇关于SoftLayer API:价格未根据Netscaler的位置进行调整的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 01:10