Skip to content

Commit 36c55f9

Browse files
committed
Binders full of documentation updates
* Fixed all PEP-8 violations in docs/conf.py * Fixed a Sphinx build warning in docs/install.rst * Add license to SoftLayer.managers.iscsi as it wasn't showing in docs * Minor updates to readme, and taming of extremely long lines * Added Pull Requests link to footers and header nav in docs * Updated some examples in proper docs * Minor wording/spelling fixes in proper docs * Extremely long lines (inconsistent, some were wrapped, some not) were tamed in the proper docs * Ensured proper capitalization of SoftLayer and GitHub in a number of places * Updated RPM spec to reflect MIT license * Updated CLAs to use consistent line wrapping and removed a bit of trailing whitespace
1 parent e68b5b8 commit 36c55f9

13 files changed

+409
-245
lines changed

README.rst

+17-8
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,28 @@ SoftLayer API Python Client
22
===========================
33
.. image:: https://travis-ci.org/softlayer/softlayer-python.svg?branch=master
44
:target: https://travis-ci.org/softlayer/softlayer-python
5-
5+
66
.. image:: https://landscape.io/github/softlayer/softlayer-python/master/landscape.png
77
:target: https://landscape.io/github/softlayer/softlayer-python/master
88

99
.. image:: https://badge.fury.io/py/SoftLayer.png
1010
:target: http://badge.fury.io/py/SoftLayer
1111

12-
SoftLayer API bindings for Python. For use with `SoftLayer's API <http://sldn.softlayer.com/reference/softlayerapi>`_.
12+
SoftLayer API bindings for Python. For use with
13+
`SoftLayer's API <http://sldn.softlayer.com/reference/softlayerapi>`_.
14+
15+
This library provides a simple interface to interact with SoftLayer's XML-RPC
16+
API and provides support for many of SoftLayer API's features like
17+
`object masks <http://sldn.softlayer.com/article/Using-Object-Masks-SoftLayerAPI>`_
18+
and includes a command-line interface that can be used to manage various
19+
SoftLayer services.
1320

14-
This library provides a simple interface to interact with SoftLayer's XML-RPC API and provides support for many of SoftLayer API's features like `object masks <http://sldn.softlayer.com/article/Using-Object-Masks-SoftLayerAPI>`_ and includes a command-line interface that can be used to manage various SoftLayer services.
1521

1622
Documentation
1723
-------------
1824
Documentation is available at http://softlayer.github.io/softlayer-python/
1925

26+
2027
Installation
2128
------------
2229
Install via pip:
@@ -29,25 +36,27 @@ Install via pip:
2936
Or you can install from source. Download source and run:
3037

3138
.. code-block:: bash
32-
39+
3340
$ python setup.py install
3441
3542
3643
The most up to date version of this library can be found on the SoftLayer
37-
GitHub public repositories: http://github.com/softlayer. Please post to the
38-
SoftLayer forums http://forums.softlayer.com/ or open a support ticket in the
39-
SoftLayer customer portal if you have any questions regarding use of this
44+
GitHub public repositories at http://github.com/softlayer. Please post to the
45+
SoftLayer forums at http://forums.softlayer.com/ or open a support ticket in
46+
the SoftLayer customer portal if you have any questions regarding use of this
4047
library.
4148

49+
4250
System Requirements
4351
-------------------
4452
* This library has been tested on Python 2.6, 2.7, 3.3 and 3.4.
45-
* A valid SoftLayer API username and key are required to call SoftLayer's API
53+
* A valid SoftLayer API username and key are required to call SoftLayer's API.
4654
* A connection to SoftLayer's private network is required to connect to
4755
SoftLayer’s private network API endpoints.
4856

4957

5058
Copyright
5159
---------
5260
This software is Copyright (c) 2014 SoftLayer Technologies, Inc.
61+
5362
See the bundled LICENSE file for more information.

SoftLayer/managers/iscsi.py

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
SoftLayer.iscsi
33
~~~~~~~~~~~~~~~
44
ISCSI Manager/helpers
5+
6+
:license: MIT, see LICENSE for more details.
57
"""
68
from SoftLayer import utils
79

docs/api/client.rst

+57-30
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33

44
API Documentation
55
=================
6-
This is the primary API client to make API calls. It deals with constructing and executing XML-RPC calls against the SoftLayer API. Below are some links that will help to use the SoftLayer API.
6+
This is the primary API client to make API calls. It deals with constructing
7+
and executing XML-RPC calls against the SoftLayer API. Below are some links
8+
that will help to use the SoftLayer API.
79

810

911
* `SoftLayer API Documentation <http://sldn.softlayer.com/reference/softlayerapi>`_
10-
* `Source on Github <https://github.com/softlayer/softlayer-python>`_
12+
* `Source on GitHub <https://github.com/softlayer/softlayer-python>`_
1113

1214
::
1315

@@ -20,7 +22,9 @@ This is the primary API client to make API calls. It deals with constructing and
2022

2123
Getting Started
2224
---------------
23-
You can pass in your username and api_key when creating a SoftLayer client instance. However, you can set these in the environmental variables 'SL_USERNAME' and 'SL_API_KEY'
25+
You can pass in your username and api_key when creating a SoftLayer client
26+
instance. However, you can also set these in the environmental variables
27+
'SL_USERNAME' and 'SL_API_KEY'.
2428

2529
Creating a client instance by passing in the username/api_key:
2630
::
@@ -31,31 +35,34 @@ Creating a client instance by passing in the username/api_key:
3135
Creating a client instance with environmental variables set:
3236
::
3337

34-
# env variables
35-
# SL_USERNAME = YOUR_USERNAME
36-
# SL_API_KEY = YOUR_API_KEY
37-
import SoftLayer
38-
client = SoftLayer.Client()
38+
$ export SL_USERNAME=YOUR_USERNAME
39+
$ export SL_API_KEY=YOUR_API_KEY
40+
$ python
41+
>>> import SoftLayer
42+
>>> client = SoftLayer.Client()
3943

40-
Below is an example of creating a client instance with more options. This will create a client with the private API endpoint (only accessable from the SoftLayer network) and a timeout of 4 minutes.
44+
Below is an example of creating a client instance with more options. This will
45+
create a client with the private API endpoint (only accessible from the
46+
SoftLayer private network) and a timeout of 4 minutes.
4147
::
4248

43-
client = SoftLayer.Client(
44-
username='YOUR_USERNAME',
45-
api_key='YOUR_API_KEY'
46-
endpoint_url=SoftLayer.API_PRIVATE_ENDPOINT,
47-
timeout=240,
48-
)
49+
client = SoftLayer.Client(username='YOUR_USERNAME',
50+
api_key='YOUR_API_KEY'
51+
endpoint_url=SoftLayer.API_PRIVATE_ENDPOINT,
52+
timeout=240)
4953

5054
Managers
5155
--------
52-
For day to day operation, most users will find the managers to be the most convenient means for interacting with the API. Managers mask out a lot of the complexities of using the API into classes that provide a simpler interface to various services. These are higher-level interfaces to the SoftLayer API.
56+
For day-to-day operation, most users will find the managers to be the most
57+
convenient means for interacting with the API. Managers abstract a lot of the
58+
complexities of using the API into classes that provide a simpler interface to
59+
various services. These are higher-level interfaces to the SoftLayer API.
5360
::
5461

55-
>>> from SoftLayer import VSManager, Client
56-
>>> client = Client(...)
57-
>>> vs = VSManager(client)
58-
>>> vs.list_instances()
62+
from SoftLayer import VSManager, Client
63+
client = Client(...)
64+
vs = VSManager(client)
65+
vs.list_instances()
5966
[...]
6067

6168
**Available managers**:
@@ -66,28 +73,43 @@ For day to day operation, most users will find the managers to be the most conve
6673

6774
managers/*
6875

69-
If you need more power or functionality than the managers provide, you can make direct API calls as well.
76+
If you need more power or functionality than the managers provide, you can
77+
make direct API calls as well.
7078

7179

7280
Making API Calls
7381
----------------
74-
For full control over your account and services, you can directly call the SoftLayer API. The SoftLayer API client for python leverages SoftLayer's XML-RPC API. It supports authentication, object masks, object filters, limits, offsets, and retrieving objects by id. The following section assumes you have a initialized client named 'client'.
75-
76-
The best way to test our setup is to call the `getObject <http://sldn.softlayer.com/reference/services/SoftLayer_Account/getObject>`_ method on the `SoftLayer_Account <http://sldn.softlayer.com/reference/services/SoftLayer_Account>`_ service.
82+
For full control over your account and services, you can directly call the
83+
SoftLayer API. The SoftLayer API client for python leverages SoftLayer's
84+
XML-RPC API. It supports authentication, object masks, object filters, limits,
85+
offsets, and retrieving objects by id. The following section assumes you have
86+
an initialized client named 'client'.
87+
88+
The best way to test our setup is to call the
89+
`getObject <http://sldn.softlayer.com/reference/services/SoftLayer_Account/getObject>`_
90+
method on the
91+
`SoftLayer_Account <http://sldn.softlayer.com/reference/services/SoftLayer_Account>`_
92+
service.
7793
::
7894

7995
client['Account'].getObject()
8096

81-
For a more complex example we'll retrieve a support ticket with id 123456 along with the ticket's updates, the user it's assigned to, the servers attached to it, and the datacenter those servers are in. To retrieve our extra information using an `object mask <http://sldn.softlayer.com/article/Extended-Object-Masks>`_.
97+
For a more complex example we'll retrieve a support ticket with id 123456 along
98+
with the ticket's updates, the user it's assigned to, the servers attached to
99+
it, and the datacenter those servers are in. To retrieve our extra information
100+
using an `object mask <http://sldn.softlayer.com/article/Extended-Object-Masks>`_.
82101

83-
Retreive a ticket using Object Masks.
102+
Retrieve a ticket using object masks.
84103
::
85104

86105
ticket = client['Ticket'].getObject(
87106
id=123456, mask="updates, assignedUser, attachedHardware.datacenter")
88107

89108

90-
Now add an update to the ticket with `Ticket.addUpdate <http://sldn.softlayer.com/reference/services/SoftLayer_Ticket/addUpdate>`_. This uses a parameter, which translate to positional arguments in the order that they appear in the API docs.
109+
Now add an update to the ticket with
110+
`Ticket.addUpdate <http://sldn.softlayer.com/reference/services/SoftLayer_Ticket/addUpdate>`_.
111+
This uses a parameter, which translate to positional arguments in the order
112+
that they appear in the API docs.
91113
::
92114

93115
update = client['Ticket'].addUpdate({'entry' : 'Hello!'}, id=123456)
@@ -98,7 +120,8 @@ Let's get a listing of virtual guests using the domain example.com
98120
client['Account'].getVirtualGuests(
99121
filter={'virtualGuests': {'domain': {'operation': 'example.com'}}})
100122

101-
This call gets tickets created between the beginning of March 1, 2013 and March 15, 2013.
123+
This call gets tickets created between the beginning of March 1, 2013 and
124+
March 15, 2013.
102125
::
103126

104127
client['Account'].getTickets(
@@ -121,7 +144,10 @@ SoftLayer's XML-RPC API also allows for pagination.
121144
client['Account'].getVirtualGuests(limit=10, offset=0) # Page 1
122145
client['Account'].getVirtualGuests(limit=10, offset=10) # Page 2
123146

124-
Here's how to create a new Cloud Compute Instance using `SoftLayer_Virtual_Guest.createObject <http://sldn.softlayer.com/reference/services/SoftLayer_Virtual_Guest/createObject>`_. Be warned, this call actually creates an hourly virtual server so this does have billing implications.
147+
Here's how to create a new Cloud Compute Instance using
148+
`SoftLayer_Virtual_Guest.createObject <http://sldn.softlayer.com/reference/services/SoftLayer_Virtual_Guest/createObject>`_.
149+
Be warned, this call actually creates an hourly virtual server so this will
150+
have billing implications.
125151
::
126152

127153
client['Virtual_Guest'].createObject({
@@ -157,7 +183,8 @@ API Reference
157183

158184
Backwards Compatibility
159185
-----------------------
160-
As of 3.0, the old API methods and parameters no longer work. Below are examples of converting the old API to the new one.
186+
As of version 3.0 of the API bindings, the old API methods and parameters no
187+
longer work. Below are examples of converting old API calls to the new ones.
161188

162189
**Get the IP address for an account**
163190
::

docs/cla-corporate.md

+38-24
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,62 @@
1-
#### International Business machines, Inc.
2-
#####Software Grant and Corporate Contributor License Agreement ("Agreement")
1+
#### International Business Machines, Inc.
2+
##### Software Grant and Corporate Contributor License Agreement ("Agreement")
33

4-
http://www.github.com/softlayer/softlayer-python/
4+
https://github.com/softlayer/softlayer-python/
55

66

7-
Thank you for your interest in IBM’s softlayer-python project (“the Project"). In order to clarify the intellectual property license granted with Contributions from any person or entity, IBM must have a Contributor License Agreement (CLA) on file that has been signed by each Contributor, indicating agreement to the license terms below. This license is for your protection as a Contributor as well as the protection of IBM and its users; it does not change your rights to use your own Contributions for any other purpose.
7+
Thank you for your interest in IBM’s softlayer-python project (“the Project").
8+
In order to clarify the intellectual property license granted with
9+
Contributions from any person or entity, IBM must have a Contributor License
10+
Agreement (CLA) on file that has been signed by each Contributor, indicating
11+
agreement to the license terms below. This license is for your protection as a
12+
Contributor as well as the protection of IBM and its users; it does not change
13+
your rights to use your own Contributions for any other purpose.
814

9-
This version of the Agreement allows an entity (the "Corporation") to submit Contributions to the Project, to authorize Contributions submitted by its designated employees to the Project, and to grant copyright and patent licenses thereto.
15+
This version of the Agreement allows an entity (the "Corporation") to submit
16+
Contributions to the Project, to authorize Contributions submitted by its
17+
designated employees to the Project, and to grant copyright and patent licenses
18+
thereto.
1019

11-
If you have not already done so, please complete and sign, then scan and email a pdf file of this Agreement to [email protected].
20+
If you have not already done so, please complete and sign, then scan and email
21+
a PDF file of this Agreement to [email protected].
1222

1323

1424

15-
Please read this document carefully before signing and keep a copy for your records.
25+
Please read this document carefully before signing and keep a copy for your
26+
records.
1627

1728
Corporation name: ________________________________________________
18-
19-
Corporation address: ________________________________________________
29+
30+
Corporation address: ________________________________________________
2031

2132
Point of Contact: ________________________________________________
2233

2334
E-Mail: ________________________________________________
2435

25-
Telephone: _____________________
26-
36+
Telephone: _____________________
37+
2738

28-
You accept and agree to the following terms and conditions for Your present and future Contributions submitted to the Project. Except for the license granted herein to IBM and recipients of software distributed by IBM, You reserve all right, title, and interest in and to Your Contributions.
39+
You accept and agree to the following terms and conditions for Your present and
40+
future Contributions submitted to the Project. Except for the license granted
41+
herein to IBM and recipients of software distributed by IBM, You reserve all
42+
right, title, and interest in and to Your Contributions.
2943

3044
1. Definitions.
3145

3246
"You" (or "Your") shall mean the copyright owner or legal entity
3347
authorized by the copyright owner that is making this Agreement
34-
with IBM. For legal entities, the entity making a Contribution and
35-
all other entities that control, are controlled by, or are under
36-
common control with that entity are considered to be a single
37-
Contributor. For the purposes of this definition, "control" means
48+
with IBM. For legal entities, the entity making a Contribution and
49+
all other entities that control, are controlled by, or are under
50+
common control with that entity are considered to be a single
51+
Contributor. For the purposes of this definition, "control" means
3852
(i) the power, direct or indirect, to cause the direction or
3953
management of such entity, whether by contract or otherwise, or
4054
(ii) ownership of fifty percent (50%) or more of the outstanding
4155
shares, or (iii) beneficial ownership of such entity.
4256

4357
"Contribution" shall mean the code, documentation or other original
4458
works of authorship expressly identified in Schedule B, as well as
45-
any original work of authorship, including any modifications or
59+
any original work of authorship, including any modifications or
4660
additions to an existing work, that is intentionally submitted by
4761
You to IBM for inclusion in, or documentation of, the Project managed
4862
by IBM (the "Work"). For the purposes of this definition, "submitted"
@@ -58,17 +72,17 @@ You accept and agree to the following terms and conditions for Your present and
5872

5973
Subject to the terms and conditions of this Agreement,
6074
You hereby grant to IBM and to recipients of software
61-
distributed by IBM a perpetual, worldwide, non-exclusive,
62-
no-charge, royalty-free, irrevocable copyright license to
63-
reproduce, prepare derivative works of, publicly display,
75+
distributed by IBM a perpetual, worldwide, non-exclusive,
76+
no-charge, royalty-free, irrevocable copyright license to
77+
reproduce, prepare derivative works of, publicly display,
6478
publicly perform, sublicense, and distribute Your Contributions
6579
and such derivative works.
6680

6781
3. Grant of Patent License.
6882

69-
Subject to the terms and conditions of this Agreement,
70-
You hereby grant to IBM and to recipients of software
71-
distributed by IBM a perpetual, worldwide, non-exclusive,
83+
Subject to the terms and conditions of this Agreement,
84+
You hereby grant to IBM and to recipients of software
85+
distributed by IBM a perpetual, worldwide, non-exclusive,
7286
no-charge, royalty-free, irrevocable (except as
7387
stated in this section) patent license to make, have made, use,
7488
offer to sell, sell, import, and otherwise transfer the Work,
@@ -86,7 +100,7 @@ You accept and agree to the following terms and conditions for Your present and
86100
4. You represent that You are legally entitled to grant the above
87101
license.
88102

89-
You represent further that each employee of the Corporation
103+
You represent further that each employee of the Corporation
90104
designated on Schedule A below (or in a subsequent written
91105
modification to that Schedule) is authorized to submit
92106
Contributions on behalf of the Corporation.

0 commit comments

Comments
 (0)