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: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Plugin

type Plugin struct {
	// DoValidate performs local validation on a provision request.
	DoValidate func(req *types.Any) error

	// DoProvision creates a new instance based on the spec.
	DoProvision func(spec instance.Spec) (*instance.ID, error)

	// DoLabel labels the resource
	DoLabel func(instance instance.ID, labels map[string]string) error

	// DoDestroy terminates an existing instance.
	DoDestroy func(instance instance.ID) error

	// DoDescribeInstances returns descriptions of all instances matching all of the provided tags.
	DoDescribeInstances func(tags map[string]string) ([]instance.Description, error)
}

Plugin implements the instance.Plugin interface and supports testing by letting user assemble behavior dyanmically.

func (*Plugin) DescribeInstances

func (t *Plugin) DescribeInstances(tags map[string]string) ([]instance.Description, error)

DescribeInstances returns descriptions of all instances matching all of the provided tags.

func (*Plugin) Destroy

func (t *Plugin) Destroy(instance instance.ID) error

Destroy terminates an existing instance.

func (*Plugin) Label

func (t *Plugin) Label(instance instance.ID, labels map[string]string) error

Label labels the resource

func (*Plugin) Provision

func (t *Plugin) Provision(spec instance.Spec) (*instance.ID, error)

Provision creates a new instance based on the spec.

func (*Plugin) Validate

func (t *Plugin) Validate(req *types.Any) error

Validate performs local validation on a provision request.

Jump to

Keyboard shortcuts

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