Skip to content

Instantly share code, notes, and snippets.

from pprint import pprint as pp
import SoftLayer
client = SoftLayer.Client()
mgr = SoftLayer.CCIManager(client)
serverId = 1234
mask = ('mask[monitoringAgents[id,name,statusName]]')
server = mgr.get_instance(serverId, mask=mask)
pp(server)
@underscorephil
underscorephil / create_notification.py
Created January 13, 2014 18:05
Create notification subscribers
#!/usr/bin/env python
import SoftLayer.API
from pprint import pprint as pp
api_username = ''
api_key = ''
client = SoftLayer.Client(
username=api_username,
<?php
include('softlayer-api-php-client/SoftLayer/SoapClient.class.php');
$apiUsername = '';
$apiKey = '';
$accountClient = SoftLayer_SoapClient::getClient('SoftLayer_Account', null, $apiUsername, $apiKey);
$mask = "mask[billingItem[recurringFee, id, orderItem[description, order[userRecord[id, username], id]]]]";
from SoftLayer import CCIManager, Client
api_username = ''
api_key = ''
object_mask = 'mask.provisionDate'
client = Client(
username=api_username,
api_key=api_key
import SoftLayer
object_mask = 'mask.provisionDate'
client = SoftLayer.Client()
cci = client['Virtual_Guest'].getObject(id=12345, mask=object_mask)
if ( 'provisionDate' in cci and cci['provisionDate'] != ''):
print 'CCI %s is online' % cci['hostname']
{
"parameters": [
{
"id": 1234,
"virtualServers": [
{
"virtualIpAddressId": 1234,
"port": 80,
"allocation": 100,
"serviceGroups": [
import SoftLayer.API
from pprint import pprint as pp
api_username = ''
api_key = ''
hostname = ''
domain_name = ''
client = SoftLayer.Client(
<?php
include('softlayer-api-php-client/SoftLayer/SoapClient.class.php');
$apiUsername = '';
$apiKey = '';
$client = SoftLayer_SoapClient::getClient('SoftLayer_Account', null, $apiUsername, $apiKey);
$client->setObjectMask("mask.users.userStatus");
$users = $client->getObject();
print_r($users);
<?php
include('softlayer-api-php-client/SoftLayer/SoapClient.class.php');
$apiUsername = '';
$apiKey = '';
$accountClient = SoftLayer_SoapClient::getClient('SoftLayer_Account', null, $apiUsername, $apiKey);
$userClient = SoftLayer_SoapClient::getClient('SoftLayer_User_Customer', null, $apiUsername, $apiKey);
$virtualGuestClient = SoftLayer_SoapClient::getClient('SoftLayer_Virtual_Guest', null, $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>
*/