Skip to content

Commit 418d90e

Browse files
committed
Use slcli command over sl
1 parent aaacca4 commit 418d90e

14 files changed

Lines changed: 68 additions & 50 deletions

File tree

SoftLayer/CLI/call_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ def cli(env, service, method, _id, mask, limit, offset):
1919
2020
\b
2121
Examples:
22-
sl call-api Account getObject
23-
sl call-api Account getVirtualGuests --limit=10 --mask=id,hostname
24-
sl call-api Virtual_Guest getObject --id=2710344
22+
slcli call-api Account getObject
23+
slcli call-api Account getVirtualGuests --limit=10 --mask=id,hostname
24+
slcli call-api Virtual_Guest getObject --id=2710344
2525
"""
2626
result = env.client.call(service, method,
2727
id=_id,

SoftLayer/CLI/core.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def get_command(self, ctx, name):
6969
@click.group(help="SoftLayer Command-line Client",
7070
epilog="""To use most commands your SoftLayer
7171
username and api_key need to be configured. The easiest way to do that is to
72-
use: 'sl setup'""",
72+
use: 'slcli setup'""",
7373
cls=CommandLoader,
7474
context_settings={'help_option_names': ['-h', '--help']})
7575
@click.pass_context
@@ -178,7 +178,7 @@ def main():
178178
except SoftLayer.SoftLayerAPIError as ex:
179179
if 'invalid api token' in ex.faultString.lower():
180180
print("Authentication Failed: To update your credentials,"
181-
" use 'sl config setup'")
181+
" use 'slcli config setup'")
182182
exit_status = 1
183183
else:
184184
print(str(ex))

SoftLayer/CLI/deprecated.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
"""
2+
SoftLayer.CLI.deprecated
3+
~~~~~~~~~~~~~~~~~~~~~~~~
4+
Handles usage of the deprecated command name, 'sl'.
5+
:license: MIT, see LICENSE for more details.
6+
"""
7+
import sys
8+
9+
import click
10+
11+
12+
def main():
13+
"""Main function for the deprecated 'sl' command."""
14+
click.echo("ERROR: Use the 'slcli' command instead.", err=True)
15+
click.echo("> slcli %s" % ' '.join(sys.argv[1:]), err=True)
16+
exit(-1)

SoftLayer/CLI/metadata.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
Examples :
3737
%s
3838
""" % ('*'+'\n*'.join(META_CHOICES),
39-
'sl metadata '+'\nsl metadata '.join(META_CHOICES))
39+
'slcli metadata '+'\nslcli metadata '.join(META_CHOICES))
4040

4141

4242
@click.command(help=HELP,

SoftLayer/CLI/server/create.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212

1313

1414
@click.command(epilog="""See 'sl server create-options' for valid options.""")
15-
@click.option('--domain', '-D', help="Domain portion of the FQDN")
1615
@click.option('--hostname', '-H', help="Host portion of the FQDN")
16+
@click.option('--domain', '-D', help="Domain portion of the FQDN")
1717
@click.option('--size', '-s', help="Hardware size")
1818
@click.option('--os', '-o', help="OS install code")
1919
@click.option('--datacenter', '-d', help="Datacenter shortname")

SoftLayer/CLI/ticket/create.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
@click.option('--subject-id',
1414
required=True,
1515
help="""The subject id to use for the ticket,
16-
issue 'sl ticket subjects' to get the list""")
16+
issue 'slcli ticket subjects' to get the list""")
1717
@click.option('--body', help="The ticket body")
1818
@environment.pass_env
1919
def cli(env, title, subject_id, body):

SoftLayer/CLI/virt/create.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
import click
1414

1515

16-
@click.command(epilog="See 'sl vs create-options' for valid options")
16+
@click.command(epilog="See 'slcli vs create-options' for valid options")
1717
@click.option('--domain', '-D', help="Domain portion of the FQDN")
1818
@click.option('--hostname', '-H', help="Host portion of the FQDN")
1919
@click.option('--image',
20-
help="Image GUID. See: 'sl image list' for reference")
20+
help="Image GUID. See: 'slcli image list' for reference")
2121
@click.option('--cpu', '-c', help="Number of CPU cores", type=click.INT)
2222
@click.option('--memory', '-m', help="Memory in mebibytes", type=virt.MEM_TYPE)
2323
@click.option('--os', '-o',

SoftLayer/tests/CLI/core_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def test_auth_error(self, stdoutmock, climock):
9090
self.assertRaises(SystemExit, core.main)
9191

9292
self.assertIn("Authentication Failed:", stdoutmock.getvalue())
93-
self.assertIn("use 'sl config setup'", stdoutmock.getvalue())
93+
self.assertIn("use 'slcli config setup'", stdoutmock.getvalue())
9494

9595

9696
def recursive_subcommand_loader(root, path=''):

docs/cli.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ functionality not fully documented here.
1919

2020
Configuration Setup
2121
-------------------
22-
To update the configuration, you can use `sl setup`.
22+
To update the configuration, you can use `slcli setup`.
2323
::
2424

25-
$ sl setup
25+
$ slcli setup
2626
Username []: username
2727
API Key or Password []:
2828
Endpoint (public|private|custom): public
@@ -35,10 +35,10 @@ To update the configuration, you can use `sl setup`.
3535
:..............:..................................................................:
3636
Are you sure you want to write settings to "/home/me/.softlayer"? [y/N]: y
3737

38-
To check the configuration, you can use `sl config show`.
38+
To check the configuration, you can use `slcli config show`.
3939
::
4040

41-
$ sl config show
41+
$ slcli config show
4242
:..............:..................................................................:
4343
: Name : Value :
4444
:..............:..................................................................:
@@ -58,7 +58,7 @@ To discover the available commands, simply type `sl`.
5858
::
5959

6060
$ sl
61-
Usage: sl [OPTIONS] COMMAND [ARGS]...
61+
Usage: slcli [OPTIONS] COMMAND [ARGS]...
6262

6363
SoftLayer Command-line Client
6464

@@ -99,14 +99,14 @@ To discover the available commands, simply type `sl`.
9999
vs Virtual Servers.
100100

101101
To use most commands your SoftLayer username and api_key need to be
102-
configured. The easiest way to do that is to use: 'sl setup'
102+
configured. The easiest way to do that is to use: 'slcli setup'
103103

104104
As you can see, there are a number of commands/sections. To look at the list of
105-
subcommands for virtual servers type `sl vs`. For example:
105+
subcommands for virtual servers type `slcli vs`. For example:
106106
::
107107

108-
$ sl vs
109-
Usage: sl vs [OPTIONS] COMMAND [ARGS]...
108+
$ slcli vs
109+
Usage: slcli vs [OPTIONS] COMMAND [ARGS]...
110110

111111
Virtual Servers.
112112

@@ -135,11 +135,11 @@ subcommands for virtual servers type `sl vs`. For example:
135135
upgrade Upgrade a virtual server.
136136

137137
Finally, we can make an actual call. Let's list out the virtual servers on our
138-
account by using `sl vs list`.
138+
account by using `slcli vs list`.
139139

140140
::
141141

142-
$ sl vs list
142+
$ slcli vs list
143143
:.........:............:....................:.......:........:................:..............:....................:
144144
: id : datacenter : host : cores : memory : primary_ip : backend_ip : active_transaction :
145145
:.........:............:....................:.......:........:................:..............:....................:
@@ -149,8 +149,8 @@ account by using `sl vs list`.
149149
Most commands will take in additional options/arguments. To see all available actions, use `--help`.
150150
::
151151

152-
$ sl vs list --help
153-
Usage: sl vs list [OPTIONS]
152+
$ slcli vs list --help
153+
Usage: slcli vs list [OPTIONS]
154154

155155
List virtual servers.
156156

docs/cli/vs.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ using SoftLayer's command-line client.
1414
:ref:`configured with valid SoftLayer credentials<cli>`.
1515

1616

17-
First, let's list the current virtual servers with `sl vs list`.
17+
First, let's list the current virtual servers with `slcli vs list`.
1818
::
1919

20-
$ sl vs list
20+
$ slcli vs list
2121
:.....:............:.........................:.......:........:..............:.............:....................:........:
2222
: id : datacenter : host : cores : memory : primary_ip : backend_ip : active_transaction : owner :
2323
:.....:............:.........................:.......:........:..............:.............:....................:........:
@@ -26,11 +26,11 @@ First, let's list the current virtual servers with `sl vs list`.
2626
We don't have any virtual servers yet! Let's fix that. Before we can create a
2727
virtual server (VS), we need to know what options are available to us: RAM,
2828
CPU, operating systems, disk sizes, disk types, datacenters, and so on.
29-
Luckily, there's a simple command to show all options: `sl vs create-options`.
29+
Luckily, there's a simple command to show all options: `slcli vs create-options`.
3030

3131
::
3232

33-
$ sl vs create-options
33+
$ slcli vs create-options
3434
:.................:...........................................................................................:
3535
: Name : Value :
3636
:.................:...........................................................................................:
@@ -112,11 +112,11 @@ Luckily, there's a simple command to show all options: `sl vs create-options`.
112112

113113
Here's the command to create a 2-core virtual server with 1GiB memory, running
114114
Ubuntu 14.04 LTS, and that is billed on an hourly basis in the San Jose 1
115-
datacenter using the command `sl vs create`.
115+
datacenter using the command `slcli vs create`.
116116

117117
::
118118

119-
$ sl vs create --hostname=example --domain=softlayer.com --cpu 2 --memory 1024 -o UBUNTU_14_64 --datacenter=sjc01 --billing=hourly
119+
$ slcli vs create --hostname=example --domain=softlayer.com --cpu 2 --memory 1024 -o UBUNTU_14_64 --datacenter=sjc01 --billing=hourly
120120
This action will incur charges on your account. Continue? [y/N]: y
121121
:.........:......................................:
122122
: name : value :
@@ -132,7 +132,7 @@ instantly appear in your virtual server list now.
132132

133133
::
134134

135-
$ sl vs list
135+
$ slcli vs list
136136
:.........:............:.......................:.......:........:................:..............:....................:
137137
: id : datacenter : host : cores : memory : primary_ip : backend_ip : active_transaction :
138138
:.........:............:.......................:.......:........:................:..............:....................:
@@ -144,15 +144,15 @@ here's how:
144144

145145
::
146146

147-
$ sl vs ready 'example' --wait=600
147+
$ slcli vs ready 'example' --wait=600
148148
READY
149149

150150
When the previous command returns, you'll know that the virtual server has
151151
finished the provisioning process and is ready to use. This is *very* useful
152152
for chaining commands together.
153153

154154
Now that you have your virtual server, let's get access to it. To do that, use
155-
the `sl vs detail` command. From the example below, you can see that the
155+
the `slcli vs detail` command. From the example below, you can see that the
156156
username is 'root' and password is 'ABCDEFGH'.
157157

158158
.. warning::
@@ -165,7 +165,7 @@ username is 'root' and password is 'ABCDEFGH'.
165165

166166
::
167167

168-
$ sl vs detail example --passwords
168+
$ slcli vs detail example --passwords
169169
:..............:...........................:
170170
: Name : Value :
171171
:..............:...........................:
@@ -188,12 +188,12 @@ username is 'root' and password is 'ABCDEFGH'.
188188

189189

190190
There are many other commands to help manage virtual servers. To see them all,
191-
use `sl help vs`.
191+
use `slcli help vs`.
192192

193193
::
194194

195-
$ sl vs
196-
Usage: sl vs [OPTIONS] COMMAND [ARGS]...
195+
$ slcli vs
196+
Usage: slcli vs [OPTIONS] COMMAND [ARGS]...
197197

198198
Virtual Servers.
199199

0 commit comments

Comments
 (0)