zhao xiongwei
zhao xiongwei

Reputation: 15

SoftLayer API: order license

I am using the method Product_Order.placeOrder to order licenses. The question is what's the relationship of complexType and packageId. Can I specify both complexType and packageId? Where can I find the API document? Thanks.

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

Upvotes: 0

Views: 55

Answers (1)

Albert Camacho
Albert Camacho

Reputation: 1104

The complexType lets to the server know what is the datatype structure you are sending. https://softlayer.github.io/article/soap/

Each WSDL defines that specific service’s available methods and includes an XSD file that defines every complex type available to the SoftLayer API.

Important API headers, such as authentication, initialization parameters, and object masks are sent to the SoftLayer API as SOAP headers. Each call header has an associated complex type.

When calling to placeOrder you need to send a SoftLayer_Container_Product_Order datatype (a basic orderData), and some products/devices requires to set additional information but they aren't in SoftLayer_Container_Product_Order because they belongs to another datatype which inherits from SoftLayer_Container_Product_Order.

SoftLayer_Container_Product_Order_Software_License inherits from SoftLayer_Container_Product_Order and it may not necessary to set the complexType unless there are required data that doesn't belongs to SoftLayer_Container_Product_Order or you get an exception.

The packageId defines what are the prices you are sending to order the product you want. Now, some products can be ordered with the same complexType, but with a different packageId, for example hardware servers (see table in 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|

It is advisable to set both complexType and packageId, this helps to the server to process the request a little faster.

Upvotes: 0

Related Questions