-
Notifications
You must be signed in to change notification settings - Fork 148
/
control_v1.proto
123 lines (104 loc) · 3.28 KB
/
control_v1.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.
syntax = "proto3";
// proto namespace/package name is shared with elastic-agent-client
// we need to be careful with modifications to avoid name collisions
// proto is here to maintain backward compatibility and cannot be changed.
// elastic-agent-client namespace is likely change after 8.6
package proto;
option cc_enable_arenas = true;
option go_package = "pkg/agent/control/proto;proto";
// Status codes for the current state.
enum Status {
V1_STARTING = 0;
V1_CONFIGURING = 1;
V1_HEALTHY = 2;
V1_DEGRADED = 3;
V1_FAILED = 4;
V1_STOPPING = 5;
V1_UPGRADING = 6;
V1_SROLLBACK = 7;
}
// Action status codes for restart and upgrade response.
enum ActionStatus {
// Action was successful.
V1_SUCCESS = 0;
// Action failed.
V1_FAILURE = 1;
}
// Empty message.
message Empty {
}
// Version response message.
message VersionResponse {
// Current running version.
string version = 1;
// Current running commit.
string commit = 2;
// Current running build time.
string buildTime = 3;
// Current running version is a snapshot.
bool snapshot = 4;
}
message RestartResponse {
// Response status.
ActionStatus status = 1;
// Error message when it fails to trigger restart.
string error = 2;
}
// Upgrade request message.
message UpgradeRequest {
// (Optional) Version to upgrade to.
//
// If not provided Elastic Agent will auto discover the latest version in the same major
// to upgrade to. If wanting to upgrade to a new major that major must be present in the
// this version field.
string version = 1;
// (Optional) Use a different source URI then configured.
//
// If provided the upgrade process will use the provided sourceURI instead of the configured
// sourceURI in the configuration.
string sourceURI = 2;
}
// A upgrade response message.
message UpgradeResponse {
// Response status.
ActionStatus status = 1;
// Version that is being upgraded to.
string version = 2;
// Error message when it fails to trigger upgrade.
string error = 3;
}
// Current status of the application in Elastic Agent.
message ApplicationStatus {
// Unique application ID.
string id = 1;
// Application name.
string name = 2;
// Current status.
Status status = 3;
// Current status message.
string message = 4;
// Current status payload.
string payload = 5;
}
// Status is the current status of Elastic Agent.
message StatusResponse {
// Overall status of Elastic Agent.
Status status = 1;
// Overall status message of Elastic Agent.
string message = 2;
// Status of each application in Elastic Agent.
repeated ApplicationStatus applications = 3;
}
service ElasticAgentControl {
// Fetches the currently running version of the Elastic Agent.
rpc Version(Empty) returns (VersionResponse);
// Fetches the currently status of the Elastic Agent.
rpc Status(Empty) returns (StatusResponse);
// Restart restarts the current running Elastic Agent.
rpc Restart(Empty) returns (RestartResponse);
// Upgrade starts the upgrade process of Elastic Agent.
rpc Upgrade(UpgradeRequest) returns (UpgradeResponse);
}