Skip to content

Commit 5f44bad

Browse files
Merge pull request #1219 from allmightyspiff/docUpdates
Doc updates
2 parents 568ffea + b7416ff commit 5f44bad

33 files changed

+904
-275
lines changed

SoftLayer/CLI/metadata.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,13 @@
2828
'ip': 'primary_ip',
2929
}
3030

31-
HELP = """Find details about this machine
32-
33-
\b
34-
PROP Choices
35-
%s
36-
\b
37-
Examples :
38-
%s
39-
""" % ('*' + '\n*'.join(META_CHOICES),
40-
'slcli metadata ' + '\nslcli metadata '.join(META_CHOICES))
31+
HELP = """Find details about the machine making these API calls.
32+
33+
.. csv-table:: Choices
34+
35+
{choices}
36+
37+
""".format(choices="\n ".join(META_CHOICES))
4138

4239

4340
@click.command(help=HELP,

SoftLayer/CLI/user/create.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,13 @@
3434
def cli(env, username, email, password, from_user, template, api_key):
3535
"""Creates a user Users.
3636
37-
:Example: slcli user create my@email.com -e my@email.com -p generate -a
38-
-t '{"firstName": "Test", "lastName": "Testerson"}'
39-
4037
Remember to set the permissions and access for this new user.
38+
39+
Example::
40+
41+
slcli user create my@email.com -e my@email.com -p generate -a
42+
-t '{"firstName": "Test", "lastName": "Testerson"}'
43+
4144
"""
4245

4346
mgr = SoftLayer.UserManager(env.client)

SoftLayer/CLI/user/delete.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ def cli(env, identifier):
1717
and will eventually be fully removed from the account by an automated internal process.
1818
1919
Example: slcli user delete userId
20+
2021
"""
2122

2223
mgr = SoftLayer.UserManager(env.client)

SoftLayer/CLI/user/edit_details.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ def cli(env, user, template):
2222
2323
JSON strings should be enclosed in '' and each item should be enclosed in ""
2424
25-
:Example: slcli user edit-details testUser -t '{"firstName": "Test", "lastName": "Testerson"}'
25+
Example::
26+
27+
slcli user edit-details testUser -t '{"firstName": "Test", "lastName": "Testerson"}'
28+
2629
"""
2730
mgr = SoftLayer.UserManager(env.client)
2831
user_id = helpers.resolve_id(mgr.resolve_ids, user, 'username')

SoftLayer/CLI/user/edit_permissions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
@environment.pass_env
2222
def cli(env, identifier, enable, permission, from_user):
2323
"""Enable or Disable specific permissions."""
24+
2425
mgr = SoftLayer.UserManager(env.client)
2526
user_id = helpers.resolve_id(mgr.resolve_ids, identifier, 'username')
2627
result = False

SoftLayer/managers/autoscale.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ def get_virtual_guests(self, identifier, mask=None):
9999
100100
:param identifier: SoftLayer_Scale_Group Id
101101
:param mask: optional SoftLayer_Scale_Member objectMask
102+
102103
.. _SoftLayer_Scale_Group::getVirtualGuestMembers():
103104
https://sldn.softlayer.com/reference/services/SoftLayer_Scale_Group/getVirtualGuestMembers/
104105
"""
@@ -109,6 +110,7 @@ def edit(self, identifier, template):
109110
110111
:param identifier: SoftLayer_Scale_Group id
111112
:param template: `SoftLayer_Scale_Group`_
113+
112114
.. _SoftLayer_Scale_Group::editObject():
113115
https://sldn.softlayer.com/reference/services/SoftLayer_Scale_Group/editObject/
114116
.. _SoftLayer_Scale_Group: https://sldn.softlayer.com/reference/datatypes/SoftLayer_Scale_Group/

docs/cli.rst

Lines changed: 86 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -9,43 +9,39 @@ SoftLayer API bindings for python and how to efficiently make API calls. See
99
the :ref:`usage-examples` section to see how to discover all of the
1010
functionality not fully documented here.
1111

12-
.. toctree::
13-
:maxdepth: 2
14-
:glob:
15-
16-
cli/*
17-
1812
.. _config_setup:
1913

2014
Configuration Setup
2115
-------------------
2216
To update the configuration, you can use `slcli setup`.
17+
2318
::
2419

25-
$ slcli setup
26-
Username []: username
27-
API Key or Password []:
28-
Endpoint (public|private|custom): public
29-
:..............:..................................................................:
30-
: Name : Value :
31-
:..............:..................................................................:
32-
: Username : username :
33-
: API Key : oyVmeipYQCNrjVS4rF9bHWV7D75S6pa1fghFl384v7mwRCbHTfuJ8qRORIqoVnha :
34-
: Endpoint URL : https://api.softlayer.com/xmlrpc/v3.1/ :
35-
:..............:..................................................................:
36-
Are you sure you want to write settings to "/home/me/.softlayer"? [y/N]: y
20+
$ slcli setup
21+
Username []: username
22+
API Key or Password []:
23+
Endpoint (public|private|custom): public
24+
:..............:..................................................................:
25+
: Name : Value :
26+
:..............:..................................................................:
27+
: Username : username :
28+
: API Key : oyVmeipYQCNrjVS4rF9bHWV7D75S6pa1fghFl384v7mwRCbHTfuJ8qRORIqoVnha :
29+
: Endpoint URL : https://api.softlayer.com/xmlrpc/v3.1/ :
30+
:..............:..................................................................:
31+
Are you sure you want to write settings to "/home/me/.softlayer"? [y/N]: y
3732

3833
To check the configuration, you can use `slcli config show`.
34+
3935
::
4036

41-
$ slcli config show
42-
:..............:..................................................................:
43-
: Name : Value :
44-
:..............:..................................................................:
45-
: Username : username :
46-
: API Key : oyVmeipYQCNrjVS4rF9bHWV7D75S6pa1fghFl384v7mwRCbHTfuJ8qRORIqoVnha :
47-
: Endpoint URL : https://api.softlayer.com/xmlrpc/v3.1/ :
48-
:..............:..................................................................:
37+
$ slcli config show
38+
:..............:..................................................................:
39+
: Name : Value :
40+
:..............:..................................................................:
41+
: Username : username :
42+
: API Key : oyVmeipYQCNrjVS4rF9bHWV7D75S6pa1fghFl384v7mwRCbHTfuJ8qRORIqoVnha :
43+
: Endpoint URL : https://api.softlayer.com/xmlrpc/v3.1/ :
44+
:..............:..................................................................:
4945

5046

5147
If you are using an account created from the https://cloud.ibm.com portal, your username will be literally `apikey`, and use the key provided. `How to create an IBM apikey <https://cloud.ibm.com/docs/iam?topic=iam-userapikey#create_user_key>`_
@@ -57,6 +53,8 @@ To see more about the config file format, see :ref:`config_file`.
5753
Usage Examples
5854
--------------
5955
To discover the available commands, simply type `slcli`.
56+
57+
6058
::
6159

6260
$ slcli
@@ -112,71 +110,76 @@ To discover the available commands, simply type `slcli`.
112110

113111
As you can see, there are a number of commands/sections. To look at the list of
114112
subcommands for virtual servers type `slcli vs`. For example:
115-
::
116113

117-
$ slcli vs
118-
Usage: slcli vs [OPTIONS] COMMAND [ARGS]...
119-
120-
Virtual Servers.
121-
122-
Options:
123-
--help Show this message and exit.
124-
125-
Commands:
126-
cancel Cancel virtual servers.
127-
capture Capture SoftLayer image.
128-
create Order/create virtual servers.
129-
create-options Virtual server order options.
130-
credentials List virtual server credentials.
131-
detail Get details for a virtual server.
132-
dns-sync Sync DNS records.
133-
edit Edit a virtual server's details.
134-
list List virtual servers.
135-
network Manage network settings.
136-
pause Pauses an active virtual server.
137-
power_off Power off an active virtual server.
138-
power_on Power on a virtual server.
139-
ready Check if a virtual server is ready.
140-
reboot Reboot an active virtual server.
141-
reload Reload operating system on a virtual server.
142-
rescue Reboot into a rescue image.
143-
resume Resumes a paused virtual server.
144-
upgrade Upgrade a virtual server.
145-
146-
Finally, we can make an actual call. Let's list out the virtual servers on our
147-
account by using `slcli vs list`.
148114

149115
::
150116

151-
$ slcli vs list
152-
:.........:............:....................:.......:........:................:..............:....................:
153-
: id : datacenter : host : cores : memory : primary_ip : backend_ip : active_transaction :
154-
:.........:............:....................:.......:........:................:..............:....................:
155-
: 1234567 : sjc01 : test.example.com : 4 : 4G : 12.34.56 : 65.43.21 : - :
156-
:.........:............:....................:.......:........:................:..............:....................:
117+
$ slcli vs
118+
Usage: slcli vs [OPTIONS] COMMAND [ARGS]...
119+
120+
Virtual Servers.
121+
122+
Options:
123+
--help Show this message and exit.
124+
125+
Commands:
126+
cancel Cancel virtual servers.
127+
capture Capture SoftLayer image.
128+
create Order/create virtual servers.
129+
create-options Virtual server order options.
130+
credentials List virtual server credentials.
131+
detail Get details for a virtual server.
132+
dns-sync Sync DNS records.
133+
edit Edit a virtual server's details.
134+
list List virtual servers.
135+
network Manage network settings.
136+
pause Pauses an active virtual server.
137+
power_off Power off an active virtual server.
138+
power_on Power on a virtual server.
139+
ready Check if a virtual server is ready.
140+
reboot Reboot an active virtual server.
141+
reload Reload operating system on a virtual server.
142+
rescue Reboot into a rescue image.
143+
resume Resumes a paused virtual server.
144+
upgrade Upgrade a virtual server.
145+
146+
147+
Finally, we can make an actual call. Let's list out the virtual servers on our account by using `slcli vs list`.
148+
149+
150+
Example::
151+
152+
$ slcli vs list
153+
:.........:............:....................:.......:........:................:..............:....................:
154+
: id : datacenter : host : cores : memory : primary_ip : backend_ip : active_transaction :
155+
:.........:............:....................:.......:........:................:..............:....................:
156+
: 1234567 : sjc01 : test.example.com : 4 : 4G : 12.34.56 : 65.43.21 : - :
157+
:.........:............:....................:.......:........:................:..............:....................:
157158

158159
Most commands will take in additional options/arguments. To see all available actions, use `--help`.
160+
161+
159162
::
160163

161-
$ slcli vs list --help
162-
Usage: slcli vs list [OPTIONS]
163-
164-
List virtual servers.
165-
166-
Options:
167-
--sortby [guid|hostname|primary_ip|backend_ip|datacenter]
168-
Column to sort by
169-
-c, --cpu INTEGER Number of CPU cores
170-
-D, --domain TEXT Domain portion of the FQDN
171-
-d, --datacenter TEXT Datacenter shortname
172-
-H, --hostname TEXT Host portion of the FQDN
173-
-m, --memory INTEGER Memory in mebibytes
174-
-n, --network TEXT Network port speed in Mbps
175-
--hourly Show only hourly instances
176-
--monthly Show only monthly instances
177-
--tags TEXT Show instances that have one of these comma-
178-
separated tags
179-
--help Show this message and exit.
164+
$ slcli vs list --help
165+
Usage: slcli vs list [OPTIONS]
166+
167+
List virtual servers.
168+
169+
Options:
170+
--sortby [guid|hostname|primary_ip|backend_ip|datacenter]
171+
Column to sort by
172+
-c, --cpu INTEGER Number of CPU cores
173+
-D, --domain TEXT Domain portion of the FQDN
174+
-d, --datacenter TEXT Datacenter shortname
175+
-H, --hostname TEXT Host portion of the FQDN
176+
-m, --memory INTEGER Memory in mebibytes
177+
-n, --network TEXT Network port speed in Mbps
178+
--hourly Show only hourly instances
179+
--monthly Show only monthly instances
180+
--tags TEXT Show instances that have one of these comma-
181+
separated tags
182+
--help Show this message and exit.
180183

181184

182185

0 commit comments

Comments
 (0)