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 | |
require_once('SoftLayer/SoapClient.class.php'); | |
/** | |
* Set your SoftLayer API username and key. | |
*/ | |
$apiUsername = ''; | |
$apiKey = ''; |
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
""" | |
Perform a server OS reload with a new operating system. | |
Reload a server with a new operating system, software, and a custom drive | |
partition scheme. In this case we're loading a server with Windows 2008 R2 | |
Standard Edition, 64-bit with a 50G C: partition and a D: partition that fills | |
up the rest of the disk's free space. SoftLayer's standard | |
reloadOperatingSystem() method in the SoftLayer_Hardware_Server API service | |
<http://sldn.softlayer.com/reference/services/SoftLayer_Hardware_Server/reloadOperatingSystem> | |
takes care of the heavy lifting after you've defined your new software options |
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 | |
require_once('SoftLayer/SoapClient.class.php'); | |
/** | |
* Set your SoftLayer API username and key. | |
*/ | |
$apiUsername = 'USER HERE'; | |
$apiKey = 'KEY HERE'; |
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 | |
require_once('SoftLayer/SoapClient.class.php'); | |
function updateDns() { | |
$apiUsername = 'USER HERE'; | |
$apiKey = 'KEY HERE'; | |
$domainId = 'DOMAIN ID HERE'; | |
$dnsClient = SoftLayer_SoapClient::getClient('SoftLayer_Dns_Domain', $domainId, $apiUsername, $apiKey); | |
$recordClient = SoftLayer_SoapClient::getClient('SoftLayer_Dns_Domain_ResourceRecord', null , $apiUsername, $apiKey); |
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
import SoftLayer.API | |
import ipaddr | |
def splitIpCidrNotation(arg): | |
ipv4 = ipaddr.IPv4Network(arg) | |
return str(ipv4.ip), str(ipv4.netmask) | |
def getClients(user, 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 | |
/** | |
* 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. | |
* | |
* 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
<?php | |
/** | |
* Retrieve graphs for specific metrics for a single server. | |
* | |
* This example shows how to use the SoftLayer API to retrieve graphs for the | |
* specific Advanced Monitoring metrics for a single hardware or virtual guest | |
* server instance. | |
* | |
* We will call the SoftLayer API to retrieve the monitoring agents, | |
* configuration template, and configuration values for a server instance. |
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
# So we can talk to the SoftLayer API: | |
import SoftLayer.API | |
import argparse | |
# Your SoftLayer API username and key. | |
# | |
# Generate an API key at the SoftLayer Customer Portal: | |
# https://manage.softlayer.com/Administrative/apiKeychain | |
apiUsername = '' | |
apiKey = '' |
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 | |
require_once dirname(__FILE__) . '/SoftLayer/SoapClient.class.php'; | |
/** | |
* Your SoftLayer API username. | |
* | |
* @var string | |
*/ | |
$apiUsername = 'API_USERNAME'; |
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 new server. | |
* | |
* Build a SoftLayer_Container_Product_Order_Hardware_Server object for a new | |
* server order and pass it to the SoftLayer_Product_Order API service to order | |
* it. In this care we'll order a Xeon 3060 server with 2G RAM, 100mbit NICs, | |
* 2000GB bandwidth, a 250G SATA drive, CentOS 5 64-bit, and default server | |
* order options. See below for more details. | |
* |
NewerOlder