cli

command
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2017 License: Apache-2.0 Imports: 34 Imported by: 0

README

InfraKit CLI

This is a developer CLI for working with various InfraKit plugins. The CLI offers several subcommands for working with plugins. In general, plugin methods are exposed as verbs and configuration JSON can be read from local file.

Building

Begin by building plugin binaries.

List Plugins
$ build/infrakit plugin ls
Plugins:
NAME                	LISTEN
flavor-swarm        	~/.infrakit/plugins/flavor-swarm
flavor-zookeeper    	~/.infrakit/plugins/flavor-zookeeper
group               	~/.infrakit/plugins/group
instance-file       	~/.infrakit/plugins/instance-file

Once you know the plugins by name, you can make calls to them. For example, the instance plugin instance-file is a Plugin that "provisions" instances by writing the instructions to a file in a local directory.

You can access the following plugins and their methods via command line:

  • instance
  • group
  • flavor
Working with Instance Plugin

Using the plugin instance-file as an example:

Validate

Save the folliwing in a file named instance.json,

{
    "Properties": {
        "version": "v0.0.1"
    },
    "Tags": {
        "instanceType": "small",
        "group": "test2"
    },
    "Init": "#!/bin/sh\napt-get install -y wget",
    "LogicalID": "logic2"
}

and send a request for an instance plugin to validate it:

$ build/infrakit instance --name instance-file instance.json
validate:ok
Provision
$ build/infrakit instance --name instance-file provision instance.json
instance-1474873473
List instances
$ build/infrakit instance --name instance-file describe
ID                            	LOGICAL                       	TAGS
instance-1474850397           	  -                           	group=test,instanceType=small
instance-1474850412           	  -                           	group=test2,instanceType=small
instance-1474851747           	logic2                        	group=test2,instanceType=small
instance-1474873473           	logic2                        	group=test2,instanceType=small
Destroy
$ build/infrakit instance --name instance-file destroy instance-1474873473
destroyed instance-1474873473

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL