@@ -19,26 +19,40 @@ package event
19
19
20
20
import "time"
21
21
22
+ // Origin for the API event
23
+ type Origin string
24
+
25
+ const (
26
+ OriginClient Origin = "client"
27
+ OriginSiteReplication Origin = "site-replication"
28
+ OriginILM Origin = "ilm"
29
+ OriginBatch Origin = "batch"
30
+ OriginRebalance Origin = "rebalance"
31
+ OriginReplicate Origin = "replicate"
32
+ OriginDecommission Origin = "decommission"
33
+ OriginHeal Origin = "heal"
34
+ )
35
+
22
36
// API represents the api event
23
37
type API struct {
24
38
Version string `json:"version"`
25
- Type string `json:"type,omitempty"`
26
39
DeploymentID string `json:"deploymentid,omitempty"`
27
40
SiteName string `json:"siteName,omitempty"`
28
41
Time time.Time `json:"time"`
29
42
Node string `json:"node,omitempty"`
43
+ Origin Origin `json:"origin,omitempty"`
44
+ Type string `json:"type,omitempty"`
30
45
Name string `json:"name,omitempty"`
31
46
Bucket string `json:"bucket,omitempty"`
32
47
Object string `json:"object,omitempty"`
33
48
VersionID string `json:"versionId,omitempty"`
34
- External bool `json:"external,omitempty"`
35
49
Tags map [string ]interface {} `json:"tags,omitempty"`
36
50
CallInfo * CallInfo `json:"callInfo,omitempty"`
37
51
}
38
52
39
53
// CallInfo represents the info for the external call
40
54
type CallInfo struct {
41
- StatusCode int `json:"statusCode ,omitempty"`
55
+ HttpStatusCode int `json:"httpStatusCode ,omitempty"`
42
56
InputBytes int64 `json:"rx"`
43
57
OutputBytes int64 `json:"tx"`
44
58
HeaderBytes int64 `json:"txHeaders,omitempty"`
0 commit comments