|
6 | 6 | <language>en-US</language> |
7 | 7 | <author>Enthusiastic Hugo User</author> |
8 | 8 | <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 | +<p>Operation: <code>GET</code></p> |
| 20 | + |
| 21 | +<p>Method: <a href="http://sldn.softlayer.com/reference/services/SoftLayer_Hardware_Server/sparePool"><code>SoftLayer_Hardware_Server::sparepool()</code></a></p> |
| 22 | + |
| 23 | +<p>Example CURL:</p> |
| 24 | + |
| 25 | +<pre><code>curl -su userid:api_key https://api.softlayer.com/rest/v3/SoftLayer_Hardware_Server/&lt;hardware_id&gt;/sparepool/add |
| 26 | + |
| 27 | +curl -su userid:api_key &quot;https://api.softlayer.com/rest/v3/SoftLayer_Hardware_Server/&lt;hardware_id&gt;/sparePool/activate&quot; |
| 28 | +</code></pre> |
| 29 | + |
| 30 | +<p>Will return True if the action was successful, or throw an exception otherwise</p> |
| 31 | + |
| 32 | +<p>Exceptions:</p> |
| 33 | + |
| 34 | +<pre><code>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 | +</code></pre> |
| 37 | + |
| 38 | +<p>The server is likely already in a spare pool.</p> |
| 39 | + |
| 40 | +<h3 id="view-spare-pool-servers">View Spare Pool Servers</h3> |
| 41 | + |
| 42 | +<p>Filtering by hardwareStatus-&gt;status doesn&rsquo;t work, you will need to filter by the status id only.</p> |
| 43 | + |
| 44 | +<p>Status id 23 is SPARE_POOL |
| 45 | +Status id 5 is ACTIVE</p> |
| 46 | + |
| 47 | +<pre><code>curl -su userid:api_key 'https://api.softlayer.com/rest/v3/SoftLayer_Account/getHardware?objectMask=mask[id,hostname,hardwareStatus[status,id]]&amp;objectFilter={&quot;hardware&quot;:{&quot;hardwareStatus&quot;:{&quot;id&quot;:{&quot;operation&quot;:23}}}}' |
| 48 | +</code></pre> |
| 49 | +</description> |
| 50 | + </item> |
10 | 51 |
|
11 | 52 | <item> |
12 | 53 | <title>Get Dedicated Host Allocation</title> |
@@ -1017,43 +1058,6 @@ item = client['SoftLayer_Account'] |
1017 | 1058 | getIPMI = item.object_mask(object_mask).getHardware |
1018 | 1059 |
|
1019 | 1060 | pp getIPMI |
1020 | | -</code></pre> |
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><pre><code class="language-php">&lt;?php |
1031 | | - |
1032 | | -require_once './vendor/autoload.php'; |
1033 | | -$apiUsername = getenv('SOFTLAYER_USERNAME'); |
1034 | | -$apiKey = getenv('SOFTLAYER_API_KEY'); |
1035 | | - |
1036 | | -$server_id = 882187; |
1037 | | - |
1038 | | -try { |
1039 | | - $client = \SoftLayer\SoapClient::getClient('SoftLayer_Account', $server_id, $apiUsername, $apiKey); |
1040 | | - $objectMask = new \SoftLayer\Common\ObjectMask(); |
1041 | | - $objectMask-&gt;networkManagementIpAddress; |
1042 | | - $objectMask-&gt;remoteManagementAccounts-&gt;username; |
1043 | | - $objectMask-&gt;remoteManagementAccounts-&gt;password; |
1044 | | - $objectMask-&gt;id; |
1045 | | - $objectMask-&gt;fullyQualifiedDomainName; |
1046 | | - $client-&gt;setObjectMask($objectMask); |
1047 | | - $response = $client-&gt;getHardware($objectMask); |
1048 | | - |
1049 | | - print_r($response); |
1050 | | - |
1051 | | - } catch(Exception $e) { |
1052 | | - echo 'Cannot compute. Error is: ' . $e-&gt;getMessage(); |
1053 | | -} |
1054 | | - |
1055 | | -?&gt; |
1056 | | - |
1057 | 1061 | </code></pre> |
1058 | 1062 | </description> |
1059 | 1063 | </item> |
|
0 commit comments