space

package
v0.0.0-...-0000000 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 11, 2016 License: AGPL-3.0 Imports: 16 Imported by: 0

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 NewSuperCommand

func NewSuperCommand() cmd.Command

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

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

func (*SpaceCommandBase) RunWithAPI

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

Source Files

  • create.go
  • list.go
  • remove.go
  • rename.go
  • space.go
  • update.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址