Documentation ¶
Index ¶
- func IsMachineOrNewContainer(spec string) bool
- func NewAddRelationCommand() cmd.Command
- func NewAddUnitCommand() cmd.Command
- func NewDeployCommand() cmd.Command
- func NewExposeCommand() cmd.Command
- func NewGetCommand() cmd.Command
- func NewRemoveRelationCommand() cmd.Command
- func NewRemoveServiceCommand() cmd.Command
- func NewRemoveUnitCommand() cmd.Command
- func NewServiceGetConstraintsCommand() cmd.Command
- func NewServiceSetConstraintsCommand() cmd.Command
- func NewSetCommand() cmd.Command
- func NewUnexposeCommand() cmd.Command
- func NewUpgradeCharmCommand() cmd.Command
- type APICmd
- type DeployCommand
- type DeployStep
- type DeploymentInfo
- type ModelConfigGetter
- type RegisterMeteredCharm
- func (r *RegisterMeteredCharm) RunPost(state api.Connection, bakeryClient *httpbakery.Client, ctx *cmd.Context, ...) error
- func (r *RegisterMeteredCharm) RunPre(state api.Connection, bakeryClient *httpbakery.Client, ctx *cmd.Context, ...) error
- func (r *RegisterMeteredCharm) SetFlags(f *gnuflag.FlagSet)
- type ServiceAPI
- type UnitCommandBase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsMachineOrNewContainer ¶
IsMachineOrNewContainer returns whether spec is a valid machine id or new container definition.
func NewAddRelationCommand ¶
NewAddRelationCommand returns a command to add a relation between 2 services.
func NewAddUnitCommand ¶
NewAddUnitCommand returns a command that adds a unit[s] to a service.
func NewDeployCommand ¶
NewDeployCommand returns a command to deploy services.
func NewExposeCommand ¶
NewExposeCommand returns a command to expose services.
func NewGetCommand ¶
NewGetCommand returns a command used to get service attributes.
func NewRemoveRelationCommand ¶
NewRemoveRelationCommand returns a command to remove a relation between 2 services.
func NewRemoveServiceCommand ¶
NewRemoveServiceCommand returns a command which removes a service.
func NewRemoveUnitCommand ¶
NewRemoveUnitCommand returns a command which removes a service's units.
func NewServiceGetConstraintsCommand ¶
NewServiceGetConstraintsCommand returns a command which gets service constraints.
func NewServiceSetConstraintsCommand ¶
NewServiceSetConstraintsCommand returns a command which sets service constraints.
func NewSetCommand ¶
NewSetCommand returns a command used to set service attributes.
func NewUnexposeCommand ¶
NewUnexposeCommand returns a command to unexpose services.
func NewUpgradeCharmCommand ¶
NewUpgradeCharmCommand returns a command which upgrades service's charm.
Types ¶
type APICmd ¶
type APICmd interface {
NewAPIRoot() (api.Connection, error)
}
type DeployCommand ¶
type DeployCommand struct { modelcmd.ModelCommandBase UnitCommandBase // CharmOrBundle is either a charm URL, a path where a charm can be found, // or a bundle name. CharmOrBundle string // Channel holds the charmstore channel to use when obtaining // the charm to be deployed. Channel csclientparams.Channel Series string // Force is used to allow a charm to be deployed onto a machine // running an unsupported series. Force bool ServiceName string Config cmd.FileVar Constraints constraints.Value BindToSpaces string // TODO(axw) move this to UnitCommandBase once we support --storage // on add-unit too. // // Storage is a map of storage constraints, keyed on the storage name // defined in charm storage metadata. Storage map[string]storage.Constraints // BundleStorage maps service names to maps of storage constraints keyed on // the storage name defined in that service's charm storage metadata. BundleStorage map[string]map[string]storage.Constraints // Resources is a map of resource name to filename to be uploaded on deploy. Resources map[string]string Bindings map[string]string Steps []DeployStep // contains filtered or unexported fields }
func (*DeployCommand) Info ¶
func (c *DeployCommand) Info() *cmd.Info
func (*DeployCommand) Init ¶
func (c *DeployCommand) Init(args []string) error
func (*DeployCommand) SetFlags ¶
func (c *DeployCommand) SetFlags(f *gnuflag.FlagSet)
type DeployStep ¶
type DeployStep interface { // Set flags necessary for the deploy step. SetFlags(*gnuflag.FlagSet) // RunPre runs before the call is made to add the charm to the environment. RunPre(api.Connection, *httpbakery.Client, *cmd.Context, DeploymentInfo) error // RunPost runs after the call is made to add the charm to the environment. // The error parameter is used to notify the step of a previously occurred error. RunPost(api.Connection, *httpbakery.Client, *cmd.Context, DeploymentInfo, error) error }
DeployStep is an action that needs to be taken during charm deployment.
type DeploymentInfo ¶
type DeploymentInfo struct { CharmID charmstore.CharmID ServiceName string ModelUUID string }
DeploymentInfo is used to maintain all deployment information for deployment steps.
type ModelConfigGetter ¶
type RegisterMeteredCharm ¶
type RegisterMeteredCharm struct { AllocationSpec string Plan string RegisterURL string QueryURL string // contains filtered or unexported fields }
RegisterMeteredCharm implements the DeployStep interface.
func (*RegisterMeteredCharm) RunPost ¶
func (r *RegisterMeteredCharm) RunPost(state api.Connection, bakeryClient *httpbakery.Client, ctx *cmd.Context, deployInfo DeploymentInfo, prevErr error) error
RunPost sends credentials obtained during the call to RunPre to the controller.
func (*RegisterMeteredCharm) RunPre ¶
func (r *RegisterMeteredCharm) RunPre(state api.Connection, bakeryClient *httpbakery.Client, ctx *cmd.Context, deployInfo DeploymentInfo) error
RunPre obtains authorization to deploy this charm. The authorization, if received is not sent to the controller, rather it is kept as an attribute on RegisterMeteredCharm.
func (*RegisterMeteredCharm) SetFlags ¶
func (r *RegisterMeteredCharm) SetFlags(f *gnuflag.FlagSet)
type ServiceAPI ¶
type UnitCommandBase ¶
type UnitCommandBase struct { // PlacementSpec is the raw string command arg value used to specify placement directives. PlacementSpec string // Placement is the result of parsing the PlacementSpec arg value. Placement []*instance.Placement NumUnits int }
UnitCommandBase provides support for commands which deploy units. It handles the parsing and validation of --to and --num-units arguments.
func (*UnitCommandBase) Init ¶
func (c *UnitCommandBase) Init(args []string) error
func (*UnitCommandBase) SetFlags ¶
func (c *UnitCommandBase) SetFlags(f *gnuflag.FlagSet)