Last active
August 29, 2015 13:59
-
-
Save hassenius/10728414 to your computer and use it in GitHub Desktop.
SoftLayer Order multiple RAID Groups
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_multiple_raid_groups.rb | |
# ©Copyright IBM Corporation 2014. | |
# | |
# LICENSE: MIT (http://opensource.org/licenses/MIT) | |
################################################################################ | |
require 'rubygems' | |
require 'softlayer_api' | |
$SL_API_USERNAME = " PLEASE SET ME " | |
$SL_API_KEY = " PLEASE SET ME TOO " | |
client = SoftLayer::Service.new( "SoftLayer_Product_Order"); | |
order = { | |
:complexType => 'SoftLayer_Container_Product_Order_Hardware_Server', | |
:quantity => 1, | |
:hardware => [{:hostname => 'raidtest', :domain => 'example.com'}], | |
:location => 168642, # San Jose 1 | |
:packageId => 53, # Intel Xeon 3200 Series | |
:prices => [ | |
{:id => 2050}, # Single Processor Quad Core Xeon 3460 - 2.80GHz (Lynnfield) - 1 x 8MB cache w/HT | |
{:id => 17438}, # -- Ubuntu Linux 12.04.0 LTS Precise Pangolin - Minimal Install (64 bit) | |
{:id => 21004}, # 4 GB DDR3 Registered 1333 | |
{:id => 22482}, # Disk controller -- RAID | |
{:id => 13756}, # First hard drive -- 50GB SSD | |
{:id => 1256}, # Second hard drive -- 147GB SA-SCSI 10K RPM | |
{:id => 825}, # Third hard drive -- 147GB SA-SCSI 10K RPM | |
{:id => 825}, # Fourth hard drive -- 147GB SA-SCSI 10K RPM | |
{:id => 728}, # 0 GB Bandwidth | |
{:id => 898}, # 100 Mbps Private Network | |
{:id => 906}, # Reboot / KVM over IP | |
{:id => 420}, # Unlimited SSL VPN Users & 1 PPTP VPN User per account | |
{:id => 55}, # Host Ping | |
{:id => 418}, # Nessus Vulnerability Assessment & Reporting | |
{:id => 57}, # Notification -- Email and Ticket | |
{:id => 58} # Response -- Automated Notification | |
], | |
:storageGroups => [ | |
{ # RAID Array 1 | |
:arrayTypeId => 9, # JBOD | |
:hardDrives => [0], # First Hard Drive (50GB SSD) | |
:partitionTemplateId => 226 # Custom partition template - 12GB Swap | |
}, | |
{ # RAID Array 2 | |
:arrayTypeId => 1, # RAID 0 | |
:hardDrives => [1,2,3] # Second, thrid and fourth hard drives (147GB SAS) | |
} | |
] | |
} | |
result = client.verifyOrder(order) | |
## Uncomment when you're ready to order | |
# client.placeOrder(order) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment