Skip to content

Instantly share code, notes, and snippets.

import SoftLayer
from pprint import pprint as pp
api_username = ''
api_key = ''
guestId = 1234
hostname = 'host1'
domain_name = 'example.com'
operating_system = 'CENTOS_5_64'
import SoftLayer
from pprint import pprint as pp
client = SoftLayer.Client(username=apiUsername, api_key=apiKey)
mask = {
'hardware': {
'datacenter': {},
'privateIpAddress': {},
'primaryNetworkComponent': {
# 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
# 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 = ''
@sudorandom
sudorandom / network_graphs.py
Last active December 12, 2015 02:38
Generates graphs of VLANs/hardware/CCIs/firewalls from data in the SoftLayer API.
#!/usr/bin/env python
"""
Generates graphs of VLANs and connected hardware/CCIs from data in the
SoftLayer API.
"""
import argparse
import time
import math
import matplotlib.pyplot as plt