Commit 275ad28d authored by Stavros Sachtouris's avatar Stavros Sachtouris
Browse files

Merge branch 'feature-output' into develop

parents 766eb677 8fa6ef6a
......@@ -19,7 +19,6 @@
from sys import path, stderr
import os
path.append('/home/saxtouri/src/objpool')
try:
from objpool import http
http
......@@ -61,7 +60,7 @@ copyright = u'2012, GRNET'
# The short X.Y version.
version = '0.6'
# The full version, including alpha/beta/rc tags.
release = '0.6.1'
release = '0.6.2'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
......
......@@ -157,7 +157,7 @@ store commands
* append Append local file to (existing) remote object
* cat Print a file to console
* copy Copy an object
* create Create a container or a directory object
* create Create a container
* delete Delete a container [or an object]
* delgroup Delete a user group on an account
* delmeta Delete an existing metadatum of account [, container [or object]]
......@@ -182,6 +182,7 @@ store commands
* setquota Set new quota (in KB) for account [or container]
* setversioning Set new versioning (auto, none) for account [or container]
* sharers List the accounts that share objects with default account
* touch Create an empty file
* truncate Truncate remote file up to a size
* unpublish Unpublish an object
* upload Upload a file
......
......@@ -40,13 +40,13 @@ config_cmds = CommandTree('config', 'Configuration commands')
_commands = [config_cmds]
about_options = '\nAbout options:\
\n syntax: [group.]option\
\n example: store.account\
\n special case: <option> is equivalent to global.<option>\
\n configuration file syntax:\
\n [group]\
\n option=value\
\n (more options can be set per group)'
\n. syntax: [group.]option\
\n. example: store.account\
\n. special case: <option> is equivalent to global.<option>\
\n. configuration file syntax:\
\n. [group]\
\n. option=value\
\n. (more options can be set per group)'
@command(config_cmds)
......
......@@ -231,9 +231,9 @@ class PersonalityArgument(KeyValueArgument):
class server_create(_init_cyclades):
"""Create a server (aka Virtual Machine)
Parameters:
name: (single quoted text)
flavor id: Hardware flavor. Pick one from: /flavor list
image id: OS images. Pick one from: /image list
- name: (single quoted text)
- flavor id: Hardware flavor. Pick one from: /flavor list
- image id: OS images. Pick one from: /image list
"""
arguments = dict(
......@@ -391,9 +391,9 @@ class server_shutdown(_init_cyclades):
class server_console(_init_cyclades):
"""Get a VNC console to access an existing server (VM)
Console connection information provided (at least):
host: (url or address) a VNC host
port: (int) the gateway to enter VM on host
password: for VNC authorization
- host: (url or address) a VNC host
- port: (int) the gateway to enter VM on host
- password: for VNC authorization
"""
def main(self, server_id):
......@@ -418,9 +418,9 @@ class server_console(_init_cyclades):
class server_firewall(_init_cyclades):
"""Set the server (VM) firewall profile on VMs public network
Values for profile:
DISABLED: Shutdown firewall
ENABLED: Firewall in normal mode
PROTECTED: Firewall in secure mode
- DISABLED: Shutdown firewall
- ENABLED: Firewall in normal mode
- PROTECTED: Firewall in secure mode
"""
def main(self, server_id, profile):
......@@ -873,7 +873,7 @@ class network_connect(_init_cyclades):
class network_disconnect(_init_cyclades):
"""Disconnect a nic that connects a server to a network
Nic ids are listed as "attachments" in detailed network information
To get detailed network information: /network info <network id>
To get detailed network information: /network info <network id>
"""
def main(self, nic_id):
......
......@@ -80,17 +80,17 @@ class _init_history(_command_init):
class history_show(_init_history):
"""Show intersession command history
---
* With no parameters : pick all commands in history records
* With:
1. <order-id> : pick the <order-id>th command
2. <order-id-1>-<order-id-2> : pick all commands ordered in the range
[<order-id-1> - <order-id-2>]
- the above can be mixed and repeated freely, separated by spaces
e.g. pick 2 4-7 -3
- Use negative integers to count from the end of the list, e.g.:
-2 means : the command before the last one
-2-5 means : last 2 commands + the first 5
-5--2 means : the last 5 commands except the last 2
- With no parameters : pick all commands in history records
- With:
. 1. <order-id> : pick the <order-id>th command
. 2. <order-id-1>-<order-id-2> : pick all commands ordered in the range
. [<order-id-1> - <order-id-2>]
. - the above can be mixed and repeated freely, separated by spaces
. e.g. pick 2 4-7 -3
. - Use negative integers to count from the end of the list, e.g.:
. -2 means : the command before the last one
. -2-5 means : last 2 commands + the first 5
. -5--2 means : the last 5 commands except the last 2
"""
arguments = dict(
......@@ -133,14 +133,14 @@ class history_clean(_init_history):
class history_run(_init_history):
"""Run previously executed command(s)
Use with:
1. <order-id> : pick the <order-id>th command
2. <order-id-1>-<order-id-2> : pick all commands ordered in the range
[<order-id-1> - <order-id-2>]
- Use negative integers to count from the end of the list, e.g.:
-2 means : the command before the last one
-2-5 means : last 2 commands + the first 5
-5--2 mean
- to find order ids for commands try /history show.
. 1. <order-id> : pick the <order-id>th command
. 2. <order-id-1>-<order-id-2> : pick all commands ordered in the range
. [<order-id-1> - <order-id-2>]
. - Use negative integers to count from the end of the list, e.g.:
. -2 means : the command before the last one
. -2-5 means : last 2 commands + the first 5
. -5--2 mean
. - to find order ids for commands try /history show.
"""
_cmd_tree = None
......
......@@ -132,9 +132,9 @@ class image_public(_init_image):
class image_meta(_init_image):
"""Get image metadata
Image metadata include:
- image file information (location, size, etc.)
- image information (id, name, etc.)
- image os properties (os, fs, etc.)
- image file information (location, size, etc.)
- image information (id, name, etc.)
- image os properties (os, fs, etc.)
"""
def main(self, image_id):
......
This diff is collapsed.
......@@ -191,6 +191,27 @@ def print_list(l,
print('%s%s' % (prefix, item))
def page_hold(index, limit, maxlen):
"""Check if there are results to show, and hold the page when needed
:param index: (int) > 0
:param limit: (int) 0 < limit <= max, page hold if limit mod index == 0
:param maxlen: (int) Don't hold if index reaches maxlen
:returns: True if there are more to show, False if all results are shown
"""
if index >= limit and index % limit == 0:
if index >= maxlen:
return False
else:
print('(%s listed - %s more - "enter" to continue)' % (
index,
maxlen - index))
c = ' '
while c != '\n':
c = stdin.read(1)
return True
def print_items(items,
title=('id', 'name'),
with_enumeration=False,
......@@ -232,14 +253,7 @@ def print_items(items,
print_list(item, ident=1)
else:
print(' %s' % item)
if num_of_pages and len(items) > (i + 1) and 0 == (i + 1) % page_size:
num_of_pages -= 1
print('(%s listed - %s more - "enter" to continue)' % (
i + 1,
len(items) - (i + 1)))
c = ' '
while c != '\n':
c = stdin.read(1)
page_hold(i + 1, page_size, len(items))
def format_size(size):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment