Python on SoftLayer API https://sldn.softlayer.com/tags/python/ Recent content in Python on SoftLayer API Hugo en-us Tue, 10 Aug 2021 00:00:00 +0000 The SoftLayer Python Library https://sldn.softlayer.com/article/python/ Tue, 10 Aug 2021 00:00:00 +0000 https://sldn.softlayer.com/article/python/ <h2 id="the-basics">The Basics</h2> <ul> <li><a href="https://github.com/softlayer/softlayer-python">softlayer-python</a> project homepage. For source code and submitting issues.</li> <li><a href="https://softlayer-python.readthedocs.io/en/latest/">Documentation</a> Covers both the SLCLI and softlayer-python library.</li> <li><a href="https://pypi.org/project/SoftLayer/">PyPi project</a> For latest information about the softlayer-python package, which is kept updated on PyPi.</li> </ul> <h4 id="font-colorredpython-27-supportfont"><font color=red>Python 2.7 Support</font></h4> <p>As of version 5.8.0 SoftLayer-Python will no longer support python2.7, which is <a href="https://www.python.org/dev/peps/pep-0373/">End Of Life as of 2020</a> . If you cannot install python 3.6+ for some reason, you will need to use a version of softlayer-python &lt;= 5.7.2</p> Single Account Billing Detail https://sldn.softlayer.com/article/single-account-billing-detail/ Wed, 08 Aug 2018 00:00:00 +0000 https://sldn.softlayer.com/article/single-account-billing-detail/ <h1 id="account-level-billing">Account Level Billing</h1> <p>This tutorial walks you through accessing detailed billing data for a single specified account using a specified time and date range.</p> <h2 id="objectives">Objectives</h2> <ul> <li>Understand how to use multiple API services and methods to access detailed billing data for a specified account using a specified time and date range.</li> </ul> <h2 id="services-used">Services used</h2> <p>This tutorial uses the following technologies:</p> <ul> <li><a href="http://softlayer-python.readthedocs.io/en/latest/">SoftLayer Python Library</a></li> <li><a href="https://softlayer.github.io/reference/services/SoftLayer_Billing_Invoice/">Billing_Invoice Service</a></li> <li><a href="https://softlayer.github.io/reference/services/SoftLayer_Billing_Invoice_Item/">Billing_Invoice_Item Service</a></li> <li><a href="https://softlayer.github.io/reference/services/SoftLayer_Billing_Item/">Billing_item Service</a></li> </ul> <h2 id="architecture">Architecture</h2> <p>This tutorial will leverage account Invoice and Billing Item API&rsquo;s to collect and display detailed billing detail for a specified time and date range.</p> Automating Block Storage https://sldn.softlayer.com/article/AutomatingStorage/ Mon, 23 Jul 2018 00:00:00 +0000 https://sldn.softlayer.com/article/AutomatingStorage/ <h2 id="the-process">The Process</h2> <ol> <li>Order a VSI with a postInstall script</li> <li>Order a storage volume</li> <li>Update the metadata of the VSI to include the needed information to mount the storage volume</li> <li>postInstall script gets metadata from the metadata service, and mounts the volume</li> </ol> <h2 id="ordering-code">Ordering Code</h2> <p>This script will order a VSI, based on a configuration in the file, then order some storage, authorize storage to the new VSI, and set the VSI&rsquo;s metadata with the needed information for it to be mounted.</p> Sub-Organization Billing Detail https://sldn.softlayer.com/article/sub-org-billing-detail/ Mon, 23 Jul 2018 00:00:00 +0000 https://sldn.softlayer.com/article/sub-org-billing-detail/ <h1 id="sub-org-billing-detail">Sub-org Billing Detail</h1> <p>This tutorial walks you through accessing the steps required to access detailed billing data across sub-organization accounts using a specified date and time range.</p> <h2 id="objectives">Objectives</h2> <p>Understand how to use multiple API services and methods to access detailed billing data for all sub organization accounts for a specified time and date range.</p> <h2 id="services-used">Services used</h2> <p>This tutorial uses the following technologies:</p> <ul> <li><a href="http://softlayer-python.readthedocs.io/en/latest/">SoftLayer Python Library</a></li> <li><a href="https://softlayer.github.io/reference/services/SoftLayer_Account">Account Service</a></li> <li><a href="https://softlayer.github.io/reference/services/SoftLayer_Billing_Invoice/">Billing_Invoice Service</a></li> <li><a href="https://softlayer.github.io/reference/services/SoftLayer_Billing_Invoice_Item/">Billing_Invoice_Item Service</a></li> <li><a href="https://softlayer.github.io/reference/services/SoftLayer_Billing_Item/">Billing_item Service</a></li> </ul> <h2 id="architecture">Architecture</h2> <p>Accounts (refered to in this document as a sub account) can be owned by a Brand Account, which is the top level account type for an organization which can enable sub-organizational level billing. The API Key for a Brand Account has access billing data for it&rsquo;s sub accounts. This tutorial demonstrates how to leverage Account, Invoice and Billing API&rsquo;s to identify invoices accross the multiple sub accounts owned by an organization for a specific range of dates. For each invoice, a list of top level billing items are retreived, such as the billing data for a single virtual machine. These top level items, often have detailed sub-billing items such as memory, disk, or cpu which are also retreived.</p>