Skip to content

Instantly share code, notes, and snippets.

"""
Reboot a SoftLayer server
Given a server id call the rebootDefault() method in the
SoftLayer_Hardware_Server service to attempt to reboot the server via IPMI or
its power strip if remote management is unavailable. See
<http://sldn.softlayer.com/reference/services/SoftLayer_Hardware_Server/rebootDefault>
for more information.
This script assumes you're using the SoftLayer API Python client
#!/usr/bin/perl
# Reboot a SoftLayer server
#
# Given a server id call the rebootDefault() method in the
# SoftLayer_Hardware_Server service to attempt to reboot the server via IPMI
# or its power strip if remote management is unavailable. See
# <http://sldn.softlayer.com/reference/services/SoftLayer_Hardware_Server/rebootDefault>
# for more information.
#
# This script assumes you're using the SoftLayer API Perl client
#!/usr/bin/perl
# Order a new CDN account
#
# Build a SoftLayer_Container_Product_Order_Network_ContentDelivery_Account
# object for a new CDN account order and pass it to the SoftLayer_Product_Order
# API service to order it. In this carsre we'll order a pay as you go bandwidth
# and storage CDN accopunt. See below for more details.
#
# This assumes you're using the SoftLayer API Perl client
# <http://github.com/softlayer/softlayer-api-perl-client>.
#!/usr/bin/perl
# Retrieve and analyze a single invoice record
#
# Print a simple report containing information about a single SoftLayer invoice:
# * The invoice's id number and creation date
# * The amount billed in the invoice
# * A list of all items billed for in the invoice, their child items, and their
# prices.
# * Note whether or not the item billed is for an existing server on your
# SoftLauer account.
#!/usr/bin/perl
# Order a Cloud Computing Instance based on an existing CCI
#
# Build a SoftLayer_Container_Product_Order_Virtaul_Guest object for a new
# CloudLayer Computing Instance based on an existing CCI and disk template image
# on your account and pass it to the SoftLayer_Product_Order API service to
# order it. See below for more details.
#
# This assumes you're using the SoftLayer API Perl client
# <http://github.com/softlayer/softlayer-api-perl-client>.
"""
Order a Cloud Computing Instance based on an existing CCI
Build a SoftLayer_Container_Product_Order_Virtaul_Guest object for a new
CloudLayer Computing Instance based on an existing CCI and disk template image
on your account and pass it to the SoftLayer_Product_Order API service to order
it. See below for more details.
This assumes you're using the SoftLayer API Python client
<http://github.com/softlayer/softlayer-api-python-client>. It's been written
<?php
/**
* Get the recurring cost of a single server or all servers on your account.
*
* Perform two operations:
* 1) Get a list of servers on a SoftLayer account along with their recurring
* monthly costs. We can get that by calling getHardware() in the
* SoftLayer_Account API service with an object mask to retrieve cost.
* 2) Get the cost for a single server by calling getCost() in the
* SoftLayer_Hardware_Server service.
<?php
/**
* Edit a server's basic information
*
* Change the notes property for a single server record to the sentence "This
* is my fastest server!" using the editObject() method in the
* SoftLayer_Hardware_Server API service. See below for more details.
*
* This assumes the SoftLayer API PHP client
* <http://github.com/softlayer/softlayer-api-php-client> is installed in the
<?php
/**
* Retrieve an account's next invoice information.
*
* This script retrieves the data presented in the SoftLayer Customer Portal's
* show next invoice page
* (https://manage.softlayer.com/Administrative/showNextInvoice) using a single
* API call. Next invoice information is retrieved from the billing items
* related to the servers and service you own with SoftLayer. It represents what
* is gauranteed to show on your next invoice, but doesn't represent one-time
<?php
/**
* Print a report containing a single server's details.
*
* Print a report for a single server containing:
*
* - id number
* - hostname
* - domain
* - notes