Updated to jclouds-karaf 1.5.0-beta.11
1 file changed
tree: 9ae84f998ae646aa1b87ab11d9b8df9ccfdb8db2
  1. assembly/
  2. branding/
  3. runner/
  4. .gitignore
  5. LICENSE.txt
  6. pom.xml
  7. README.md
README.md

jclouds-cli

Jclouds CLI provides two types of command line interface:

  • An interactive shell.
  • A shell script.

Installation

To install the jclouds cli you just need to download the zip or the tarball and extract it to the folder of your choice.

Using the CLI

You can use the jclouds cli to perform misc operations, such as creating a node, run scripts on a node, list nodes, destroy a node etc. The cli also supports blobstore, so you can create, delete or access a blobstore.

To use the cli: ./bin/jclouds [category] [action] [options] [arguments].

  • Categories: node, group, image, location, hardware.
  • Actions: list, create, destroy, runscript.
  • Options: --provider --api, --identity, --credential --endpoint etc.

Some examples: To create 10 nodes on EC2 under group: myGroupName using Ubuntu 10.04

To list all nodes:

To destroy a node:

APIs work in the same manner as providers, but you will also need to specify the endpoint.

Using the interactive shell

To start the interactive shell: ./bin/jclouds-cli

The are two ways of configuring a provider or api, when using the interactive mode:

  • As command options
  • As a Service

All commands support the following options that you can use: --provider (use this for apis too), --identity, --credential --endpoint.

For example, in a fresh installation you can simple:

If you want to avoid passing the same options all the time, you can configure the provider or the api once and reuse it. To configure the provider or the api:

For compute providers & apis:

For blobstore providers or apis:

To list the available compute or blobstore services:

You can also remove one of the services:

Installing additional providers and api The interactive version of the cli will have out of the box installed support for the mainstream providers and apis. To enable the any other provider or api, you will need to enable it. This is done using the features commands.

List the available jclouds modules:

To install an additional api (say cloudstack)

Leveraging environmental variables

Both in the interactive shell and cli modes, you may find repeating the provider information again and again not really friendly. You can completely skip those options by sepcifying them as environmental variables.

Supported variables:

  • JCLOUDS_COMPUTE_PROVIDER

  • JCLOUDS_COMPUTE_API

  • JCLOUDS_COMPUTE_ENDPOINT

  • JCLOUDS_COMPUTE_IDENTITY

  • JCLOUDS_COMPUTE_CREDENTIAL

  • JCLOUDS_BLOBSTORE_PROVIDER

  • JCLOUDS_BLOBSTORE_API

  • JCLOUDS_BLOBSTORE_ENDPOINT

  • JCLOUDS_BLOBSTORE_IDENTITY

  • JCLOUDS_BLOBSTORE_CREDENTIAL