Getting Started with the Skytap Command Line Interface
The Skytap command-line interface, or CLI, lets you perform actions on Skytap resources from a command shell without having to write code to call the Skytap API. The Skytap CLI can also be used to quickly integrate Skytap into existing build, deploy, and test scripts supporting continuous integration with on-demand infrastructure. Most actions available from the Skytap web interface are available from the CLI.
The Skytap CLI is distributed and installed as a Ruby gem. You can either:
Create an environment from the Skytap CLI template in the Skytap Cloud public templates. The Skytap CLI Ruby gem is pre-installed on the VM in this template.
Before you begin
Make sure you have Ruby (version 1.9 or greater) and RubyGems installed on your local machine The computer that you are using to access Skytap Cloud. .
For instructions about installing Ruby for your specific operating system, see the Ruby downloads page. In most cases, RubyGems is installed as part of Ruby. If you need to install RubyGems separately, see the RubyGems download page.
After Ruby is installed, install the Skytap Ruby gem with the following command:
gem install skytap --no-rdoc --no-ri
Test your installation by typing the following:
To get started with the Skytap CLI
Type the following command:
Choose whether to store your user name and API token in a configuration file. If you do not store your credentials in the configuration file, you must supply your user name and API token with each command.
Choose whether you want to be interactively prompted for parameters. If you do not want interactive prompts, you must include the required parameters with each request.
skytap template index
To include your user name and API token with the command, type:
skytap template index --username=USERNAME --api-token=API-TOKEN
Supported commands, parameters, and global options
For a list of supported commands, parameters, and global options, see the Skytap Command Line Interface Reference.
Alternately, to see all the available commands and global options from the command line, type:
To see the help text for the a specific command, add
--help. For example, to see documentation for
skytap configuration index, enter:
skytap configuration index --help
If you are using the CLI from automated scripts, the following global options are recommended:
--no-askdisables interactive prompts.
--log-level=quietreturns only JSON output with additional messages.
Editing the Skytap CLI configuration file
You can edit the Skytap CLI Ruby gem configuration file
.skytaprc at any time. The file is usually located in your home directory (for example,