Documentation
¶
Index ¶
- func CheckCIDRs(args []string, cidrsOptional bool) (set.Strings, error)
- func CheckName(name string) (string, error)
- func NewSuperCommand() cmd.Command
- func ParseNameAndCIDRs(args []string, cidrsOptional bool) (name string, CIDRs set.Strings, err error)
- type RunOnAPI
- type SpaceAPI
- type SpaceCommandBase
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckCIDRs ¶
CheckCIDRs parses the list of strings as CIDRs, checking for correct formatting, no duplication and no overlaps. Returns error if no CIDRs are provided, unless cidrsOptional is true.
func CheckName ¶
CheckName checks whether name is a valid space name.
func NewSuperCommand ¶
NewSuperCommand creates the "space" supercommand and registers the subcommands that it supports.
func ParseNameAndCIDRs ¶
func ParseNameAndCIDRs(args []string, cidrsOptional bool) ( name string, CIDRs set.Strings, err error, )
ParseNameAndCIDRs verifies the input args and returns any errors, like missing/invalid name or CIDRs (validated when given, but it's an error for CIDRs to be empty if cidrsOptional is false).
Types ¶
type SpaceAPI ¶
type SpaceAPI interface {
io.Closer
// ListSpaces returns all Juju network spaces and their subnets.
ListSpaces() ([]params.Space, error)
// CreateSpace creates a new Juju network space, associating the
// specified subnets with it (optional; can be empty), setting the
// space and subnets access to public or private.
CreateSpace(name string, subnetIds []string, public bool) error
// RemoveSpace removes an existing Juju network space, transferring
// any associated subnets to the default space.
RemoveSpace(name string) error
// UpdateSpace changes the associated subnets for an existing space with
// the given name. The list of subnets must contain at least one entry.
UpdateSpace(name string, subnetIds []string) error
// RenameSpace changes the name of the space.
RenameSpace(name, newName string) error
}
SpaceAPI defines the necessary API methods needed by the space subcommands.
type SpaceCommandBase ¶
type SpaceCommandBase struct {
modelcmd.ModelCommandBase
// contains filtered or unexported fields
}
SpaceCommandBase is the base type embedded into all space subcommands.
func (*SpaceCommandBase) NewAPI ¶
func (c *SpaceCommandBase) NewAPI() (SpaceAPI, error)
NewAPI returns a SpaceAPI for the root api endpoint that the environment command returns.
Source Files
¶
- create.go
- list.go
- remove.go
- rename.go
- space.go
- update.go