-1

I am using the following API to generate the order template and then use it in the place order

POST https://api.softlayer.com/rest/v3/SoftLayer_Hardware/generateOrderTemplate.json

{
    "parameters":[
        {
            "bareMetalInstanceFlag":1,
            "datacenter":{
                "name":"dal01"
            },
            "domain":"b.com",
            "fixedConfigurationPreset":{
                "keyName":"S1270_32GB_1X1TBSATA_NORAID"
            },
            "hostname":"abcdef",
            "hourlyBillingFlag":true,
            "networkComponents":[
                {
                    "maxSpeed":100
                }
            ],
            "operatingSystemReferenceCode":"UBUNTU_16_64",
            "postInstallScriptUri":"",
            "privateNetworkOnlyFlag":false,
            "userData":[
                {
                    "value":"{\"value\":\"newvalue\"}"
                }
            ]
        }
    ]
}

POST https://api.softlayer.com/rest/v3/SoftLayer_Product_Order/placeOrder.json

{
    "parameters":[
        {
            "complexType":"SoftLayer_Container_Product_Order",
            "hardware":[
                {
                    "domain":"terraformuat.ibm.com",
                    "fixedConfigurationPreset":{
                        "keyName":"S1270_32GB_1X1TBSATA_NORAID"
                    },
                    "hostname":"pc7xobxzs8taoxe8",
                    "userData":[
                        {
                            "value":"{\"value\":\"newvalue\"}"
                        }
                    ]
                }
            ],
            "location":"3",
            "packageId":200,
            "presetId":93,
            "prices":[
                {
                    "hourlyRecurringFee":0,
                    "id":26737,
                    "item":{
                        "description":"100 Mbps Public \u0026 Private Network Uplinks"
                    },
                    "recurringFee":0
                },
                {
                    "hourlyRecurringFee":0.15,
                    "id":175789,
                    "item":{
                        "description":"Ubuntu Linux 16.04 LTS Xenial Xerus (64 bit)"
                    },
                    "recurringFee":35
                },
                {
                    "hourlyRecurringFee":0,
                    "id":34183,
                    "item":{
                        "description":"0 GB Bandwidth"
                    }
                },
                {
                    "hourlyRecurringFee":0,
                    "id":25014,
                    "item":{
                        "description":"Reboot / KVM over IP"
                    },
                    "recurringFee":0
                },
                {
                    "hourlyRecurringFee":0,
                    "id":34807,
                    "item":{
                        "description":"1 IP Address"
                    },
                    "recurringFee":0
                },
                {
                    "hourlyRecurringFee":0,
                    "id":33483,
                    "item":{
                        "description":"Unlimited SSL VPN Users \u0026 1 PPTP VPN User per account"
                    },
                    "recurringFee":0
                },
                {
                    "hourlyRecurringFee":0,
                    "id":35310,
                    "item":{
                        "description":"Nessus Vulnerability Assessment \u0026 Reporting"
                    },
                    "recurringFee":0
                }
            ],
            "quantity":1,
            "useHourlyPricing":true
        },
        false
    ]
}

Error ordering bare metal server: SoftLayer_Exception_Order_MissingCategory: Order is missing the following category: Power Supply. (HTTP 500). I see that Power supply is mandatory field in the UI and already selected. How do I pass it in while preparing the order in the above APIs.

old_timer
  • 69,149
  • 8
  • 89
  • 168
akt
  • 19
  • 3

1 Answers1

1

I just found the price id of the power supply from https://api.softlayer.com/rest/v3.1/SoftLayer_Product_Package/200/getItems

and added it to the order

Adding {"id":177697} to the above prices list makes it work.

akt
  • 19
  • 3