如何使用 Python API 从 sotlayer 保存的引用中检索对象
How to retrieve objects from the sotlayer saved quote using Python API
我正在尝试检索存储在特定 Softlayer 帐户的已保存报价下的 objects/items(服务器名称、主机名、域名、位置等)。有人可以帮助如何检索报价中的对象吗?我可以找到 REST API (Python) 来检索报价详细信息(报价 ID、状态等),但找不到在报价中获取对象的方法。
谢谢!
此致,
凯兰帕特尔
如果您尝试检索您在提交报价时发送的相同订单信息结构,那么您需要使用方法 getRecalculatedOrderContainer,它应该 returns packageId、presetId、location、item价格等,但据我所知,主机名、域、sshKeys、provisionScripts、vlans 不在报价中,因为这些值
用户在下订单之前是否需要新值或避免系统因 vlan 和子网等资源的可用性而出错,可能会随着时间的推移而改变。
https://[username]:[apikey]api.softlayer.com/rest/v3/SoftLayer_Billing_Order_Quote/[quoteID]/getRecalculatedOrderContainer
Method: GET
现在,如果您想检索 orderId、商品等,则需要在列表中或作为单个对象使用 object-mask feature whether you are using the methods Account::getQuotes
or SoftLayer_Billing_Order_Quote::getObject
they both returns the datatype SoftLayer_Billing_Order_Quote。
账户::getQuotes
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Account/getQuotes?objectMask=mask[id,name,order[id,status,items[id,description,domainName,hostName,location]]]
Method: GET
SoftLayer_Billing_Order_Quote::getObject
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Billing_Order_Quote/[quoteID]/getObject?objectMask=mask[id,name,order[id,status,items[id,description,location]]]
Method: GET
参考文献:
https://softlayer.github.io/reference/services/SoftLayer_Account/getQuotes/
https://softlayer.github.io/reference/services/SoftLayer_Billing_Order_Quote/
https://softlayer.github.io/reference/datatypes/SoftLayer_Billing_Order_Quote/
谢谢阿尔伯特 getRecalculatedOrderContainer 正是我要找的东西。
我正在尝试检索存储在特定 Softlayer 帐户的已保存报价下的 objects/items(服务器名称、主机名、域名、位置等)。有人可以帮助如何检索报价中的对象吗?我可以找到 REST API (Python) 来检索报价详细信息(报价 ID、状态等),但找不到在报价中获取对象的方法。
谢谢!
此致,
凯兰帕特尔
如果您尝试检索您在提交报价时发送的相同订单信息结构,那么您需要使用方法 getRecalculatedOrderContainer,它应该 returns packageId、presetId、location、item价格等,但据我所知,主机名、域、sshKeys、provisionScripts、vlans 不在报价中,因为这些值 用户在下订单之前是否需要新值或避免系统因 vlan 和子网等资源的可用性而出错,可能会随着时间的推移而改变。
https://[username]:[apikey]api.softlayer.com/rest/v3/SoftLayer_Billing_Order_Quote/[quoteID]/getRecalculatedOrderContainer
Method: GET
现在,如果您想检索 orderId、商品等,则需要在列表中或作为单个对象使用 object-mask feature whether you are using the methods Account::getQuotes
or SoftLayer_Billing_Order_Quote::getObject
they both returns the datatype SoftLayer_Billing_Order_Quote。
账户::getQuotes
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Account/getQuotes?objectMask=mask[id,name,order[id,status,items[id,description,domainName,hostName,location]]]
Method: GET
SoftLayer_Billing_Order_Quote::getObject
https://[username]:[apikey]@api.softlayer.com/rest/v3/SoftLayer_Billing_Order_Quote/[quoteID]/getObject?objectMask=mask[id,name,order[id,status,items[id,description,location]]]
Method: GET
参考文献:
https://softlayer.github.io/reference/services/SoftLayer_Account/getQuotes/
https://softlayer.github.io/reference/services/SoftLayer_Billing_Order_Quote/
https://softlayer.github.io/reference/datatypes/SoftLayer_Billing_Order_Quote/
谢谢阿尔伯特 getRecalculatedOrderContainer 正是我要找的东西。