This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin perl | |
use warnings; | |
use strict; | |
use SoftLayer::API::SOAP; | |
# Set SLAPI User and Key | |
my $api_username = ''; | |
my $api_key = ''; | |
# ID of LoadBalancer to poll |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a network monitor | |
# So we can talk to the SoftLayer API: | |
import SoftLayer.API | |
# For nice debug output: | |
import pprint | |
pp = pprint.PrettyPrinter(indent=4) | |
# Your SoftLayer API username and key. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add/update a reverse DNS record by providing an IP and FQDN. | |
* | |
* This assumes the SoftLayer API PHP client | |
* <http://github.com/softlayer/softlayer-api-php-client> is installed in the | |
* directory '/SoftLayer' in this script's path and that you wish to use the | |
* SOAP client instead of our XML-RPC client. | |
* | |
* @see http://sldn.softlayer.com/wiki/index.php/SoftLayer_Network_Subnet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Recieve an indexed array of IPs and their associated reverse DNS hostnames | |
* when providing an IP address. This reuiqres two api calls to accomplish, | |
* one to retrieve the privded IP address's subnet ID, then to get all of the | |
* reverse DNS records for that subnet. | |
* | |
* This assumes the SoftLayer API PHP client | |
* <http://github.com/softlayer/softlayer-api-php-client> is installed in the | |
* directory '/SoftLayer' in this script's path and that you wish to use the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Retrieve a bandwidth graph for a single server. | |
* | |
* Retrieve a bandwidth graph for a single server for an arbitrary start and | |
* end date, specifying graph size and other graphing options. We can do this | |
* with two calls to the SoftLayer API. | |
* | |
* Counter data such as bandwidth counters and CCI resource use are stored in | |
* a server's metric tracking object. Our first call retrieves that server's |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Retrieve account VLAN and subnet information per server. | |
// | |
// Retrieve a list of all servers associated with a SoftLayer customer account | |
// and print a simple report detailing their VLANs and the subnets assigned to | |
// them. We do this with a call to the getHardare() method in the | |
// SoftLayer_Account API service using an object mask to retrieve the hardware, | |
// VLANs, VLANs' associated subnets and primary router records. See below for | |
// more details. | |
// | |
// Backend code to call the SoftLayer API was generated with the wsdl.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Order a control panel license for a virtual private server (VPS). | |
* | |
* Build a SoftLayer_Container_Product_Order_Software_Component_Virtual object | |
* for a new control panel license order and pass it to the | |
* SoftLayer_Product_Order API service to order it. See below for more details. | |
* | |
* This assumes the SoftLayer API PHP client | |
* <http://github.com/softlayer/softlayer-api-php-client> is installed in the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Order a new SoftLayer IP subnet | |
// | |
// Build a SoftLayer_Container_Product_Order_Network_Subnet object for a new IP | |
// subnet order and pass it to the SoftLayer_Product_Order API service to order | |
// it. See below for more details. | |
// | |
// Backend code to call the SoftLayer API was generated with the wsdl.exe | |
// utility: | |
// | |
// wsdl.exe /language:CS /out:"C:\path\to\project\SoftLayer_API.cs" /sharetypes http://api.service.softlayer.com/soap/v3/SoftLayer_Product_Order?wsdl |