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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

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

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) Label added in v0.3.0

func (p *Instance) Label(_ *http.Request, req *LabelRequest, resp *LabelResponse) error

Label labels the instance

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 LabelRequest added in v0.3.0

type LabelRequest struct {
	Type     string
	Instance instance.ID
	Labels   map[string]string
}

LabelRequest is the rpc wrapper for Label request

type LabelResponse added in v0.3.0

type LabelResponse struct {
	Type string
	OK   bool
}

LabelResponse is the rpc wrapper for Label response

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 *types.Any
}

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