juju: github.com/juju/juju/apiserver/facades/client/spaces Index | Files

package spaces

import "github.com/juju/juju/apiserver/facades/client/spaces"

Index

Package Files

move.go opfactory.go remove.go rename.go shims.go spaces.go

func NewMoveSubnetsOp Uses

func NewMoveSubnetsOp(space networkingcommon.BackingSpace, subnets []MovingSubnet) *moveSubnetsOp

NewMoveSubnetOp returns an operation reference that can be used to move the the input subnets into the input space.

func NewRemoveSpaceOp Uses

func NewRemoveSpaceOp(space RemoveSpace, subnets []Subnet) *spaceRemoveModelOp

func NewRenameSpaceOp Uses

func NewRenameSpaceOp(
    isController bool, settings Settings, st RenameSpaceState, space RenameSpace, toName string,
) *spaceRenameModelOp

func NewStateShim Uses

func NewStateShim(st *state.State) (*stateShim, error)

NewStateShim returns a new state shim.

type API Uses

type API struct {
    // contains filtered or unexported fields
}

API provides the spaces API facade for version 6.

func NewAPI Uses

func NewAPI(st *state.State, res facade.Resources, auth facade.Authorizer) (*API, error)

NewAPI creates a new Space API server-side facade with a state.State backing.

func (*API) CreateSpaces Uses

func (api *API) CreateSpaces(args params.CreateSpacesParams) (results params.ErrorResults, err error)

CreateSpaces creates a new Juju network space, associating the specified subnets with it (optional; can be empty).

func (*API) ListSpaces Uses

func (api *API) ListSpaces() (results params.ListSpacesResults, err error)

ListSpaces lists all the available spaces and their associated subnets.

func (*API) MoveSubnets Uses

func (api *API) MoveSubnets(args params.MoveSubnetsParams) (params.MoveSubnetsResults, error)

MoveSubnets ensures that the input subnets are in the input space.

func (*API) ReloadSpaces Uses

func (api *API) ReloadSpaces() error

ReloadSpaces refreshes spaces from substrate

func (*API) RemoveSpace Uses

func (api *API) RemoveSpace(spaceParams params.RemoveSpaceParams) (params.RemoveSpaceResults, error)

RemoveSpace removes a space. Returns SpaceResults if entities/settings are found which makes the deletion not possible.

func (*API) RenameSpace Uses

func (api *API) RenameSpace(args params.RenameSpacesParams) (params.ErrorResults, error)

RenameSpace renames a space.

func (*API) ShowSpace Uses

func (api *API) ShowSpace(entities params.Entities) (params.ShowSpaceResults, error)

ListSpaces lists all the available spaces and their associated subnets.

type APIv2 Uses

type APIv2 struct {
    *APIv3
}

APIv2 provides the spaces API facade for versions < 3.

func NewAPIv2 Uses

func NewAPIv2(st *state.State, res facade.Resources, auth facade.Authorizer) (*APIv2, error)

NewAPIv2 is a wrapper that creates a V2 spaces API.

func (*APIv2) ReloadSpaces Uses

func (u *APIv2) ReloadSpaces(_, _ struct{})

ReloadSpaces is not available via the V2 API.

type APIv3 Uses

type APIv3 struct {
    *APIv4
}

APIv3 provides the spaces API facade for version 3.

func NewAPIv3 Uses

func NewAPIv3(st *state.State, res facade.Resources, auth facade.Authorizer) (*APIv3, error)

NewAPIv3 is a wrapper that creates a V3 spaces API.

type APIv4 Uses

type APIv4 struct {
    *APIv5
}

APIv4 provides the spaces API facade for version 4.

func NewAPIv4 Uses

func NewAPIv4(st *state.State, res facade.Resources, auth facade.Authorizer) (*APIv4, error)

NewAPIv4 is a wrapper that creates a V4 spaces API.

func (*APIv4) CreateSpaces Uses

func (api *APIv4) CreateSpaces(args params.CreateSpacesParamsV4) (params.ErrorResults, error)

CreateSpaces creates a new Juju network space, associating the specified subnets with it (optional; can be empty).

type APIv5 Uses

type APIv5 struct {
    *API
}

APIv5 provides the spaces API facade for version 5.

func NewAPIv5 Uses

func NewAPIv5(st *state.State, res facade.Resources, auth facade.Authorizer) (*APIv5, error)

NewAPIv4 is a wrapper that creates a V4 spaces API.

func (*APIv5) ShowSpace Uses

func (api *APIv5) ShowSpace(_, _ struct{})

type Address Uses

type Address interface {
    SubnetCIDR() string
}

Address is an indirection for state.Address.

type ApplicationEndpointBindingsShim Uses

type ApplicationEndpointBindingsShim struct {
    AppName  string
    Bindings map[string]string
}

ApplicationEndpointBindingsShim is a shim interface for stateless access to ApplicationEndpointBindings

type Backing Uses

type Backing interface {
    environs.EnvironConfigGetter

    // ModelTag returns the tag of this model.
    ModelTag() names.ModelTag

    // SubnetByCIDR returns a unique subnet based on the input CIDR.
    SubnetByCIDR(cidr string) (networkingcommon.BackingSubnet, error)

    // MovingSubnet returns the subnet for the input ID,
    // suitable for moving to a new space.
    MovingSubnet(id string) (MovingSubnet, error)

    // AddSpace creates a space.
    AddSpace(Name string, ProviderId network.Id, Subnets []string, Public bool) error

    // AllSpaces returns all known Juju network spaces.
    AllSpaces() ([]networkingcommon.BackingSpace, error)

    // SpaceByName returns the Juju network space given by name.
    SpaceByName(name string) (networkingcommon.BackingSpace, error)

    // AllEndpointBindings loads all endpointBindings.
    AllEndpointBindings() ([]ApplicationEndpointBindingsShim, error)

    // AllMachines loads all machines.
    AllMachines() ([]Machine, error)

    // ApplyOperation applies a given ModelOperation to the model.
    ApplyOperation(state.ModelOperation) error

    // ControllerConfig returns the controller config.
    ControllerConfig() (jujucontroller.Config, error)

    // AllConstraints returns all constraints in the model.
    AllConstraints() ([]Constraints, error)

    // ConstraintsBySpaceName returns constraints found by spaceName.
    ConstraintsBySpaceName(name string) ([]Constraints, error)

    // SaveProviderSpaces loads providerSpaces into state.
    SaveProviderSpaces([]network.SpaceInfo) error

    // SaveProviderSubnets loads subnets into state.
    SaveProviderSubnets([]network.SubnetInfo, string) error

    // IsController returns true if this state instance has the bootstrap
    // model UUID.
    IsController() bool
}

Backend contains the state methods used in this package.

type BlockChecker Uses

type BlockChecker interface {
    ChangeAllowed() error
    RemoveAllowed() error
}

BlockChecker defines the block-checking functionality required by the spaces facade. This is implemented by apiserver/common.BlockChecker.

type Constraints Uses

type Constraints interface {
    ID() string
    Value() constraints.Value
    ChangeSpaceNameOps(from, to string) []txn.Op
}

Constraints defines the methods supported by constraints used in the space context.

type Machine Uses

type Machine interface {
    ApplicationNames() ([]string, error)
    AllAddresses() ([]Address, error)
    AllSpaces() (set.Strings, error)
}

Machine defines the methods supported by a machine used in the space context.

type MoveSubnetsOp Uses

type MoveSubnetsOp interface {
    state.ModelOperation

    // GetMovedSubnets returns the information for subnets that were
    // successfully moved as a result of applying this operation.
    GetMovedSubnets() []MovedSubnet
}

MoveSubnetsOp describes a model operation for moving subnets to a new space.

type MovedSubnet Uses

type MovedSubnet struct {
    ID        string
    FromSpace string
    CIDR      string
}

MovedSubnet identifies a subnet and the space it was move from.

type MovingSubnet Uses

type MovingSubnet interface {
    ID() string
    CIDR() string
    SpaceName() string
    SpaceID() string
    FanLocalUnderlay() string

    UpdateSpaceOps(spaceID string) []txn.Op
    Refresh() error
}

MovingSubnet describes a subnet that is to be relocated to a new space.

type OpFactory Uses

type OpFactory interface {
    // NewRemoveSpaceOp returns an operation for removing a space.
    NewRemoveSpaceOp(fromName string) (state.ModelOperation, error)

    // NewRenameSpaceOp returns an operation for renaming a space.
    NewRenameSpaceOp(spaceName, toName string) (state.ModelOperation, error)

    // NewMoveSubnetsOp returns an operation for updating a space with new CIDRs.
    NewMoveSubnetsOp(spaceID string, subnets []MovingSubnet) (MoveSubnetsOp, error)
}

OpFactory describes a source of model operations required by the spaces API.

type RemoveSpace Uses

type RemoveSpace interface {
    Refresh() error
    RemoveSpaceOps() []txn.Op
}

RemoveSpace describes a space that can be removed.

type RenameSpace Uses

type RenameSpace interface {
    Refresh() error
    Id() string
    Name() string
    RenameSpaceOps(toName string) []txn.Op
}

RenameSpace describes a space that can be renamed.

type RenameSpaceState Uses

type RenameSpaceState interface {
    // ControllerConfig returns current ControllerConfig.
    ControllerConfig() (controller.Config, error)

    // ConstraintsBySpaceName returns all the constraints
    // that refer to the input space name.
    ConstraintsBySpaceName(spaceName string) ([]Constraints, error)
}

RenameSpaceState describes state operations required to execute the renameSpace operation.

type Settings Uses

type Settings interface {
    DeltaOps(key string, delta settings.ItemChanges) ([]txn.Op, error)
}

Settings describes methods for interacting with settings to apply space-based configuration deltas.

type Subnet Uses

type Subnet interface {
    UpdateSpaceOps(spaceID string) []txn.Op
}

Package spaces imports 21 packages (graph) and is imported by 4 packages. Updated 2020-04-01. Refresh now. Tools for package owners.