Documentation ¶
Index ¶
- func BuiltInProviders() map[string]cloud.Cloud
- func CloudOrProvider(cloudName string, cloudByNameFunc func(string) (*cloud.Cloud, error)) (cloud *cloud.Cloud, err error)
- func ConformYAML(input interface{}) (interface{}, error)
- func FormatTime(t *time.Time, formatISO bool) string
- func GUIDataSourceBaseURL() string
- func LastConnection(connectionTime *time.Time, now time.Time, exact bool) string
- func ModelUserInfoFromParams(users []params.ModelUserInfo, now time.Time) map[string]ModelUserInfo
- func SortStringsNaturally(s []string) []string
- func UserFriendlyDuration(when, now time.Time) string
- type CmdBlockHelper
- type ConfigFlag
- type ModelInfo
- type ModelStatus
- type ModelUserInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuiltInProviders ¶
BuiltInProviders returns cloud information for those providers which are built in to Juju.
func CloudOrProvider ¶
func CloudOrProvider(cloudName string, cloudByNameFunc func(string) (*cloud.Cloud, error)) (cloud *cloud.Cloud, err error)
CloudOrProvider finds and returns cloud or provider.
func ConformYAML ¶
func ConformYAML(input interface{}) (interface{}, error)
ConformYAML ensures all keys of any nested maps are strings. This is necessary because YAML unmarshals map[interface{}]interface{} in nested maps, which cannot be serialized by bson. Also, handle []interface{}. cf. gopkg.in/juju/charm.v4/actions.go cleanse
func FormatTime ¶
FormatTime returns a string with the local time formatted in an arbitrary format used for status or and localized tz or in UTC timezone and format RFC3339 if u is specified.
func GUIDataSourceBaseURL ¶
func GUIDataSourceBaseURL() string
GUIDataSourceBaseURL returns the default base URL to use for the Juju GUI simplestreams data source. The default value can be overridden by setting the JUJU_GUI_SIMPLESTREAMS_URL environment variable.
func LastConnection ¶
LastConnection turns the *time.Time returned from the API server into a user facing string with either exact time or a user friendly string based on the args.
func ModelUserInfoFromParams ¶
func ModelUserInfoFromParams(users []params.ModelUserInfo, now time.Time) map[string]ModelUserInfo
ModelUserInfoFromParams translates []params.ModelInfo to a map of user names to ModelUserInfo.
func SortStringsNaturally ¶
SortStringsNaturally sorts strings according to their natural sort order.
func UserFriendlyDuration ¶
UserFriendlyDuration translates a time in the past into a user friendly string representation relative to the "now" time argument.
Types ¶
type CmdBlockHelper ¶
type CmdBlockHelper struct {
// contains filtered or unexported fields
}
CmdBlockHelper is a helper struct used to block commands.
func NewCmdBlockHelper ¶
func NewCmdBlockHelper(st api.Connection) CmdBlockHelper
NewCmdBlockHelper creates a block switch used in testing to manage desired juju blocks.
func (*CmdBlockHelper) AssertBlocked ¶
func (s *CmdBlockHelper) AssertBlocked(c *gc.C, err error, msg string)
func (*CmdBlockHelper) BlockAllChanges ¶
func (s *CmdBlockHelper) BlockAllChanges(c *gc.C, msg string)
BlockAllChanges switches changes block on. This prevents all changes to juju environment.
func (*CmdBlockHelper) BlockDestroyModel ¶
func (s *CmdBlockHelper) BlockDestroyModel(c *gc.C, msg string)
BlockDestroyModel switches destroy block on. This prevents juju environment destruction.
func (*CmdBlockHelper) BlockRemoveObject ¶
func (s *CmdBlockHelper) BlockRemoveObject(c *gc.C, msg string)
BlockRemoveObject switches remove block on. This prevents any object/entity removal on juju environment
func (*CmdBlockHelper) Close ¶
func (s *CmdBlockHelper) Close()
type ConfigFlag ¶
type ConfigFlag struct {
// contains filtered or unexported fields
}
ConfigFlag records k=v attributes from command arguments and/or specified files containing key values.
func (*ConfigFlag) ReadAttrs ¶
func (f *ConfigFlag) ReadAttrs(ctx *cmd.Context) (map[string]interface{}, error)
ReadAttrs reads attributes from the specified files, and then overlays the results with the k=v attributes.
func (*ConfigFlag) String ¶
func (f *ConfigFlag) String() string
String implements gnuflag.Value.String.
type ModelInfo ¶
type ModelInfo struct { Name string `json:"name" yaml:"name"` UUID string `json:"model-uuid" yaml:"model-uuid"` ControllerUUID string `json:"controller-uuid" yaml:"controller-uuid"` Owner string `json:"owner" yaml:"owner"` ProviderType string `json:"type" yaml:"type"` Life string `json:"life" yaml:"life"` Status ModelStatus `json:"status" yaml:"status"` Users map[string]ModelUserInfo `json:"users" yaml:"users"` }
ModelInfo contains information about a model.
type ModelStatus ¶
type ModelStatus struct { Current status.Status `json:"current" yaml:"current"` Message string `json:"message,omitempty" yaml:"message,omitempty"` Since string `json:"since,omitempty" yaml:"since,omitempty"` }
ModelStatus contains the current status of a model.
type ModelUserInfo ¶
type ModelUserInfo struct { DisplayName string `yaml:"display-name,omitempty" json:"display-name,omitempty"` Access string `yaml:"access" json:"access"` LastConnection string `yaml:"last-connection" json:"last-connection"` }
ModelUserInfo defines the serialization behaviour of the model user information.