instance

package
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: 2 Imported by: 155

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InterfaceSpec = spi.InterfaceSpec{
	Name:    "Instance",
	Version: "0.3.0",
}

InterfaceSpec is the current name and version of the Instance API.

Functions

This section is empty.

Types

type Attachment

type Attachment struct {
	// ID is the unique identifier for the attachment.
	ID string

	// Type is the kind of attachment.  This allows multiple attachments of different types, with the supported
	// types defined by the plugin.
	Type string
}

Attachment is an identifier for a resource to attach to an instance.

type Description

type Description struct {
	ID        ID
	LogicalID *LogicalID
	Tags      map[string]string
}

Description contains details about an instance.

type ID

type ID string

ID is the identifier for an instance.

type LogicalID

type LogicalID string

LogicalID is the logical identifier to associate with an instance.

type Plugin

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)
}

Plugin is a vendor-agnostic API used to create and manage resources with an infrastructure provider.

type Spec

type Spec struct {
	// Properties is the opaque instance plugin configuration.
	Properties *types.Any

	// Tags are metadata that describes an instance.
	Tags map[string]string

	// Init is the boot script to execute when the instance is created.
	Init string

	// LogicalID is the logical identifier assigned to this instance, which may be absent.
	LogicalID *LogicalID

	// Attachments are instructions for external entities that should be attached to the instance.
	Attachments []Attachment
}

Spec is a specification of an instance to be provisioned

Jump to

Keyboard shortcuts

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