Skip to content

Instantly share code, notes, and snippets.

<?php
include('softlayer-api-php-client/SoftLayer/SoapClient.class.php');
/*
* Loop through all permissions and remove permission objects who's key
* appears in the $permissionsToRemove array
*/
function unsetArray($allPermissions, $permissionsToRemove) {
foreach($permissionsToRemove as $permissionToRemove) {
foreach($allPermissions as $index => $permission){
@underscorephil
underscorephil / archive_transaction.py
Created November 13, 2013 16:22
Capture an image for all block devices on a CCI
client = SoftLayer.Client()
cci = SoftLayer.CCIManager(client)
instance = cci.get_instance(cci_id)
disks = filter(lambda x: x['blockDevices'] != 1, instance['blockDevices']) # remove the swap disk
client['Virtual_Guest'].createArchiveTransaction(
"display name",
disks,
"Description here - My first capture",
id=cci_id,
)
import SoftLayer.API
from pprint import pprint as pp
api_username = ''
api_key = ''
client = SoftLayer.Client(
username=api_username,
api_key=api_key,
import SoftLayer.API
from pprint import pprint as pp
apiUsername = ''
apiKey = ''
client = SoftLayer.Client(
username=apiUsername,
api_key=apiKey,
)
import SoftLayer.API
apiUsername = ''
apiKey = ''
client = SoftLayer.Client(
username=apiUsername,
api_key=apiKey,
)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace SLAPI_TEST
{
class Program
{
static void Main(string[] args)
import SoftLayer.API
from pprint import pprint as pp
apiUsername = ''
apiKey = ''
client = SoftLayer.Client(
username=apiUsername,
api_key=apiKey,
)
require 'rubygems'
require 'softlayer_api'
require 'net/https'
require 'pp'
require 'json'
order_client = SoftLayer::Service.new('SoftLayer_Product_Order',
:username => "",
:api_key => "")
require 'rubygems'
require 'softlayer_api'
require 'net/https'
require 'pp'
virtual_guest_service = SoftLayer::Service.new("SoftLayer_Virtual_Guest",
:username => "",
:api_key => "")
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace SLAPI_TEST
{
class Program
{
static void Main(string[] args)