forked from docker-archive/deploykit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspi.go
39 lines (30 loc) · 1.21 KB
/
spi.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package instance
import (
"github.com/docker/infrakit/pkg/spi"
"github.com/docker/infrakit/pkg/types"
)
// InterfaceSpec is the current name and version of the Instance API.
var InterfaceSpec = spi.InterfaceSpec{
Name: "Instance",
Version: "0.6.0",
}
var (
// RollingUpdate is context indicating rolling update
RollingUpdate = Context{Reason: "rolling_update"}
// Termination is context indicating termination
Termination = Context{Reason: "terminate"}
)
// Plugin is a vendor-agnostic API used to create and manage resources with an infrastructure provider.
type Plugin interface {
// Validate performs local validation on a provision request.
Validate(req *types.Any) error
// Provision creates a new instance based on the spec.
Provision(spec Spec) (*ID, error)
// Label labels the instance
Label(instance ID, labels map[string]string) error
// Destroy terminates an existing instance.
Destroy(instance ID, context Context) error
// DescribeInstances returns descriptions of all instances matching all of the provided tags.
// The properties flag indicates the client is interested in receiving details about each instance.
DescribeInstances(labels map[string]string, properties bool) ([]Description, error)
}