subnets

package
v0.0.0-...-56cb166 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2025 License: AGPL-3.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStateShim

func NewStateShim(st *state.State, cloudService CloudService, credentialService CredentialService, modelConfigService ModelConfigService) (*stateShim, error)

func Register

func Register(registry facade.FacadeRegistry)

Register is called to expose a package of facades onto a given registry.

Types

type API

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

API provides the subnets API facade for version 5.

func (*API) AllZones

func (api *API) AllZones(ctx context.Context) (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(ctx context.Context, args params.SubnetsFilters) (results params.ListSubnetsResults, err error)

ListSubnets returns the matching subnets after applying optional filters.

func (*API) SubnetsByCIDR

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

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

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

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

Backing contains the state methods used in this package.

type CloudService

type CloudService interface {
	// Cloud returns the named cloud.
	Cloud(ctx context.Context, name string) (*cloud.Cloud, error)
}

CloudService provides access to clouds.

type CredentialService

type CredentialService interface {
	// CloudCredential returns the cloud credential for the given tag.
	CloudCredential(ctx context.Context, key credential.Key) (cloud.Credential, error)
}

CredentialService provides access to credentials.

type ModelConfigService

type ModelConfigService interface {
	// ModelConfig returns the current config for the model.
	ModelConfig(ctx context.Context) (*config.Config, error)
}

ModelConfigService is an interface that provides access to the model configuration.

type NetworkService

type NetworkService interface {
	// Space returns a space from state that matches the input ID.
	// An error is returned if the space does not exist or if there was a problem
	// accessing its information.
	Space(ctx context.Context, uuid string) (*network.SpaceInfo, error)
	// SpaceByName returns a space from state that matches the input name.
	// An error is returned that satisfied errors.NotFound if the space was not found
	// or an error static any problems fetching the given space.
	SpaceByName(ctx context.Context, name string) (*network.SpaceInfo, error)
	// GetAllSpaces returns all spaces for the model.
	GetAllSpaces(ctx context.Context) (network.SpaceInfos, error)
	// GetAllSubnets returns all the subnets for the model.
	GetAllSubnets(ctx context.Context) (network.SubnetInfos, error)
	// SubnetsByCIDR returns the subnets matching the input CIDRs.
	SubnetsByCIDR(ctx context.Context, cidrs ...string) ([]network.SubnetInfo, error)
}

NetworkService is the interface that is used to interact with the network spaces/subnets.

Jump to

Keyboard shortcuts

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