Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 is the public API facade for resources.
func NewFacade ¶
NewFacade creates a public API facade for resources. It is used for API registration.
func NewResourcesAPI ¶
func NewResourcesAPI(backend Backend, factory func(*charm.URL) (NewCharmRepository, error)) (*API, error)
NewResourcesAPI returns a new resources API facade.
func (*API) AddPendingResources ¶
func (a *API) AddPendingResources(args params.AddPendingResourcesArgsV2) (params.AddPendingResourcesResult, error)
AddPendingResources adds the provided resources (info) to the Juju model in a pending state, meaning they are not available until resolved. Handles CharmHub and Local charms.
func (*API) ListResources ¶
func (a *API) ListResources(args params.ListResourcesArgs) (params.ResourcesResults, error)
ListResources returns the list of resources for the given application.
type Backend ¶
type Backend interface { // ListResources returns the resources for the given application. ListResources(application string) (resources.ApplicationResources, error) // AddPendingResource adds the resource to the data backend in a // "pending" state. It will stay pending (and unavailable) until // it is resolved. The returned ID is used to identify the pending // resources when resolving it. AddPendingResource(applicationID, userID string, chRes charmresource.Resource) (string, error) }
Backend is the functionality of Juju's state needed for the resources API.
type NewCharmRepository ¶
type NewCharmRepository interface {
ResolveResources(resources []charmresource.Resource, id corecharm.CharmID) ([]charmresource.Resource, error)
}
NewCharmRepository defines methods required by the resources facade specific to an individual repository type.