github.com/axw/juju@v0.0.0-20161005053422-4bd6544d08d4/payload/api/private/data.go (about) 1 // Copyright 2015 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package private 5 6 // TODO(ericsnow) Eliminate the params import if possible. 7 8 import ( 9 "github.com/juju/juju/apiserver/params" 10 "github.com/juju/juju/payload/api" 11 ) 12 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"` 17 } 18 19 // List uses params.Entities. 20 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"` 25 } 26 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. 32 ID string `json:"id"` 33 } 34 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"` 39 } 40 41 // SetStatusArg are the arguments for a single call to the 42 // SetStatus endpoint. 43 type SetStatusArg struct { 44 params.Entity 45 // Status is the new status of the payload. 46 Status string `json:"status"` 47 } 48 49 // Untrack uses params.Entities. 50 51 // PayloadResults is the result for a call that makes one or more requests 52 // about payloads. 53 type PayloadResults struct { 54 Results []PayloadResult `json:"results"` 55 } 56 57 // TODO(ericsnow) Eliminate the NotFound field? 58 59 // PayloadResult contains the result for a single call. 60 type PayloadResult struct { 61 params.Entity 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"` 68 }