juju: github.com/juju/juju/cmd/juju/space Index | Files

package space

import "github.com/juju/juju/cmd/juju/space"

Index

Package Files

add.go list.go reload.go remove.go rename.go space.go update.go

Constants

const ReloadCommandDoc = `
Reloades spaces and subnets from substrate
`

func CheckCIDRs Uses

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 Uses

func CheckName(name string) (string, error)

CheckName checks whether name is a valid space name.

func NewAddCommand Uses

func NewAddCommand() modelcmd.ModelCommand

NewAddCommand returns a command used to add a network space.

func NewListCommand Uses

func NewListCommand() modelcmd.ModelCommand

NewListCommand returns a command used to list spaces.

func NewReloadCommand Uses

func NewReloadCommand() modelcmd.ModelCommand

NewListCommand returns a command used to list spaces.

func NewRemoveCommand Uses

func NewRemoveCommand() modelcmd.ModelCommand

NewRemoveCommand returns a command used to remove a space.

func NewRenameCommand Uses

func NewRenameCommand() modelcmd.ModelCommand

NewRenameCommand returns a command used to rename an existing space.

func NewUpdateCommand Uses

func NewUpdateCommand() modelcmd.ModelCommand

NewUpdateCommand returns a command used to update subnets in a space.

func ParseNameAndCIDRs Uses

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).

type AddCommand Uses

type AddCommand struct {
    SpaceCommandBase
    Name  string
    CIDRs set.Strings
}

AddCommand calls the API to add a new network space.

func (*AddCommand) Info Uses

func (c *AddCommand) Info() *cmd.Info

Info is defined on the cmd.Command interface.

func (*AddCommand) Init Uses

func (c *AddCommand) Init(args []string) error

Init is defined on the cmd.Command interface. It checks the arguments for sanity and sets up the command to run.

func (*AddCommand) Run Uses

func (c *AddCommand) Run(ctx *cmd.Context) error

Run implements Command.Run.

type ListCommand Uses

type ListCommand struct {
    SpaceCommandBase
    Short bool
    // contains filtered or unexported fields
}

listCommand displays a list of all spaces known to Juju.

func (*ListCommand) Info Uses

func (c *ListCommand) Info() *cmd.Info

Info is defined on the cmd.Command interface.

func (*ListCommand) Init Uses

func (c *ListCommand) Init(args []string) error

Init is defined on the cmd.Command interface. It checks the arguments for sanity and sets up the command to run.

func (*ListCommand) Run Uses

func (c *ListCommand) Run(ctx *cmd.Context) error

Run implements Command.Run.

func (*ListCommand) SetFlags Uses

func (c *ListCommand) SetFlags(f *gnuflag.FlagSet)

SetFlags is defined on the cmd.Command interface.

type ReloadCommand Uses

type ReloadCommand struct {
    SpaceCommandBase
}

listCommand displays a list of all spaces known to Juju.

func (*ReloadCommand) Info Uses

func (c *ReloadCommand) Info() *cmd.Info

Info is defined on the cmd.Command interface.

func (*ReloadCommand) Run Uses

func (c *ReloadCommand) Run(ctx *cmd.Context) error

Run implements Command.Run.

type RemoveCommand Uses

type RemoveCommand struct {
    SpaceCommandBase
    // contains filtered or unexported fields
}

RemoveCommand calls the API to remove an existing network space.

func (*RemoveCommand) Info Uses

func (c *RemoveCommand) Info() *cmd.Info

Info is defined on the cmd.Command interface.

func (*RemoveCommand) Init Uses

func (c *RemoveCommand) Init(args []string) (err error)

Init is defined on the cmd.Command interface. It checks the arguments for sanity and sets up the command to run.

func (*RemoveCommand) Run Uses

func (c *RemoveCommand) Run(ctx *cmd.Context) error

Run implements Command.Run.

type RenameCommand Uses

type RenameCommand struct {
    SpaceCommandBase
    Name    string
    NewName string
}

RenameCommand calls the API to rename an existing network space.

func (*RenameCommand) Info Uses

func (c *RenameCommand) Info() *cmd.Info

Info is defined on the cmd.Command interface.

func (*RenameCommand) Init Uses

func (c *RenameCommand) Init(args []string) (err error)

Init is defined on the cmd.Command interface. It checks the arguments for sanity and sets up the command to run.

func (*RenameCommand) Run Uses

func (c *RenameCommand) Run(ctx *cmd.Context) error

Run implements Command.Run.

func (*RenameCommand) SetFlags Uses

func (c *RenameCommand) SetFlags(f *gnuflag.FlagSet)

type RunOnAPI Uses

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

type SpaceAPI Uses

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

    // ReloadSpaces fetches spaces and subnets from substrate
    ReloadSpaces() error
}

SpaceAPI defines the necessary API methods needed by the space subcommands.

type SpaceCommandBase Uses

type SpaceCommandBase struct {
    modelcmd.ModelCommandBase
    modelcmd.IAASOnlyCommand
    // contains filtered or unexported fields
}

SpaceCommandBase is the base type embedded into all space subcommands.

func (*SpaceCommandBase) NewAPI Uses

func (c *SpaceCommandBase) NewAPI() (SpaceAPI, error)

NewAPI returns a SpaceAPI for the root api endpoint that the environment command returns.

func (*SpaceCommandBase) RunWithAPI Uses

func (c *SpaceCommandBase) RunWithAPI(ctx *cmd.Context, toRun RunOnAPI) error

type UpdateCommand Uses

type UpdateCommand struct {
    SpaceCommandBase
    Name  string
    CIDRs set.Strings
}

UpdateCommand calls the API to update an existing network space.

func (*UpdateCommand) Info Uses

func (c *UpdateCommand) Info() *cmd.Info

Info is defined on the cmd.Command interface.

func (*UpdateCommand) Init Uses

func (c *UpdateCommand) Init(args []string) error

Init is defined on the cmd.Command interface. It checks the arguments for sanity and sets up the command to run.

func (*UpdateCommand) Run Uses

func (c *UpdateCommand) Run(ctx *cmd.Context) error

Run implements Command.Run.

Package space imports 21 packages (graph) and is imported by 27 packages. Updated 2019-10-13. Refresh now. Tools for package owners.