Skip to content

Commit c96f53e

Browse files
added spare pool example
1 parent 33b8408 commit c96f53e

17 files changed

Lines changed: 749 additions & 167 deletions

File tree

classes/index.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<item>
2121
<title>Softlayer_account</title>
2222
<link>https://softlayer.github.io/classes/softlayer_account/</link>
23-
<pubDate>Wed, 09 Aug 2017 00:00:00 UTC</pubDate>
23+
<pubDate>Mon, 09 Oct 2017 00:00:00 UTC</pubDate>
2424
<author>Enthusiastic Hugo User</author>
2525
<guid>https://softlayer.github.io/classes/softlayer_account/</guid>
2626
<description></description>

classes/softlayer_account/index.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,11 @@ <h3>python</h3>
245245
<h3>rest</h3>
246246
<ul>
247247

248+
<li>
249+
<a href="https://softlayer.github.io/rest/spare_pool/">Spare Pool Servers</a>
250+
<div class="meta">How to interact with the Spare Pool</div>
251+
</li>
252+
248253
<li>
249254
<a href="https://softlayer.github.io/rest/which_user_placed_order/">Find out which user placed an order</a>
250255
<div class="meta">Find out which user placed an orde</div>

classes/softlayer_account/index.xml

Lines changed: 42 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,48 @@
66
<language>en-US</language>
77
<author>Enthusiastic Hugo User</author>
88
<rights>Copyright (c) 2014, Enthusiastic Hugo User; all rights reserved.</rights>
9-
<updated>Wed, 09 Aug 2017 00:00:00 UTC</updated>
9+
<updated>Mon, 09 Oct 2017 00:00:00 UTC</updated>
10+
11+
<item>
12+
<title>Spare Pool Servers</title>
13+
<link>https://softlayer.github.io/rest/spare_pool/</link>
14+
<pubDate>Mon, 09 Oct 2017 00:00:00 UTC</pubDate>
15+
<author>Enthusiastic Hugo User</author>
16+
<guid>https://softlayer.github.io/rest/spare_pool/</guid>
17+
<description>
18+
19+
&lt;p&gt;Operation: &lt;code&gt;GET&lt;/code&gt;&lt;/p&gt;
20+
21+
&lt;p&gt;Method: &lt;a href=&#34;http://sldn.softlayer.com/reference/services/SoftLayer_Hardware_Server/sparePool&#34;&gt;&lt;code&gt;SoftLayer_Hardware_Server::sparepool()&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
22+
23+
&lt;p&gt;Example CURL:&lt;/p&gt;
24+
25+
&lt;pre&gt;&lt;code&gt;curl -su userid:api_key https://api.softlayer.com/rest/v3/SoftLayer_Hardware_Server/&amp;lt;hardware_id&amp;gt;/sparepool/add
26+
27+
curl -su userid:api_key &amp;quot;https://api.softlayer.com/rest/v3/SoftLayer_Hardware_Server/&amp;lt;hardware_id&amp;gt;/sparePool/activate&amp;quot;
28+
&lt;/code&gt;&lt;/pre&gt;
29+
30+
&lt;p&gt;Will return True if the action was successful, or throw an exception otherwise&lt;/p&gt;
31+
32+
&lt;p&gt;Exceptions:&lt;/p&gt;
33+
34+
&lt;pre&gt;&lt;code&gt;This server (hostname.domain.name) is not in a status that allows it to be added to spare pool.
35+
This server (hostname.domain.name) is not in a status that allows it to be removed from spare pool.
36+
&lt;/code&gt;&lt;/pre&gt;
37+
38+
&lt;p&gt;The server is likely already in a spare pool.&lt;/p&gt;
39+
40+
&lt;h3 id=&#34;view-spare-pool-servers&#34;&gt;View Spare Pool Servers&lt;/h3&gt;
41+
42+
&lt;p&gt;Filtering by hardwareStatus-&amp;gt;status doesn&amp;rsquo;t work, you will need to filter by the status id only.&lt;/p&gt;
43+
44+
&lt;p&gt;Status id 23 is SPARE_POOL
45+
Status id 5 is ACTIVE&lt;/p&gt;
46+
47+
&lt;pre&gt;&lt;code&gt;curl -su userid:api_key &#39;https://api.softlayer.com/rest/v3/SoftLayer_Account/getHardware?objectMask=mask[id,hostname,hardwareStatus[status,id]]&amp;amp;objectFilter={&amp;quot;hardware&amp;quot;:{&amp;quot;hardwareStatus&amp;quot;:{&amp;quot;id&amp;quot;:{&amp;quot;operation&amp;quot;:23}}}}&#39;
48+
&lt;/code&gt;&lt;/pre&gt;
49+
</description>
50+
</item>
1051

1152
<item>
1253
<title>Get Dedicated Host Allocation</title>
@@ -1017,43 +1058,6 @@ item = client[&#39;SoftLayer_Account&#39;]
10171058
getIPMI = item.object_mask(object_mask).getHardware
10181059

10191060
pp getIPMI
1020-
&lt;/code&gt;&lt;/pre&gt;
1021-
</description>
1022-
</item>
1023-
1024-
<item>
1025-
<title>Get IPMI info for Bare Metal Server</title>
1026-
<link>https://softlayer.github.io/php/get_ipmi/</link>
1027-
<pubDate>Mon, 22 Aug 2016 00:00:00 UTC</pubDate>
1028-
<author>Enthusiastic Hugo User</author>
1029-
<guid>https://softlayer.github.io/php/get_ipmi/</guid>
1030-
<description>&lt;pre&gt;&lt;code class=&#34;language-php&#34;&gt;&amp;lt;?php
1031-
1032-
require_once &#39;./vendor/autoload.php&#39;;
1033-
$apiUsername = getenv(&#39;SOFTLAYER_USERNAME&#39;);
1034-
$apiKey = getenv(&#39;SOFTLAYER_API_KEY&#39;);
1035-
1036-
$server_id = 882187;
1037-
1038-
try {
1039-
$client = \SoftLayer\SoapClient::getClient(&#39;SoftLayer_Account&#39;, $server_id, $apiUsername, $apiKey);
1040-
$objectMask = new \SoftLayer\Common\ObjectMask();
1041-
$objectMask-&amp;gt;networkManagementIpAddress;
1042-
$objectMask-&amp;gt;remoteManagementAccounts-&amp;gt;username;
1043-
$objectMask-&amp;gt;remoteManagementAccounts-&amp;gt;password;
1044-
$objectMask-&amp;gt;id;
1045-
$objectMask-&amp;gt;fullyQualifiedDomainName;
1046-
$client-&amp;gt;setObjectMask($objectMask);
1047-
$response = $client-&amp;gt;getHardware($objectMask);
1048-
1049-
print_r($response);
1050-
1051-
} catch(Exception $e) {
1052-
echo &#39;Cannot compute. Error is: &#39; . $e-&amp;gt;getMessage();
1053-
}
1054-
1055-
?&amp;gt;
1056-
10571061
&lt;/code&gt;&lt;/pre&gt;
10581062
</description>
10591063
</item>

classes/softlayer_hardware_server/index.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,16 @@ <h3>python</h3>
142142

143143
</ul>
144144

145+
<h3>rest</h3>
146+
<ul>
147+
148+
<li>
149+
<a href="https://softlayer.github.io/rest/spare_pool/">Spare Pool Servers</a>
150+
<div class="meta">How to interact with the Spare Pool</div>
151+
</li>
152+
153+
</ul>
154+
145155
<h3>ruby</h3>
146156
<ul>
147157

classes/softlayer_hardware_server/index.xml

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,48 @@
66
<language>en-US</language>
77
<author>Enthusiastic Hugo User</author>
88
<rights>Copyright (c) 2014, Enthusiastic Hugo User; all rights reserved.</rights>
9-
<updated>Sun, 02 Apr 2017 00:00:00 UTC</updated>
9+
<updated>Mon, 09 Oct 2017 00:00:00 UTC</updated>
10+
11+
<item>
12+
<title>Spare Pool Servers</title>
13+
<link>https://softlayer.github.io/rest/spare_pool/</link>
14+
<pubDate>Mon, 09 Oct 2017 00:00:00 UTC</pubDate>
15+
<author>Enthusiastic Hugo User</author>
16+
<guid>https://softlayer.github.io/rest/spare_pool/</guid>
17+
<description>
18+
19+
&lt;p&gt;Operation: &lt;code&gt;GET&lt;/code&gt;&lt;/p&gt;
20+
21+
&lt;p&gt;Method: &lt;a href=&#34;http://sldn.softlayer.com/reference/services/SoftLayer_Hardware_Server/sparePool&#34;&gt;&lt;code&gt;SoftLayer_Hardware_Server::sparepool()&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
22+
23+
&lt;p&gt;Example CURL:&lt;/p&gt;
24+
25+
&lt;pre&gt;&lt;code&gt;curl -su userid:api_key https://api.softlayer.com/rest/v3/SoftLayer_Hardware_Server/&amp;lt;hardware_id&amp;gt;/sparepool/add
26+
27+
curl -su userid:api_key &amp;quot;https://api.softlayer.com/rest/v3/SoftLayer_Hardware_Server/&amp;lt;hardware_id&amp;gt;/sparePool/activate&amp;quot;
28+
&lt;/code&gt;&lt;/pre&gt;
29+
30+
&lt;p&gt;Will return True if the action was successful, or throw an exception otherwise&lt;/p&gt;
31+
32+
&lt;p&gt;Exceptions:&lt;/p&gt;
33+
34+
&lt;pre&gt;&lt;code&gt;This server (hostname.domain.name) is not in a status that allows it to be added to spare pool.
35+
This server (hostname.domain.name) is not in a status that allows it to be removed from spare pool.
36+
&lt;/code&gt;&lt;/pre&gt;
37+
38+
&lt;p&gt;The server is likely already in a spare pool.&lt;/p&gt;
39+
40+
&lt;h3 id=&#34;view-spare-pool-servers&#34;&gt;View Spare Pool Servers&lt;/h3&gt;
41+
42+
&lt;p&gt;Filtering by hardwareStatus-&amp;gt;status doesn&amp;rsquo;t work, you will need to filter by the status id only.&lt;/p&gt;
43+
44+
&lt;p&gt;Status id 23 is SPARE_POOL
45+
Status id 5 is ACTIVE&lt;/p&gt;
46+
47+
&lt;pre&gt;&lt;code&gt;curl -su userid:api_key &#39;https://api.softlayer.com/rest/v3/SoftLayer_Account/getHardware?objectMask=mask[id,hostname,hardwareStatus[status,id]]&amp;amp;objectFilter={&amp;quot;hardware&amp;quot;:{&amp;quot;hardwareStatus&amp;quot;:{&amp;quot;id&amp;quot;:{&amp;quot;operation&amp;quot;:23}}}}&#39;
48+
&lt;/code&gt;&lt;/pre&gt;
49+
</description>
50+
</item>
1051

1152
<item>
1253
<title>Reload with SSH keys</title>

index.xml

Lines changed: 42 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,48 @@
66
<language>en-US</language>
77
<author>Enthusiastic Hugo User</author>
88
<rights>Copyright (c) 2014, Enthusiastic Hugo User; all rights reserved.</rights>
9-
<updated>Thu, 05 Oct 2017 00:00:00 UTC</updated>
9+
<updated>Mon, 09 Oct 2017 00:00:00 UTC</updated>
10+
11+
<item>
12+
<title>Spare Pool Servers</title>
13+
<link>https://softlayer.github.io/rest/spare_pool/</link>
14+
<pubDate>Mon, 09 Oct 2017 00:00:00 UTC</pubDate>
15+
<author>Enthusiastic Hugo User</author>
16+
<guid>https://softlayer.github.io/rest/spare_pool/</guid>
17+
<description>
18+
19+
&lt;p&gt;Operation: &lt;code&gt;GET&lt;/code&gt;&lt;/p&gt;
20+
21+
&lt;p&gt;Method: &lt;a href=&#34;http://sldn.softlayer.com/reference/services/SoftLayer_Hardware_Server/sparePool&#34;&gt;&lt;code&gt;SoftLayer_Hardware_Server::sparepool()&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
22+
23+
&lt;p&gt;Example CURL:&lt;/p&gt;
24+
25+
&lt;pre&gt;&lt;code&gt;curl -su userid:api_key https://api.softlayer.com/rest/v3/SoftLayer_Hardware_Server/&amp;lt;hardware_id&amp;gt;/sparepool/add
26+
27+
curl -su userid:api_key &amp;quot;https://api.softlayer.com/rest/v3/SoftLayer_Hardware_Server/&amp;lt;hardware_id&amp;gt;/sparePool/activate&amp;quot;
28+
&lt;/code&gt;&lt;/pre&gt;
29+
30+
&lt;p&gt;Will return True if the action was successful, or throw an exception otherwise&lt;/p&gt;
31+
32+
&lt;p&gt;Exceptions:&lt;/p&gt;
33+
34+
&lt;pre&gt;&lt;code&gt;This server (hostname.domain.name) is not in a status that allows it to be added to spare pool.
35+
This server (hostname.domain.name) is not in a status that allows it to be removed from spare pool.
36+
&lt;/code&gt;&lt;/pre&gt;
37+
38+
&lt;p&gt;The server is likely already in a spare pool.&lt;/p&gt;
39+
40+
&lt;h3 id=&#34;view-spare-pool-servers&#34;&gt;View Spare Pool Servers&lt;/h3&gt;
41+
42+
&lt;p&gt;Filtering by hardwareStatus-&amp;gt;status doesn&amp;rsquo;t work, you will need to filter by the status id only.&lt;/p&gt;
43+
44+
&lt;p&gt;Status id 23 is SPARE_POOL
45+
Status id 5 is ACTIVE&lt;/p&gt;
46+
47+
&lt;pre&gt;&lt;code&gt;curl -su userid:api_key &#39;https://api.softlayer.com/rest/v3/SoftLayer_Account/getHardware?objectMask=mask[id,hostname,hardwareStatus[status,id]]&amp;amp;objectFilter={&amp;quot;hardware&amp;quot;:{&amp;quot;hardwareStatus&amp;quot;:{&amp;quot;id&amp;quot;:{&amp;quot;operation&amp;quot;:23}}}}&#39;
48+
&lt;/code&gt;&lt;/pre&gt;
49+
</description>
50+
</item>
1051

1152
<item>
1253
<title>Release notes: October 05, 2017</title>
@@ -1213,45 +1254,6 @@ getAllocStats = client[&#39;SoftLayer_Virtual_DedicatedHost&#39;].object_with_id
12131254

12141255
pp getAllocStats
12151256
&lt;/code&gt;&lt;/pre&gt;
1216-
</description>
1217-
</item>
1218-
1219-
<item>
1220-
<title>Get Dedicated Host Guests</title>
1221-
<link>https://softlayer.github.io/ruby/getdedicatedhostguests/</link>
1222-
<pubDate>Wed, 09 Aug 2017 00:00:00 UTC</pubDate>
1223-
<author>Enthusiastic Hugo User</author>
1224-
<guid>https://softlayer.github.io/ruby/getdedicatedhostguests/</guid>
1225-
<description>&lt;p&gt;The first thing you need to get is a list of the Dedicated Hosts on your account. To list the Dedicated Hosts on your account you can use the following code:&lt;/p&gt;
1226-
1227-
&lt;pre&gt;&lt;code class=&#34;language-ruby&#34;&gt;
1228-
require &#39;softlayer_api&#39;
1229-
require &#39;pp&#39;
1230-
1231-
# Connect to SoftLayer
1232-
client = SoftLayer::Client.new(:timeout =&amp;gt; 120)
1233-
1234-
getDediHosts = client[&#39;SoftLayer_Account&#39;].getDedicatedHosts
1235-
pp getDediHosts
1236-
&lt;/code&gt;&lt;/pre&gt;
1237-
1238-
&lt;p&gt;Once you have the Dedicated Host ID you can use the following code to retrieve the Virtual Guests on the host.&lt;/p&gt;
1239-
1240-
&lt;pre&gt;&lt;code class=&#34;language-ruby&#34;&gt;=begin
1241-
@author Ryan Tiffany
1242-
=end
1243-
1244-
require &#39;softlayer_api&#39;
1245-
require &#39;pp&#39;
1246-
1247-
# Connect to SoftLayer
1248-
client = SoftLayer::Client.new(:timeout =&amp;gt; 120)
1249-
1250-
dedicated_host_id = 10501
1251-
1252-
getGuests = client[&#39;SoftLayer_Virtual_DedicatedHost&#39;].object_with_id(dedicated_host_id).getGuests
1253-
pp getGuests
1254-
&lt;/code&gt;&lt;/pre&gt;
12551257
</description>
12561258
</item>
12571259

rest/index.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,16 @@
9898
<div class="col-md-6">
9999
<div class="well well-sm example">
100100
<h4>
101+
<a href="https://softlayer.github.io/rest/spare_pool/"><span class="fa fa-terminal"> Spare Pool Servers</span></a> <small class="pull-right">Oct 9, 2017</small><br>
102+
<small>How to interact with the Spare Pool</small>
103+
</h4>
104+
<a class="btn btn-primary btn-xs" href="https://softlayer.github.io/rest/spare_pool/">View Example <span class="fa fa-code"></span></a>
105+
</div>
106+
</div>
107+
108+
<div class="col-md-6">
109+
<div class="well well-sm example">
110+
<h4>
101111
<a href="https://softlayer.github.io/rest/getkvmdetails/"><span class="fa fa-terminal"> Get Virtual Console Virtual Guest</span></a> <small class="pull-right">May 4, 2017</small><br>
102112
<small>Retrieve the IP, username, and password needed to access the KVM console for a Virtual Guest.</small>
103113
</h4>

rest/index.xml

Lines changed: 42 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,48 @@
66
<language>en-US</language>
77
<author>Enthusiastic Hugo User</author>
88
<rights>Copyright (c) 2014, Enthusiastic Hugo User; all rights reserved.</rights>
9-
<updated>Thu, 04 May 2017 00:00:00 UTC</updated>
9+
<updated>Mon, 09 Oct 2017 00:00:00 UTC</updated>
10+
11+
<item>
12+
<title>Spare Pool Servers</title>
13+
<link>https://softlayer.github.io/rest/spare_pool/</link>
14+
<pubDate>Mon, 09 Oct 2017 00:00:00 UTC</pubDate>
15+
<author>Enthusiastic Hugo User</author>
16+
<guid>https://softlayer.github.io/rest/spare_pool/</guid>
17+
<description>
18+
19+
&lt;p&gt;Operation: &lt;code&gt;GET&lt;/code&gt;&lt;/p&gt;
20+
21+
&lt;p&gt;Method: &lt;a href=&#34;http://sldn.softlayer.com/reference/services/SoftLayer_Hardware_Server/sparePool&#34;&gt;&lt;code&gt;SoftLayer_Hardware_Server::sparepool()&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
22+
23+
&lt;p&gt;Example CURL:&lt;/p&gt;
24+
25+
&lt;pre&gt;&lt;code&gt;curl -su userid:api_key https://api.softlayer.com/rest/v3/SoftLayer_Hardware_Server/&amp;lt;hardware_id&amp;gt;/sparepool/add
26+
27+
curl -su userid:api_key &amp;quot;https://api.softlayer.com/rest/v3/SoftLayer_Hardware_Server/&amp;lt;hardware_id&amp;gt;/sparePool/activate&amp;quot;
28+
&lt;/code&gt;&lt;/pre&gt;
29+
30+
&lt;p&gt;Will return True if the action was successful, or throw an exception otherwise&lt;/p&gt;
31+
32+
&lt;p&gt;Exceptions:&lt;/p&gt;
33+
34+
&lt;pre&gt;&lt;code&gt;This server (hostname.domain.name) is not in a status that allows it to be added to spare pool.
35+
This server (hostname.domain.name) is not in a status that allows it to be removed from spare pool.
36+
&lt;/code&gt;&lt;/pre&gt;
37+
38+
&lt;p&gt;The server is likely already in a spare pool.&lt;/p&gt;
39+
40+
&lt;h3 id=&#34;view-spare-pool-servers&#34;&gt;View Spare Pool Servers&lt;/h3&gt;
41+
42+
&lt;p&gt;Filtering by hardwareStatus-&amp;gt;status doesn&amp;rsquo;t work, you will need to filter by the status id only.&lt;/p&gt;
43+
44+
&lt;p&gt;Status id 23 is SPARE_POOL
45+
Status id 5 is ACTIVE&lt;/p&gt;
46+
47+
&lt;pre&gt;&lt;code&gt;curl -su userid:api_key &#39;https://api.softlayer.com/rest/v3/SoftLayer_Account/getHardware?objectMask=mask[id,hostname,hardwareStatus[status,id]]&amp;amp;objectFilter={&amp;quot;hardware&amp;quot;:{&amp;quot;hardwareStatus&amp;quot;:{&amp;quot;id&amp;quot;:{&amp;quot;operation&amp;quot;:23}}}}&#39;
48+
&lt;/code&gt;&lt;/pre&gt;
49+
</description>
50+
</item>
1051

1152
<item>
1253
<title>Get Virtual Console Virtual Guest</title>
@@ -825,36 +866,6 @@ Add-Content $log &amp;quot;$(Get-Date -format s) : End&amp;quot;
825866
&amp;quot;setupFeeTaxRate&amp;quot;: &amp;quot;0&amp;quot;
826867
}
827868
&lt;/code&gt;&lt;/pre&gt;
828-
</description>
829-
</item>
830-
831-
<item>
832-
<title>Find provisioned product from a billing item</title>
833-
<link>https://softlayer.github.io/rest/find_product_from_billing/</link>
834-
<pubDate>Wed, 30 Dec 2015 00:00:00 UTC</pubDate>
835-
<author>Enthusiastic Hugo User</author>
836-
<guid>https://softlayer.github.io/rest/find_product_from_billing/</guid>
837-
<description>&lt;p&gt;Operation: &lt;code&gt;GET&lt;/code&gt;&lt;/p&gt;
838-
839-
&lt;p&gt;Method: &lt;a href=&#34;http://sldn.softlayer.com/reference/services/SoftLayer_Billing_Item/getAssociatedParent&#34;&gt;&lt;code&gt;SoftLayer_Billing_Item::getAssociatedParent()&lt;/code&gt;&lt;/a&gt;&lt;/p&gt;
840-
841-
&lt;p&gt;URL: SoftLayer_Billing_Item/getAssociatedParent&lt;/p&gt;
842-
843-
&lt;p&gt;Example CURL:&lt;/p&gt;
844-
845-
&lt;pre&gt;&lt;code&gt;curl -su userid:api_key https://api.softlayer.com/rest/v3/SoftLayer_Billing_Item/&amp;lt;billing_item_id&amp;gt;/getAssociatedParent?objectMask=mask\[categoryCode,id,description\]
846-
&lt;/code&gt;&lt;/pre&gt;
847-
848-
&lt;p&gt;Example Response:&lt;/p&gt;
849-
850-
&lt;pre&gt;&lt;code class=&#34;language-json&#34;&gt;[
851-
{
852-
&amp;quot;categoryCode&amp;quot;: &amp;quot;storage_service_enterprise&amp;quot;,
853-
&amp;quot;description&amp;quot;: &amp;quot;Endurance Storage&amp;quot;,
854-
&amp;quot;id&amp;quot;: 1234321
855-
}
856-
]
857-
&lt;/code&gt;&lt;/pre&gt;
858869
</description>
859870
</item>
860871

0 commit comments

Comments
 (0)