Language: English

Hardware
SoftLayer_Hardware::createObject

Overview

createObject() enables the creation of servers on an account. This
method is a simplified alternative to interacting with the ordering system directly.

In order to create a server, a template object must be sent in with a few required
values.

When this method returns an order will have been placed for a server of the specified configuration.

To determine when the server is available you can poll the server via getObject,
checking the provisionDate property.
When provisionDate is not null, the server will be ready. Be sure to use the globalIdentifier
as your initialization parameter.

Warning: Servers created via this method will incur charges on your account. For testing input parameters see generateOrderTemplate.

Input - SoftLayer_Hardware

  • hostname
    Hostname for the server.
    • Required
    • Type - string

  • domain
    Domain for the server.
    • Required
    • Type - string

  • processorCoreAmount
    The number of logical CPU cores to allocate.

  • memoryCapacity
    The amount of memory to allocate in gigabytes.

  • hourlyBillingFlag
    Specifies the billing type for the server.
    • Required
    • Type - boolean
    • When true the server will be billed on hourly usage, otherwise it will be billed on a monthly basis.

  • operatingSystemReferenceCode
    An identifier for the operating system to provision the server with.

  • datacenter.name
    Specifies which datacenter the server is to be provisioned in.

    {
    "datacenter": {
    "name": "dal05"
    }
    }


  • networkComponents.maxSpeed
    Specifies the connection speed for the server's network components.
    • Optional
    • Type - int
    • Default - The highest available zero cost port speed will be used.
    • Description - The networkComponents property is an array with a single network component structure. The maxSpeed property must be set to specify the network uplink speed, in megabits per second, of the server.
    • See getCreateObjectOptions for available options.

    {
    "networkComponents": [
    {
    "maxSpeed": 1000
    }
    ]
    }


  • networkComponents.redundancyEnabledFlag
    Specifies whether or not the server's network components should be in redundancy groups.
    • Optional
    • Type - bool
    • Default - false
    • Description - The networkComponents property is an array with a single network component structure. When the redundancyEnabledFlag property is true the server's network components will be in redundancy groups.

    {
    "networkComponents": [
    {
    "redundancyEnabledFlag": false
    }
    ]
    }


  • privateNetworkOnlyFlag
    Specifies whether or not the server only has access to the private network
    • Optional
    • Type - boolean
    • Default - false
    • When true this flag specifies that a server is to only have access to the private network.

  • primaryNetworkComponent.networkVlan.id
    Specifies the network vlan which is to be used for the frontend interface of the server.
    • Optional
    • Type - int
    • Description - The primaryNetworkComponent property is a network component structure with the networkVlan property populated with a vlan structure. The id property must be set to specify the frontend network vlan of the server.

    {
    "primaryNetworkComponent": {
    "networkVlan": {
    "id": 1
    }
    }
    }


  • primaryBackendNetworkComponent.networkVlan.id
    Specifies the network vlan which is to be used for the backend interface of the server.
    • Optional
    • Type - int
    • Description - The primaryBackendNetworkComponent property is a network component structure with the networkVlan property populated with a vlan structure. The id property must be set to specify the backend network vlan of the server.

    {
    "primaryBackendNetworkComponent": {
    "networkVlan": {
    "id": 2
    }
    }
    }


  • fixedConfigurationPreset.keyName
    • Optional
    • Type - string
    • Description - The fixedConfigurationPreset property is a fixed configuration preset structure. The keyName property must be set to specify preset to use.
    • If a fixed configuration preset is used processorCoreAmount, memoryCapacity and hardDrives properties must not be set.
    • See getCreateObjectOptions for available options.

    {
    "fixedConfigurationPreset": {
    "keyName": "SOME_KEY_NAME"
    }
    }


  • userData.value
    Arbitrary data to be made available to the server.
    • Optional
    • Type - string
    • Description - The userData property is an array with a single attribute structure with the value property set to an arbitrary value.
    • This value can be retrieved via the getUserMetadata method from a request originating from the server. This is primarily useful for providing data to software that may be on the server and configured to execute upon first boot.

    {
    "userData": [
    {
    "value": "someValue"
    }
    ]
    }


  • hardDrives
    Hard drive settings for the server
    • Optional
    • Type - SoftLayer_Hardware_Component
    • Default - The largest available capacity for a zero cost primary disk will be used.
    • Description - The hardDrives property is an array of hardware component structures.
    • Each hard drive must specify the capacity property.
    • See getCreateObjectOptions for available options.

    {
    "hardDrives": [
    {
    "capacity": 500
    }
    ]
    }


  • sshKeys
    SSH keys to install on the server upon provisioning.

    {
    "sshKeys": [
    {
    "id": 123
    }
    ]
    }


  • postInstallScriptUri
    Specifies the uri location of the script to be downloaded and run after installation is complete.
    • Optional
    • Type - string

REST Example

curl -X POST -d '{
"parameters":[
{
"hostname": "host1",
"domain": "example.com",
"processorCoreAmount": 2,
"memoryCapacity": 2,
"hourlyBillingFlag": true,
"operatingSystemReferenceCode": "UBUNTU_LATEST"
}
]
}' https://api.softlayer.com/rest/v3/SoftLayer_Hardware.json

HTTP/1.1 201 Created
Location: https://api.softlayer.com/rest/v3/SoftLayer_Hardware/f5a3fcff-db1d-4b7c-9fa0-0349e41c29c5/getObject

{
"accountId": 232298,
"bareMetalInstanceFlag": null,
"domain": "example.com",
"hardwareStatusId": null,
"hostname": "host1",
"id": null,
"serviceProviderId": null,
"serviceProviderResourceId": null,
"globalIdentifier": "f5a3fcff-db1d-4b7c-9fa0-0349e41c29c5",
"hourlyBillingFlag": true,
"memoryCapacity": 2,
"operatingSystemReferenceCode": "UBUNTU_LATEST",
"processorCoreAmount": 2
}

Parameters

templateObject

SoftLayer_Hardware

The SoftLayer_Hardware object that you wish to create.

Headers

Optional Headers: 
SoftLayer_ObjectMask
Required Headers: 
authenticate

Return Values