Documentation ¶
Index ¶
- func CheckCIDRs(args []string, cidrsOptional bool) (set.Strings, error)
- func CheckName(name string) (string, error)
- func NewAddCommand() cmd.Command
- func NewListCommand() cmd.Command
- func NewRemoveCommand() cmd.Command
- func NewRenameCommand() cmd.Command
- func NewUpdateCommand() 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 NewAddCommand ¶
NewAddCommand returns a command used to add a network space.
func NewListCommand ¶
NewListCommand returns a command used to list spaces.
func NewRemoveCommand ¶
NewRemoveCommand returns a command used to remove a space.
func NewRenameCommand ¶
NewRenameCommand returns a command used to rename an existing space.
func NewUpdateCommand ¶
NewUpdateCommand returns a command used to update subnets in a space.
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) // AddSpace adds 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. AddSpace(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.
func (*SpaceCommandBase) RunWithAPI ¶
func (c *SpaceCommandBase) RunWithAPI(ctx *cmd.Context, toRun RunOnAPI) error