3
3
Much of the behavior in _ InfraKit_ is defined by Plugins. Technically, a Plugin is an HTTP server with a well-defined
4
4
API, listening on a unix socket.
5
5
6
- [ Utilities] ( pkg/rpc ) are available as libraries to simplify Plugin development in Go.
7
-
8
6
## Plugin Discovery
9
7
10
8
Multiple _ InfraKit_ plugins are typically used together to support a declared configuration. These plugins discover
@@ -82,14 +80,14 @@ Over time, we would prefer to phase out reference Plugins that appear to provide
82
80
are developed independently. For this reason, please [ file an issue] ( https://github.com/docker/infrakit/issues/new )
83
81
to start a discussion before contributing to these plugins with non-trivial code.
84
82
85
- | plugin | type | description |
86
- | :---------------------------------------------------| :---------| :----------------------------------------|
87
- | [ swarm] ( pkg/example/flavor/swarm ) | flavor | runs Docker in Swarm mode |
88
- | [ vanilla] ( pkg/example/flavor/vanilla ) | flavor | manual specification of instance fields |
89
- | [ zookeeper] ( pkg/example/flavor/zookeeper ) | flavor | run an Apache ZooKeeper ensemble |
90
- | [ infrakit/file] ( pkg/example/instance/file ) | instance | useful for development and testing |
91
- | [ infrakit/terraform] ( pkg/example/instance/terraform ) | instance | creates instances using Terraform |
92
- | [ infrakit/vagrant] ( pkg/example/instance/vagrant ) | instance | creates Vagrant VMs |
83
+ | plugin | type | description |
84
+ | :----------------------------------------------------- | :---------| :----------------------------------------|
85
+ | [ swarm] ( pkg/example/flavor/swarm ) | flavor | runs Docker in Swarm mode |
86
+ | [ vanilla] ( pkg/example/flavor/vanilla ) | flavor | manual specification of instance fields |
87
+ | [ zookeeper] ( pkg/example/flavor/zookeeper ) | flavor | run an Apache ZooKeeper ensemble |
88
+ | [ infrakit/file] ( pkg/example/instance/file ) | instance | useful for development and testing |
89
+ | [ infrakit/terraform] ( pkg/example/instance/terraform ) | instance | creates instances using Terraform |
90
+ | [ infrakit/vagrant] ( pkg/example/instance/vagrant ) | instance | creates Vagrant VMs |
93
91
94
92
95
93
### Supported implementations
@@ -103,14 +101,20 @@ project, so please double-check where the code lives before filing InfraKit issu
103
101
104
102
Have a Plugin you'd like to share? Submit a Pull Request to add yourself to the list!
105
103
106
- ### APIs
104
+ ### Creating a plugin
105
+ A plugin must be an HTTP server that implements one of the plugin [ APIs] ( #apis ) , lisetning on a Unix socket. While
106
+ a plugin can be written in any programming language, [ utilities] ( pkg/rpc ) are available as libraries to simplify Plugin
107
+ development in Go. Our [ reference implementations] ( #reference-implementations ) should provide a good starting point
108
+ for building a new plugin using these utilities.
109
+
110
+ #### APIs
107
111
_ InfraKit_ plugins are exposed via HTTP, using [ JSON-RPC 2.0] ( http://www.jsonrpc.org/specification ) .
108
112
109
113
API requests can be made manually with ` curl ` . For example, the following command will list all groups:
110
114
``` console
111
115
$ curl -X POST --unix-socket ~ /.infrakit/plugins/group http:/rpc \
112
116
-H 'Content-Type: application/json'
113
- -d '{"jsonrpc":"2.0","method":"Group.InspectGroups","params":{},"id":5577006791947779410 }'
117
+ -d '{"jsonrpc":"2.0","method":"Group.InspectGroups","params":{},"id":1 }'
114
118
{"jsonrpc":"2.0","result":{"Groups":null},"id":1}
115
119
```
116
120
0 commit comments