Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReloadSpaces ¶
func ReloadSpaces(ctx context.ProviderCallContext, state ReloadSpacesState, environ 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.
Types ¶
type Constraints ¶
type Constraints interface{}
Constraints defines the methods supported by constraints used in the space context.
type ProviderSpaces ¶
type ProviderSpaces struct {
// contains filtered or unexported fields
}
ProviderSpaces defines a set of operations to perform when dealing with provider spaces. SaveSpaces, DeleteSpaces are operations for setting state in the persistence layer.
func NewProviderSpaces ¶
func NewProviderSpaces(st ReloadSpacesState) *ProviderSpaces
NewProviderSpaces creates a new ProviderSpaces to perform a series of operations.
func (*ProviderSpaces) DeleteSpaces ¶
func (s *ProviderSpaces) DeleteSpaces() ([]string, error)
DeleteSpaces will attempt to delete any unused spaces after a SaveSpaces has been called. If there are no spaces to be deleted, it will exit out early.
func (*ProviderSpaces) DeltaSpaces ¶
func (s *ProviderSpaces) DeltaSpaces() network.IDSet
DeltaSpaces returns all the spaces that haven't been updated.
func (*ProviderSpaces) SaveSpaces ¶
func (s *ProviderSpaces) SaveSpaces(providerSpaces []network.SpaceInfo) error
SaveSpaces consumes provider spaces and saves the spaces as subnets on a provider.
type ReloadSpacesState ¶
type ReloadSpacesState interface { // AllSpaces returns all spaces for the model. AllSpaces() ([]Space, error) // AddSpace creates and returns a new space. AddSpace(string, network.Id, []string, bool) (Space, error) // SaveProviderSubnets loads subnets into state. SaveProviderSubnets([]network.SubnetInfo, string) error // ConstraintsBySpaceName returns all Constraints that include a positive // or negative space constraint for the input space name. ConstraintsBySpaceName(string) ([]Constraints, error) // DefaultEndpointBindingSpace returns the current space ID to be used for // the default endpoint binding. DefaultEndpointBindingSpace() (string, error) // AllEndpointBindingsSpaceNames returns a set of spaces names for all the // endpoint bindings. AllEndpointBindingsSpaceNames() (set.Strings, error) }
ReloadSpacesState defines an in situ point of use type for ReloadSpaces