instance

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2017 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(name plugin.Name, socketPath string) instance.Plugin

NewClient returns a plugin interface implementation connected to a plugin

Types

type DescribeInstancesRequest

type DescribeInstancesRequest struct {
	Type string
	Tags map[string]string
}

DescribeInstancesRequest is the rpc wrapper for DescribeInstances request

type DescribeInstancesResponse

type DescribeInstancesResponse struct {
	Type         string
	Descriptions []instance.Description
}

DescribeInstancesResponse is the rpc wrapper for the DescribeInstances response

type DestroyRequest

type DestroyRequest struct {
	Type     string
	Instance instance.ID
}

DestroyRequest is the rpc wrapper for Destroy request

type DestroyResponse

type DestroyResponse struct {
	Type string
	OK   bool
}

DestroyResponse is the rpc wrapper for Destroy response

type Instance

type Instance struct {
	// contains filtered or unexported fields
}

Instance is the JSON RPC service representing the Instance Plugin. It must be exported in order to be registered by the rpc server package.

func PluginServer

func PluginServer(p instance.Plugin) *Instance

PluginServer returns a RPCService that conforms to the net/rpc rpc call convention.

func PluginServerWithTypes added in v0.2.0

func PluginServerWithTypes(typed map[string]instance.Plugin) *Instance

PluginServerWithTypes which supports multiple types of instance plugins. The de-multiplexing is done by the server's RPC method implementations.

func (*Instance) DescribeInstances

func (p *Instance) DescribeInstances(_ *http.Request, req *DescribeInstancesRequest, resp *DescribeInstancesResponse) error

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

func (*Instance) Destroy

func (p *Instance) Destroy(_ *http.Request, req *DestroyRequest, resp *DestroyResponse) error

Destroy terminates an existing instance.

func (*Instance) ImplementedInterface

func (p *Instance) ImplementedInterface() spi.InterfaceSpec

ImplementedInterface returns the interface implemented by this RPC service.

func (*Instance) Provision

func (p *Instance) Provision(_ *http.Request, req *ProvisionRequest, resp *ProvisionResponse) error

Provision creates a new instance based on the spec.

func (*Instance) SetExampleProperties added in v0.2.0

func (p *Instance) SetExampleProperties(request interface{})

SetExampleProperties sets the rpc request with any example properties/ custom type

func (*Instance) Validate

func (p *Instance) Validate(_ *http.Request, req *ValidateRequest, resp *ValidateResponse) error

Validate performs local validation on a provision request.

func (*Instance) VendorInfo added in v0.2.0

func (p *Instance) VendorInfo() *spi.VendorInfo

VendorInfo returns a metadata object about the plugin, if the plugin implements it.

type ProvisionRequest

type ProvisionRequest struct {
	Type string
	Spec instance.Spec
}

ProvisionRequest is the rpc wrapper for Provision request

type ProvisionResponse

type ProvisionResponse struct {
	Type string
	ID   *instance.ID
}

ProvisionResponse is the rpc wrapper for Provision response

type ValidateRequest

type ValidateRequest struct {
	Type       string
	Properties *json.RawMessage
}

ValidateRequest is the rpc wrapper for the Validate method args

type ValidateResponse

type ValidateResponse struct {
	Type string
	OK   bool
}

ValidateResponse is the rpc wrapper for the Validate response values

Jump to

Keyboard shortcuts

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