Skip to content

Commit 4c21f93

Browse files
doc updates
1 parent 7a3c644 commit 4c21f93

File tree

4 files changed

+57
-15
lines changed

4 files changed

+57
-15
lines changed

SoftLayer/CLI/order/quote.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,21 @@ def _parse_create_args(client, args):
7979
@click.option('--image', help="Image ID. See: 'slcli image list' for reference")
8080
@environment.pass_env
8181
def cli(env, quote, **args):
82-
"""View and Order a quote"""
82+
"""View and Order a quote
83+
84+
:note:
85+
The hostname and domain are split out from the fully qualified domain name.
86+
87+
If you want to order multiple servers, you need to specify each FQDN. Postinstall, userdata, and
88+
sshkeys are applied to all servers in an order.
89+
90+
::
91+
92+
slcli order quote 12345 --fqdn testing.tester.com \\
93+
--complex-type SoftLayer_Container_Product_Order_Virtual_Guest -k sshKeyNameLabel\\
94+
-i https://domain.com/runthis.sh --userdata DataGoesHere
95+
96+
"""
8397
table = formatting.Table([
8498
'Id', 'Name', 'Created', 'Expiration', 'Status'
8599
])

SoftLayer/managers/ordering.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def get_package_id_by_type(self, package_type):
133133
raise ValueError("No package found for type: " + package_type)
134134

135135
def get_quotes(self):
136-
"""Retrieve a list of quotes.
136+
"""Retrieve a list of active quotes.
137137
138138
:returns: a list of SoftLayer_Billing_Order_Quote
139139
"""

docs/api/client.rst

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ offsets, and retrieving objects by id. The following section assumes you have
8686
an initialized client named 'client'.
8787

8888
The 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>`_
9090
method on the
91-
`SoftLayer_Account <http://developer.softlayer.com/reference/services/SoftLayer_Account>`_
91+
`SoftLayer_Account <https://sldn.softlayer.com/reference/services/SoftLayer_Account>`_
9292
service.
9393
::
9494

@@ -97,7 +97,7 @@ service.
9797
For a more complex example we'll retrieve a support ticket with id 123456 along
9898
with the ticket's updates, the user it's assigned to, the servers attached to
9999
it, 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

102102
Retrieve 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>`_.
111110
This uses a parameter, which translate to positional arguments in the order
112111
that they appear in the API docs.
112+
113+
113114
::
114115

115116
update = client.call('Ticket', 'addUpdate', {'entry' : 'Hello!'}, id=123456)
116117

117118
Let'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.
141147
SoftLayer'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

150166
Here'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>`_.
152168
Be warned, this call actually creates an hourly virtual server so this will
153169
have billing implications.
154170
::

docs/cli/ordering.rst

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.. _cli_order:
22

33
Ordering
4-
==========
4+
========
55
The Order :ref:`cli` commands can be used to build an order for any product in the SoftLayer catalog.
66

77
The basic flow for ordering goes something like this...
@@ -116,10 +116,22 @@ order place <Virtual Server>
116116
--complex-type SoftLayer_Container_Product_Order_Virtual_Guest
117117

118118

119+
120+
Quotes
121+
======
122+
.. click:: SoftLayer.CLI.order.quote:cli
123+
:prog: order quote
124+
:show-nested:
125+
126+
119127
.. click:: SoftLayer.CLI.order.quote_list:cli
120128
:prog: order quote-list
121129
:show-nested:
122130

131+
.. click:: SoftLayer.CLI.order.quote_detail:cli
132+
:prog: order quote-detail
133+
:show-nested:
134+
123135
.. click:: SoftLayer.CLI.order.place_quote:cli
124136
:prog: order place-quote
125137
:show-nested:

0 commit comments

Comments
 (0)