juju: github.com/juju/juju/apiserver/facades/client/resources Index | Files

package resources

import "github.com/juju/juju/apiserver/facades/client/resources"

Index

Package Files

facade.go

type Backend Uses

type Backend interface {
    // ListResources returns the resources for the given application.
    ListResources(service string) (resource.ApplicationResources, error)

    // AddPendingResource adds the resource to the data store 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 CharmStore Uses

type CharmStore interface {
    // ListResources composes, for each of the identified charms, the
    // list of details for each of the charm's resources. Those details
    // are those associated with the specific charm revision. They
    // include the resource's metadata and revision.
    ListResources([]charmstore.CharmID) ([][]charmresource.Resource, error)

    // ResourceInfo returns the metadata for the given resource.
    ResourceInfo(charmstore.ResourceRequest) (charmresource.Resource, error)
}

CharmStore exposes the functionality of the charm store as needed here.

type Facade Uses

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

Facade is the public API facade for resources.

func NewFacade Uses

func NewFacade(store Backend, newClient func() (CharmStore, error)) (*Facade, error)

NewFacade returns a new resoures API facade.

func NewPublicFacade Uses

func NewPublicFacade(st *state.State, _ facade.Resources, authorizer facade.Authorizer) (*Facade, error)

NewPublicFacade creates a public API facade for resources. It is used for API registration.

func (Facade) AddPendingResources Uses

func (f Facade) AddPendingResources(args params.AddPendingResourcesArgs) (params.AddPendingResourcesResult, error)

AddPendingResources adds the provided resources (info) to the Juju model in a pending state, meaning they are not available until resolved.

func (Facade) ListResources Uses

func (f Facade) ListResources(args params.ListResourcesArgs) (params.ResourcesResults, error)

ListResources returns the list of resources for the given application.

Package resources imports 14 packages (graph) and is imported by 3 packages. Updated 2019-08-23. Refresh now. Tools for package owners.