November 23, 2017


Order a block storage (endurance) As a Service

The script orders a block storage (endurance) device As a Service, with 80GB storage and 0.25 IOPS.
Since softlayer-go client doesn't have the new datatype containers used in control portal, to order
a SoftLayer_Container_Product_Order_Network_Storage_AsAService object we will make a REST request
by using the source code located in /utils/slapi/softlayer_service_request.go file.

Important manual pages:

Author: SoftLayer Technologies, Inc. <>

package main

// Change imports depending where is located the file softlayer_service_request.go
import "../utils/slapi"

func main() {

	// SoftLayer API username and key
	username := "set me"
	apikey   := "set me"

	// Build the SoftLayer request you want to send to the API by using REST
	slRequest :=  slapi.SoftLayerServiceRequest{
		Endpoint: "",
		ServiceName: "SoftLayer_Product_Order",
		Method: "verifyOrder",

	// Build the Parameters object that will be send in the Body request
	parameters := `{"parameters" : [
					"complexType": "SoftLayer_Container_Product_Order_Network_Storage_AsAService",
    					"location": "MEXICO",
    					"quantity": 1,
					"packageId": 759,
					"prices": [
        					{ "id": 189443 },
        					{ "id": 189433 },
        					{ "id": 192043 },
						{ "id": 192233 },
						{ "id": 192053 }
					"volumeSize": 80,
    					"osFormatType": {
        					"keyName": "LINUX",
        					"complexType": "SoftLayer_Network_Storage_Iscsi_OS_Type"

	// Send API request
	response := slapi.RestRequest(slapi.UrlRequest(slRequest), username, apikey, &parameters, "POST")

	// Following prints the result in a pretty json format


If this article contains any error, or leaves any of your questions unanswered, please help us out by opening up a github issue.
Open an issue