Skip to content

Commit bbbfb42

Browse files
committed
Documentation Improvements
1 parent a9732c2 commit bbbfb42

11 files changed

Lines changed: 38 additions & 23 deletions

File tree

CHANGELOG

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
* Consistency changes/bug fixes
44

5-
* Added sphinx documentation
5+
* Added sphinx documentation. See it here: http://softlayer.github.com/softlayer-api-python-client
66

77
* CCI: Adds Support for Additional Disks
88

@@ -12,4 +12,4 @@
1212

1313
* CLI(CCI): Adds the ability to filter list results for CCIs
1414

15-
* API: Adds generator to transparently chunk SoftLayer requests into reasonable chunks
15+
* API: for large result sets, requests can now be chunked into smaller batches on the server side. Using service.iter_call('getObjects', ...) or service.getObjects(..., iter=True) will return a generator regardless of the results returned. offset and limit can be passed in like normal. An additional named parameter of 'chunk' is used to limit the number of items coming back in a single request, defaults to 100.

SoftLayer/API.py

Lines changed: 21 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -200,16 +200,11 @@ def call(self, service, method, *args, **kwargs):
200200
201201
:param service: the name of the SoftLayer API service
202202
:param method: the method to call on the service
203-
:param \*args: (optional) arguments for the remote call
204-
:param id: (optional) id for the resource
205-
:param mask: (optional) object mask
206-
:param dict filter: (optional) filter dict
207-
:param dict headers: (optional) optional XML-RPC headers
208-
:param dict raw_headers: (optional) HTTP transport headers
209-
:param int limit: (optional) return at most this many results
210-
:param int offset: (optional) offset results by this many
211-
:param boolean iter: (optional) if True, returns a generator with the
212-
results
203+
:param \*args: same optional arguments that ``Service.call`` takes
204+
:param \*\*kwargs: same optional keyword arguments that
205+
``Service.call`` takes
206+
207+
:param service: the name of the SoftLayer API service
213208
214209
Usage:
215210
>>> client['Account'].getVirtualGuests(mask="id", limit=10)
@@ -276,9 +271,9 @@ def iter_call(self, service, method,
276271
:param service: the name of the SoftLayer API service
277272
:param method: the method to call on the service
278273
:param integer chunk: result size for each API call
279-
:param \*args: same optional arguments that ``Client.call`` takes
280-
:param \*\*kwargs: same optional keyword arguments that ``Client.call``
281-
takes
274+
:param \*args: same optional arguments that ``Service.call`` takes
275+
:param \*\*kwargs: same optional keyword arguments that
276+
``Service.call`` takes
282277
283278
"""
284279
if chunk <= 0:
@@ -386,9 +381,16 @@ def call(self, name, *args, **kwargs):
386381
""" Make a SoftLayer API call
387382
388383
:param method: the method to call on the service
389-
:param \*args: same optional arguments that ``Client.call`` takes
390-
:param \*\*kwargs: same optional keyword arguments that ``Client.call``
391-
takes
384+
:param \*args: (optional) arguments for the remote call
385+
:param id: (optional) id for the resource
386+
:param mask: (optional) object mask
387+
:param dict filter: (optional) filter dict
388+
:param dict headers: (optional) optional XML-RPC headers
389+
:param dict raw_headers: (optional) HTTP transport headers
390+
:param int limit: (optional) return at most this many results
391+
:param int offset: (optional) offset results by this many
392+
:param boolean iter: (optional) if True, returns a generator with the
393+
results
392394
393395
Usage:
394396
>>> client['Account'].getVirtualGuests(mask="id", limit=10)
@@ -404,9 +406,9 @@ def iter_call(self, name, *args, **kwargs):
404406
405407
:param method: the method to call on the service
406408
:param integer chunk: result size for each API call
407-
:param \*args: same optional arguments that ``Client.call`` takes
408-
:param \*\*kwargs: same optional keyword arguments that ``Client.call``
409-
takes
409+
:param \*args: same optional arguments that ``Service.call`` takes
410+
:param \*\*kwargs: same optional keyword arguments that
411+
``Service.call`` takes
410412
411413
Usage:
412414
>>> gen = client['Account'].getVirtualGuests(iter=True)

docs/_static/style.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@import url("nature.css");
2+
3+
p.deprecated {
4+
background-color: #ffe4e4;
5+
border: 1px solid #f66;
6+
padding: 0.2em;
7+
}

docs/api/client.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Retreive a ticket using Object Masks.
5353
id=123456, mask="mask[updates, assignedUser, attachedHardware.datacenter]")
5454

5555

56-
Now add an update to the ticket.
56+
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.
5757
::
5858

5959
update = client['Ticket'].addUpdate({'entry' : 'Hello!'}, id=123456)

docs/api/managers.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Managers
99
>>> cci.list_instances()
1010
[...]
1111

12-
Managers mask out a lot of the complexities of using the API into classes that provide a simpler interface to various services.
12+
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.
1313

1414
.. toctree::
1515
:maxdepth: 1

docs/api/managers/cci.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22

33
.. automodule:: SoftLayer.CCI
44
:members:
5+
:inherited-members:
56
:undoc-members:

docs/api/managers/dns.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22

33
.. automodule:: SoftLayer.DNS
44
:members:
5+
:inherited-members:
56
:undoc-members:

docs/api/managers/firewall.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22

33
.. automodule:: SoftLayer.firewall
44
:members:
5+
:inherited-members:
56
:undoc-members:

docs/api/managers/metadata.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
.. automodule:: SoftLayer.metadata
44
:members:
5+
:inherited-members:
56
:undoc-members:
67

78
.. autoattribute:: SoftLayer.metadata.METADATA_ATTRIBUTES

docs/api/managers/ssl.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22

33
.. automodule:: SoftLayer.SSL
44
:members:
5+
:inherited-members:
56
:undoc-members:

0 commit comments

Comments
 (0)