Softlayer api: 异常 为这个订单提供的位置是无效的[英] Softlayer api: exception The location provided for this order is invalid

本文是小编为大家收集整理的关于Softlayer api: 异常 为这个订单提供的位置是无效的的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

背景

使用sl_product_order.placeOrder API订购VSI.订购参数:

{'prices': [{'id': 1644}, {'id': 1640}, {'id': 2202}, {'id': 272}, {'id': 45466}, {'id': 905}, {'id': 21}, {'id': 57}, {'id': 55}, {'id': 58}, {'id': 420}, {'id': 418}, {'id': 17129}, {'id': 1800}], 'location': '224092', 'packageId': 835, 'complexType': 'SoftLayer_Container_Product_Order_Virtual_Guest', 'useHourlyPricing': True, 'virtualGuests': [{'domain': 'xxx.com', 'hostname': 'xxx-rkgw77q5'}], 'quantity': 1}

'数据中心':'sng01'ID:224092

例外

softlayerapierror(softlayer_exception_order_invalidlocation):为此订单提供的位置无效.

问题

昨天,此API适用于使用相同的参数创建VSI.但是,现在它不起作用.

我可以在门户网站上购买SNG01的VSI.但API始终讲述为此订单提供的位置无效.

推荐答案

在订购之前,您需要确保将要使用的包用于要使用的位置,以检查必须运行此方法:

http://sldn.softlayer.com/reference/services/softerlayer_product_package/getregions

当前您使用的包裹不具有SNG01的位置,这是有效的,这就是您收到错误的原因.

在另一只手中,您可以使用控件门户在该区域中订购,因为控件门户对Virtuall服务器使用另一个包,它使用了包46,因此您需要更改您的订单中的包,也许价格同样因为每个包都有自己的价格.

本文地址:https://www.itbaoku.cn/post/1937783.html

问题描述

background

Use sl_product_order.placeOrder api to order a vsi. Order params:

{'prices': [{'id': 1644}, {'id': 1640}, {'id': 2202}, {'id': 272}, {'id': 45466}, {'id': 905}, {'id': 21}, {'id': 57}, {'id': 55}, {'id': 58}, {'id': 420}, {'id': 418}, {'id': 17129}, {'id': 1800}], 'location': '224092', 'packageId': 835, 'complexType': 'SoftLayer_Container_Product_Order_Virtual_Guest', 'useHourlyPricing': True, 'virtualGuests': [{'domain': 'xxx.com', 'hostname': 'xxx-rkgw77q5'}], 'quantity': 1}

'dataCenter': 'sng01' id:224092

exception

SoftLayerAPIError(SoftLayer_Exception_Order_InvalidLocation): The location provided for this order is invalid.

question

Yesterday, this api works ok for create a vsi with the same params. But, now it does not works.

I can buy vsi of sng01 in portal website. But the api always tells The location provided for this order is invalid.

推荐答案

Before ordering you need to make sure that the package that you are going to use works for the location that you want to use, to check that you must run this method:

http://sldn.softlayer.com/reference/services/SoftLayer_Product_Package/getRegions

Currently the package that you are using does not have the location sng01 as valid that's why you are getting the error.

In another hand you are able to order in that region using the control portal because the control portal uses another package for virtuall servers, it is using the package 46, So you need to change the package in your order and maybe the prices as well because each package has its own prices.