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.
Begin by building plugin binaries.
$ 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
Using the plugin instance-file
as an example:
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
$ build/infrakit instance --name instance-file provision instance.json
instance-1474873473
$ 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
$ build/infrakit instance --name instance-file destroy instance-1474873473
destroyed instance-1474873473