Documentation ¶
Index ¶
- func CheckFile(name, path string, fs modelcmd.Filesystem) error
- func CombinedConfig(ctx *cmd.Context, filesystem modelcmd.Filesystem, configOptions configFlag, ...) (string, error)
- func GetFlags(flagSet *gnuflag.FlagSet, flagNames []string) []string
- func GetMetaResources(charmURL string, client CharmClient) (map[string]charmresource.Meta, error)
- func GetUpgradeResources(newCharmID application.CharmID, repositoryResourceLister CharmClient, ...) (map[string]charmresource.Meta, error)
- func IsTerminal(w io.Writer) bool
- func MakeOrigin(schema charm.Schema, revision int, channel charm.Channel, ...) (commoncharm.Origin, error)
- func MakePlatform(cons constraints.Value, base corebase.Base, modelCons constraints.Value) corecharm.Platform
- func ParsePlacement(spec string) (*instance.Placement, error)
- func ProcessConfig(ctx *cmd.Context, filesystem modelcmd.Filesystem, configOptions configFlag, ...) (map[string]string, string, error)
- func ReadValue(ctx *cmd.Context, filesystem modelcmd.Filesystem, filename string) (string, error)
- type CharmClient
- type ResourceLister
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CombinedConfig ¶
func CombinedConfig(ctx *cmd.Context, filesystem modelcmd.Filesystem, configOptions configFlag, appName string) (string, error)
CombinedConfig takes the config key/value pairs and config.yaml file and combines into a yaml string. The key/value pairs representing charm settings overrides anything in the YAML file. If more than one file is specified, that is an error.
func GetFlags ¶
GetFlags returns the flags with the given names. Only flags that are set and whose name is included in flagNames are included.
func GetMetaResources ¶
func GetMetaResources(charmURL string, client CharmClient) (map[string]charmresource.Meta, error)
GetMetaResources retrieves metadata resources for the given charmURL.
func GetUpgradeResources ¶
func GetUpgradeResources( newCharmID application.CharmID, repositoryResourceLister CharmClient, resourceLister ResourceLister, applicationID string, providedResources map[string]string, meta map[string]charmresource.Meta, ) (map[string]charmresource.Meta, error)
GetUpgradeResources returns a map of resources which require refresh.
func IsTerminal ¶
IsTerminal checks if the file descriptor is a terminal.
func MakeOrigin ¶
func MakeOrigin(schema charm.Schema, revision int, channel charm.Channel, platform corecharm.Platform) (commoncharm.Origin, error)
MakeOrigin creates an origin from a schema, revision, channel and a platform. Depending on what the schema is, will then construct the correct origin for that application.
func MakePlatform ¶
func MakePlatform(cons constraints.Value, base corebase.Base, modelCons constraints.Value) corecharm.Platform
MakePlatform creates a Platform (architecture, os and base) from a set of constraints and a base.
func ParsePlacement ¶
ParsePlacement validates provided placement of a unit and returns instance.Placement.
func ProcessConfig ¶
func ProcessConfig(ctx *cmd.Context, filesystem modelcmd.Filesystem, configOptions configFlag, trust *bool) (map[string]string, string, error)
ProcessConfig processes the config defined by the config flag and returns the map of config values and any YAML file content. We may have a single file arg specified, in which case it points to a YAML file keyed on the charm name and containing values for any charm settings. We may also have key/value pairs representing charm settings which overrides anything in the YAML file. If more than one file is specified, that is an error.
Types ¶
type CharmClient ¶
type CharmClient interface { CharmInfo(string) (*charms.CharmInfo, error) ListCharmResources(curl string, origin apicharm.Origin) ([]charmresource.Resource, error) }
CharmClient defines a subset of the charms facade, as required by the upgrade-charm command and to GetMetaResources.
type ResourceLister ¶
type ResourceLister interface {
ListResources([]string) ([]resources.ApplicationResources, error)
}
ResourceLister defines a subset of the resources facade, as required by the upgrade-charm command and to deploy bundles.