instance

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2016 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(socketPath string) instance.Plugin

NewClient returns a plugin interface implementation connected to a plugin

Types

type DescribeInstancesRequest

type DescribeInstancesRequest struct {
	Tags map[string]string
}

DescribeInstancesRequest is the rpc wrapper for DescribeInstances request

type DescribeInstancesResponse

type DescribeInstancesResponse struct {
	Descriptions []instance.Description
}

DescribeInstancesResponse is the rpc wrapper for the DescribeInstances response

type DestroyRequest

type DestroyRequest struct {
	Instance instance.ID
}

DestroyRequest is the rpc wrapper for Destroy request

type DestroyResponse

type DestroyResponse struct {
	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 (*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) Validate

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

Validate performs local validation on a provision request.

type ProvisionRequest

type ProvisionRequest struct {
	Spec instance.Spec
}

ProvisionRequest is the rpc wrapper for Provision request

type ProvisionResponse

type ProvisionResponse struct {
	ID *instance.ID
}

ProvisionResponse is the rpc wrapper for Provision response

type ValidateRequest

type ValidateRequest struct {
	Properties *json.RawMessage
}

ValidateRequest is the rpc wrapper for the Validate method args

type ValidateResponse

type ValidateResponse struct {
	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