首页 文章

SoftLayer API:订单许可证

提问于
浏览
0

我使用Product_Order.placeOrder方法来订购许可证 . 问题是complexType和packageId的关系是什么 . 我可以同时指定complexType和packageId吗?我在哪里可以找到API文档?谢谢 .

{'complexType': 'SoftLayer_Container_Product_Order_Software_License',
   'quantity': xxx,
   'packageId': xxx,
   'prices': [{'id': xxx}]
  }

1 回答

  • 0

    complexType允许服务器知道您要发送的数据类型结构是什么 . https://softlayer.github.io/article/soap/

    每个WSDL都定义了特定服务的可用方法,并包含一个XSD文件,该文件定义了SoftLayer API可用的每种复杂类型 . 重要的API标头(例如身份验证,初始化参数和对象掩码)将作为SOAP标头发送到SoftLayer API . 每个调用头都有一个关联的复杂类型 .

    调用placeOrder时,您需要发送 SoftLayer_Container_Product_Order 数据类型(基本orderData),并且某些产品/设备需要设置其他信息,但它们不在 SoftLayer_Container_Product_Order 中,因为它们属于从 SoftLayer_Container_Product_Order 继承的另一种数据类型 .

    SoftLayer_Container_Product_Order_Software_License 继承自 SoftLayer_Container_Product_Order ,除非存在不属于 SoftLayer_Container_Product_Order 的必需数据或者您获得异常,否则可能无需设置complexType .

    packageId定义了您订购所需产品的价格 . 现在,某些产品可以使用相同的complexType进行订购,但使用不同的packageId,例如硬件服务器(请参阅placeOrder中的表):

    |Product                  | Order Container                                   | Package type
    ------------------------------------------------------------------------------------------------
    |Bare metal server by CPU | SoftLayer_Container_Product_Order_Hardware_Server | BARE_METAL_CPU |
    |Bare metal server by core| SoftLayer_Container_Product_Order_Hardware_Server | BARE_METAL_CORE|
    

    建议同时设置 complexTypepackageId ,这有助于服务器更快地处理请求 .

相关问题