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

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

func NewRemoveSpaceModelOp Uses

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

func NewRenameSpaceModelOp Uses

func NewRenameSpaceModelOp(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) ReloadSpaces Uses

func (api *API) ReloadSpaces() error

RefreshSpaces refreshes spaces from substrate

func (*API) RemoveSpace Uses

func (api *API) RemoveSpace(entities params.Entities) (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 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 subnet based on the input CIDR.
    SubnetByCIDR(cidr string) (networkingcommon.BackingSubnet, 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)

    // ReloadSpaces loads spaces from backing environ.
    ReloadSpaces(environ environs.BootstrapEnviron) 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)

    // ConstraintsBySpaceName  Returns constraints found by spaceName.
    ConstraintsBySpaceName(name string) ([]Constraints, 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
}

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

type Machine Uses

type Machine interface {
    AllSpaces() (set.Strings, error)
}

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

type OpFactory Uses

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

    // NewRenameSpaceModelOp returns an operation for renaming a space.
    NewRenameSpaceModelOp(fromName, toName string) (state.ModelOperation, 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() (jujucontroller.Config, error)

    // ConstraintsOpsForSpaceNameChange returns all the database transaction operation required
    // to transform a constraints spaces from `a` to `b`
    ConstraintsOpsForSpaceNameChange(spaceName, toName string) ([]txn.Op, error)
}

RenameSpaceState describes state operations required to execute the renameSpace operation. * This allows us to indirect state at the operation level instead of the * whole API level as currently done in interface.go

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 {
    MoveSubnetOps(spaceID string) []txn.Op
}

Package spaces imports 19 packages (graph) and is imported by 4 packages. Updated 2020-02-18. Refresh now. Tools for package owners.