Documentation ¶
Overview ¶
The worker/uniter/runner/jujuc package implements the server side of the jujuc proxy tool, which forwards command invocations to the unit agent process so that they can be executed against specific state.
Index ¶
- Constants
- Variables
- func CommandNames() (names []string)
- func EnsureSymlinks(dir string) (err error)
- func IsNotAvailable(err error) bool
- func NewActionFailCommand(ctx Context) (cmd.Command, error)
- func NewActionGetCommand(ctx Context) (cmd.Command, error)
- func NewActionSetCommand(ctx Context) (cmd.Command, error)
- func NewAddMetricCommand(ctx Context) (cmd.Command, error)
- func NewApplicationVersionSetCommand(ctx Context) (cmd.Command, error)
- func NewClosePortCommand(ctx Context) (cmd.Command, error)
- func NewCommand(ctx Context, name string) (cmd.Command, error)
- func NewConfigGetCommand(ctx Context) (cmd.Command, error)
- func NewIsLeaderCommand(ctx Context) (cmd.Command, error)
- func NewJujuLogCommand(ctx Context) (cmd.Command, error)
- func NewJujuRebootCommand(ctx Context) (cmd.Command, error)
- func NewLeaderGetCommand(ctx Context) (cmd.Command, error)
- func NewLeaderSetCommand(ctx Context) (cmd.Command, error)
- func NewNetworkGetCommand(ctx Context) (cmd.Command, error)
- func NewOpenPortCommand(ctx Context) (cmd.Command, error)
- func NewOpenedPortsCommand(ctx Context) (cmd.Command, error)
- func NewRelationGetCommand(ctx Context) (cmd.Command, error)
- func NewRelationIdsCommand(ctx Context) (cmd.Command, error)
- func NewRelationListCommand(ctx Context) (cmd.Command, error)
- func NewRelationSetCommand(ctx Context) (cmd.Command, error)
- func NewStatusGetCommand(ctx Context) (cmd.Command, error)
- func NewStatusSetCommand(ctx Context) (cmd.Command, error)
- func NewStorageAddCommand(ctx Context) (cmd.Command, error)
- func NewStorageGetCommand(ctx Context) (cmd.Command, error)
- func NewStorageListCommand(ctx Context) (cmd.Command, error)
- func NewUnitGetCommand(ctx Context) (cmd.Command, error)
- func NotAvailable(thing string) error
- func RegisterCommand(name string, f creator)
- type ActionFailCommand
- type ActionGetCommand
- type ActionHookContext
- type ActionSetCommand
- type AddMetricCommand
- type ApplicationStatusInfo
- type CmdGetter
- type ConfigGetCommand
- type Context
- type ContextComponent
- type ContextComponents
- type ContextInstance
- type ContextLeadership
- type ContextMetrics
- type ContextNetworking
- type ContextRelation
- type ContextRelations
- type ContextStatus
- type ContextStorage
- type ContextStorageAttachment
- type ContextUnit
- type ContextVersion
- type HookContext
- type JujuLogCommand
- type JujuRebootCommand
- type Jujuc
- type Metric
- type NetworkGetCommand
- type OpenedPortsCommand
- type RebootPriority
- type RelationGetCommand
- type RelationHookContext
- type RelationIdsCommand
- type RelationListCommand
- type RelationSetCommand
- type Request
- type RestrictedContext
- func (*RestrictedContext) ActionParams() (map[string]interface{}, error)
- func (*RestrictedContext) AddMetric(string, string, time.Time) error
- func (*RestrictedContext) AddUnitStorage(map[string]params.StorageConstraints) error
- func (*RestrictedContext) ApplicationStatus() (ApplicationStatusInfo, error)
- func (*RestrictedContext) AvailabilityZone() (string, error)
- func (*RestrictedContext) ClosePorts(protocol string, fromPort, toPort int) error
- func (*RestrictedContext) Component(string) (ContextComponent, error)
- func (*RestrictedContext) ConfigSettings() (charm.Settings, error)
- func (*RestrictedContext) HookRelation() (ContextRelation, error)
- func (*RestrictedContext) HookStorage() (ContextStorageAttachment, error)
- func (*RestrictedContext) IsLeader() (bool, error)
- func (*RestrictedContext) LeaderSettings() (map[string]string, error)
- func (*RestrictedContext) NetworkConfig(bindingName string) ([]params.NetworkConfig, error)
- func (*RestrictedContext) OpenPorts(protocol string, fromPort, toPort int) error
- func (*RestrictedContext) OpenedPorts() []network.PortRange
- func (*RestrictedContext) PrivateAddress() (string, error)
- func (*RestrictedContext) PublicAddress() (string, error)
- func (*RestrictedContext) Relation(id int) (ContextRelation, error)
- func (*RestrictedContext) RelationIds() ([]int, error)
- func (*RestrictedContext) RemoteUnitName() (string, error)
- func (*RestrictedContext) RequestReboot(prio RebootPriority) error
- func (*RestrictedContext) SetActionFailed() error
- func (*RestrictedContext) SetActionMessage(string) error
- func (*RestrictedContext) SetApplicationStatus(StatusInfo) error
- func (*RestrictedContext) SetUnitStatus(StatusInfo) error
- func (*RestrictedContext) SetUnitWorkloadVersion(string) error
- func (*RestrictedContext) Storage(names.StorageTag) (ContextStorageAttachment, error)
- func (*RestrictedContext) StorageTags() ([]names.StorageTag, error)
- func (*RestrictedContext) UnitStatus() (*StatusInfo, error)
- func (*RestrictedContext) UnitWorkloadVersion() (string, error)
- func (*RestrictedContext) UpdateActionResults(keys []string, value string) error
- func (*RestrictedContext) WriteLeaderSettings(map[string]string) error
- type Server
- type Settings
- type StatusGetCommand
- type StatusInfo
- type StatusSetCommand
- type StorageAddCommand
- type StorageGetCommand
- type StorageListCommand
- type UnitGetCommand
- type UnitHookContext
Constants ¶
const CmdSuffix = cmdSuffix
CmdSuffix is the filename suffix to use for executables.
Variables ¶
var ErrNoStdin = errors.New("hook tool requires stdin, none supplied")
ErrNoStdin is returned by Jujuc.Main if the hook tool requests stdin, and none is supplied.
var ErrRestrictedContext = errors.NotImplementedf("not implemented for restricted context")
ErrRestrictedContext indicates a method is not implemented in the given context.
var StorageAddDoc = `
Storage add adds storage instances to unit using provided storage directives.
A storage directive consists of a storage name as per charm specification
and optional storage COUNT.
COUNT is a positive integer indicating how many instances
of the storage to create. If unspecified, COUNT defaults to 1.
`[1:]
Functions ¶
func CommandNames ¶
func CommandNames() (names []string)
CommandNames returns the names of all jujuc commands.
func EnsureSymlinks ¶
EnsureSymlinks creates a symbolic link to jujuc within dir for each hook command. If the commands already exist, this operation does nothing. If dir is a symbolic link, it will be dereferenced first.
func IsNotAvailable ¶
IsNotAvailable reports whether err was creates with NotAvailable().
func NewActionFailCommand ¶
NewActionFailCommand returns a new ActionFailCommand with the given context.
func NewActionGetCommand ¶
NewActionGetCommand returns an ActionGetCommand for use with the given context.
func NewActionSetCommand ¶
NewActionSetCommand returns a new ActionSetCommand with the given context.
func NewAddMetricCommand ¶
NewAddMetricCommand generates a new AddMetricCommand.
func NewApplicationVersionSetCommand ¶
NewApplicationVersionSetCommand creates an application-version-set command.
func NewCommand ¶
NewCommand returns an instance of the named Command, initialized to execute against the supplied Context.
func NewIsLeaderCommand ¶
NewIsLeaderCommand returns a new isLeaderCommand with the given context.
func NewLeaderGetCommand ¶
NewLeaderGetCommand returns a new leaderGetCommand with the given context.
func NewLeaderSetCommand ¶
NewLeaderSetCommand returns a new leaderSetCommand with the given context.
func NewStatusSetCommand ¶
NewStatusSetCommand makes a jujuc status-set command.
func NewStorageAddCommand ¶
NewStorageAddCommand makes a jujuc storage-add command.
func NotAvailable ¶
NotAvailable returns an error which satisfies IsNotAvailable.
func RegisterCommand ¶
func RegisterCommand(name string, f creator)
Types ¶
type ActionFailCommand ¶
type ActionFailCommand struct { cmd.CommandBase // contains filtered or unexported fields }
ActionFailCommand implements the action-fail command.
func (*ActionFailCommand) Info ¶
func (c *ActionFailCommand) Info() *cmd.Info
Info returns the content for --help.
func (*ActionFailCommand) Init ¶
func (c *ActionFailCommand) Init(args []string) error
Init sets the fail message and checks for malformed invocations.
func (*ActionFailCommand) Run ¶
func (c *ActionFailCommand) Run(ctx *cmd.Context) error
Run sets the Action's fail state.
func (*ActionFailCommand) SetFlags ¶
func (c *ActionFailCommand) SetFlags(f *gnuflag.FlagSet)
SetFlags handles any option flags, but there are none.
type ActionGetCommand ¶
type ActionGetCommand struct { cmd.CommandBase // contains filtered or unexported fields }
ActionGetCommand implements the action-get command.
func (*ActionGetCommand) Info ¶
func (c *ActionGetCommand) Info() *cmd.Info
Info returns the content for --help.
func (*ActionGetCommand) Init ¶
func (c *ActionGetCommand) Init(args []string) error
Init makes sure there are no additional unknown arguments to action-get.
func (*ActionGetCommand) Run ¶
func (c *ActionGetCommand) Run(ctx *cmd.Context) error
Run recurses into the params map for the Action, given the list of keys into the map, and returns either the keyed value, or nothing. In the case of an empty keys list, the entire params map will be returned.
func (*ActionGetCommand) SetFlags ¶
func (c *ActionGetCommand) SetFlags(f *gnuflag.FlagSet)
SetFlags handles known option flags; in this case, [--output={json|yaml}] and --help.
type ActionHookContext ¶
type ActionHookContext interface { HookContext // contains filtered or unexported methods }
ActionHookContext is the context for an action hook.
type ActionSetCommand ¶
type ActionSetCommand struct { cmd.CommandBase // contains filtered or unexported fields }
ActionSetCommand implements the action-set command.
func (*ActionSetCommand) Info ¶
func (c *ActionSetCommand) Info() *cmd.Info
Info returns the content for --help.
func (*ActionSetCommand) Init ¶
func (c *ActionSetCommand) Init(args []string) error
Init accepts maps in the form of key=value, key.key2.keyN....=value
func (*ActionSetCommand) Run ¶
func (c *ActionSetCommand) Run(ctx *cmd.Context) error
Run adds the given <key list>/<value> pairs, such as foo.bar=baz to the existing map of results for the Action.
func (*ActionSetCommand) SetFlags ¶
func (c *ActionSetCommand) SetFlags(f *gnuflag.FlagSet)
SetFlags handles known option flags.
type AddMetricCommand ¶
type AddMetricCommand struct { cmd.CommandBase Metrics []Metric // contains filtered or unexported fields }
AddMetricCommand implements the add-metric command.
func (*AddMetricCommand) Info ¶
func (c *AddMetricCommand) Info() *cmd.Info
Info returns the command infor structure for the add-metric command.
func (*AddMetricCommand) Init ¶
func (c *AddMetricCommand) Init(args []string) error
Init parses the command's parameters.
type ApplicationStatusInfo ¶
type ApplicationStatusInfo struct { Application StatusInfo Units []StatusInfo }
ApplicationStatusInfo holds StatusInfo for an Application and all its Units.
type ConfigGetCommand ¶
type ConfigGetCommand struct { cmd.CommandBase Key string // The key to show. If empty, show all. All bool // contains filtered or unexported fields }
ConfigGetCommand implements the config-get command.
func (*ConfigGetCommand) Info ¶
func (c *ConfigGetCommand) Info() *cmd.Info
func (*ConfigGetCommand) Init ¶
func (c *ConfigGetCommand) Init(args []string) error
func (*ConfigGetCommand) SetFlags ¶
func (c *ConfigGetCommand) SetFlags(f *gnuflag.FlagSet)
type Context ¶
type Context interface { HookContext // contains filtered or unexported methods }
Context is the interface that all hook helper commands depend on to interact with the rest of the system.
type ContextComponent ¶
type ContextComponent interface { // Flush pushes the component's data to Juju state. // In the Flush implementation, call your components API. Flush() error }
ContextComponent is a single modular Juju component as it relates to the current unit and hook. Components should implement this interfaces in a type-safe way. Ensuring checked type-conversions are preformed on the result and value interfaces. You will use the runner.RegisterComponentFunc to register a your components concrete ContextComponent implementation.
See: process/context/context.go for an implementation example.
type ContextComponents ¶
type ContextComponents interface { // Component returns the ContextComponent with the supplied name if // it was found. Component(name string) (ContextComponent, error) }
ContextComponents exposes modular Juju components as they relate to the unit in the context of the hook.
type ContextInstance ¶
type ContextInstance interface { // AvailabilityZone returns the executing unit's availability zone or an error // if it was not found (or is not available). AvailabilityZone() (string, error) // RequestReboot will set the reboot flag to true on the machine agent RequestReboot(prio RebootPriority) error }
ContextInstance is the part of a hook context related to the unit's instance.
type ContextLeadership ¶
type ContextLeadership interface { // IsLeader returns true if the local unit is known to be leader for at // least the next 30s. IsLeader() (bool, error) // LeaderSettings returns the current leader settings. Once leader settings // have been read in a given context, they will not be updated other than // via successful calls to WriteLeaderSettings. LeaderSettings() (map[string]string, error) // WriteLeaderSettings writes the supplied settings directly to state, or // fails if the local unit is not the service's leader. WriteLeaderSettings(map[string]string) error }
ContextLeadership is the part of a hook context related to the unit leadership.
type ContextMetrics ¶
type ContextMetrics interface { // AddMetric records a metric to return after hook execution. AddMetric(string, string, time.Time) error }
ContextMetrics is the part of a hook context related to metrics.
type ContextNetworking ¶
type ContextNetworking interface { // PublicAddress returns the executing unit's public address or an // error if it is not available. PublicAddress() (string, error) // PrivateAddress returns the executing unit's private address or an // error if it is not available. PrivateAddress() (string, error) // OpenPorts marks the supplied port range for opening when the // executing unit's service is exposed. OpenPorts(protocol string, fromPort, toPort int) error // ClosePorts ensures the supplied port range is closed even when // the executing unit's service is exposed (unless it is opened // separately by a co- located unit). ClosePorts(protocol string, fromPort, toPort int) error // OpenedPorts returns all port ranges currently opened by this // unit on its assigned machine. The result is sorted first by // protocol, then by number. OpenedPorts() []network.PortRange // NetworkConfig returns the network configuration for the unit and the // given bindingName. // // TODO(dimitern): Currently, only the Address is populated, add the // rest later. // // LKK Card: https://canonical.leankit.com/Boards/View/101652562/119258804 NetworkConfig(bindingName string) ([]params.NetworkConfig, error) }
ContextNetworking is the part of a hook context related to network interface of the unit's instance.
type ContextRelation ¶
type ContextRelation interface { // Id returns an integer which uniquely identifies the relation. Id() int // Name returns the name the locally executing charm assigned to this relation. Name() string // FakeId returns a string of the form "relation-name:123", which uniquely // identifies the relation to the hook. In reality, the identification // of the relation is the integer following the colon, but the composed // name is useful to humans observing it. FakeId() string // Settings allows read/write access to the local unit's settings in // this relation. Settings() (Settings, error) // UnitNames returns a list of the remote units in the relation. UnitNames() []string // ReadSettings returns the settings of any remote unit in the relation. ReadSettings(unit string) (params.Settings, error) }
ContextRelation expresses the capabilities of a hook with respect to a relation.
type ContextRelations ¶
type ContextRelations interface { // Relation returns the relation with the supplied id if it was found, and // an error if it was not found or is not available. Relation(id int) (ContextRelation, error) // RelationIds returns the ids of all relations the executing unit is // currently participating in or an error if they are not available. RelationIds() ([]int, error) }
ContextRelations exposes the relations associated with the unit.
type ContextStatus ¶
type ContextStatus interface { // UnitStatus returns the executing unit's current status. UnitStatus() (*StatusInfo, error) // SetUnitStatus updates the unit's status. SetUnitStatus(StatusInfo) error // ApplicationStatus returns the executing unit's service status // (including all units). ApplicationStatus() (ApplicationStatusInfo, error) // SetApplicationStatus updates the status for the unit's service. SetApplicationStatus(StatusInfo) error }
ContextStatus is the part of a hook context related to the unit's status.
type ContextStorage ¶
type ContextStorage interface { // StorageTags returns a list of tags for storage instances // attached to the unit or an error if they are not available. StorageTags() ([]names.StorageTag, error) // Storage returns the ContextStorageAttachment with the supplied // tag if it was found, and an error if it was not found or is not // available to the context. Storage(names.StorageTag) (ContextStorageAttachment, error) // HookStorage returns the storage attachment associated // the executing hook if it was found, and an error if it // was not found or is not available. HookStorage() (ContextStorageAttachment, error) // AddUnitStorage saves storage constraints in the context. AddUnitStorage(map[string]params.StorageConstraints) error }
ContextStorage is the part of a hook context related to storage resources associated with the unit.
type ContextStorageAttachment ¶
type ContextStorageAttachment interface { // Tag returns a tag which uniquely identifies the storage attachment // in the context of the unit. Tag() names.StorageTag // Kind returns the kind of the storage. Kind() storage.StorageKind // Location returns the location of the storage: the mount point for // filesystem-kind stores, and the device path for block-kind stores. Location() string }
ContextStorageAttachment expresses the capabilities of a hook with respect to a storage attachment.
type ContextUnit ¶
type ContextUnit interface { // UnitName returns the executing unit's name. UnitName() string // Config returns the current service configuration of the executing unit. ConfigSettings() (charm.Settings, error) }
ContextUnit is the part of a hook context related to the unit.
type ContextVersion ¶
type ContextVersion interface { // UnitWorkloadVersion returns the currently set workload version for // the unit. UnitWorkloadVersion() (string, error) // SetUnitWorkloadVersion updates the workload version for the unit. SetUnitWorkloadVersion(string) error }
ContextVersion expresses the parts of a hook context related to reporting workload versions.
type HookContext ¶
type HookContext interface { ContextUnit ContextStatus ContextInstance ContextNetworking ContextLeadership ContextMetrics ContextStorage ContextComponents ContextRelations ContextVersion }
HookContext represents the information and functionality that is common to all charm hooks.
type JujuLogCommand ¶
type JujuLogCommand struct { cmd.CommandBase Message string Debug bool Level string // contains filtered or unexported fields }
JujuLogCommand implements the juju-log command.
func (*JujuLogCommand) Info ¶
func (c *JujuLogCommand) Info() *cmd.Info
func (*JujuLogCommand) Init ¶
func (c *JujuLogCommand) Init(args []string) error
func (*JujuLogCommand) SetFlags ¶
func (c *JujuLogCommand) SetFlags(f *gnuflag.FlagSet)
type JujuRebootCommand ¶
type JujuRebootCommand struct { cmd.CommandBase Now bool // contains filtered or unexported fields }
JujuRebootCommand implements the juju-reboot command.
func (*JujuRebootCommand) Info ¶
func (c *JujuRebootCommand) Info() *cmd.Info
func (*JujuRebootCommand) Init ¶
func (c *JujuRebootCommand) Init(args []string) error
func (*JujuRebootCommand) SetFlags ¶
func (c *JujuRebootCommand) SetFlags(f *gnuflag.FlagSet)
type Jujuc ¶
type Jujuc struct {
// contains filtered or unexported fields
}
Jujuc implements the jujuc command in the form required by net/rpc.
type NetworkGetCommand ¶
type NetworkGetCommand struct { cmd.CommandBase // contains filtered or unexported fields }
NetworkGetCommand implements the network-get command.
func (*NetworkGetCommand) Info ¶
func (c *NetworkGetCommand) Info() *cmd.Info
Info is part of the cmd.Command interface.
func (*NetworkGetCommand) Init ¶
func (c *NetworkGetCommand) Init(args []string) error
Init is part of the cmd.Command interface.
func (*NetworkGetCommand) SetFlags ¶
func (c *NetworkGetCommand) SetFlags(f *gnuflag.FlagSet)
SetFlags is part of the cmd.Command interface.
type OpenedPortsCommand ¶
type OpenedPortsCommand struct { cmd.CommandBase // contains filtered or unexported fields }
OpenedPortsCommand implements the opened-ports command.
func (*OpenedPortsCommand) Info ¶
func (c *OpenedPortsCommand) Info() *cmd.Info
func (*OpenedPortsCommand) Init ¶
func (c *OpenedPortsCommand) Init(args []string) error
func (*OpenedPortsCommand) SetFlags ¶
func (c *OpenedPortsCommand) SetFlags(f *gnuflag.FlagSet)
type RebootPriority ¶
type RebootPriority int
RebootPriority is the type used for reboot requests.
const ( // RebootSkip is a noop. RebootSkip RebootPriority = iota // RebootAfterHook means wait for current hook to finish before // rebooting. RebootAfterHook // RebootNow means reboot immediately, killing and requeueing the // calling hook RebootNow )
type RelationGetCommand ¶
type RelationGetCommand struct { cmd.CommandBase RelationId int Key string UnitName string // contains filtered or unexported fields }
RelationGetCommand implements the relation-get command.
func (*RelationGetCommand) Info ¶
func (c *RelationGetCommand) Info() *cmd.Info
Info is part of the cmd.Command interface.
func (*RelationGetCommand) Init ¶
func (c *RelationGetCommand) Init(args []string) error
Init is part of the cmd.Command interface.
func (*RelationGetCommand) SetFlags ¶
func (c *RelationGetCommand) SetFlags(f *gnuflag.FlagSet)
SetFlags is part of the cmd.Command interface.
type RelationHookContext ¶
type RelationHookContext interface { HookContext // contains filtered or unexported methods }
RelationHookContext is the context for a relation hook.
type RelationIdsCommand ¶
type RelationIdsCommand struct { cmd.CommandBase Name string // contains filtered or unexported fields }
RelationIdsCommand implements the relation-ids command.
func (*RelationIdsCommand) Info ¶
func (c *RelationIdsCommand) Info() *cmd.Info
func (*RelationIdsCommand) Init ¶
func (c *RelationIdsCommand) Init(args []string) error
func (*RelationIdsCommand) SetFlags ¶
func (c *RelationIdsCommand) SetFlags(f *gnuflag.FlagSet)
type RelationListCommand ¶
type RelationListCommand struct { cmd.CommandBase RelationId int // contains filtered or unexported fields }
RelationListCommand implements the relation-list command.
func (*RelationListCommand) Info ¶
func (c *RelationListCommand) Info() *cmd.Info
func (*RelationListCommand) Init ¶
func (c *RelationListCommand) Init(args []string) (err error)
func (*RelationListCommand) SetFlags ¶
func (c *RelationListCommand) SetFlags(f *gnuflag.FlagSet)
type RelationSetCommand ¶
type RelationSetCommand struct { cmd.CommandBase RelationId int Settings map[string]string // contains filtered or unexported fields }
RelationSetCommand implements the relation-set command.
func (*RelationSetCommand) Info ¶
func (c *RelationSetCommand) Info() *cmd.Info
func (*RelationSetCommand) Init ¶
func (c *RelationSetCommand) Init(args []string) error
func (*RelationSetCommand) SetFlags ¶
func (c *RelationSetCommand) SetFlags(f *gnuflag.FlagSet)
type Request ¶
type Request struct { ContextId string Dir string CommandName string Args []string // StdinSet indicates whether or not the client supplied stdin. This is // necessary as Stdin will be nil if the client supplied stdin but it // is empty. StdinSet bool Stdin []byte }
Request contains the information necessary to run a Command remotely.
type RestrictedContext ¶
type RestrictedContext struct{}
RestrictedContext is a base implementation for restricted contexts to embed, so that an error is returned for methods that are not explicitly implemented.
func (*RestrictedContext) ActionParams ¶
func (*RestrictedContext) ActionParams() (map[string]interface{}, error)
ActionParams implements jujuc.Context.
func (*RestrictedContext) AddUnitStorage ¶
func (*RestrictedContext) AddUnitStorage(map[string]params.StorageConstraints) error
AddUnitStorage implements jujuc.Context.
func (*RestrictedContext) ApplicationStatus ¶
func (*RestrictedContext) ApplicationStatus() (ApplicationStatusInfo, error)
ApplicationStatus implements jujuc.Context.
func (*RestrictedContext) AvailabilityZone ¶
func (*RestrictedContext) AvailabilityZone() (string, error)
AvailabilityZone implements jujuc.Context.
func (*RestrictedContext) ClosePorts ¶
func (*RestrictedContext) ClosePorts(protocol string, fromPort, toPort int) error
ClosePorts implements jujuc.Context.
func (*RestrictedContext) Component ¶
func (*RestrictedContext) Component(string) (ContextComponent, error)
Component implements jujc.Context.
func (*RestrictedContext) ConfigSettings ¶
func (*RestrictedContext) ConfigSettings() (charm.Settings, error)
ConfigSettings implements jujuc.Context.
func (*RestrictedContext) HookRelation ¶
func (*RestrictedContext) HookRelation() (ContextRelation, error)
HookRelation implements jujuc.Context.
func (*RestrictedContext) HookStorage ¶
func (*RestrictedContext) HookStorage() (ContextStorageAttachment, error)
HookStorage implements jujuc.Context.
func (*RestrictedContext) IsLeader ¶
func (*RestrictedContext) IsLeader() (bool, error)
IsLeader implements jujuc.Context.
func (*RestrictedContext) LeaderSettings ¶
func (*RestrictedContext) LeaderSettings() (map[string]string, error)
LeaderSettings implements jujuc.Context.
func (*RestrictedContext) NetworkConfig ¶
func (*RestrictedContext) NetworkConfig(bindingName string) ([]params.NetworkConfig, error)
NetworkConfig implements jujuc.Context.
func (*RestrictedContext) OpenPorts ¶
func (*RestrictedContext) OpenPorts(protocol string, fromPort, toPort int) error
OpenPorts implements jujuc.Context.
func (*RestrictedContext) OpenedPorts ¶
func (*RestrictedContext) OpenedPorts() []network.PortRange
OpenedPorts implements jujuc.Context.
func (*RestrictedContext) PrivateAddress ¶
func (*RestrictedContext) PrivateAddress() (string, error)
PrivateAddress implements jujuc.Context.
func (*RestrictedContext) PublicAddress ¶
func (*RestrictedContext) PublicAddress() (string, error)
PublicAddress implements jujuc.Context.
func (*RestrictedContext) Relation ¶
func (*RestrictedContext) Relation(id int) (ContextRelation, error)
Relation implements jujuc.Context.
func (*RestrictedContext) RelationIds ¶
func (*RestrictedContext) RelationIds() ([]int, error)
RelationIds implements jujuc.Context.
func (*RestrictedContext) RemoteUnitName ¶
func (*RestrictedContext) RemoteUnitName() (string, error)
RemoteUnitName implements jujuc.Context.
func (*RestrictedContext) RequestReboot ¶
func (*RestrictedContext) RequestReboot(prio RebootPriority) error
RequestReboot implements jujuc.Context.
func (*RestrictedContext) SetActionFailed ¶
func (*RestrictedContext) SetActionFailed() error
SetActionFailed implements jujuc.Context.
func (*RestrictedContext) SetActionMessage ¶
func (*RestrictedContext) SetActionMessage(string) error
SetActionMessage implements jujuc.Context.
func (*RestrictedContext) SetApplicationStatus ¶
func (*RestrictedContext) SetApplicationStatus(StatusInfo) error
SetApplicationStatus implements jujuc.Context.
func (*RestrictedContext) SetUnitStatus ¶
func (*RestrictedContext) SetUnitStatus(StatusInfo) error
SetUnitStatus implements jujuc.Context.
func (*RestrictedContext) SetUnitWorkloadVersion ¶
func (*RestrictedContext) SetUnitWorkloadVersion(string) error
SetUnitWorkloadVersion implements jujuc.Context.
func (*RestrictedContext) Storage ¶
func (*RestrictedContext) Storage(names.StorageTag) (ContextStorageAttachment, error)
Storage implements jujuc.Context.
func (*RestrictedContext) StorageTags ¶
func (*RestrictedContext) StorageTags() ([]names.StorageTag, error)
StorageTags implements jujuc.Context.
func (*RestrictedContext) UnitStatus ¶
func (*RestrictedContext) UnitStatus() (*StatusInfo, error)
UnitStatus implements jujuc.Context.
func (*RestrictedContext) UnitWorkloadVersion ¶
func (*RestrictedContext) UnitWorkloadVersion() (string, error)
UnitWorkloadVersion implements jujuc.Context.
func (*RestrictedContext) UpdateActionResults ¶
func (*RestrictedContext) UpdateActionResults(keys []string, value string) error
UpdateActionResults implements jujuc.Context.
func (*RestrictedContext) WriteLeaderSettings ¶
func (*RestrictedContext) WriteLeaderSettings(map[string]string) error
WriteLeaderSettings implements jujuc.Context.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server implements a server that serves command invocations via a unix domain socket.
func NewServer ¶
NewServer creates an RPC server bound to socketPath, which can execute remote command invocations against an appropriate Context. It will not actually do so until Run is called.
type StatusGetCommand ¶
type StatusGetCommand struct { cmd.CommandBase // contains filtered or unexported fields }
StatusGetCommand implements the status-get command.
func (*StatusGetCommand) ApplicationStatus ¶
func (c *StatusGetCommand) ApplicationStatus(ctx *cmd.Context) error
func (*StatusGetCommand) Info ¶
func (c *StatusGetCommand) Info() *cmd.Info
func (*StatusGetCommand) Init ¶
func (c *StatusGetCommand) Init(args []string) error
func (*StatusGetCommand) SetFlags ¶
func (c *StatusGetCommand) SetFlags(f *gnuflag.FlagSet)
type StatusInfo ¶
StatusInfo is a record of the status information for a service or a unit's workload.
type StatusSetCommand ¶
type StatusSetCommand struct { cmd.CommandBase // contains filtered or unexported fields }
StatusSetCommand implements the status-set command.
func (*StatusSetCommand) Info ¶
func (c *StatusSetCommand) Info() *cmd.Info
func (*StatusSetCommand) Init ¶
func (c *StatusSetCommand) Init(args []string) error
func (*StatusSetCommand) SetFlags ¶
func (c *StatusSetCommand) SetFlags(f *gnuflag.FlagSet)
type StorageAddCommand ¶
type StorageAddCommand struct { cmd.CommandBase // contains filtered or unexported fields }
StorageAddCommand implements the status-set command.
func (*StorageAddCommand) Info ¶
func (s *StorageAddCommand) Info() *cmd.Info
func (*StorageAddCommand) Init ¶
func (s *StorageAddCommand) Init(args []string) error
type StorageGetCommand ¶
type StorageGetCommand struct { cmd.CommandBase // contains filtered or unexported fields }
StorageGetCommand implements the storage-get command.
func (*StorageGetCommand) Info ¶
func (c *StorageGetCommand) Info() *cmd.Info
func (*StorageGetCommand) Init ¶
func (c *StorageGetCommand) Init(args []string) error
func (*StorageGetCommand) SetFlags ¶
func (c *StorageGetCommand) SetFlags(f *gnuflag.FlagSet)
type StorageListCommand ¶
type StorageListCommand struct { cmd.CommandBase // contains filtered or unexported fields }
StorageListCommand implements the storage-list command.
StorageListCommand implements cmd.Command.
func (*StorageListCommand) Info ¶
func (c *StorageListCommand) Info() *cmd.Info
func (*StorageListCommand) Init ¶
func (c *StorageListCommand) Init(args []string) (err error)
func (*StorageListCommand) SetFlags ¶
func (c *StorageListCommand) SetFlags(f *gnuflag.FlagSet)
type UnitGetCommand ¶
type UnitGetCommand struct { cmd.CommandBase Key string // contains filtered or unexported fields }
UnitGetCommand implements the unit-get command.
func (*UnitGetCommand) Info ¶
func (c *UnitGetCommand) Info() *cmd.Info
func (*UnitGetCommand) Init ¶
func (c *UnitGetCommand) Init(args []string) error
func (*UnitGetCommand) SetFlags ¶
func (c *UnitGetCommand) SetFlags(f *gnuflag.FlagSet)
type UnitHookContext ¶
type UnitHookContext interface { HookContext }
UnitHookContext is the context for a unit hook.
Source Files ¶
- action-fail.go
- action-get.go
- action-set.go
- add-metric.go
- application-version-set.go
- commands.go
- config-get.go
- context.go
- errors.go
- is-leader.go
- juju-log.go
- leader-get.go
- leader-set.go
- network-get.go
- opened-ports.go
- ports.go
- reboot.go
- relation-get.go
- relation-ids.go
- relation-list.go
- relation-set.go
- restricted.go
- server.go
- status-get.go
- status-set.go
- storage-add.go
- storage-get.go
- storage-list.go
- tools.go
- unit-get.go