Revision 8741c407
b/docs/usage.rst | ||
---|---|---|
118 | 118 |
config : Configuration commands |
119 | 119 |
flavor : Compute/Cyclades API flavor commands |
120 | 120 |
history: Command history |
121 |
image : Compute/Cyclades or Plankton API image commands
|
|
121 |
image : Plankton Image API commands
|
|
122 | 122 |
network: Compute/Cyclades API network commands |
123 | 123 |
server : Compute/Cyclades API server commands |
124 | 124 |
store : Pithos+ storage commands |
b/kamaki/cli/command_shell.py | ||
---|---|---|
254 | 254 |
except IndexError: |
255 | 255 |
break |
256 | 256 |
print('Syntax: %s %s' % (' '.join(clist[upto:]), cls.syntax)) |
257 |
else:
|
|
257 |
if cmd.subcommands:
|
|
258 | 258 |
print_subcommands_help(cmd) |
259 | 259 |
|
260 | 260 |
self._register_method(help_method, 'help_%s' % cmd.name) |
b/kamaki/cli/command_tree.py | ||
---|---|---|
70 | 70 |
|
71 | 71 |
@property |
72 | 72 |
def is_command(self): |
73 |
return self.cmd_class is not None |
|
73 |
return self.cmd_class is not None and len(self.subcommands) == 0
|
|
74 | 74 |
|
75 | 75 |
@property |
76 | 76 |
def has_description(self): |
... | ... | |
153 | 153 |
self._all_commands[path] = new_cmd |
154 | 154 |
cmd.add_subcmd(new_cmd) |
155 | 155 |
cmd = new_cmd |
156 |
if cmd_class is not None:
|
|
156 |
if cmd_class: |
|
157 | 157 |
cmd.set_class(cmd_class) |
158 | 158 |
if description is not None: |
159 | 159 |
cmd.help = description |
b/kamaki/cli/commands/cyclades_cli.py | ||
---|---|---|
46 | 46 |
|
47 | 47 |
server_cmds = CommandTree('server', 'Compute/Cyclades API server commands') |
48 | 48 |
flavor_cmds = CommandTree('flavor', 'Compute/Cyclades API flavor commands') |
49 |
image_cmds = CommandTree('image', 'Cyclades/Plankton API image commands') |
|
50 | 49 |
network_cmds = CommandTree('network', 'Compute/Cyclades API network commands') |
51 |
_commands = [server_cmds, flavor_cmds, image_cmds, network_cmds]
|
|
50 |
_commands = [server_cmds, flavor_cmds, network_cmds] |
|
52 | 51 |
|
53 | 52 |
|
54 | 53 |
about_authentication = '\nUser Authentication:\ |
b/kamaki/cli/commands/image_cli.py | ||
---|---|---|
41 | 41 |
from kamaki.cli.commands import _command_init, errors |
42 | 42 |
|
43 | 43 |
|
44 |
image_cmds = CommandTree( |
|
45 |
'image', |
|
46 |
'Compute/Cyclades or Glance API image commands') |
|
44 |
image_cmds = CommandTree('image', 'Plankton Image API commands') |
|
47 | 45 |
_commands = [image_cmds] |
48 | 46 |
|
49 | 47 |
|
... | ... | |
174 | 172 |
if not location.startswith('pithos://'): |
175 | 173 |
account = self.config.get('store', 'account') \ |
176 | 174 |
or self.config.get('global', 'account') |
175 |
assert account, 'No user account provided' |
|
177 | 176 |
if account[-1] == '/': |
178 | 177 |
account = account[:-1] |
179 | 178 |
container = self.config.get('store', 'container') \ |
... | ... | |
282 | 281 |
|
283 | 282 |
|
284 | 283 |
@command(image_cmds) |
285 |
class image_list(_init_cyclades): |
|
284 |
class image_compute(_init_cyclades): |
|
285 |
"""Compute Image API commands""" |
|
286 |
|
|
287 |
|
|
288 |
@command(image_cmds) |
|
289 |
class image_compute_list(_init_cyclades): |
|
286 | 290 |
"""List images""" |
287 | 291 |
|
288 | 292 |
arguments = dict( |
... | ... | |
315 | 319 |
|
316 | 320 |
|
317 | 321 |
@command(image_cmds) |
318 |
class image_info(_init_cyclades): |
|
322 |
class image_compute_info(_init_cyclades):
|
|
319 | 323 |
"""Get detailed information on an image""" |
320 | 324 |
|
321 | 325 |
@errors.generic.all |
... | ... | |
333 | 337 |
|
334 | 338 |
|
335 | 339 |
@command(image_cmds) |
336 |
class image_delete(_init_cyclades): |
|
340 |
class image_compute_delete(_init_cyclades):
|
|
337 | 341 |
"""Delete an image (WARNING: image file is also removed)""" |
338 | 342 |
|
339 | 343 |
@errors.generic.all |
... | ... | |
348 | 352 |
|
349 | 353 |
|
350 | 354 |
@command(image_cmds) |
351 |
class image_properties(_init_cyclades): |
|
355 |
class image_compute_properties(_init_cyclades):
|
|
352 | 356 |
"""Get properties related to OS installation in an image""" |
353 | 357 |
|
354 | 358 |
@errors.generic.all |
... | ... | |
382 | 386 |
|
383 | 387 |
|
384 | 388 |
@command(image_cmds) |
385 |
class image_setproperty(_init_cyclades): |
|
389 |
class image_compute_setproperty(_init_cyclades):
|
|
386 | 390 |
"""Update an existing property in an image""" |
387 | 391 |
|
388 | 392 |
@errors.generic.all |
... | ... | |
400 | 404 |
|
401 | 405 |
|
402 | 406 |
@command(image_cmds) |
403 |
class image_delproperty(_init_cyclades): |
|
407 |
class image_compute_delproperty(_init_cyclades):
|
|
404 | 408 |
"""Delete a property of an image""" |
405 | 409 |
|
406 | 410 |
@errors.generic.all |
b/kamaki/cli/commands/pithos_cli.py | ||
---|---|---|
1021 | 1021 |
poolsize=IntArgument('set pool size', '--with-pool-size'), |
1022 | 1022 |
progress_bar=ProgressBarArgument( |
1023 | 1023 |
'do not show progress bar', |
1024 |
('N', '--no-progress-bar'), |
|
1024 |
('-N', '--no-progress-bar'),
|
|
1025 | 1025 |
default=False), |
1026 | 1026 |
overwrite=FlagArgument('Force (over)write', ('-f', '--force')) |
1027 | 1027 |
) |
b/kamaki/clients/image/__init__.py | ||
---|---|---|
41 | 41 |
def __init__(self, base_url, token): |
42 | 42 |
super(ImageClient, self).__init__(base_url, token) |
43 | 43 |
|
44 |
def test(self): |
|
45 |
""" |
|
46 |
:param image_id: (str) |
|
47 |
|
|
48 |
:param member: (str) user to allow access to current user's images |
|
49 |
""" |
|
50 |
path = path4url('images') |
|
51 |
data = dict(stuff='stuff') |
|
52 |
r = self.put(path, json=data, async_headers={'x-image-meta-name': 'lalakis'}) |
|
53 |
r.release() |
|
54 |
|
|
44 | 55 |
def list_public(self, detail=False, filters={}, order=''): |
45 | 56 |
""" |
46 | 57 |
:param detail: (bool) |
Also available in: Unified diff