forked from softlayer/softlayer-python
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcli.html
More file actions
260 lines (237 loc) · 11.4 KB
/
cli.html
File metadata and controls
260 lines (237 loc) · 11.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Command-line Interface — SoftLayer API Python Client 2.3.1 documentation</title>
<link rel="stylesheet" href="_static/style.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '2.3.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="SoftLayer API Python Client 2.3.1 documentation" href="index.html" />
<link rel="next" title="Working with Cloud Compute Instances" href="cli/cci.html" />
<link rel="prev" title="SoftLayer.SSL" href="api/managers/ssl.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="cli/cci.html" title="Working with Cloud Compute Instances"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="api/managers/ssl.html" title="SoftLayer.SSL"
accesskey="P">previous</a> |</li>
<li><a href="index.html">SoftLayer API Python Client 2.3.1 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="command-line-interface">
<span id="cli"></span><h1>Command-line Interface<a class="headerlink" href="#command-line-interface" title="Permalink to this headline">¶</a></h1>
<p>The SoftLayer command line interface is available via the <cite>sl</cite> command available in your <cite>PATH</cite>. The <cite>sl</cite> command is a reference implementation of SoftLayer API bindings for python and how to efficiently make API calls.</p>
<div class="section" id="configuration-setup">
<h2>Configuration Setup<a class="headerlink" href="#configuration-setup" title="Permalink to this headline">¶</a></h2>
<p>To check the configuration, you can use <cite>sl config show</cite>.</p>
<div class="highlight-python"><pre>$ sl config setup
Username: username
API Key: oyVmeipYQCNrjVS4rF9bHWV7D75S6pa1fghFl384v7mwRCbHTfuJ8qRORIqoVnha
Endpoint URL [https://api.softlayer.com/xmlrpc/v3/]:
Are you sure you want to write settings to "/path/to/home/.softlayer"? [y/N]: y</pre>
</div>
<p>To check the configuration, you can use <cite>sl config show</cite>.</p>
<div class="highlight-python"><pre>$ sl config show
:..............:..................................................................:
: Name : Value :
:..............:..................................................................:
: Username : username :
: API Key : oyVmeipYQCNrjVS4rF9bHWV7D75S6pa1fghFl384v7mwRCbHTfuJ8qRORIqoVnha :
: Endpoint URL : https://api.softlayer.com/xmlrpc/v3/ :
:..............:..................................................................:</pre>
</div>
</div>
<div class="section" id="configuration-file-details">
<h2>Configuration File Details<a class="headerlink" href="#configuration-file-details" title="Permalink to this headline">¶</a></h2>
<p>The CLI loads your settings from a number of different locations.</p>
<ul class="simple">
<li>Enviorment variables (SL_USERNAME, SL_API_KEY)</li>
<li>Config file (~/.softlayer)</li>
<li>Or argument (-C/path/to/config or –config=/path/to/config)</li>
</ul>
<p>The configuration file is INI based and requires the <cite>softlayer</cite> section to be present.
The only required fields are <cite>username</cite> and <cite>api_key</cite>. You can optionally also/exclusively supply the <cite>endpoint_url</cite> as well.</p>
<p><em>Full config</em></p>
<div class="highlight-python"><pre>[softlayer]
username = username
api_key = oyVmeipYQCNrjVS4rF9bHWV7D75S6pa1fghFl384v7mwRCbHTfuJ8qRORIqoVnha
endpoint_url = https://api.softlayer.com/xmlrpc/v3/</pre>
</div>
<p><em>exclusive url</em></p>
<div class="highlight-python"><pre>[softlayer]
endpoint_url = https://api.softlayer.com/xmlrpc/v3/</pre>
</div>
</div>
<div class="section" id="usage-examples">
<h2>Usage Examples<a class="headerlink" href="#usage-examples" title="Permalink to this headline">¶</a></h2>
<p>To discover the available commands, simply type <cite>sl</cite>.</p>
<div class="highlight-python"><pre>$ sl
usage: sl <command> [<args>...]
sl help <command>
sl [-h | --help]
SoftLayer Command-line Client
The available commands are:
firewall Firewall rule and security management
image Manages compute and flex images
ssl Manages SSL
cci Manage, delete, order compute instances
dns Manage DNS
config View and edit configuration for this tool
metadata Get details about this machine. Also available with 'my' and 'meta'
nas View NAS details
iscsi View iSCSI details
See 'sl help <command>' for more information on a specific command.
To use most commands your SoftLayer username and api_key need to be configured.
The easiest way to do that is to use: 'sl config setup'</pre>
</div>
<p>As you can see, there are a number of commands. To look at the list of subcommands for Cloud Compute Instances, type <cite>sl <command></cite>. For example:</p>
<div class="highlight-python"><pre>$ sl cci
usage: sl cci [<command>] [<args>...] [options]
Manage, delete, order compute instances
The available commands are:
network Manage network settings
create Order and create a CCI
(see `sl cci create-options` for choices)
manage Manage active CCI
list List CCI's on the account
detail Output details about a CCI
dns DNS related actions to a CCI
cancel Cancel a running CCI
create-options Output available available options when creating a CCI
reload Reload the OS on a CCI based on its current configuration
Standard Options:
-h --help Show this screen</pre>
</div>
<p>Finally, we can make an actual call. Let’s list out the CCIs on our account using <cite>sl cci list</cite>.</p>
<div class="highlight-python"><pre>$ sl cci list
:.........:............:....................:.......:........:................:..............:....................:
: id : datacenter : host : cores : memory : primary_ip : backend_ip : active_transaction :
:.........:............:....................:.......:........:................:..............:....................:
: 1234567 : dal05 : test.example.com : 4 : 4G : 12.34.56 : 65.43.21 : - :
:.........:............:....................:.......:........:................:..............:....................:</pre>
</div>
<p>Most commands will take in additional options/arguments. To see all available actions, use <cite>–help</cite>.</p>
<div class="highlight-python"><pre>$ sl cci list --help
usage: sl cci list [--hourly | --monthly] [--sortby=SORT_COLUMN] [--tags=TAGS]
[options]
List CCIs
Examples:
sl cci list --datacenter=dal05
sl cci list --network=100 --cpu=2
sl cci list --memory='>= 2048'
sl cci list --tags=production,db
Options:
--sortby=ARG Column to sort by. options: id, datacenter, host,
Cores, memory, primary_ip, backend_ip
Filters:
--hourly Show hourly instances
--monthly Show monthly instances
-H --hostname=HOST Host portion of the FQDN. example: server
-D --domain=DOMAIN Domain portion of the FQDN example: example.com
-c --cpu=CPU Number of CPU cores
-m --memory=MEMORY Memory in mebibytes (n * 1024)
-d DC, --datacenter=DC datacenter shortname (sng01, dal05, ...)
-n MBPS, --network=MBPS Network port speed in Mbps
--tags=ARG Only show instances that have one of these tags.
Comma-separated. (production,db)
For more on filters see 'sl help filters'
Standard Options:
--format=ARG Output format. [Options: table, raw] [Default: table]
-C FILE --config=FILE Config file location. [Default: ~/.softlayer]
-h --help Show this screen</pre>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Command-line Interface</a><ul>
<li><a class="reference internal" href="#configuration-setup">Configuration Setup</a></li>
<li><a class="reference internal" href="#configuration-file-details">Configuration File Details</a></li>
<li><a class="reference internal" href="#usage-examples">Usage Examples</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="api/managers/ssl.html"
title="previous chapter">SoftLayer.SSL</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="cli/cci.html"
title="next chapter">Working with Cloud Compute Instances</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/cli.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="cli/cci.html" title="Working with Cloud Compute Instances"
>next</a> |</li>
<li class="right" >
<a href="api/managers/ssl.html" title="SoftLayer.SSL"
>previous</a> |</li>
<li><a href="index.html">SoftLayer API Python Client 2.3.1 documentation</a> »</li>
</ul>
</div>
<div class="footer">
© Copyright 2013, SoftLayer Technologies, Inc..
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2b1.
</div>
</body>
</html>