charms

package
v0.0.0-...-b0bff92 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2021 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

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

func NewCharmsAPI(
	authorizer facade.Authorizer,
	st charmsinterfaces.BackendState,
	m charmsinterfaces.BackendModel,
	newStorage func(modelUUID string) services.Storage,
	repoFactory corecharm.RepositoryFactory,
	newDownloader func(cfg services.CharmDownloaderConfig) (charmsinterfaces.Downloader, error),
) (*API, error)

NewCharmsAPI is only used for testing. TODO (stickupkid): We should use the latest NewFacadeV4 to better exercise the API.

func NewFacadeV4

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

NewFacadeV4 provides the signature required for facade V4 registration.

func (*API) AddCharm

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

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

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

CharmInfo returns information about the requested charm.

func (*API) CheckCharmPlacement

func (a *API) CheckCharmPlacement(args params.ApplicationCharmPlacements) (params.ErrorResults, error)

CheckCharmPlacement checks if a charm is allowed to be placed with in a given application.

func (*API) GetDownloadInfos

func (a *API) GetDownloadInfos(args params.CharmURLAndOrigins) (params.DownloadInfoResults, error)

GetDownloadInfos attempts to get the bundle corresponding to the charm url and origin.

func (*API) IsMetered

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

IsMetered returns whether or not the charm is metered.

func (*API) List

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) ListCharmResources

func (a *API) ListCharmResources(args params.CharmURLAndOrigins) (params.CharmResourcesResults, error)

ListCharmResources returns a series of resources for a given charm.

func (*API) ResolveCharms

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

type APIv2

type APIv2 struct {
	*APIv3
}

func NewFacadeV2

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

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

func (*APIv2) AddCharm

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

AddCharm is not available via the V2 API.

func (*APIv2) AddCharmWithAuthorization

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

AddCharmWithAuthorization is not available via the V2 API.

func (*APIv2) GetDownloadInfos

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

GetDownloadInfos is not available via the V2 API.

func (*APIv2) ListCharmResources

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

ListCharmResources is not available via the V2 API.

func (*APIv2) ResolveCharms

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

ResolveCharms is not available via the V2 API.

type APIv3

type APIv3 struct {
	*API
}

func NewFacadeV3

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

NewFacadeV3 provides the signature required for facade V3 registration.

func (*APIv3) CheckCharmPlacement

func (a *APIv3) CheckCharmPlacement(_, _ struct{})

CheckCharmPlacement isn't on the v13 API.

type StoreCharm

type StoreCharm interface {
	charm.Charm
	charm.LXDProfiler
	Version() string
}

StoreCharm represents a store charm.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
Package services is a generated GoMock package.
Package services is a generated GoMock package.

Jump to

Keyboard shortcuts

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