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

integrity.go interface.go move.go opfactory.go reload.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)

ShowSpace shows the spaces for a set of given entities.

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)

NewAPIv5 is a wrapper that creates a V5 spaces API.

func (*APIv5) ShowSpace Uses

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

type Address Uses

type Address interface {
    SubnetCIDR() string
    ConfigMethod() network.AddressConfigMethod
    Value() string
}

Address is an indirection for state.Address.

type AuthorizerState Uses

type AuthorizerState interface {
    // ModelTag returns the tag of this model.
    ModelTag() names.ModelTag
}

AuthorizerState contains the methods used from state to authorize API requests.

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) (networkingcommon.BackingSpace, error)

    // AllSpaces returns all known Juju network spaces.
    // TODO (manadart 2020-04-14): This should be removed in favour of
    // AllSpaceInfos below, reducing the reliance on networkingcommon.
    AllSpaces() ([]networkingcommon.BackingSpace, error)

    // AllSpaceInfos returns SpaceInfos for all spaces in the model.
    AllSpaceInfos() (network.SpaceInfos, error)

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

    // AllEndpointBindings loads all endpointBindings.
    AllEndpointBindings() (map[string]Bindings, 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() (controller.Config, error)

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

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

    // IsController returns true if this state instance
    // is for the controller model.
    IsController() bool
}

Backing describes the state methods used in this package.

type Bindings Uses

type Bindings interface {
    // Map returns the space IDs for each bound endpoint.
    Map() map[string]string
}

Bindings describes a collection of endpoint bindings for an application.

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 EnvironSpaces Uses

type EnvironSpaces interface {
    // ReloadSpaces loads spaces and subnets from provider specified by environ
    // into state.
    // Currently it's an append-only operation, no spaces/subnets are deleted.
    ReloadSpaces(context.ProviderCallContext, ReloadSpacesState, environs.BootstrapEnviron) error
}

EnvironSpaces defines methods for handling spaces within a environ setting.

type EnvironSpacesAdapter Uses

type EnvironSpacesAdapter struct{}

EnvironSpacesAdapter allows the calling of ReloadSpaces from a type level, instead of a package level construct.

func (EnvironSpacesAdapter) ReloadSpaces Uses

func (EnvironSpacesAdapter) ReloadSpaces(ctx context.ProviderCallContext, st ReloadSpacesState, env environs.BootstrapEnviron) error

ReloadSpaces loads spaces and subnets from provider specified by environ into state. Currently it's an append-only operation, no spaces/subnets are deleted.

type Machine Uses

type Machine interface {
    AllAddresses() ([]Address, error)
    Units() ([]Unit, 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 ReloadSpaces Uses

type ReloadSpaces interface {
    // ReloadSpaces refreshes spaces from the substrate.
    ReloadSpaces() error
}

ReloadSpaces offers a version 1 of the ReloadSpacesAPI.

type ReloadSpacesAPI Uses

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

ReloadSpacesAPI provides the reload spaces API facade for version.

func NewReloadSpacesAPI Uses

func NewReloadSpacesAPI(state ReloadSpacesState,
    environs ReloadSpacesEnviron,
    spaces EnvironSpaces,
    context context.ProviderCallContext,
    authorizer ReloadSpacesAuthorizer,
) *ReloadSpacesAPI

NewReloadSpacesAPI creates a new ReloadSpacesAPI.

func (*ReloadSpacesAPI) ReloadSpaces Uses

func (api *ReloadSpacesAPI) ReloadSpaces() error

ReloadSpaces refreshes spaces from the substrate.

type ReloadSpacesAuthorizer Uses

type ReloadSpacesAuthorizer func() error

ReloadSpacesAuthorizer represents a way to authorize reload spaces.

func DefaultReloadSpacesAuthorizer Uses

func DefaultReloadSpacesAuthorizer(auth facade.Authorizer,
    check BlockChecker,
    state AuthorizerState,
) ReloadSpacesAuthorizer

DefaultReloadSpacesAuthorizer creates a new ReloadSpacesAuthorizer for handling reload spaces.

type ReloadSpacesEnviron Uses

type ReloadSpacesEnviron interface {
    environs.EnvironConfigGetter

    // GetEnviron returns the environs.Environ ("provider") associated
    // with the model.
    GetEnviron(environs.EnvironConfigGetter, environs.NewEnvironFunc) (environs.Environ, error)
}

ReloadSpacesEnviron contains the methods for requesting environ data.

type ReloadSpacesEnvirons Uses

type ReloadSpacesEnvirons struct {
    stateenvirons.EnvironConfigGetter
}

ReloadSpacesEnvirons returns a reload spaces environs type.

func DefaultReloadSpacesEnvirons Uses

func DefaultReloadSpacesEnvirons(st *state.State) (ReloadSpacesEnvirons, error)

DefaultReloadSpacesEnvirons creates a new ReloadSpacesEnviron from state.

func (ReloadSpacesEnvirons) GetEnviron Uses

func (ReloadSpacesEnvirons) GetEnviron(st environs.EnvironConfigGetter, fn environs.NewEnvironFunc) (environs.Environ, error)

GetEnviron returns the environs.Environ ("provider") associated with the model.

type ReloadSpacesState Uses

type ReloadSpacesState interface {
    space.ReloadSpacesState
}

ReloadSpacesState contains all the methods required to execute the 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
}

type Unit Uses

type Unit interface {
    Name() string
    ApplicationName() string
}

Unit is an indirection for state.Unit.

Package spaces imports 22 packages (graph) and is imported by 4 packages. Updated 2020-08-10. Refresh now. Tools for package owners.