params

package
v0.0.0-...-acd7349 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2013 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodeNotFound            = "not found"
	CodeUnauthorized        = "unauthorized access"
	CodeCannotEnterScope    = "cannot enter scope"
	CodeCannotEnterScopeYet = "cannot enter scope yet"
	CodeExcessiveContention = "excessive contention"
	CodeUnitHasSubordinates = "unit has subordinates"
	CodeNotAssigned         = "not assigned"
	CodeStopped             = "stopped"
	CodeHasAssignedUnits    = "machine has assigned units"
)

The Code constants hold error codes for some kinds of error.

Variables

This section is empty.

Functions

func ClientError

func ClientError(err error) error

clientError maps errors returned from an RPC call into local errors with appropriate values.

func ErrCode

func ErrCode(err error) string

ErrCode returns the error code associated with the given error, or the empty string if there is none.

Types

type AddRelation

type AddRelation struct {
	Endpoints []string
}

AddRelation holds the parameters for making the AddRelation call. The endpoints specified are unordered.

type AddRelationResults

type AddRelationResults struct {
	Endpoints map[string]charm.Relation
}

AddRelationResults holds the results of a AddRelation call. The Endpoints field maps service names to the involved endpoints.

type AddServiceUnits

type AddServiceUnits struct {
	ServiceName string
	NumUnits    int
}

AddServiceUnits holds parameters for the AddUnits call.

type AddServiceUnitsResults

type AddServiceUnitsResults struct {
	Units []string
}

AddServiceUnitsResults holds the names of the units added by the AddServiceUnits call.

type AgentTools

type AgentTools struct {
	Tag    string
	Major  int
	Minor  int
	Patch  int
	Build  int
	Arch   string
	Series string
	URL    string
}

AgentTools describes the tools for a given Agent. This is mostly a flattened state.Tools description, plus an agent Tag field.

type AgentToolsResult

type AgentToolsResult struct {
	AgentTools AgentTools
	Error      *Error
}

AgentToolsResult holds the tools and possibly error for a given Agent request

type AgentToolsResults

type AgentToolsResults struct {
	Tools []AgentToolsResult
}

AgentToolsResults is a list of tools for various requested agents.

type AllWatcherId

type AllWatcherId struct {
	AllWatcherId string
}

AllWatcherId holds the id of an AllWatcher.

type AllWatcherNextResults

type AllWatcherNextResults struct {
	Deltas []Delta
}

AllWatcherNextResults holds deltas returned from calling AllWatcher.Next().

type AnnotationInfo

type AnnotationInfo struct {
	Tag         string
	Annotations map[string]string
}

func (*AnnotationInfo) EntityId

func (i *AnnotationInfo) EntityId() EntityId

type CharmInfo

type CharmInfo struct {
	CharmURL string
}

CharmInfo stores parameters for a CharmInfo call.

type Creds

type Creds struct {
	AuthTag  string
	Password string
}

Creds holds credentials for identifying an entity.

type Delta

type Delta struct {
	// If Removed is true, the entity has been removed;
	// otherwise it has been created or changed.
	Removed bool
	// Entity holds data about the entity that has changed.
	Entity EntityInfo
}

Delta holds details of a change to the environment.

func (*Delta) MarshalJSON

func (d *Delta) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*Delta) UnmarshalJSON

func (d *Delta) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type DestroyRelation

type DestroyRelation struct {
	Endpoints []string
}

DestroyRelation holds the parameters for making the DestroyRelation call. The endpoints specified are unordered.

type DestroyServiceUnits

type DestroyServiceUnits struct {
	UnitNames []string
}

DestroyServiceUnits holds parameters for the DestroyUnits call.

type Endpoint

type Endpoint struct {
	ServiceName string
	Relation    charm.Relation
}

type Entities

type Entities struct {
	Entities []Entity
}

Entities identifies multiple entities.

type Entity

type Entity struct {
	Tag string
}

Entity identifies a single entity.

type EntityId

type EntityId struct {
	Kind string
	Id   interface{}
}

type EntityInfo

type EntityInfo interface {
	// EntityId returns an identifier that will uniquely
	// identify the entity within its kind
	EntityId() EntityId
}

EntityInfo is implemented by all entity Info types.

type Error

type Error struct {
	Message string
	Code    string
}

Error is the type of error returned by any call to the state API

func (*Error) Error

func (e *Error) Error() string

func (*Error) ErrorCode

func (e *Error) ErrorCode() string

func (Error) GoString

func (e Error) GoString() string

GoString implements fmt.GoStringer. It means that a *Error shows its contents correctly when printed with %#v.

type ErrorResults

type ErrorResults struct {
	// Errors contains errors occured while performing each operation (if any).
	Errors []*Error
}

ErrorResults holds the results of calling a bulk operation which mutates multiple entites, like Machiner.SetStatus. The order and number of elements matches the entities specified in the request.

type GetAnnotations

type GetAnnotations struct {
	Tag string
}

GetAnnotations stores parameters for making the GetAnnotations call.

type GetAnnotationsResults

type GetAnnotationsResults struct {
	Annotations map[string]string
}

GetAnnotationsResults holds annotations associated with an entity.

type GetServiceConstraints

type GetServiceConstraints struct {
	ServiceName string
}

GetServiceConstraints stores parameters for making the GetServiceConstraints call.

type GetServiceConstraintsResults

type GetServiceConstraintsResults struct {
	Constraints constraints.Value
}

GetServiceConstraintsResults holds results of the GetServiceConstraints call.

type Life

type Life string

Life describes the lifecycle state of an entity ("alive", "dying" or "dead").

const (
	Alive Life = "alive"
	Dying Life = "dying"
	Dead  Life = "dead"
)

type LifeResult

type LifeResult struct {
	Life  Life
	Error *Error
}

LifeResult holds the life status of a single entity, or an error indicating why it is not available.

type LifeResults

type LifeResults struct {
	Results []LifeResult
}

LifeResults holds the life or error status of multiple entities.

type MachineAgentGetMachinesResult

type MachineAgentGetMachinesResult struct {
	Life  Life
	Jobs  []MachineJob
	Error *Error
}

MachineAgentGetMachinesResult holds the results of a machineagent.API.GetMachines call for a single machine.

type MachineAgentGetMachinesResults

type MachineAgentGetMachinesResults struct {
	Machines []MachineAgentGetMachinesResult
}

MachineAgentGetMachinesResults holds the results of a machineagent.API.GetMachines call.

type MachineInfo

type MachineInfo struct {
	Id         string `bson:"_id"`
	InstanceId string
	Status     Status
	StatusInfo string
}

MachineInfo holds the information about a Machine that is watched by StateWatcher.

func (*MachineInfo) EntityId

func (i *MachineInfo) EntityId() EntityId

type MachineJob

type MachineJob string

MachineJob values define responsibilities that machines may be expected to fulfil.

const (
	JobHostUnits     MachineJob = "JobHostUnits"
	JobManageEnviron MachineJob = "JobManageEnviron"
	JobManageState   MachineJob = "JobManageState"
)

type MachineSetStatus

type MachineSetStatus struct {
	Tag    string
	Status Status
	Info   string
}

MachineSetStatus holds a machine tag, status and extra info.

type MachinesSetStatus

type MachinesSetStatus struct {
	Machines []MachineSetStatus
}

MachinesSetStatus holds the parameters for making a Machiner.SetStatus call.

type NotifyWatchResult

type NotifyWatchResult struct {
	NotifyWatcherId string
	Error           *Error
}

NotifyWatchResult holds a NotifyWatcher id and an error (if any).

type NotifyWatchResults

type NotifyWatchResults struct {
	Results []NotifyWatchResult
}

NotifyWatchResults holds the results for any API call which ends up returning a list of NotifyWatchers

type PasswordChange

type PasswordChange struct {
	Tag      string
	Password string
}

PasswordChange specifies a password change for the entity with the given tag.

type PasswordChanges

type PasswordChanges struct {
	Changes []PasswordChange
}

PasswordChanges holds the parameters for making a SetPasswords call.

type RelationInfo

type RelationInfo struct {
	Key       string `bson:"_id"`
	Endpoints []Endpoint
}

func (*RelationInfo) EntityId

func (i *RelationInfo) EntityId() EntityId

type Resolved

type Resolved struct {
	UnitName string
	Retry    bool
}

Resolved holds parameters for the Resolved call.

type ResolvedResults

type ResolvedResults struct {
	Service  string
	Charm    string
	Settings map[string]interface{}
}

ResolvedResults holds results of the Resolved call.

type ServiceDeploy

type ServiceDeploy struct {
	ServiceName    string
	CharmUrl       string
	NumUnits       int
	Config         map[string]string
	ConfigYAML     string // Takes precedence over config if both are present.
	Constraints    constraints.Value
	ForceMachineId string
}

ServiceDeploy holds the parameters for making the ServiceDeploy call.

type ServiceDestroy

type ServiceDestroy struct {
	ServiceName string
}

ServiceDestroy holds the parameters for making the ServiceDestroy call.

type ServiceExpose

type ServiceExpose struct {
	ServiceName string
}

ServiceExpose holds the parameters for making the ServiceExpose call.

type ServiceGet

type ServiceGet struct {
	ServiceName string
}

ServiceGet holds parameters for making the ServiceGet call.

type ServiceGetResults

type ServiceGetResults struct {
	Service     string
	Charm       string
	Config      map[string]interface{}
	Constraints constraints.Value
}

ServiceGetResults holds results of the ServiceGet call.

type ServiceInfo

type ServiceInfo struct {
	Name        string `bson:"_id"`
	Exposed     bool
	CharmURL    string
	Life        Life
	Constraints constraints.Value
	Config      map[string]interface{}
}

func (*ServiceInfo) EntityId

func (i *ServiceInfo) EntityId() EntityId

type ServiceSet

type ServiceSet struct {
	ServiceName string
	Options     map[string]string
}

ServiceSet holds the parameters for a ServiceSet command. Options contains the configuration data.

type ServiceSetCharm

type ServiceSetCharm struct {
	ServiceName string
	CharmUrl    string
	Force       bool
}

ServiceSetCharm sets the charm for a given service.

type ServiceSetYAML

type ServiceSetYAML struct {
	ServiceName string
	Config      string
}

ServiceSetYAML holds the parameters for a ServiceSetYAML command. Config contains the configuration data in YAML format.

type ServiceUnexpose

type ServiceUnexpose struct {
	ServiceName string
}

ServiceUnexpose holds parameters for the ServiceUnexpose call.

type SetAgentTools

type SetAgentTools struct {
	AgentTools []AgentTools
}

Set what tools are being run for multiple agents

type SetAgentToolsResult

type SetAgentToolsResult struct {
	Tag   string
	Error *Error
}

The result of setting the tools for one agent

type SetAgentToolsResults

type SetAgentToolsResults struct {
	Results []SetAgentToolsResult
}

The result of setting the tools for many agents

type SetAnnotations

type SetAnnotations struct {
	Tag   string
	Pairs map[string]string
}

SetAnnotations stores parameters for making the SetAnnotations call.

type SetServiceConstraints

type SetServiceConstraints struct {
	ServiceName string
	Constraints constraints.Value
}

SetServiceConstraints stores parameters for making the SetServiceConstraints call.

type Status

type Status string

Status represents the status of an entity. It could be a unit, machine or its agent.

const (
	// The entity is not yet participating in the environment.
	StatusPending Status = "pending"

	// The unit has performed initial setup and is adapting itself to
	// the environment. Not applicable to machines.
	StatusInstalled Status = "installed"

	// The entity is actively participating in the environment.
	StatusStarted Status = "started"

	// The entity's agent will perform no further action, other than
	// to set the unit to Dead at a suitable moment.
	StatusStopped Status = "stopped"

	// The entity requires human intervention in order to operate
	// correctly.
	StatusError Status = "error"

	// The entity ought to be signalling activity, but it cannot be
	// detected.
	StatusDown Status = "down"
)

type StringsWatchResult

type StringsWatchResult struct {
	StringsWatcherId string
	Changes          []string
	Error            *Error
}

StringsWatchResult holds a StringsWatcher id, changes and an error (if any).

type UnitInfo

type UnitInfo struct {
	Name           string `bson:"_id"`
	Service        string
	Series         string
	CharmURL       string
	PublicAddress  string
	PrivateAddress string
	MachineId      string
	Ports          []instance.Port
	Status         Status
	StatusInfo     string
}

func (*UnitInfo) EntityId

func (i *UnitInfo) EntityId() EntityId

Jump to

Keyboard shortcuts

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