This file contains hidden or 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 | |
/* | |
This script will take all dns records on a SoftLayer account and create a dns zone file for them in the 'zones' subdirectory. If this subdirectory does not exist, it will be created. | |
If single_use is set to true, you can supply your API Username and Key as arguments to the script. single_use also assumes that it is in the same directory as the SoftLayer folder from the PHP API Client. If single_use is false, it will draw from a file in the 'configuration' subdirectory named apiconfig.php, which should define apiUsername, apiKey, and the path to the SoapClient.class.php file. | |
*/ | |
$single_use = true; | |
if ($single_use) { | |
require_once('SoftLayer/SoapClient.class.php'); |
This file contains hidden or 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 | |
/* | |
/ ccikvm.php - Used to pull KVM credentials for all cloud instances on an account. | |
/ With single_use true, you need to supply the api username and password as the first and second arguments. | |
/ This assumes that you have ccikvm.php in the same directory as the 'SoftLayer' folder in the PHP api client. | |
/ Syntax: php ccikvm.php $apiUsername $apiKey | |
/ | |
/ If single_use is false, this will look for configuration/apiconfig.php, which will need to contain the | |
/ apiUsername, apiKey, and the path to the SoftLayer php client directory. Only useful if you have a lot | |
/ of scripts to work with. |
This file contains hidden or 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 | |
$single_use = true; | |
if ($single_use) { | |
if(!isset($_SERVER['argv'][1]) || !isset($_SERVER['argv'][2])){ | |
die("single_use is set, please supply API Username and Key"); | |
} | |
require_once('SoftLayer/SoapClient.class.php'); | |
$apiUsername = $argv[1]; | |
$apiKey = $argv[2]; |
This file contains hidden or 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 | |
// This relies on the Softlayer PHP API Client, available at https://github.com/softlayer/softlayer-api-php-client. | |
// Please make sure you have set this up before running the script. To run this, just drop it in the same directory | |
// as the "SoftLayer" folder and run 'php virtdisks.php' from the terminal. It will prompt for three things: | |
// API User - This is your SL Username | |
// API Key - Available at https://manage.softlayer.com/Administrative/apiKeychain or https://control.softlayer.com/account/user/profile/ | |
// Cloud Instance - The CCI Id, found by clicking on the CCI at https://manage.softlayer.com/CloudLayer/computing and examining the "viewinstance" url of the next page. | |
// This script will grab all block devices for the given CCI, then loop through them to grab further information, such as disk image capacity and so on. |
This file contains hidden or 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 | |
// This relies on the Softlayer PHP API Client, available at https://github.com/softlayer/softlayer-api-php-client. | |
// Please make sure you have set this up before running the script. To run this, just drop it in the same directory | |
// as the "SoftLayer" folder and run 'php virtdisks.php' from the terminal. It will prompt for three things: | |
// API User - This is your SL Username | |
// API Key - Available at https://manage.softlayer.com/Administrative/apiKeychain or https://control.softlayer.com/account/user/profile/ | |
// apiconfig.php needs to have apiUsername, apiKey, and the path to the SLApi file that used to be in this script. | |
require_once('configuration/apiconfig.php'); |
This file contains hidden or 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 | |
/* | |
This relies on the Softlayer PHP API Client, available at https://github.com/softlayer/softlayer-api-php-client. | |
Please make sure you have set this up before running the script. To run this, just drop it in the same directory as the "SoftLayer" folder and run 'php dns_bulkAddARecords.php' from the terminal. It will prompt for three things: | |
API User - This is your SL Username | |
API Key - Available at https://manage.softlayer.com/Administrative/apiKeychain or https://control.softlayer.com/account/user/profile/ | |
Domain name - Domain to modify | |
File name - File to read from, with following format: | |
$host $target |
This file contains hidden or 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 | |
// Grab an IP address | |
$ip = readline("IP: "); | |
require_once dirname(__FILE__) . '/SoftLayer/SoapClient.class.php'; | |
$apiUsername = 'set me'; | |
$apiKey = 'set me too'; |
This file contains hidden or 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
#Last 5 login attempts for User1 | |
#- Successful login from 123.45.67.89 at 2013-11-28T15:29:32-06:00 | |
#- Failed login from 123.45.67.89 at 2013-11-28T15:29:23-06:00 | |
#- Failed login from 123.45.67.89 at 2013-11-28T15:29:22-06:00 | |
#- Successful login from 123.45.67.89 at 2013-11-27T15:13:49-06:00 | |
#- Successful login from 123.45.67.89 at 2013-11-26T08:35:12-06:00 | |
# | |
#Last 5 login attempts for User2 | |
#- Successful login from 123.45.67.89 at 2013-11-16T04:51:42-06:00 | |
#- Successful login from 123.45.67.89 at 2013-11-16T04:50:29-06:00 |
This file contains hidden or 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
require './api.rb' | |
require 'date' | |
slapi = AuthApi.new | |
#api.rb and slapi are used in another file to handle my connection to the SoftLayer API. | |
#Feel free to include that information in this file if you wish. | |
begin |
This file contains hidden or 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 | |
// apiconfig.php needs to have apiUsername, apiKey, and the path to the SLApi file that used to be in this script. | |
require_once('configuration/apiconfig.php'); | |
$guestClient = SoftLayer_SoapClient::getClient('SoftLayer_Virtual_Guest', null, $apiUsername, $apiKey); | |
$objectMask = new SoftLayer_ObjectMask(); | |
$objectMask->operatingSystems->itemPrice; |
OlderNewer