juju: github.com/juju/juju/apiserver/facades/agent/meterstatus Index | Files | Directories

package meterstatus

import "github.com/juju/juju/apiserver/facades/agent/meterstatus"

Package meterstatus provides the meter status API facade.

Index

Package Files

meterstatus.go wrapper.go

func MeterStatusWrapper Uses

func MeterStatusWrapper(getter func() (state.MeterStatus, error)) (state.MeterStatus, error)

MeterStatusWrapper takes a MeterStatus and converts it into an 'api friendly' form where Not Set and Not Available (which are important distinctions in state) are converted into Amber and Red respectively in the api.

type MeterStatus Uses

type MeterStatus interface {
    GetMeterStatus(args params.Entities) (params.MeterStatusResults, error)
    WatchMeterStatus(args params.Entities) (params.NotifyWatchResults, error)
}

MeterStatus defines the methods exported by the meter status API facade.

type MeterStatusAPI Uses

type MeterStatusAPI struct {
    *common.UnitStateAPI
    // contains filtered or unexported fields
}

MeterStatusAPI implements the MeterStatus interface and is the concrete implementation of the API endpoint. Additionally, it embeds common.UnitStateAPI to allow meter status workers to access their controller-backed internal state.

func NewMeterStatusAPI Uses

func NewMeterStatusAPI(
    st MeterStatusState,
    resources facade.Resources,
    authorizer facade.Authorizer,
) (*MeterStatusAPI, error)

NewMeterStatusAPI creates a new API endpoint for dealing with unit meter status.

func NewMeterStatusFacade Uses

func NewMeterStatusFacade(ctx facade.Context) (*MeterStatusAPI, error)

NewMeterStatusFacade provides the signature required for facade registration.

func (*MeterStatusAPI) GetMeterStatus Uses

func (m *MeterStatusAPI) GetMeterStatus(args params.Entities) (params.MeterStatusResults, error)

GetMeterStatus returns meter status information for each unit.

func (*MeterStatusAPI) WatchMeterStatus Uses

func (m *MeterStatusAPI) WatchMeterStatus(args params.Entities) (params.NotifyWatchResults, error)

WatchMeterStatus returns a NotifyWatcher for observing changes to each unit's meter status.

type MeterStatusAPIV1 Uses

type MeterStatusAPIV1 struct {
    MeterStatusAPI
}

MeterStatusAPIV1 implements V1 of the Meter Status API.

func NewMeterStatusAPIV1 Uses

func NewMeterStatusAPIV1(
    st MeterStatusState,
    resources facade.Resources,
    authorizer facade.Authorizer,
) (*MeterStatusAPIV1, error)

NewMeterStatusAPIV1 creates an instance of the V1 MeterStatus API.

func NewMeterStatusFacadeV1 Uses

func NewMeterStatusFacadeV1(ctx facade.Context) (*MeterStatusAPIV1, error)

NewMeterStatusFacadeV1 provides the signature required for the V1 facade registration.

func (*MeterStatusAPIV1) SetState Uses

func (u *MeterStatusAPIV1) SetState(_ struct{})

SetState isn't on the v1 API.

func (*MeterStatusAPIV1) State Uses

func (u *MeterStatusAPIV1) State(_ struct{})

State isn't on the v1 API.

type MeterStatusState Uses

type MeterStatusState interface {
    ApplyOperation(state.ModelOperation) error
    ControllerConfig() (controller.Config, error)

    // Application returns a application state by name.
    Application(name string) (*state.Application, error)

    // Unit returns a unit by name.
    Unit(id string) (*state.Unit, error)
}

MeterStatusState represents the state of an model required by the MeterStatus. go:generate go run github.com/golang/mock/mockgen -package mocks -destination mocks/meterstatus_mock.go github.com/juju/juju/apiserver/facades/agent/meterstatus MeterStatusState

Directories

PathSynopsis
mocksPackage mocks is a generated GoMock package.
testing

Package meterstatus imports 10 packages (graph) and is imported by 6 packages. Updated 2020-09-30. Refresh now. Tools for package owners.