charms

package
v0.0.0-...-298751d Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: AGPL-3.0 Imports: 27 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertParamsOrigin

func ConvertParamsOrigin(origin params.CharmOrigin) (corecharm.Origin, error)

ConvertParamsOrigin converts a params struct to a core charm origin.

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 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 (*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) 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. TODO (cderici) only used for metered charms in cmd MeteredDeployAPI, kept for client compatibility, remove in juju 4.0

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 APIv5

type APIv5 struct {
	*APIv6
}

APIv5 provides the Charms API facade for version 5.

func (*APIv5) AddCharmWithAuthorization

func (a *APIv5) 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 hub URLs. See also AddLocalCharm().

Since the charm macaroons are no longer supported, this is the same as AddCharm. We keep it for backwards compatibility in APIv5.

type APIv6

type APIv6 struct {
	*APIv7
}

APIv6 provides the Charms API facade for version 6. It removes the AddCharmWithAuthorization function, as we no longer support macaroons.

func (*APIv6) ResolveCharms

ResolveCharms resolves the given charm URLs with an optionally specified preferred channel. Channel provided via CharmOrigin. We need to include SupportedSeries in facade version 6

type APIv7

type APIv7 struct {
	*API
}

APIv7 provides the Charms API facade for version 7. v7 guarantees SupportedBases will be provided in ResolveCharms

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.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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