forked from linode/cli
-
Notifications
You must be signed in to change notification settings - Fork 0
/
linode-linode
executable file
·311 lines (168 loc) · 5.41 KB
/
linode-linode
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
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
#!/usr/bin/env perl
# linode-cli
# Copyright (C) 2013 Linode, LLC
use 5.010;
use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/lib";
use Linode::CLI;
use Linode::CLI::Util ':basic';
my $mode = 'linode';
my $cmdargs = Linode::CLI::Util::eat_cmdargs($mode);
my $cli = Linode::CLI->new(
api_key => $cmdargs->{'api-key'},
mode => $mode,
opts => $cmdargs,
output_format => $cmdargs->{output},
wait => $cmdargs->{wait},
);
my $runaction = $cmdargs->{run};
$cli->$runaction;
$cli->response;
__END__
=head1 NAME
linode-linode - command-line interface for Linode instances
=head1 SYNOPSIS
B<linode-linode> [B<--api-key> API key] [B<-a> action] [action-options...] [options...]
B<Actions> available: B<create>, B<start>, B<stop>, B<restart>, B<rename>, B<group>, B<resize>, B<delete>, B<list>, B<show>.
Most actions require a B<-l> or B<--label> option specifying the Linode's label. You can also specify multiple Linodes using their labels.
=head1 OPTIONS
=over 8
=item B<-a>, B<--action>
An action to perform on one Linode. One of: B<create>, B<start>, B<stop>, B<restart>, B<rename>, B<group>, B<resize>, B<delete>.
Read-only operations are available as well: B<list>, B<show>.
Each action has a set of options that apply to it, which are outlined in the section B<ACTIONS>.
=item B<--api-key>
API key to use when communicating with the Linode API. The API key can also be set using an environment variable (LINODE_API_KEY). Alternatively, you can specify the API key in a B<.linodecli> file in the working user's home directory, using the format `api-key foobar`.
=item B<-j>, B<--json>:
Optional. JSON output.
=item B<-w>, B<--wait>
Optional. Waits and provides feedback while the task(s) run.
=item B<-h>, B<--help>
Brief help message.
=item B<-m>, B<--man>
Full documentation
=back
=head1 ACTIONS
=head2 CREATE
=over 8
Create and start a new Linode. This action prompts for a password which will be used as the root password on the newly-created Linode.
=over 8
=item B<-d>, B<--distribution>
Distribution name or DistributionID to deploy.
=item B<-g>, B<--group>
Optional. Linode Manager display group to place this Linode under. Default: none.
=item B<-L>, B<--location>
City name or DatacenterID to deploy to.
=item B<-l>, B<--label>
A Linode to operate on.
=item B<-p>, B<--plan>
The Plan to deploy. Plans are linode1024, linode2048, linode4096, linode8192, linode16384, linode24576, linode32768, and linode40960.
=item B<-t>, B<--payment-term>
Optional. Payment term, one of 1, 12, or 24 (months). Default: 1.
=back
=back
=head2 START
=over 8
Starts (boots) a Linode.
=over 8
=item B<-l>, B<--label>
A Linode to operate on.
=back
=back
=head2 STOP
=over 8
Stops (powers down) a Linode.
=over 8
=item B<-l>, B<--label>
A Linode to operate on.
=back
=back
=head2 RESTART
=over 8
Restart (reboots) a Linode.
=over 8
=item B<-l>, B<--label>
A Linode to operate on.
=back
=back
=head2 RENAME
=over 8
Change a Linode's label.
=over 8
=item B<-l>, B<--label>
A Linode to operate on.
=item B<--new-label>
New label to apply to this Linode.
=back
=back
=head2 GROUP
=over 8
Set a Linode's display group.
=over 8
=item B<-g>, B<--group>
Linode Manager display group to place this Linode under.
=item B<-l>, B<--label>
A Linode to operate on.
=back
=back
=head2 RESIZE
=over 8
Resize a Linode to a new plan size, and issue a boot job.
=over 8
=item B<-l>, B<--label>
A Linode to operate on.
=item B<-p>, B<--plan>
The Plan to resize to. Plans are linode1024, linode2048, linode4096, linode8192, linode16384, linode24576, linode32768, and linode40960.
=back
=back
=head2 DELETE
=over 8
Delete a Linode, its disk image(s), and configuration profile(s).
=over 8
=item B<-l>, B<--label>
A Linode to operate on.
=back
=back
=head2 LIST
=over 8
List information about one or more Linodes. Linodes are grouped by their display group.
=over 8
=item B<-l>, B<--label>
A Linode to list.
=back
=back
=head2 SHOW
=over 8
Display detailed information about a single Linode.
=over 8
=item B<-l>, B<--label>
Label of the Linode to show information about.
=back
=back
=head1 EXAMPLES
=head2 WORKING WITH MULTIPLE LINODES
=over 8
Actions can be performed on multiple Linodes using their labels. Using multiple --label arguments will accomplish the same thing.
$ linode start My-Linode-Label1 My-Linode-Label2
$ linode show --label My-Linode-Label1 --label My-Linode-Label2
=back
=head1 COPYRIGHT/LICENSE
Copyright 2013 Linode, LLC. Linode CLI is made available under the terms
of the Perl Artistic License, or GPLv2 at the recipients discretion.
=head2 Perl Artistic License
Read it at L<http://dev.perl.org/licenses/artistic.html>.
=head2 GNU General Public License (GPL) Version 2
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/
See the full license at L<http://www.gnu.org/licenses/>.
=cut