Uploaded image for project: 'openATTIC'
  1. openATTIC
  2. OP-649

Create a command line utility that allows managing oA on the shell

    XMLWordPrintable

    Details

    • Epic Name:
      oA Command Line Interface
    • Epic Status:
      Done

      Description

      Create an openattic CLI that allows performing storage management tasks without using the WebUI or API directly.

      This tool replaces the oacli tool, which was based on the XML-RPC API (which both have been removed in the meanwhile, see OP-1249 and OP-1248 for details.

      The CLI should provide a feature set similar to the Web UI, by providing an abstracted interface. There should be one binary that accepts subcommands, e.g. oacmd disk list or oacmd volume create. Options common to multiple subcommands should always accept the same parameters.

      The CLI should be modular and extensible - new subcommands should be easy to add as additional modules.

      The article Building Simple Command Line Interfaces in Python provides a great introduction on how to structure a CLI application.

      The API authentication should be possible via both username/password or an API auth token. These should be provided via command line options or via settings in a configuration file e.g. ~/.config/oacmd/oacmd.conf. This file should be created during the first usage of the tool, e.g. by calling oacmd login <url>, which will prompt for the URL, username and password. The API URL and credentials should be stored in the configuration file, but it should also be possible to provide an alternative URL or credentials via the command line to override the configuation file defaults.

      Some useful Python modules that should be utilized for implementing this tool:

      • blessed - a thin, practical wrapper around terminal styling, screen positioning, and keyboard input.
      • configobj - for reading and writing config files
      • docopt - to generate the option parser
      • durga - to access the REST API
      • python-prompt-toolkit - a library for building powerful interactive command lines in Python
      • tabulate - to pretty print list output in tabular form
      • tqdm - to display a progress bar for long-running queries/actions

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              lgrimmer Grimmer, Lenz
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: