cloudspec

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: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeCloudSpecCredentialContentWatcherForModel

func MakeCloudSpecCredentialContentWatcherForModel(st *state.State) func(names.ModelTag) (state.NotifyWatcher, error)

MakeCloudSpecCredentialContentWatcherForModel returns a function which returns a NotifyWatcher for credential content changes for a single model. Attempts to request a watcher for any other model other than the one associated with the given state.State results in an error.

func MakeCloudSpecCredentialWatcherForModel

func MakeCloudSpecCredentialWatcherForModel(st *state.State) func(names.ModelTag) (state.NotifyWatcher, error)

MakeCloudSpecCredentialWatcherForModel returns a function which returns a NotifyWatcher for changes to a model's credential reference. This watch will detect when model's credential is replaced with another credential. Attempts to request a watcher for any other model other than the one associated with the given state.State results in an error.

func MakeCloudSpecGetter

func MakeCloudSpecGetter(pool Pool) func(names.ModelTag) (environscloudspec.CloudSpec, error)

MakeCloudSpecGetter returns a function which returns a CloudSpec for a given model, using the given Pool.

func MakeCloudSpecGetterForModel

func MakeCloudSpecGetterForModel(st *state.State) func(names.ModelTag) (environscloudspec.CloudSpec, error)

MakeCloudSpecGetterForModel returns a function which returns a CloudSpec for a single model. Attempts to request a CloudSpec for any other model other than the one associated with the given state.State results in an error.

func MakeCloudSpecWatcherForModel

func MakeCloudSpecWatcherForModel(st *state.State) func(names.ModelTag) (state.NotifyWatcher, error)

MakeCloudSpecWatcherForModel returns a function which returns a NotifyWatcher for cloud spec changes for a single model. Attempts to request a watcher for any other model other than the one associated with the given state.State results in an error.

Types

type CloudSpecAPI

type CloudSpecAPI interface {
	// WatchCloudSpecsChanges returns a watcher for cloud spec changes.
	WatchCloudSpecsChanges(args params.Entities) (params.NotifyWatchResults, error)

	// CloudSpec returns the model's cloud spec.
	CloudSpec(args params.Entities) (params.CloudSpecResults, error)

	// GetCloudSpec constructs the CloudSpec for a validated and authorized model.
	GetCloudSpec(tag names.ModelTag) params.CloudSpecResult
}

CloudSpecAPI implements common methods for use by various facades for querying the cloud spec of models.

func NewCloudSpec

func NewCloudSpec(
	resources facade.Resources,
	getCloudSpec func(names.ModelTag) (environscloudspec.CloudSpec, error),
	watchCloudSpec func(tag names.ModelTag) (state.NotifyWatcher, error),
	watchCloudSpecModelCredentialReference func(tag names.ModelTag) (state.NotifyWatcher, error),
	watchCloudSpecCredentialContent func(tag names.ModelTag) (state.NotifyWatcher, error),
	getAuthFunc common.GetAuthFunc,
) CloudSpecAPI

NewCloudSpec returns a new CloudSpecAPI.

type Pool

type Pool interface {
	Get(string) (*state.PooledState, error)
}

Pool describes an interface for retrieving State instances from a collection.

Jump to

Keyboard shortcuts

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