Skip to content

Instantly share code, notes, and snippets.

<?php
require_once './softlayer-api-php-client/SoftLayer/SoapClient.class.php';
$apiUsername = '';
$apiKey = '';
$accountClient = SoftLayer_SoapClient::getClient('SoftLayer_Account', null, $apiUsername, $apiKey);
$hardwareClient = SoftLayer_SoapClient::getClient('SoftLayer_Hardware_Server', null, $apiUsername, $apiKey);
$cciClient = SoftLayer_SoapClient::getClient('SoftLayer_Virtual_Guest', null, $apiUsername, $apiKey);\
import SoftLayer.API
from pprint import pprint as pp
apiUsername = ''
apiKey = ''
passwordClient = SoftLayer.API.Client(
'SoftLayer_Software_Component_Password', None, apiUsername, apiKey)
import SoftLayer.API
from pprint import pprint as pp
apiUsername = ''
apiKey = ''
client = SoftLayer.Client(username=apiUsername, api_key=apiKey)
def updatePassword(server):
#!/usr/bin/env python
def ticket_iter(client, start_date, end_date):
mask = """
mask[
id,
billableFlag,
createDate,
groupId,
@underscorephil
underscorephil / createCCIFromTemplates.py
Created May 8, 2013 20:36
SoftLayer_Virtual_Guest::createObject using an existing CCI to populate the config values in addition to a image template.
import SoftLayer.API
from pprint import pprint as pp
api_username = ''
api_key = ''
image_template_name = ''
guestId = 1234
hostname = 'host1'
domain_name = 'example.com'
@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'
<?php
require_once './softlayer/SoftLayer/SoapClient.class.php';
$apiUsername = '';
$apiKey = '';
$loadBalancerId = ;
$cciId = ;
addToLB($cciId, $loadBalancerId, $apiUsername, $apiKey);
<?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. <sldn@softlayer.com>
*/
import SoftLayer
from pprint import pprint as pp
client = SoftLayer.Client(username=apiUsername, api_key=apiKey)
mask = {
'hardware': {
'datacenter': {},
'privateIpAddress': {},
'primaryNetworkComponent': {
<?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);