Skip to content

Instantly share code, notes, and snippets.

<?php
require_once('SoftLayer/SoapClient.class.php');
/**
* Set your SoftLayer API username and key.
*/
$apiUsername = 'USER HERE';
$apiKey = 'KEY HERE';
<?php
include('softlayer-api-php-client/SoftLayer/SoapClient.class.php');
$apiUser = '';
$key = '';
$accountClient = SoftLayer_SoapClient::getClient('SoftLayer_Account', Null, $apiUser, $key);
$objectMask = "mask[id, hostname, domain, datacenter.longName, billingItem.recurringFee]";
curl -d @cci.json https://<user>:<api_key>@api.softlayer.com/rest/v3/SoftLayer_Virtual_Guest/createObject
cci.json:
{
"parameters":[
{
"hostname": "host1",
"domain": "example.com",
"datacenter": { "name": "sjc01" },
# So we can talk to the SoftLayer API:
import SoftLayer
# For nice debug output:
from pprint import pprint as pp
# Your SoftLayer API username and key.
#
# Generate an API key at the SoftLayer Customer Portal:
# https://manage.softlayer.com/Administrative/apiKeychain
api_username = ''
# So we can talk to the SoftLayer API:
import SoftLayer
# For nice debug output:
from pprint import pprint as pp
# Your SoftLayer API username and key.
#
# Generate an API key at the SoftLayer Customer Portal:
# https://manage.softlayer.com/Administrative/apiKeychain
apiUsername = ''
<?php
include('softlayer-api-php-client/SoftLayer/SoapClient.class.php');
$apiUser = '';
$key = '';
$accountClient = SoftLayer_SoapClient::getClient('SoftLayer_Account', null, $apiUser, $key);
$objectMask = "mask[id,modifyDate]";
$accountClient->setObjectMask($objectMask);
import SoftLayer
from pprint import pprint as pp
client = SoftLayer.Client(username=apiUsername, api_key=apiKey)
mask = {
'hardware': {
'datacenter': {},
'privateIpAddress': {},
'primaryNetworkComponent': {
<?php
/**
* Add new configuration for a monitoring agent.
*
* This example shows how to use the SoftLayer API to add new configuration for a monitoring agent for the hardware or virtual guest
* server instance.
*
* @license <http://sldn.softlayer.com/wiki/index.php/License>
* @author SoftLayer Technologies, Inc. <[email protected]>
*/
<?php
require_once './softlayer/SoftLayer/SoapClient.class.php';
$apiUsername = '';
$apiKey = '';
$loadBalancerId = ;
$cciId = ;
addToLB($cciId, $loadBalancerId, $apiUsername, $apiKey);
@underscorephil
underscorephil / CCIDifferentOS.py
Created May 8, 2013 20:44
Create a CCI based on the order options of an existing CCI but with a different operating system.
import SoftLayer.API
from pprint import pprint as pp
api_username = ''
api_key = ''
guestId = 1234
hostname = 'host1'
domain_name = 'example.com'
operating_system = 'CENTOS_5_64'