Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAddCommand

func NewAddCommand() cmd.Command

    NewAddCommand returns a command used to add an existing subnet to Juju.

    func NewCreateCommand

    func NewCreateCommand() cmd.Command

      NewCreateCommand returns a command to create a new subnet.

      func NewListCommand

      func NewListCommand() cmd.Command

        NewListCommand returns a cammin used to list all subnets known to Juju.

        func NewRemoveCommand

        func NewRemoveCommand() cmd.Command

          NewRemoveCommand returns a command used to remove an unused subnet from Juju.

          Types

          type RunOnAPI

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

          type SubnetAPI

          type SubnetAPI interface {
          	io.Closer
          
          	// AddSubnet adds an existing subnet to Juju.
          	AddSubnet(cidr names.SubnetTag, id network.Id, spaceTag names.SpaceTag, zones []string) error
          
          	// ListSubnets returns information about subnets known to Juju,
          	// optionally filtered by space and/or zone (both can be empty).
          	ListSubnets(withSpace *names.SpaceTag, withZone string) ([]params.Subnet, error)
          
          	// AllZones returns all availability zones known to Juju.
          	AllZones() ([]string, error)
          
          	// AllSpaces returns all Juju network spaces.
          	AllSpaces() ([]names.Tag, error)
          
          	// CreateSubnet creates a new Juju subnet.
          	CreateSubnet(subnetCIDR names.SubnetTag, spaceTag names.SpaceTag, zones []string, isPublic bool) error
          
          	// RemoveSubnet marks an existing subnet as no longer used, which
          	// will cause it to get removed at some point after all its
          	// related entites are cleaned up. It will fail if the subnet is
          	// still in use by any machines.
          	RemoveSubnet(subnetCIDR names.SubnetTag) error
          }

            SubnetAPI defines the necessary API methods needed by the subnet subcommands.

            type SubnetCommandBase

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

              SubnetCommandBase is the base type embedded into all subnet subcommands.

              func (*SubnetCommandBase) CheckNumArgs

              func (s *SubnetCommandBase) CheckNumArgs(args []string, errors []error) error

                CheckNumArgs is a helper used to validate the number of arguments passed to Init(). If the number of arguments is X, errors[X] (if set) will be returned, otherwise no error occurs.

                func (*SubnetCommandBase) NewAPI

                func (c *SubnetCommandBase) NewAPI() (SubnetAPI, error)

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

                  func (*SubnetCommandBase) RunWithAPI

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

                  func (*SubnetCommandBase) ValidateCIDR

                  func (s *SubnetCommandBase) ValidateCIDR(given string, strict bool) (names.SubnetTag, error)

                    ValidateCIDR parses given and returns an error if it's not valid. If the CIDR is incorrectly specified (e.g. 10.10.10.0/16 instead of 10.10.0.0/16) and strict is false, the correctly parsed CIDR in the expected format is returned instead without an error. Otherwise, when strict is true and given is incorrectly formatted, an error will be returned.

                    func (*SubnetCommandBase) ValidateSpace

                    func (s *SubnetCommandBase) ValidateSpace(given string) (names.SpaceTag, error)

                      ValidateSpace parses given and returns an error if it's not a valid space name, otherwise returns the parsed tag and no error.