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

package payloadshookcontext

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

Index

Package Files

unitfacade.go

func NewHookContextFacade Uses

func NewHookContextFacade(st *state.State, unit *state.Unit) (interface{}, error)

NewHookContextFacade returns a new payloads hook context facade for the State and Unit given. It is used for facade registration.

func Result2api Uses

func Result2api(result payload.Result) params.PayloadResult

Result2api converts the payload.Result into a PayloadResult.

type UnitFacade Uses

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

UnitFacade serves payload-specific API methods.

func NewUnitFacade Uses

func NewUnitFacade(backend UnitPayloadBackend) *UnitFacade

NewUnitFacade builds a new facade for the given backend.

func (UnitFacade) List Uses

func (uf UnitFacade) List(args params.Entities) (params.PayloadResults, error)

List builds the list of payload being tracked for the given unit and IDs. If no IDs are provided then all tracked payloads for the unit are returned.

func (UnitFacade) LookUp Uses

func (uf UnitFacade) LookUp(args params.LookUpPayloadArgs) (params.PayloadResults, error)

LookUp identifies the payload with the provided name and raw ID.

func (UnitFacade) SetStatus Uses

func (uf UnitFacade) SetStatus(args params.SetPayloadStatusArgs) (params.PayloadResults, error)

SetStatus sets the raw status of a payload.

func (UnitFacade) Track Uses

func (uf UnitFacade) Track(args params.TrackPayloadArgs) (params.PayloadResults, error)

Track stores a payload to be tracked in state.

func (UnitFacade) Untrack Uses

func (uf UnitFacade) Untrack(args params.Entities) (params.PayloadResults, error)

Untrack marks the identified payload as no longer being tracked.

type UnitPayloadBackend Uses

type UnitPayloadBackend interface {
    // Track tracks a payload for the unit and info.
    Track(info payload.Payload) error

    // List returns information on the payload with the id on the unit.
    List(ids ...string) ([]payload.Result, error)

    // Settatus sets the status for the payload with the given id on the unit.
    SetStatus(id, status string) error

    // LookUp returns the payload ID for the given name/rawID pair.
    LookUp(name, rawID string) (string, error)

    // Untrack removes the information for the payload with the given id.
    Untrack(id string) error
}

UnitPayloadBackend exposes the State functionality for a unit's payloads.

Package payloadshookcontext imports 8 packages (graph) and is imported by 3 packages. Updated 2019-08-23. Refresh now. Tools for package owners.