@@ -86,9 +86,9 @@ offsets, and retrieving objects by id. The following section assumes you have
8686an initialized client named 'client'.
8787
8888The best way to test our setup is to call the
89- `getObject <http ://developer .softlayer.com/reference/services/SoftLayer_Account/getObject >`_
89+ `getObject <https ://sldn .softlayer.com/reference/services/SoftLayer_Account/getObject >`_
9090method on the
91- `SoftLayer_Account <http ://developer .softlayer.com/reference/services/SoftLayer_Account >`_
91+ `SoftLayer_Account <https ://sldn .softlayer.com/reference/services/SoftLayer_Account >`_
9292service.
9393::
9494
@@ -97,7 +97,7 @@ service.
9797For a more complex example we'll retrieve a support ticket with id 123456 along
9898with the ticket's updates, the user it's assigned to, the servers attached to
9999it, and the datacenter those servers are in. To retrieve our extra information
100- using an `object mask <http ://developer .softlayer.com/article/Extended-Object-Masks >`_.
100+ using an `object mask <https ://sldn .softlayer.com/article/object-masks/ >`_.
101101
102102Retrieve a ticket using object masks.
103103::
@@ -106,22 +106,28 @@ Retrieve a ticket using object masks.
106106 id=123456, mask="updates, assignedUser, attachedHardware.datacenter")
107107
108108
109- Now add an update to the ticket with
110- `Ticket.addUpdate <http://developer.softlayer.com/reference/services/SoftLayer_Ticket/addUpdate >`_.
109+ Now add an update to the ticket with `Ticket.addUpdate <https://sldn.softlayer.com/reference/services/SoftLayer_Ticket/addUpdate >`_.
111110This uses a parameter, which translate to positional arguments in the order
112111that they appear in the API docs.
112+
113+
113114::
114115
115116 update = client.call('Ticket', 'addUpdate', {'entry' : 'Hello!'}, id=123456)
116117
117118Let's get a listing of virtual guests using the domain example.com
119+
120+
118121::
119122
120123 client.call('Account', 'getVirtualGuests',
121124 filter={'virtualGuests': {'domain': {'operation': 'example.com'}}})
122125
123- This call gets tickets created between the beginning of March 1, 2013 and
124- March 15, 2013.
126+ This call gets tickets created between the beginning of March 1, 2013 and March 15, 2013.
127+ More information on `Object Filters <https://sldn.softlayer.com/article/object-filters/ >`_.
128+
129+ :NOTE: The `value ` field for startDate and endDate is in `[] `, if you do not put the date in brackets the filter will not work.
130+
125131::
126132
127133 client.call('Account', 'getTickets',
@@ -141,14 +147,24 @@ March 15, 2013.
141147SoftLayer's XML-RPC API also allows for pagination.
142148::
143149
144- client.call('Account', 'getVirtualGuests', limit=10, offset=0) # Page 1
145- client.call('Account', 'getVirtualGuests', limit=10, offset=10) # Page 2
150+ from pprint import pprint
151+
152+ page1 = client.call('Account', 'getVirtualGuests', limit=10, offset=0) # Page 1
153+ page2 = client.call('Account', 'getVirtualGuests', limit=10, offset=10) # Page 2
154+
155+ #Automatic Pagination (v5.5.3+), default limit is 100
156+ result = client.call('Account', 'getVirtualGuests', iter=True, limit=10)
157+ pprint(result)
158+
159+ # Using a python generator, default limit is 100
160+ results = client.iter_call('Account', 'getVirtualGuests', limit=10)
161+ for result in results:
162+ pprint(result)
146163
147- #Automatic Pagination (v5.5.3+)
148- client.call('Account', 'getVirtualGuests', iter=True) # Page 2
164+ :NOTE: `client.call(iter=True) ` will pull all results, then return. `client.iter_call() ` will return a generator, and only make API calls as you iterate over the results.
149165
150166Here's how to create a new Cloud Compute Instance using
151- `SoftLayer_Virtual_Guest.createObject <http ://developer .softlayer.com/reference/services/SoftLayer_Virtual_Guest/createObject >`_.
167+ `SoftLayer_Virtual_Guest.createObject <https ://sldn .softlayer.com/reference/services/SoftLayer_Virtual_Guest/createObject >`_.
152168Be warned, this call actually creates an hourly virtual server so this will
153169have billing implications.
154170::
0 commit comments