Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckCIDRs

func CheckCIDRs(args []string, cidrsOptional bool) (set.Strings, error)

    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

    func CheckName(name string) (string, error)

      CheckName checks whether name is a valid space name.

      func NewAddCommand

      func NewAddCommand() cmd.Command

        NewAddCommand returns a command used to add a network space.

        func NewListCommand

        func NewListCommand() cmd.Command

          NewListCommand returns a command used to list spaces.

          func NewRemoveCommand

          func NewRemoveCommand() cmd.Command

            NewRemoveCommand returns a command used to remove a space.

            func NewRenameCommand

            func NewRenameCommand() cmd.Command

              NewRenameCommand returns a command used to rename an existing space.

              func NewUpdateCommand

              func NewUpdateCommand() cmd.Command

                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 RunOnAPI

                  type RunOnAPI func(api SpaceAPI, ctx *cmd.Context) error

                  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