-2

How can I order several SoftLayer baremetal servers that have differing package IDs with a single order/API call?

UPDATE: Added details below, hopefully it will add clarity to what I am trying to do.

The 2 data structures below are SoftLayer_Container_Product_Order_Hardware_Server datatypes. Each is for a hardware server (billed monthly) with a different package_id, and they can each be passed individually to the placeOrder() API method.

My question is whether there is a way to combine them into a single Order, so I can make a single API call to placeOrder()?

first data structure, to order 2 servers with package_id 553

    {'complexType': 'SoftLayer_Container_Product_Order_Hardware_Server',
 'hardware': [{'domain': 'example.com',
               'hostname': u'host1',
               'primaryBackendNetworkComponent': {'networkVlan': {'id': 1234}},
               'primaryNetworkComponent': {'networkVlan': {'id': 5678}}},
              {'domain': 'example.com',
               'hostname': u'host2',
               'primaryBackendNetworkComponent': {'networkVlan': {'id': 1234}},
               'primaryNetworkComponent': {'networkVlan': {'id': 5678}}}],
 'location': 1441195,
 'packageId': 553,
 'prices': [{'id': 177613},
            {'id': 49811},
            {'id': 49811},
            {'id': 50113},
            {'id': 50113},
            {'id': 50113},
            {'id': 50113},
            {'id': 50113},
            {'id': 50113},
            {'id': 49081},
            {'id': 49427},
            {'id': 141945},
            {'id': 50359},
            {'id': 35686},
            {'id': 50223},
            {'id': 34807},
            {'id': 29403},
            {'id': 34241},
            {'id': 32627},
            {'id': 25014},
            {'id': 33483},
            {'id': 35310},
            {'id': 32500}],
 'quantity': 2,
 'quoteName': u'DAL10-qty2-rand9939',
 'sshKeyIds': [{'sshKeyIds': [9876]}, {'sshKeyIds': [9876]}],
 'storageGroups': [{'arrayTypeId': 2, 'hardDrives': [0, 1]},
                   {'arrayTypeId': 5, 'hardDrives': [2, 3, 4, 5, 6, 7]}],
 'useHourlyPricing': False}

Second data structure, to order 2 servers with package_id 251

{'complexType': 'SoftLayer_Container_Product_Order_Hardware_Server',
 'hardware': [{'domain': 'example.com',
               'hostname': u'host3',
               'primaryBackendNetworkComponent': {'networkVlan': {'id': 1234}},
               'primaryNetworkComponent': {'networkVlan': {'id': 5678}}},
              {'domain': 'example.com',
               'hostname': u'host4',
               'primaryBackendNetworkComponent': {'networkVlan': {'id': 1234}},
               'primaryNetworkComponent': {'networkVlan': {'id': 5678}}}],
 'location': 1441195,
 'packageId': 251,
 'prices': [{'id': 50659},
            {'id': 49811},
            {'id': 49811},
            {'id': 50113},
            {'id': 50113},
            {'id': 50113},
            {'id': 50113},
            {'id': 49081},
            {'id': 49437},
            {'id': 141945},
            {'id': 50359},
            {'id': 26109},
            {'id': 50223},
            {'id': 34807},
            {'id': 29403},
            {'id': 34241},
            {'id': 32627},
            {'id': 25014},
            {'id': 33483},
            {'id': 35310},
            {'id': 32500}],
 'quantity': 2,
 'quoteName': u'DAL10-qty2-rand3106',
 'sshKeyIds': [{'sshKeyIds': [9876]}, {'sshKeyIds': [9876]}],
 'storageGroups': [{'arrayTypeId': 2, 'hardDrives': [0, 1]},
                   {'arrayTypeId': 5, 'hardDrives': [2, 3, 4, 5]}],
 'useHourlyPricing': False}
pgra
  • 13
  • 3

1 Answers1

0

yep it is posible if you take a look at the documentation for the SoftLayer_Container_Product_Order_Hardware_Server container you will see this property:

orderContainers

Orders may contain an array of configurations. Populating this property allows you to purchase multiple configurations within a single order. Each order container will have its own individual settings independent of the other order containers. For example, it is possible to order a bare metal server in one configuration and a virtual server in another. If orderContainers is populated on the base order container, most of the configuration-specific properties are ignored on the base container. For example, prices, location and packageId will be ignored on the base container, but since the billingInformation is a property that's not specific to a single order container (but the order as a whole) it must be populated on the base container.

So you just need to set that property for your orders e.g.

    "orderContainers": [
            order1,
            order2
        ]

Note: replace order1 and order2 with the orders that you posted in your question

Regards

  • That worked, thanks. I could've sworn I had tried that without success. I must've had something wrong in my data structure. – pgra Mar 21 '17 at 20:03