github.com/axw/juju@v0.0.0-20161005053422-4bd6544d08d4/apiserver/params/logfwd.go (about) 1 // Copyright 2016 Canonical Ltd. 2 // Licensed under the AGPLv3, see LICENCE file for details. 3 4 package params 5 6 // LogForwardingID is the API data that identifies a log forwarding 7 // "last sent" value. The controller has a mapping from a set of IDs 8 // to a timestamp (for each ID). The timestamp corresponds to the last 9 // log record that the specific log forwarding machinery sent to the 10 // identified "sink" (for a given model). 11 type LogForwardingID struct { 12 // ModelTag identifies the model associated with the log record. 13 ModelTag string `json:"model"` 14 15 // Sink is the name of the log forwarding target to which a log 16 // record was last sent. 17 Sink string `json:"sink"` 18 } 19 20 // LogForwardingGetLastSentParams holds the arguments for a call 21 // to the GetLastSent method of the LogForwarding facade. 22 type LogForwardingGetLastSentParams struct { 23 // IDs holds the list of IDs for which individual "last sent" 24 // timestamps should be returned (in the same order). 25 IDs []LogForwardingID `json:"ids"` 26 } 27 28 // LogForwardingGetLastSentResults holds the results of a call 29 // to the GetLastSent method of the LogForwarding facade. 30 type LogForwardingGetLastSentResults struct { 31 // Results holds the list of results that correspond to the IDs 32 // sent in a GetLastSent call. 33 Results []LogForwardingGetLastSentResult `json:"results"` 34 } 35 36 // LogForwardingGetLastSentResult holds a single result from a call 37 // to the GetLastSent method of the LogForwarding facade. 38 type LogForwardingGetLastSentResult struct { 39 // RecordID is the ID of the last log record that was 40 // forwarded for a given model and sink. If Error is set then the 41 // meaning of this value is undefined. 42 RecordID int64 `json:"record-id"` 43 44 // RecordTimestamp is the timestamp of the last log record that was 45 // forwarded for a given model and sink. If Error is set then the 46 // meaning of this value is undefined. 47 RecordTimestamp int64 `json:"record-timestamp"` 48 49 // Error holds the error, if any, that resulted while handling the 50 // request for a specific ID. 51 Error *Error `json:"err"` 52 } 53 54 // LogForwardingSetLastSentParams holds the arguments for a call 55 // to the SetLastSent method of the LogForwarding facade. 56 type LogForwardingSetLastSentParams struct { 57 // Params holds the list of individual requests for "last sent" info. 58 Params []LogForwardingSetLastSentParam `json:"params"` 59 } 60 61 // LogForwardingSetLastSentParams holds holds the info needed to set 62 // a new "last sent" value via a call to the SetLastSent method of the 63 // LogForwarding facade. 64 type LogForwardingSetLastSentParam struct { 65 LogForwardingID 66 67 // RecordID identifies the record ID to set for the given ID. 68 RecordID int64 `json:"record-id"` 69 70 // RecordTimestamp identifies the record timestamp to set for the given ID. 71 RecordTimestamp int64 `json:"record-timestamp"` 72 }