subnets

package
v0.0.0-...-9ec3720 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 6, 2021 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAddSubnetsCache

func NewAddSubnetsCache(api Backing) *addSubnetsCache

func NewStateShim

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

Types

type API

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

API provides the subnets API facade for version 4.

func NewAPI

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

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

func (*API) AddSubnets

func (api *API) AddSubnets(args params.AddSubnetsParams) (params.ErrorResults, error)

AddSubnets adds existing subnets to Juju.

func (*API) AllSpaces

func (api *API) AllSpaces(_, _ struct{})

AllSpaces does not belong on this API facade. If you need it, use the spaces facade.

func (*API) AllZones

func (api *API) AllZones() (params.ZoneResults, error)

AllZones returns all availability zones known to Juju. If a zone is unusable, unavailable, or deprecated the Available field will be false.

func (*API) ListSubnets

func (api *API) ListSubnets(args params.SubnetsFilters) (results params.ListSubnetsResults, err error)

ListSubnets returns the matching subnets after applying optional filters.

func (*API) SubnetsByCIDR

func (api *API) SubnetsByCIDR(arg params.CIDRParams) (params.SubnetsResults, error)

SubnetsByCIDR returns the collection of subnets matching each CIDR in the input.

type APIv2

type APIv2 struct {
	*APIv3
}

APIv2 provides the subnets API facade for versions < 3.

func NewAPIv2

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

NewAPIv2 is a wrapper that creates a V2 subnets API.

func (*APIv2) AddSubnets

func (api *APIv2) AddSubnets(args params.AddSubnetsParamsV2) (params.ErrorResults, error)

AddSubnets adds existing subnets to Juju. Args are converted to the new form for compatibility.

type APIv3

type APIv3 struct {
	*API
}

APIv3 provides the subnets API facade for versions 3.

func NewAPIv3

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

NewAPIv3 is a wrapper that creates a V3 subnets API.

func (*APIv3) AllSpaces

func (api *APIv3) AllSpaces() (params.SpaceResults, error)

AllSpaces returns the tags of all network spaces known to Juju. This is not recruited by any Juju client code and should not actually exist. It is preserved for versions 3 and below of the facade, but blanked for later versions to ensure it is not used.

type Backing

type Backing interface {
	environs.EnvironConfigGetter

	// AvailabilityZones returns all cached availability zones (i.e.
	// not from the provider, but in state).
	AvailabilityZones() (network.AvailabilityZones, error)

	// SetAvailabilityZones replaces the cached list of availability
	// zones with the given zones.
	SetAvailabilityZones(network.AvailabilityZones) error

	// AddSubnet creates a backing subnet for an existing subnet.
	AddSubnet(networkingcommon.BackingSubnetInfo) (networkingcommon.BackingSubnet, error)

	// AllSubnets returns all backing subnets.
	AllSubnets() ([]networkingcommon.BackingSubnet, error)

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

	// SubnetsByCIDR returns any subnets with the input CIDR.
	SubnetsByCIDR(cidr string) ([]networkingcommon.BackingSubnet, error)

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

	// ModelTag returns the tag of the model this state is associated to.
	ModelTag() names.ModelTag
}

Backend contains the state methods used in this package.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL