Skip to content

Instantly share code, notes, and snippets.

@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'
#!/usr/bin/env python
def ticket_iter(client, start_date, end_date):
mask = """
mask[
id,
billableFlag,
createDate,
groupId,
import SoftLayer.API
from pprint import pprint as pp
apiUsername = ''
apiKey = ''
client = SoftLayer.Client(username=apiUsername, api_key=apiKey)
def updatePassword(server):
import SoftLayer.API
from pprint import pprint as pp
apiUsername = ''
apiKey = ''
passwordClient = SoftLayer.API.Client(
'SoftLayer_Software_Component_Password', None, apiUsername, apiKey)
<?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);\
# 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 = ''
# So we can talk to the SoftLayer API:
import SoftLayer.API
# 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 = '';
$apiKey = '';
$cciId = ; // ID of the cloud instance
$loadBalancerId = ; // ID of the VIP
// Create the needed API interfaces
<?php
include('softlayer-api-php-client/SoftLayer/SoapClient.class.php');
$apiUser = '';
$apiKey = '';
$serverId = ;
$serverClient = SoftLayer_SoapClient::getClient('SoftLayer_Hardware_Server', $serverId, $apiUser, $apiKey);
try {
#!/usr/bin perl
use warnings;
use strict;
use Data::Dumper;
use SoftLayer::API::SOAP;
my $api_username = '';
my $api_key = '';
my $cPanelIp = '127.0.0.1';