service

package
v0.0.0-...-a002913 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2015 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Overview

Package service contains api calls for functionality related to deploying and managing services and their related charms.

Index

Constants

This section is empty.

Variables

View Source
var NewCharmStore = charmrepo.NewCharmStore

TODO - we really want to avoid this, which we can do by refactoring code requiring this to use interfaces. NewCharmStore instantiates a new charm store repository. It is defined at top level for testing purposes.

Functions

func AddCharmWithAuthorization

func AddCharmWithAuthorization(st *state.State, args params.AddCharmWithAuthorization) 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 URLs. See also AddLocalCharm().

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

func DeployService

func DeployService(st *state.State, owner string, args params.ServiceDeploy) error

DeployService fetches the charm from the charm store and deploys it. The logic has been factored out into a common function which is called by both the legacy API on the client facade, as well as the new service facade.

func ResolveCharms

func ResolveCharms(st *state.State, args params.ResolveCharms) (params.ResolveCharmResults, error)

ResolveCharm resolves the best available charm URLs with series, for charm locations without a series specified.

func ServiceSetSettingsStrings

func ServiceSetSettingsStrings(service *state.Service, settings map[string]string) error

ServiceSetSettingsStrings updates the settings for the given service, taking the configuration from a map of strings.

func StoreCharmArchive

func StoreCharmArchive(st *state.State, curl *charm.URL, ch charm.Charm, r io.Reader, size int64, sha256 string) error

StoreCharmArchive stores a charm archive in environment storage.

Types

type API

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

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

func NewAPI

func NewAPI(
	st *state.State,
	resources *common.Resources,
	authorizer common.Authorizer,
) (*API, error)

NewAPI returns a new service API facade.

func (*API) ServicesDeploy

func (api *API) ServicesDeploy(args params.ServicesDeploy) (params.ErrorResults, error)

ServicesDeploy fetches the charms from the charm store and deploys them.

func (*API) ServicesDeployWithPlacement

func (api *API) ServicesDeployWithPlacement(args params.ServicesDeploy) (params.ErrorResults, error)

ServicesDeployWithPlacement fetches the charms from the charm store and deploys them using the specified placement directives.

func (*API) SetMetricCredentials

func (api *API) SetMetricCredentials(args params.ServiceMetricCredentials) (params.ErrorResults, error)

SetMetricCredentials sets credentials on the service.

type Service

type Service interface {
	SetMetricCredentials(args params.ServiceMetricCredentials) (params.ErrorResults, error)
}

Service defines the methods on the service API end point.

Jump to

Keyboard shortcuts

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