The ViPRCommand project started as an idea to provided current ViPR/CoprHD users the ability to interact with the storage platform as any other “shell lover” person will do in their Linux/Unix systems.

The main concept surged as a way to generate a directory structure using the resources exposed in the REST API (e.g. the URL GET /hosts will be a directory /hosts) in which users will execute command (like in bash) to manipulate them (e.g. create new hosts, create volumes, etc…).

Command ‘ls’ lists the resources as directories
Command ‘ls’ lists the resources as directories

The shell commands are extracted using a wadl file provided by ViPR/CoprHD which provides all the available resources, their commands and their parameters then these are processed as dynamically generate directory structure.  It is because this dynamic generation of the model that ViPRCommand can be used against most versions of ViPR/CoprHD without having to constrict a specific version of this tool to a specific release.

Commands ‘cd’ and ‘ls’ open and list tenants in the /tenants directory.
Commands ‘cd’ and ‘ls’ open and list tenants in the /tenants directory.
Command ‘ll’ (similar to ‘ls –la’) to show detail information of the previous resources
Command ‘ll’ (similar to ‘ls –la’) to show detail information of the previous resources

ViPRCommand has many commonly expected shell commands available like:

  • ‘cd’ – changes the resource directory
  • ‘ls’ – lists the resources in the directory
  • ‘ll’ – lists the URN of the resources
  • ‘find’ – finds directory path

The most powerful commands are those that will allow creating, retrieve modifying or deleting resources like:

  • POST – creates a resource (e.g. POST -name kbvol -project name:kb -size 1GB -varray name:KB_test_varray -vpool name:KB_json_update)
  • GET – retrieve detailed information of the resource
  • PUT – updates resource fields

But there are many others commands, just type ‘help’ in the shell to view them or ‘help’ with a command to get more information about it.  The tool looks very promising and the team expect the community to help evolved it and mature as it is adopted.

The tool, written in Python, is available today.  It can be downloaded together with the source code and documentation from GitHub (https://github.com/emccode/ViPRCommand) under the MIT license for those shell developer that would like to contribute.