forked from docker-archive/deploykit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspi.go
30 lines (23 loc) · 899 Bytes
/
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
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.3.0",
}
// 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) error
// DescribeInstances returns descriptions of all instances matching all of the provided tags.
DescribeInstances(labels map[string]string) ([]Description, error)
}