1syntax = "proto3";
2
3import "github.com/gogo/protobuf/gogoproto/gogo.proto";
4import "meta.proto";
5
6package sensu.core.v2;
7
8option go_package = "v2";
9option (gogoproto.populate_all) = true;
10option (gogoproto.equal_all) = true;
11option (gogoproto.marshaler_all) = true;
12option (gogoproto.unmarshaler_all) = true;
13option (gogoproto.sizer_all) = true;
14option (gogoproto.testgen_all) = true;
15
16// HookConfig is the specification of a hook
17message HookConfig {
18  option (gogoproto.face) = true;
19  option (gogoproto.goproto_getters) = false;
20
21  // Metadata contains the name, namespace, labels and annotations of the hook
22  ObjectMeta metadata = 1 [(gogoproto.jsontag) = "metadata,omitempty", (gogoproto.embed) = true, (gogoproto.nullable) = false];
23
24  // Command is the command to be executed
25  string command = 2;
26
27  // Timeout is the timeout, in seconds, at which the hook has to run
28  uint32 timeout = 3 [(gogoproto.jsontag) = "timeout"];
29
30  // Stdin indicates if hook requests have stdin enabled
31  bool stdin = 4 [(gogoproto.jsontag) = "stdin"];
32}
33
34// A Hook is a hook specification and optionally the results of the hook's
35// execution.
36message Hook {
37  // Config is the specification of a hook
38  HookConfig config = 1 [(gogoproto.nullable) = false, (gogoproto.embed) = true, (gogoproto.jsontag) = ""];
39
40  // Duration of execution
41  double duration = 2;
42
43  // Executed describes the time in which the hook request was executed
44  int64 executed = 3 [(gogoproto.jsontag) = "executed"];
45
46  // Issued describes the time in which the hook request was issued
47  int64 issued = 4 [(gogoproto.jsontag) = "issued"];
48
49  // Output from the execution of Command
50  string output = 5;
51
52  // Status is the exit status code produced by the hook
53  int32 status = 6 [(gogoproto.jsontag) = "status"];
54}
55
56message HookList {
57  // Hooks is the list of hooks for the check hook
58  repeated string hooks = 1 [(gogoproto.jsontag) = "hooks"];
59
60  // Type indicates the type or response code for the check hook
61  string type = 2;
62}
63