root / docs / commands.rst @ 8be50626
History | View | Annotate | Download (14.7 kB)
1 |
List of commands |
---|---|
2 |
================ |
3 |
|
4 |
The commands described bellow are grouped by service. The examples showcase a |
5 |
sample set of group commands. The kamaki interactive shell (check |
6 |
`Usage section <usage.html#interactive-shell>`_ for details) is chosen as the |
7 |
execution environment. |
8 |
|
9 |
|
10 |
user (Identity Manager) |
11 |
----------------------- |
12 |
|
13 |
.. code-block:: text |
14 |
|
15 |
authenticate: Authenticate a user |
16 |
|
17 |
Showcase: get user information |
18 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
19 |
|
20 |
In the following, the token has been set in a previous step (see |
21 |
`setup section <setup.html>`_ or the |
22 |
`quick setup guide <usage.html#quick-setup>`_) |
23 |
|
24 |
.. code-block:: console |
25 |
:emphasize-lines: 1,4 |
26 |
|
27 |
* Enter user context * |
28 |
[kamaki]: user |
29 |
|
30 |
* Authenticate user * |
31 |
[user]: authenticate |
32 |
... |
33 |
user: |
34 |
name: My Real Name |
35 |
uuid: ab1cde23-45fg-6h7i-8j9k-10l1m11no2pq |
36 |
|
37 |
.. note:: actual call returns a full list of service endpoints accessible to |
38 |
the user with a specific token |
39 |
|
40 |
flavor (Compute/Cyclades) |
41 |
------------------------- |
42 |
|
43 |
.. code-block:: text |
44 |
|
45 |
info: Get flavor details |
46 |
list: List flavors |
47 |
|
48 |
Showcase: show details for flavor with id 43 |
49 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
50 |
|
51 |
.. code-block:: console |
52 |
:emphasize-lines: 1,4 |
53 |
|
54 |
* Enter flavor context * |
55 |
[kamaki]: flavor |
56 |
|
57 |
* Get details about flavor with id 43 * |
58 |
[flavor]: info 43 |
59 |
SNF:disk_template: drbd |
60 |
cpu : 4 |
61 |
disk: 10 |
62 |
id : 43 |
63 |
name: C4R2048D10 |
64 |
ram : 2048 |
65 |
|
66 |
image (Plankton commands + Compute Image subcommands) |
67 |
----------------------------------------------------- |
68 |
|
69 |
.. code-block:: text |
70 |
|
71 |
list : List images accessible by user |
72 |
meta : Get image metadata |
73 |
register : (Re)Register an image |
74 |
unregister: Unregister an image (does not delete the image file) |
75 |
shared : List shared images |
76 |
compute : Compute Image API commands |
77 |
list : List images |
78 |
delete : Delete image |
79 |
info : Get image details |
80 |
properties: Manage properties related to OS installation in an image |
81 |
add : Add a property to an image |
82 |
delete: Delete a property from an image |
83 |
get : Get an image property |
84 |
list : List all image properties |
85 |
set : Add / update a set of properties for an image |
86 |
members : Manage members (users who can modify an image) |
87 |
add : Add a member to an image |
88 |
delete: Remove a member from an image |
89 |
list : List members of an image |
90 |
set : Set the members of an image |
91 |
|
92 |
Showcase: Pick an image and list the properties |
93 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
94 |
|
95 |
.. code-block:: console |
96 |
:emphasize-lines: 1,4,18 |
97 |
|
98 |
* Enter image context * |
99 |
[kamaki]: image |
100 |
|
101 |
* list all available images * |
102 |
[image]: list |
103 |
926ab1c5-2d85-49d4-aebe-0fce712789b9 Windows Server 2008 |
104 |
container_format: bare |
105 |
disk_format : diskdump |
106 |
id : 926ab1c5-2d85-49d4-aebe-0fce712789b9 |
107 |
size : 11917066240 |
108 |
status : available |
109 |
78262ee7-949e-4d70-af3a-85360c3de57a Windows Server 2012 |
110 |
container_format: bare |
111 |
disk_format : diskdump |
112 |
id : 78262ee7-949e-4d70-af3a-85360c3de57a |
113 |
size : 11697913856 |
114 |
status : available |
115 |
5ed5a29b-292c-4fe0-b32c-2e2b65628635 ubuntu |
116 |
container_format: bare |
117 |
disk_format : diskdump |
118 |
id : 5ed5a29b-292c-4fe0-b32c-2e2b65628635 |
119 |
size : 2578100224 |
120 |
status : available |
121 |
1f8454f0-8e3e-4b6c-ab8e-5236b728dffe Debian_Wheezy_Base |
122 |
container_format: bare |
123 |
disk_format : diskdump |
124 |
id : 1f8454f0-8e3e-4b6c-ab8e-5236b728dffe |
125 |
size : 795107328 |
126 |
status : available |
127 |
|
128 |
* Get properties of image with id 1f8454f0-8e3e-4b6c-ab8e-5236b728dffe * |
129 |
[image]: compute properties 1f8454f0-8e3e-4b6c-ab8e-5236b728dffe |
130 |
description : Debian 6.0.6 (Squeeze) Base System |
131 |
gui : No GUI |
132 |
kernel : 2.6.32 |
133 |
os : debian |
134 |
osfamily : linux |
135 |
root_partition: 1 |
136 |
sortorder : 1 |
137 |
users : root |
138 |
|
139 |
server (Compute/Cyclades) |
140 |
------------------------- |
141 |
|
142 |
.. code-block:: text |
143 |
|
144 |
addr : List a server's nic address |
145 |
console : Get a VNC console |
146 |
create : Create a server |
147 |
delete : Delete a server |
148 |
firewall: Manage server's firewall profile |
149 |
set : Set the server's firewall profile |
150 |
get : Get the server's firewall profile |
151 |
ip : Manage floating IPs for the servers |
152 |
attach: Attach a floating ip to a server with server_id |
153 |
info : A floating IPs' details |
154 |
detach: Detach floating ip from server |
155 |
list : List all floating ips |
156 |
create: Create a new floating IP |
157 |
delete: Delete a floating ip |
158 |
pools : List all floating pools of floating ips |
159 |
info : Get server details |
160 |
list : List servers |
161 |
metadata: Manage Server Metadata |
162 |
list : List server metadata |
163 |
set : Add / update server metadata |
164 |
delete: Delete a piece of server metadata |
165 |
meta : Get a server's metadata |
166 |
reboot : Reboot a server |
167 |
rename : Update a server's name |
168 |
shutdown: Shutdown a server |
169 |
start : Start a server |
170 |
stats : Get server statistics |
171 |
resize : Set a different flavor for an existing server |
172 |
wait : Wait for server to finish |
173 |
|
174 |
Showcase: Create a server |
175 |
^^^^^^^^^^^^^^^^^^^^^^^^^ |
176 |
|
177 |
.. code-block:: console |
178 |
:emphasize-lines: 1,4,21,35,44,62 |
179 |
|
180 |
* Enter server context * |
181 |
[kamaki]: server |
182 |
|
183 |
* See server-create help * |
184 |
[server]: create -h |
185 |
usage: create <name> <flavor id> <image id> |
186 |
[--personality PERSONALITY] [-h] [--config CONFIG] [--cloud CLOUD] |
187 |
|
188 |
Create a server |
189 |
|
190 |
optional arguments: |
191 |
-v, --verbose More info at response |
192 |
--personality PERSONALITY |
193 |
add a personality file |
194 |
-d, --debug Include debug output |
195 |
-h, --help Show help message |
196 |
-i, --include Include protocol headers in the output |
197 |
--config CONFIG Path to configuration file |
198 |
-s, --silent Do not output anything |
199 |
--cloud CLOUD Chose a cloud to connect to |
200 |
|
201 |
* List all available images * |
202 |
[server]: /image compute list |
203 |
1395fdfb-51b4-419f-bb02-f7d632860611 Ubuntu Desktop LTS |
204 |
1580deb4-edb3-4496-a27f-7a246c4c0528 Ubuntu Desktop |
205 |
18a82962-43eb-4b32-8e28-8f8880af89d7 Kubuntu LTS |
206 |
6aa6eafd-dccb-422d-a904-67fe2bdde87e Debian Desktop |
207 |
6b5681e4-7502-46ae-b1e9-9fd837932095 maelstrom |
208 |
78262ee7-949e-4d70-af3a-85360c3de57a Windows Server 2012 |
209 |
86bc2414-0fb3-4898-a637-240292243302 Fedora |
210 |
926ab1c5-2d85-49d4-aebe-0fce712789b9 Windows Server 2008 |
211 |
b2dffe52-64a4-48c3-8a4c-8214cc3165cf Debian Base |
212 |
baf2321c-57a0-4a69-825d-49f49cea163a CentOS |
213 |
c1d27b46-d875-4f5c-b7f1-f39b5af62905 Kubuntu |
214 |
|
215 |
* See details of flavor with id 1 * |
216 |
[server]: /flavor info 1 |
217 |
SNF:disk_template: drbd |
218 |
cpu : 1 |
219 |
disk : 20 |
220 |
id : 1 |
221 |
name : C1R1024D20 |
222 |
ram : 1024 |
223 |
|
224 |
* Create a debian server named 'My Small Debian Server' |
225 |
[server]: create 'My Small Debian Server' 1 b2dffe52-64a4-48c3-8a4c-8214cc3165cf |
226 |
adminPass: L8gu2wbZ94 |
227 |
created : 2012-11-23T16:56:04.190813+00:00 |
228 |
flavorRef: 1 |
229 |
hostId : |
230 |
id : 11687 |
231 |
imageRef : b2dffe52-64a4-48c3-8a4c-8214cc3165cf |
232 |
metadata : |
233 |
os : debian |
234 |
users: root |
235 |
name : My Small Debian Server |
236 |
progress : 0 |
237 |
status : BUILD |
238 |
suspended: False |
239 |
updated : 2012-11-23T16:56:04.761962+00:00 |
240 |
|
241 |
* wait for server to build (optional) * |
242 |
[server]: wait 11687 |
243 |
Server 11687 still in BUILD mode ||||||||||||||||| | 80% |
244 |
Server 11687 is now in ACTIVE mode |
245 |
|
246 |
.. Note:: In kamaki shell, / is used to access top-level command groups while working in command group contexts |
247 |
|
248 |
network (Compute/Cyclades) |
249 |
-------------------------- |
250 |
|
251 |
.. code-block:: text |
252 |
|
253 |
connect : Connect a server to a network |
254 |
create : Create a network |
255 |
delete : Delete a network |
256 |
disconnect: Disconnect a nic of a server to a network |
257 |
info : Get network details |
258 |
list : List networks |
259 |
rename : Update network name |
260 |
|
261 |
Showcase: Connect a network to a VM |
262 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
263 |
|
264 |
.. code-block:: console |
265 |
:emphasize-lines: 1,4,9,24,27,44 |
266 |
|
267 |
* Enter network context * |
268 |
[kamaki]: network |
269 |
|
270 |
* List user-owned VMs * |
271 |
[network]: /server list |
272 |
11687 (My Small Debian Server) |
273 |
11688 (An Ubuntu server) |
274 |
|
275 |
* Try network-connect (to get help) * |
276 |
[network]: connect |
277 |
Syntax error |
278 |
usage: connect <server id> <network id> [-s] [-h] [-i] [--config CONFIG] |
279 |
|
280 |
Connect a server to a network |
281 |
|
282 |
Syntax: connect <server id> <network id> |
283 |
--config : Path to configuration file |
284 |
-d,--debug : Include debug output |
285 |
-h,--help : Show help message |
286 |
-i,--include: Include protocol headers in the output |
287 |
-s,--silent : Do not output anything |
288 |
-v,--verbose: More info at response |
289 |
|
290 |
* Connect VM with id 11687 to network with id 1409 |
291 |
[network]: connect 11687 1409 |
292 |
|
293 |
* Get details on network with id 1409 |
294 |
[network]: info 1409 |
295 |
attachments: |
296 |
nic-11687-1 |
297 |
cidr : 192.168.1.0/24 |
298 |
cidr6 : None |
299 |
created : 2012-11-23T17:17:20.560098+00:00 |
300 |
dhcp : True |
301 |
gateway : None |
302 |
gateway6: None |
303 |
id : 1409 |
304 |
name : my network |
305 |
public : False |
306 |
status : ACTIVE |
307 |
type : MAC_FILTERED |
308 |
updated : 2012-11-23T17:18:25.095225+00:00 |
309 |
|
310 |
* Get connectivity details on VM with id 11687 * |
311 |
[network]: /server addr 11687 |
312 |
id: nic-11687-1 |
313 |
ipv4 : 192.168.1.1 |
314 |
ipv6 : None |
315 |
mac_address: aa:0f:c2:0b:0e:85 |
316 |
network_id : 1409 |
317 |
firewallProfile: DISABLED |
318 |
id: nic-11687-0 |
319 |
ipv4 : 83.212.106.111 |
320 |
ipv6 : 2001:648:2ffc:1116:a80c:f2ff:fe12:a9e |
321 |
mac_address : aa:0c:f2:12:0a:9e |
322 |
network_id : 1369 |
323 |
|
324 |
.. Note:: In kamaki shell, / is used to access top-level command groups while working in command group contexts |
325 |
|
326 |
file (Storage/Pithos+) |
327 |
---------------------- |
328 |
|
329 |
.. code-block:: text |
330 |
|
331 |
append : Append local file to remote |
332 |
cat : Print a file to console |
333 |
copy : Copy an object |
334 |
containerlimit: Container size limit commands |
335 |
set : Set container data limit |
336 |
get : Get container data limit |
337 |
create : Create a container |
338 |
delete : Delete a container [or an object] |
339 |
download : Download a file or directory |
340 |
group : Manage access groups and group members |
341 |
delete: Delete a user group |
342 |
list : List groups and group members |
343 |
set : Set a user group |
344 |
hashmap : Get the hashmap of an object |
345 |
info : Get information for account [, container [or object]] |
346 |
list : List containers, object trees or objects in a directory |
347 |
manifest : Create a remote file with uploaded parts by manifestation |
348 |
metadata : Metadata are attached on objects (key:value pairs) |
349 |
delete: Delete metadata with given key |
350 |
get : Get metadatum |
351 |
set : Set a piece of metadata |
352 |
mkdir : Create a directory |
353 |
move : Copy an object |
354 |
overwrite : Overwrite part (from start to end) of a remote file |
355 |
permissions : Manage user and group accessibility for objects |
356 |
delete: Delete all permissions set on object |
357 |
get : Get read and write permissions of an object |
358 |
set : Set permissions for an object |
359 |
publish : Publish an object |
360 |
purge : Purge a container |
361 |
quota : Get quota for account |
362 |
sharers : List the accounts that share objects with default account |
363 |
touch : Create an empty object (file) |
364 |
truncate : Truncate remote file up to a size |
365 |
unpublish : Unpublish an object |
366 |
upload : Upload a file or directory |
367 |
versioning : Manage the versioning scheme of current pithos user account |
368 |
get: Get versioning for account or container |
369 |
set: Set versioning mode (auto, none) for account or container |
370 |
versions : Get the version list of an object |
371 |
|
372 |
Showcase: Upload and download a file |
373 |
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
374 |
|
375 |
.. code-block:: console |
376 |
:emphasize-lines: 1,7,11,16,21,29,33,37,41,44,51,55,60,64 |
377 |
|
378 |
* Create a random binarry file at current OS path * |
379 |
[kamaki]: !dd bs=4M if=/dev/zero of=rndm_local.file count=5 |
380 |
5+0 records in |
381 |
5+0 records out |
382 |
20971520 bytes (21 MB) copied, 0.016162 s, 1.3 GB/s |
383 |
|
384 |
* Enter file context * |
385 |
[kamaki]: file |
386 |
|
387 |
|
388 |
* Check local file * |
389 |
[file]: !ls -lh rndm_local.file |
390 |
-rw-rw-r-- 1 ******** ******** 20M Nov 26 15:36 rndm_local.file |
391 |
|
392 |
|
393 |
* Create two containers * |
394 |
[file]: create mycont1 |
395 |
[file]: create mycont2 |
396 |
|
397 |
|
398 |
* List accessible containers * |
399 |
[file]: list |
400 |
1. mycont1 (0B, 0 objects) |
401 |
2. mycont2 (0B, 0 objects) |
402 |
3. pithos (0B, 0 objects) |
403 |
4. trash (0B, 0 objects) |
404 |
|
405 |
|
406 |
* Upload local file to 1st container * |
407 |
[file]: upload rndm_local.file mycont1 |
408 |
|
409 |
|
410 |
* Check if file has been uploaded * |
411 |
[file]: list mycont1 |
412 |
1. 20M rndm_local.file |
413 |
|
414 |
* Create directory mydir on second container * |
415 |
[file]: mkdir mycont2:mydir |
416 |
|
417 |
|
418 |
* Move file from 1st to 2nd container (and in the directory) * |
419 |
[file]: move mycont1:rndm_local.file mycont2:mydir/rndm_local.file |
420 |
|
421 |
* Check contents of both containers * |
422 |
[file]: list mycont1 |
423 |
[file]: list mycont2 |
424 |
1. D mydir/ |
425 |
2. 20M mydir/rndm_local.file |
426 |
|
427 |
|
428 |
* Copy file from 2nd to 1st container, with a new name * |
429 |
[file]: copy mycont2:mydir/rndm_local.file mycont1:rndm_remote.file |
430 |
|
431 |
|
432 |
* Check pasted file * |
433 |
[file]: list mycont1 |
434 |
1. 20M rndm_remote.file |
435 |
|
436 |
|
437 |
* Download pasted file to local file system * |
438 |
[file]: download mycont1:rndm_remote.file rndm_remote.file |
439 |
|
440 |
|
441 |
* Check if file is downloaded and if it is the same to original * |
442 |
[file]: !ls -lh *.file |
443 |
-rw-rw-r-- 1 ******** ******** 20M Nov 26 15:36 rndm_local.file |
444 |
-rw-rw-r-- 1 ******** ******** 20M Nov 26 15:42 rndm_remote.file |
445 |
[file]: !diff rndm_local.file rndm_remote.file |
446 |
|
447 |
.. Note:: In kamaki shell, ! is used to execute OS shell commands (e.g. bash) |
448 |
|
449 |
.. warning:: The container:object/path syntax does not function if the |
450 |
container and / or the object path contain one or more : characters. To use |
451 |
containers and objects with : use the --container and --dst-container |
452 |
arguments, e.g. to copy test.py object from grnet:dev container to |
453 |
grnet:deploy :: |
454 |
|
455 |
$ kamaki file copy --container=grnet:dev test.py --dst-container=grnet:deploy |