Skip to content

Commit 9811434

Browse files
updated orderbaremetal example
1 parent 19ad320 commit 9811434

16 files changed

Lines changed: 1184 additions & 48 deletions

File tree

classes/softlayer_configuration_storage_group_array_type/index.xml

Lines changed: 74 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,17 @@
1414
<pubDate>Wed, 13 Sep 2017 00:00:00 UTC</pubDate>
1515
<author>Enthusiastic Hugo User</author>
1616
<guid>https://softlayer.github.io/python/orderbaremetal/</guid>
17-
<description>&lt;p&gt;Example of how to build an order for a bare metal server.&lt;/p&gt;
17+
<description>
18+
19+
&lt;p&gt;Example of how to build an order for a bare metal server.&lt;/p&gt;
1820

1921
&lt;ol&gt;
2022
&lt;li&gt;Find the package that you want to order. listServerPackages() will filter out all that are not bare metal servers&lt;/li&gt;
2123
&lt;li&gt;Use getServerPrices() to find the item keyNames you want to include in your order. These price IDs can be included prices array directly, but I&amp;rsquo;ve included gatherPriceIds() to match up KeyNames to build a list of price ids. getServerPrices() will also show the locations available for ordering.&lt;/li&gt;
2224
&lt;li&gt;listAvailableVlans() if you want to place the server on a specific VLAN.&lt;/li&gt;
2325
&lt;li&gt;listPartitionTemplates() will show what partition schemes you can apply to a disk.&lt;/li&gt;
2426
&lt;li&gt;listRaidArrayTypes() shows what id numbers are for each RAID type.&lt;/li&gt;
27+
&lt;li&gt;Custom partitions can ONLY be specified for CentOS or RHEL servers, and ONLY on the secondary drives &lt;sup class=&#34;footnote-ref&#34; id=&#34;fnref:1&#34;&gt;&lt;a rel=&#34;footnote&#34; href=&#34;#fn:1&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;. Trying to do the same for the primary controller will result in the default partitinoTemplate being applied. Custom partitions also require the arraySize be declared.&lt;/li&gt;
2528
&lt;/ol&gt;
2629

2730
&lt;pre&gt;&lt;code class=&#34;language-python&#34;&gt;&amp;quot;&amp;quot;&amp;quot;
@@ -92,11 +95,20 @@ class ordering():
9295
{
9396
&#39;arrayTypeId&#39;: 2,
9497
&#39;hardDrives&#39;: [0,1],
95-
&#39;partitionTemplateId&#39;: 1
98+
&#39;partitionTemplateId&#39; : 1
9699
},
97100
{
98101
&#39;arrayTypeId&#39;: 9,
99-
&#39;hardDrives&#39;: [2]
102+
&#39;arraySize&#39; : 2000,
103+
&#39;hardDrives&#39;: [2],
104+
&#39;partitions&#39; : [
105+
{&#39;name&#39; : &#39;/&#39;, &#39;size&#39;: 200, &#39;isGrow&#39;: 0},
106+
{&#39;name&#39; : &#39;/boot&#39;, &#39;size&#39;: 100},
107+
{&#39;name&#39; : &#39;/usr&#39;, &#39;size&#39;: 200},
108+
{&#39;name&#39; : &#39;/mine&#39;, &#39;size&#39;: 200},
109+
{&#39;name&#39; : &#39;/media&#39;, &#39;size&#39;: 1, &#39;isGrow&#39;: 1},
110+
]
111+
100112
},
101113
{
102114
&#39;arrayTypeId&#39;: 9,
@@ -274,6 +286,65 @@ if __name__ == &amp;quot;__main__&amp;quot;:
274286
main.main(package_id,location_id,pub_vlan_id,priv_vlan_id)
275287

276288
&lt;/code&gt;&lt;/pre&gt;
289+
290+
&lt;h2 id=&#34;exceptions-you-might-see&#34;&gt;Exceptions you might see&lt;/h2&gt;
291+
292+
&lt;ul&gt;
293+
&lt;li&gt;SoftLayerAPIError(SoftLayer_Exception_Order_InvalidStorageGroups):&lt;/li&gt;
294+
&lt;/ul&gt;
295+
296+
&lt;blockquote&gt;
297+
&lt;p&gt;Defining partitions on secondary storage groups is only allowed for CentOS and Red Hat operating systems.&lt;/p&gt;
298+
299+
&lt;blockquote&gt;
300+
&lt;p&gt;Chose the right operating system.&lt;/p&gt;
301+
&lt;/blockquote&gt;
302+
&lt;/blockquote&gt;
303+
304+
&lt;ul&gt;
305+
&lt;li&gt;SoftLayerAPIError(SoftLayer_Exception_Order_InvalidLocation):&lt;/li&gt;
306+
&lt;/ul&gt;
307+
308+
&lt;blockquote&gt;
309+
&lt;p&gt;The location provided for this order is invalid.&lt;/p&gt;
310+
311+
&lt;blockquote&gt;
312+
&lt;p&gt;Choose a correct location, locations should be displayed in getServerPrices()&lt;/p&gt;
313+
&lt;/blockquote&gt;
314+
&lt;/blockquote&gt;
315+
316+
&lt;ul&gt;
317+
&lt;li&gt;SoftLayerAPIError(SoftLayer_Exception_Order_InvalidStorageGroups):&lt;/li&gt;
318+
&lt;/ul&gt;
319+
320+
&lt;blockquote&gt;
321+
&lt;p&gt;Storage group #1 does not have a grow partition. Each storage group with partitions defined must have a grow partition.&lt;/p&gt;
322+
323+
&lt;blockquote&gt;
324+
&lt;p&gt;Make sure your partition has &amp;lsquo;isGrow&amp;rsquo; = 1 at some point.&lt;/p&gt;
325+
&lt;/blockquote&gt;
326+
&lt;/blockquote&gt;
327+
328+
&lt;ul&gt;
329+
&lt;li&gt;SoftLayerAPIError(SoftLayer_Exception_Order_InvalidStorageGroups):&lt;/li&gt;
330+
&lt;/ul&gt;
331+
332+
&lt;blockquote&gt;
333+
&lt;p&gt;Storage group #1 with size (GB) is smaller than the total partitioned size (501GB).&lt;/p&gt;
334+
335+
&lt;blockquote&gt;
336+
&lt;p&gt;You forgot to assign an arraySize.&lt;/p&gt;
337+
&lt;/blockquote&gt;
338+
&lt;/blockquote&gt;
339+
&lt;div class=&#34;footnotes&#34;&gt;
340+
341+
&lt;hr /&gt;
342+
343+
&lt;ol&gt;
344+
&lt;li id=&#34;fn:1&#34;&gt;&lt;a href=&#34;https://sldn.softlayer.com/reference/datatypes/SoftLayer_Container_Product_Order_Storage_Group&#34;&gt;https://sldn.softlayer.com/reference/datatypes/SoftLayer_Container_Product_Order_Storage_Group&lt;/a&gt;
345+
&lt;a class=&#34;footnote-return&#34; href=&#34;#fnref:1&#34;&gt;&lt;sup&gt;[return]&lt;/sup&gt;&lt;/a&gt;&lt;/li&gt;
346+
&lt;/ol&gt;
347+
&lt;/div&gt;
277348
</description>
278349
</item>
279350

classes/softlayer_product_order/index.xml

Lines changed: 74 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,17 @@
1414
<pubDate>Wed, 13 Sep 2017 00:00:00 UTC</pubDate>
1515
<author>Enthusiastic Hugo User</author>
1616
<guid>https://softlayer.github.io/python/orderbaremetal/</guid>
17-
<description>&lt;p&gt;Example of how to build an order for a bare metal server.&lt;/p&gt;
17+
<description>
18+
19+
&lt;p&gt;Example of how to build an order for a bare metal server.&lt;/p&gt;
1820

1921
&lt;ol&gt;
2022
&lt;li&gt;Find the package that you want to order. listServerPackages() will filter out all that are not bare metal servers&lt;/li&gt;
2123
&lt;li&gt;Use getServerPrices() to find the item keyNames you want to include in your order. These price IDs can be included prices array directly, but I&amp;rsquo;ve included gatherPriceIds() to match up KeyNames to build a list of price ids. getServerPrices() will also show the locations available for ordering.&lt;/li&gt;
2224
&lt;li&gt;listAvailableVlans() if you want to place the server on a specific VLAN.&lt;/li&gt;
2325
&lt;li&gt;listPartitionTemplates() will show what partition schemes you can apply to a disk.&lt;/li&gt;
2426
&lt;li&gt;listRaidArrayTypes() shows what id numbers are for each RAID type.&lt;/li&gt;
27+
&lt;li&gt;Custom partitions can ONLY be specified for CentOS or RHEL servers, and ONLY on the secondary drives &lt;sup class=&#34;footnote-ref&#34; id=&#34;fnref:1&#34;&gt;&lt;a rel=&#34;footnote&#34; href=&#34;#fn:1&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;. Trying to do the same for the primary controller will result in the default partitinoTemplate being applied. Custom partitions also require the arraySize be declared.&lt;/li&gt;
2528
&lt;/ol&gt;
2629

2730
&lt;pre&gt;&lt;code class=&#34;language-python&#34;&gt;&amp;quot;&amp;quot;&amp;quot;
@@ -92,11 +95,20 @@ class ordering():
9295
{
9396
&#39;arrayTypeId&#39;: 2,
9497
&#39;hardDrives&#39;: [0,1],
95-
&#39;partitionTemplateId&#39;: 1
98+
&#39;partitionTemplateId&#39; : 1
9699
},
97100
{
98101
&#39;arrayTypeId&#39;: 9,
99-
&#39;hardDrives&#39;: [2]
102+
&#39;arraySize&#39; : 2000,
103+
&#39;hardDrives&#39;: [2],
104+
&#39;partitions&#39; : [
105+
{&#39;name&#39; : &#39;/&#39;, &#39;size&#39;: 200, &#39;isGrow&#39;: 0},
106+
{&#39;name&#39; : &#39;/boot&#39;, &#39;size&#39;: 100},
107+
{&#39;name&#39; : &#39;/usr&#39;, &#39;size&#39;: 200},
108+
{&#39;name&#39; : &#39;/mine&#39;, &#39;size&#39;: 200},
109+
{&#39;name&#39; : &#39;/media&#39;, &#39;size&#39;: 1, &#39;isGrow&#39;: 1},
110+
]
111+
100112
},
101113
{
102114
&#39;arrayTypeId&#39;: 9,
@@ -274,6 +286,65 @@ if __name__ == &amp;quot;__main__&amp;quot;:
274286
main.main(package_id,location_id,pub_vlan_id,priv_vlan_id)
275287

276288
&lt;/code&gt;&lt;/pre&gt;
289+
290+
&lt;h2 id=&#34;exceptions-you-might-see&#34;&gt;Exceptions you might see&lt;/h2&gt;
291+
292+
&lt;ul&gt;
293+
&lt;li&gt;SoftLayerAPIError(SoftLayer_Exception_Order_InvalidStorageGroups):&lt;/li&gt;
294+
&lt;/ul&gt;
295+
296+
&lt;blockquote&gt;
297+
&lt;p&gt;Defining partitions on secondary storage groups is only allowed for CentOS and Red Hat operating systems.&lt;/p&gt;
298+
299+
&lt;blockquote&gt;
300+
&lt;p&gt;Chose the right operating system.&lt;/p&gt;
301+
&lt;/blockquote&gt;
302+
&lt;/blockquote&gt;
303+
304+
&lt;ul&gt;
305+
&lt;li&gt;SoftLayerAPIError(SoftLayer_Exception_Order_InvalidLocation):&lt;/li&gt;
306+
&lt;/ul&gt;
307+
308+
&lt;blockquote&gt;
309+
&lt;p&gt;The location provided for this order is invalid.&lt;/p&gt;
310+
311+
&lt;blockquote&gt;
312+
&lt;p&gt;Choose a correct location, locations should be displayed in getServerPrices()&lt;/p&gt;
313+
&lt;/blockquote&gt;
314+
&lt;/blockquote&gt;
315+
316+
&lt;ul&gt;
317+
&lt;li&gt;SoftLayerAPIError(SoftLayer_Exception_Order_InvalidStorageGroups):&lt;/li&gt;
318+
&lt;/ul&gt;
319+
320+
&lt;blockquote&gt;
321+
&lt;p&gt;Storage group #1 does not have a grow partition. Each storage group with partitions defined must have a grow partition.&lt;/p&gt;
322+
323+
&lt;blockquote&gt;
324+
&lt;p&gt;Make sure your partition has &amp;lsquo;isGrow&amp;rsquo; = 1 at some point.&lt;/p&gt;
325+
&lt;/blockquote&gt;
326+
&lt;/blockquote&gt;
327+
328+
&lt;ul&gt;
329+
&lt;li&gt;SoftLayerAPIError(SoftLayer_Exception_Order_InvalidStorageGroups):&lt;/li&gt;
330+
&lt;/ul&gt;
331+
332+
&lt;blockquote&gt;
333+
&lt;p&gt;Storage group #1 with size (GB) is smaller than the total partitioned size (501GB).&lt;/p&gt;
334+
335+
&lt;blockquote&gt;
336+
&lt;p&gt;You forgot to assign an arraySize.&lt;/p&gt;
337+
&lt;/blockquote&gt;
338+
&lt;/blockquote&gt;
339+
&lt;div class=&#34;footnotes&#34;&gt;
340+
341+
&lt;hr /&gt;
342+
343+
&lt;ol&gt;
344+
&lt;li id=&#34;fn:1&#34;&gt;&lt;a href=&#34;https://sldn.softlayer.com/reference/datatypes/SoftLayer_Container_Product_Order_Storage_Group&#34;&gt;https://sldn.softlayer.com/reference/datatypes/SoftLayer_Container_Product_Order_Storage_Group&lt;/a&gt;
345+
&lt;a class=&#34;footnote-return&#34; href=&#34;#fnref:1&#34;&gt;&lt;sup&gt;[return]&lt;/sup&gt;&lt;/a&gt;&lt;/li&gt;
346+
&lt;/ol&gt;
347+
&lt;/div&gt;
277348
</description>
278349
</item>
279350

classes/softlayer_product_package/index.xml

Lines changed: 74 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,17 @@
1414
<pubDate>Wed, 13 Sep 2017 00:00:00 UTC</pubDate>
1515
<author>Enthusiastic Hugo User</author>
1616
<guid>https://softlayer.github.io/python/orderbaremetal/</guid>
17-
<description>&lt;p&gt;Example of how to build an order for a bare metal server.&lt;/p&gt;
17+
<description>
18+
19+
&lt;p&gt;Example of how to build an order for a bare metal server.&lt;/p&gt;
1820

1921
&lt;ol&gt;
2022
&lt;li&gt;Find the package that you want to order. listServerPackages() will filter out all that are not bare metal servers&lt;/li&gt;
2123
&lt;li&gt;Use getServerPrices() to find the item keyNames you want to include in your order. These price IDs can be included prices array directly, but I&amp;rsquo;ve included gatherPriceIds() to match up KeyNames to build a list of price ids. getServerPrices() will also show the locations available for ordering.&lt;/li&gt;
2224
&lt;li&gt;listAvailableVlans() if you want to place the server on a specific VLAN.&lt;/li&gt;
2325
&lt;li&gt;listPartitionTemplates() will show what partition schemes you can apply to a disk.&lt;/li&gt;
2426
&lt;li&gt;listRaidArrayTypes() shows what id numbers are for each RAID type.&lt;/li&gt;
27+
&lt;li&gt;Custom partitions can ONLY be specified for CentOS or RHEL servers, and ONLY on the secondary drives &lt;sup class=&#34;footnote-ref&#34; id=&#34;fnref:1&#34;&gt;&lt;a rel=&#34;footnote&#34; href=&#34;#fn:1&#34;&gt;1&lt;/a&gt;&lt;/sup&gt;. Trying to do the same for the primary controller will result in the default partitinoTemplate being applied. Custom partitions also require the arraySize be declared.&lt;/li&gt;
2528
&lt;/ol&gt;
2629

2730
&lt;pre&gt;&lt;code class=&#34;language-python&#34;&gt;&amp;quot;&amp;quot;&amp;quot;
@@ -92,11 +95,20 @@ class ordering():
9295
{
9396
&#39;arrayTypeId&#39;: 2,
9497
&#39;hardDrives&#39;: [0,1],
95-
&#39;partitionTemplateId&#39;: 1
98+
&#39;partitionTemplateId&#39; : 1
9699
},
97100
{
98101
&#39;arrayTypeId&#39;: 9,
99-
&#39;hardDrives&#39;: [2]
102+
&#39;arraySize&#39; : 2000,
103+
&#39;hardDrives&#39;: [2],
104+
&#39;partitions&#39; : [
105+
{&#39;name&#39; : &#39;/&#39;, &#39;size&#39;: 200, &#39;isGrow&#39;: 0},
106+
{&#39;name&#39; : &#39;/boot&#39;, &#39;size&#39;: 100},
107+
{&#39;name&#39; : &#39;/usr&#39;, &#39;size&#39;: 200},
108+
{&#39;name&#39; : &#39;/mine&#39;, &#39;size&#39;: 200},
109+
{&#39;name&#39; : &#39;/media&#39;, &#39;size&#39;: 1, &#39;isGrow&#39;: 1},
110+
]
111+
100112
},
101113
{
102114
&#39;arrayTypeId&#39;: 9,
@@ -274,6 +286,65 @@ if __name__ == &amp;quot;__main__&amp;quot;:
274286
main.main(package_id,location_id,pub_vlan_id,priv_vlan_id)
275287

276288
&lt;/code&gt;&lt;/pre&gt;
289+
290+
&lt;h2 id=&#34;exceptions-you-might-see&#34;&gt;Exceptions you might see&lt;/h2&gt;
291+
292+
&lt;ul&gt;
293+
&lt;li&gt;SoftLayerAPIError(SoftLayer_Exception_Order_InvalidStorageGroups):&lt;/li&gt;
294+
&lt;/ul&gt;
295+
296+
&lt;blockquote&gt;
297+
&lt;p&gt;Defining partitions on secondary storage groups is only allowed for CentOS and Red Hat operating systems.&lt;/p&gt;
298+
299+
&lt;blockquote&gt;
300+
&lt;p&gt;Chose the right operating system.&lt;/p&gt;
301+
&lt;/blockquote&gt;
302+
&lt;/blockquote&gt;
303+
304+
&lt;ul&gt;
305+
&lt;li&gt;SoftLayerAPIError(SoftLayer_Exception_Order_InvalidLocation):&lt;/li&gt;
306+
&lt;/ul&gt;
307+
308+
&lt;blockquote&gt;
309+
&lt;p&gt;The location provided for this order is invalid.&lt;/p&gt;
310+
311+
&lt;blockquote&gt;
312+
&lt;p&gt;Choose a correct location, locations should be displayed in getServerPrices()&lt;/p&gt;
313+
&lt;/blockquote&gt;
314+
&lt;/blockquote&gt;
315+
316+
&lt;ul&gt;
317+
&lt;li&gt;SoftLayerAPIError(SoftLayer_Exception_Order_InvalidStorageGroups):&lt;/li&gt;
318+
&lt;/ul&gt;
319+
320+
&lt;blockquote&gt;
321+
&lt;p&gt;Storage group #1 does not have a grow partition. Each storage group with partitions defined must have a grow partition.&lt;/p&gt;
322+
323+
&lt;blockquote&gt;
324+
&lt;p&gt;Make sure your partition has &amp;lsquo;isGrow&amp;rsquo; = 1 at some point.&lt;/p&gt;
325+
&lt;/blockquote&gt;
326+
&lt;/blockquote&gt;
327+
328+
&lt;ul&gt;
329+
&lt;li&gt;SoftLayerAPIError(SoftLayer_Exception_Order_InvalidStorageGroups):&lt;/li&gt;
330+
&lt;/ul&gt;
331+
332+
&lt;blockquote&gt;
333+
&lt;p&gt;Storage group #1 with size (GB) is smaller than the total partitioned size (501GB).&lt;/p&gt;
334+
335+
&lt;blockquote&gt;
336+
&lt;p&gt;You forgot to assign an arraySize.&lt;/p&gt;
337+
&lt;/blockquote&gt;
338+
&lt;/blockquote&gt;
339+
&lt;div class=&#34;footnotes&#34;&gt;
340+
341+
&lt;hr /&gt;
342+
343+
&lt;ol&gt;
344+
&lt;li id=&#34;fn:1&#34;&gt;&lt;a href=&#34;https://sldn.softlayer.com/reference/datatypes/SoftLayer_Container_Product_Order_Storage_Group&#34;&gt;https://sldn.softlayer.com/reference/datatypes/SoftLayer_Container_Product_Order_Storage_Group&lt;/a&gt;
345+
&lt;a class=&#34;footnote-return&#34; href=&#34;#fnref:1&#34;&gt;&lt;sup&gt;[return]&lt;/sup&gt;&lt;/a&gt;&lt;/li&gt;
346+
&lt;/ol&gt;
347+
&lt;/div&gt;
277348
</description>
278349
</item>
279350

0 commit comments

Comments
 (0)