1
// Copyright 2015 Canonical Ltd.
2
// Licensed under the AGPLv3, see LICENCE file for details.
6
// TODO(ericsnow) Eliminate the params import if possible.
9
"github.com/juju/juju/apiserver/params"
10
"github.com/juju/juju/payload/api"
13
// TrackArgs are the arguments for the Track endpoint.
14
type TrackArgs struct {
15
// Payloads is the list of Payloads to track
16
Payloads []api.Payload `json:"payloads"`
19
// List uses params.Entities.
21
// LookUpArgs are the arguments for the LookUp endpoint.
22
type LookUpArgs struct {
23
// Args is the list of arguments to pass to this function.
24
Args []LookUpArg `json:"args"`
27
// LookUpArg contains all the information necessary to identify a payload.
28
type LookUpArg struct {
29
// Name is the payload name.
30
Name string `json:"name"`
31
// ID uniquely identifies the payload for the given name.
35
// SetStatusArgs are the arguments for the SetStatus endpoint.
36
type SetStatusArgs struct {
37
// Args is the list of arguments to pass to this function.
38
Args []SetStatusArg `json:"args"`
41
// SetStatusArg are the arguments for a single call to the
42
// SetStatus endpoint.
43
type SetStatusArg struct {
45
// Status is the new status of the payload.
46
Status string `json:"status"`
49
// Untrack uses params.Entities.
51
// PayloadResults is the result for a call that makes one or more requests
53
type PayloadResults struct {
54
Results []PayloadResult `json:"results"`
57
// TODO(ericsnow) Eliminate the NotFound field?
59
// PayloadResult contains the result for a single call.
60
type PayloadResult struct {
62
// Payload holds the details of the payload, if any.
63
Payload *api.Payload `json:"payload"`
64
// NotFound indicates that the payload was not found in state.
65
NotFound bool `json:"not-found"`
66
// Error is the error (if any) for the call referring to ID.
67
Error *params.Error `json:"error,omitempty"`