Return-Path: X-Original-To: apmail-libcloud-commits-archive@www.apache.org Delivered-To: apmail-libcloud-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5E49A10D2B for ; Tue, 19 Nov 2013 04:14:11 +0000 (UTC) Received: (qmail 95640 invoked by uid 500); 19 Nov 2013 04:13:38 -0000 Delivered-To: apmail-libcloud-commits-archive@libcloud.apache.org Received: (qmail 95392 invoked by uid 500); 19 Nov 2013 04:13:28 -0000 Mailing-List: contact commits-help@libcloud.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@libcloud.apache.org Delivered-To: mailing list commits@libcloud.apache.org Received: (qmail 95284 invoked by uid 99); 19 Nov 2013 04:13:24 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Nov 2013 04:13:24 +0000 Date: Tue, 19 Nov 2013 04:13:24 +0000 (UTC) From: "Mahendra M (JIRA)" To: commits@libcloud.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (LIBCLOUD-272) Implement CLI tools for libcloud MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LIBCLOUD-272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13826172#comment-13826172 ] Mahendra M commented on LIBCLOUD-272: ------------------------------------- I agree with ~briancurtin One of the main issues in keeping it outside as a separate package is that it will tend to drift away from the main project (specially if the maintainers are held up). By keeping it inside libcloud, I am sure the cli tools and libraries will be in sync. Does boto maintain it outside? > Implement CLI tools for libcloud > -------------------------------- > > Key: LIBCLOUD-272 > URL: https://issues.apache.org/jira/browse/LIBCLOUD-272 > Project: Libcloud > Issue Type: New Feature > Components: Core, Storage > Reporter: Mahendra M > > This ticket is for implementing a CLI framework for libcloud. Libcloud does a good job of abstracting cloud operations. If this functionality can be made available via command line tools, it will be an added advantage for libcloud usage. Some other cloud libraries provide such functionality (Like Boto). > Design goals are to provide > * Command line tools for all of libcloud's functionality > * Command line options to control auth information > * Ability to use config files (/etc/libcloud.conf, ~/.libcloud.conf) etc. These options can be over-written via command line arguments > * Support for logging (controlled via config files). > * Provide different commands for each functionality > * cloud_compute > * cloud_dns > * cloud_storage > * cloud_lb (load balancing) > * A hierarchical command structure within each command > $ cloud_storage providers - list storage providers > $ cloud_storage container // > $ cloud_storage object ///... > * Provide simpler to remember aliases for sub-commands > $ cloud_storage container list/ls > Implementation > * For providing most of the functionality mentioned in design goals, the python cement library was used. (http://builtoncement.com/). This provides an excellent framework for solving our design goals. > It is tested for Python 2.6, 2.7, 3.1, and 3.2. However, I am not sure of it's support for Python 2.5. > * As of now only the cloud_storage command is implemented. > Config file structure > [base] > storage_provider=s3_us_west > username=******* > access_key=******** > [log] > level=NONE > file=/tmp/cli1.log > to_console=False > rotate=False > max_bytes=512000 > max_file=5 > cloud_storage command > $ cloud_storage providers - Lists the available storage providers > Container operations > $ cloud_storage container - Lists available containers > $ cloud_storage container create > $ cloud_storage container delete -r -f -v > By default container is not deleted if it is not empty > If -r is provided, all objects are recursively deleted after being prompted for each object > If -f is provided, all objects are recursively deleted without user prompt > If -rfv is mentioned, each deleted object is mentioned in the output > Object operations > List objects in a container > $ cloud_storage object -v > List all objects in the container > If -v is mentioned, object size is also listed out > Delete an object > $ cloud_storage object -f > Deletes the object in the container after prompting user for confirmation > If -f is specified, user is not prompted > Upload an object from a local file or Unix pipe > $ cloud_storage object > $ cat /path/to/file | cloud_storage object put > $ cat /path/to/file | cloud_storage object put - > Download an object ot a local file or unix pipe > $ cloud_storage object > $ cloud_storage object get > /path/to/file > $ cloud_storage object get - > /path/to/file > Other changes > ------------- > * Minor bug fix in S3 > * setup.py was modified to install the cloud_storage command -- This message was sent by Atlassian JIRA (v6.1#6144)