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

package charms

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


Package Files

client.go convertions.go interface.go repositories.go

type API Uses

type API struct {
    // contains filtered or unexported fields

API implements the charms interface and is the concrete implementation of the API end point.

func NewCharmsAPI Uses

func NewCharmsAPI(
    authorizer facade.Authorizer,
    st BackendState,
    m BackendModel,
    csResolverFunc CSResolverGetterFunc,
    getStrategyFunc func(source string) StrategyFunc,
    newStorage func(modelUUID string, session *mgo.Session) storage.Storage,
) (*API, error)

func NewFacadeV3 Uses

func NewFacadeV3(ctx facade.Context) (*API, error)

NewFacadeV3 provides the signature required for facade V3 registration.

func (*API) AddCharm Uses

func (a *API) AddCharm(args params.AddCharmWithOrigin) (params.CharmOriginResult, error)

AddCharm adds the given charm URL (which must include revision) to the environment, if it does not exist yet. Local charms are not supported, only charm store and charm hub URLs. See also AddLocalCharm().

func (*API) AddCharmWithAuthorization Uses

func (a *API) AddCharmWithAuthorization(args params.AddCharmWithAuth) (params.CharmOriginResult, error)

AddCharmWithAuthorization adds the given charm URL (which must include revision) to the environment, if it does not exist yet. Local charms are not supported, only charm store and charm hub URLs. See also AddLocalCharm().

The authorization macaroon, args.CharmStoreMacaroon, may be omitted, in which case this call is equivalent to AddCharm.

func (*API) CharmInfo Uses

func (a *API) CharmInfo(args params.CharmURL) (params.Charm, error)

CharmInfo returns information about the requested charm. NOTE: thumper 2016-06-29, this is not a bulk call and probably should be.

func (*API) IsMetered Uses

func (a *API) IsMetered(args params.CharmURL) (params.IsMeteredResult, error)

IsMetered returns whether or not the charm is metered.

func (*API) List Uses

func (a *API) List(args params.CharmsList) (params.CharmsListResult, error)

List returns a list of charm URLs currently in the state. If supplied parameter contains any names, the result will be filtered to return only the charms with supplied names.

func (*API) ResolveCharms Uses

func (a *API) ResolveCharms(args params.ResolveCharmsWithChannel) (params.ResolveCharmWithChannelResults, error)

ResolveCharms resolves the given charm URLs with an optionally specified preferred channel. Channel provided via CharmOrigin.

type APIv2 Uses

type APIv2 struct {

func NewFacade Uses

func NewFacade(ctx facade.Context) (*APIv2, error)

NewFacade provides the signature required for facade V2 registration. It is unknown where V1 is.

func (*APIv2) AddCharm Uses

func (a *APIv2) AddCharm(_ struct{})

AddCharm is not available via the V2 API.

func (*APIv2) AddCharmWithAuthorization Uses

func (a *APIv2) AddCharmWithAuthorization(_ struct{})

AddCharmWithAuthorization is not available via the V2 API.

func (*APIv2) ResolveCharms Uses

func (a *APIv2) ResolveCharms(_ struct{})

ResolveCharms is not available via the V2 API.

type BackendModel Uses

type BackendModel interface {
    Config() (*config.Config, error)
    ModelTag() names.ModelTag

type BackendState Uses

type BackendState interface {
    AllCharms() ([]*state.Charm, error)
    Charm(curl *charm.URL) (*state.Charm, error)
    ControllerConfig() (controller.Config, error)
    ControllerTag() names.ControllerTag
    ModelUUID() string

type CSRepository Uses

type CSRepository interface {
    Get(curl *charm.URL, archivePath string) (*charm.CharmArchive, error)
    ResolveWithPreferredChannel(*charm.URL, csparams.Channel) (*charm.URL, csparams.Channel, []string, error)

CSRepository is the part of charmrepo.Charmstore that we need to resolve a charm url, install or upgrade a charm store charm.

type CSResolverGetterFunc Uses

type CSResolverGetterFunc func(args ResolverGetterParams) (CSRepository, error)

type CharmArchive Uses

type CharmArchive struct {
    // ID is the charm URL for which we're storing the archive.
    ID  *charm.URL

    // Charm is the metadata about the charm for the archive.
    Charm charm.Charm

    // Data contains the bytes of the archive.
    Data io.Reader

    // Size is the number of bytes in Data.
    Size int64

    // SHA256 is the hash of the bytes in Data.
    SHA256 string

    // Macaroon is the authorization macaroon for accessing the charmstore.
    Macaroon macaroon.Slice

    // Charm Version contains semantic version of charm, typically the output of git describe.
    CharmVersion string

CharmArchive is the data that needs to be stored for a charm archive in state.

type CharmHubClient Uses

type CharmHubClient interface {
    Download(ctx context.Context, resourceURL *url.URL, archivePath string) (*charm.CharmArchive, error)
    Info(ctx context.Context, name string) (transport.InfoResponse, error)
    Refresh(ctx context.Context, config charmhub.RefreshConfig) ([]transport.RefreshResponse, error)

CharmHubClient represents the methods required of a client to install or upgrade a CharmHub charm.

type CharmState Uses

type CharmState interface {
    UpdateUploadedCharm(info state.CharmInfo) (*state.Charm, error)
    PrepareCharmUpload(curl *charm.URL) (corecharm.StateCharm, error)

CharmState represents directives for accessing charm methods

type ResolverGetterParams Uses

type ResolverGetterParams struct {
    CSURL              string
    Channel            string
    CharmStoreMacaroon *macaroon.Macaroon

type StoreCharm Uses

type StoreCharm interface {
    Version() string

StoreCharm represents a store charm.

type Strategy Uses

type Strategy interface {
    CharmURL() *charm.URL
    Finish() error
    Run(corecharm.State, corecharm.JujuVersionValidator, corecharm.Origin) (corecharm.DownloadResult, bool, corecharm.Origin, error)
    Validate() error

Strategy represents a core charm Strategy

type StrategyFunc Uses

type StrategyFunc func(charmRepo corecharm.Repository, url string, force bool, series string) (Strategy, error)

Package charms imports 35 packages (graph) and is imported by 4 packages. Updated 2020-09-30. Refresh now. Tools for package owners.