Documentation ¶
Index ¶
- func NewMoveSubnetsOp(space networkingcommon.BackingSpace, subnets []MovingSubnet) *moveSubnetsOp
- func NewRemoveSpaceOp(space RemoveSpace, subnets []Subnet) *spaceRemoveModelOp
- func NewRenameSpaceOp(isController bool, settings Settings, st RenameSpaceState, space RenameSpace, ...) *spaceRenameModelOp
- func NewStateShim(st *state.State) (*stateShim, error)
- type API
- func (api *API) CreateSpaces(args params.CreateSpacesParams) (results params.ErrorResults, err error)
- func (api *API) ListSpaces() (results params.ListSpacesResults, err error)
- func (api *API) MoveSubnets(args params.MoveSubnetsParams) (params.MoveSubnetsResults, error)
- func (api *API) ReloadSpaces() error
- func (api *API) RemoveSpace(spaceParams params.RemoveSpaceParams) (params.RemoveSpaceResults, error)
- func (api *API) RenameSpace(args params.RenameSpacesParams) (params.ErrorResults, error)
- func (api *API) ShowSpace(entities params.Entities) (params.ShowSpaceResults, error)
- type APIv2
- type APIv3
- type APIv4
- type APIv5
- type Address
- type AuthorizerState
- type Backing
- type Bindings
- type BlockChecker
- type Constraints
- type EnvironSpaces
- type EnvironSpacesAdapter
- type Machine
- type MoveSubnetsOp
- type MovedSubnet
- type MovingSubnet
- type OpFactory
- type ReloadSpaces
- type ReloadSpacesAPI
- type ReloadSpacesAuthorizer
- type ReloadSpacesEnviron
- type ReloadSpacesEnvirons
- type ReloadSpacesState
- type RemoveSpace
- type RenameSpace
- type RenameSpaceState
- type Settings
- type Subnet
- type Unit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMoveSubnetsOp ¶
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 ¶
func NewRemoveSpaceOp(space RemoveSpace, subnets []Subnet) *spaceRemoveModelOp
func NewRenameSpaceOp ¶
func NewRenameSpaceOp( isController bool, settings Settings, st RenameSpaceState, space RenameSpace, toName string, ) *spaceRenameModelOp
func NewStateShim ¶
NewStateShim returns a new state shim.
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
API provides the spaces API facade for version 6.
func (*API) CreateSpaces ¶
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 ¶
func (api *API) ListSpaces() (results params.ListSpacesResults, err error)
ListSpaces lists all the available spaces and their associated subnets.
func (*API) MoveSubnets ¶
func (api *API) MoveSubnets(args params.MoveSubnetsParams) (params.MoveSubnetsResults, error)
MoveSubnets ensures that the input subnets are in the input space.
func (*API) ReloadSpaces ¶
ReloadSpaces refreshes spaces from substrate
func (*API) RemoveSpace ¶
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 ¶
func (api *API) RenameSpace(args params.RenameSpacesParams) (params.ErrorResults, error)
RenameSpace renames a space.
type APIv2 ¶
type APIv2 struct {
*APIv3
}
APIv2 provides the spaces API facade for versions < 3.
func (*APIv2) ReloadSpaces ¶
func (u *APIv2) ReloadSpaces(_, _ struct{})
ReloadSpaces is not available via the V2 API.
type APIv4 ¶
type APIv4 struct {
*APIv5
}
APIv4 provides the spaces API facade for version 4.
func (*APIv4) CreateSpaces ¶
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 ¶
type APIv5 struct {
*API
}
APIv5 provides the spaces API facade for version 5.
type Address ¶
type Address interface { SubnetCIDR() string ConfigMethod() network.AddressConfigMethod Value() string }
Address is an indirection for state.Address.
type AuthorizerState ¶
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 ¶
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 ¶
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 ¶
BlockChecker defines the block-checking functionality required by the spaces facade. This is implemented by apiserver/common.BlockChecker.
type Constraints ¶
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 ¶
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 ¶
type EnvironSpacesAdapter struct{}
EnvironSpacesAdapter allows the calling of ReloadSpaces from a type level, instead of a package level construct.
func (EnvironSpacesAdapter) ReloadSpaces ¶
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 ¶
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 ¶
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 ¶
MovedSubnet identifies a subnet and the space it was move from.
type MovingSubnet ¶
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 ¶
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 ¶
type ReloadSpaces interface { // ReloadSpaces refreshes spaces from the substrate. ReloadSpaces() error }
ReloadSpaces offers a version 1 of the ReloadSpacesAPI.
type ReloadSpacesAPI ¶
type ReloadSpacesAPI struct {
// contains filtered or unexported fields
}
ReloadSpacesAPI provides the reload spaces API facade for version.
func NewReloadSpacesAPI ¶
func NewReloadSpacesAPI(state ReloadSpacesState, environs ReloadSpacesEnviron, spaces EnvironSpaces, context context.ProviderCallContext, authorizer ReloadSpacesAuthorizer, ) *ReloadSpacesAPI
NewReloadSpacesAPI creates a new ReloadSpacesAPI.
func (*ReloadSpacesAPI) ReloadSpaces ¶
func (api *ReloadSpacesAPI) ReloadSpaces() error
ReloadSpaces refreshes spaces from the substrate.
type ReloadSpacesAuthorizer ¶
type ReloadSpacesAuthorizer func() error
ReloadSpacesAuthorizer represents a way to authorize reload spaces.
func DefaultReloadSpacesAuthorizer ¶
func DefaultReloadSpacesAuthorizer(auth facade.Authorizer, check BlockChecker, state AuthorizerState, ) ReloadSpacesAuthorizer
DefaultReloadSpacesAuthorizer creates a new ReloadSpacesAuthorizer for handling reload spaces.
type ReloadSpacesEnviron ¶
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 ¶
type ReloadSpacesEnvirons struct {
stateenvirons.EnvironConfigGetter
}
ReloadSpacesEnvirons returns a reload spaces environs type.
func DefaultReloadSpacesEnvirons ¶
func DefaultReloadSpacesEnvirons(st *state.State) (ReloadSpacesEnvirons, error)
DefaultReloadSpacesEnvirons creates a new ReloadSpacesEnviron from state.
func (ReloadSpacesEnvirons) GetEnviron ¶
func (ReloadSpacesEnvirons) GetEnviron(st environs.EnvironConfigGetter, fn environs.NewEnvironFunc) (environs.Environ, error)
GetEnviron returns the environs.Environ ("provider") associated with the model.
type ReloadSpacesState ¶
type ReloadSpacesState interface { space.ReloadSpacesState }
ReloadSpacesState contains all the methods required to execute the API.
type RemoveSpace ¶
RemoveSpace describes a space that can be removed.
type RenameSpace ¶
type RenameSpace interface { Refresh() error Id() string Name() string RenameSpaceOps(toName string) []txn.Op }
RenameSpace describes a space that can be renamed.
type RenameSpaceState ¶
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.