Skip to content

Commit

Permalink
Add rpc interface for livestate in plugin architecture (#5447)
Browse files Browse the repository at this point in the history
* Add rpc for livestate in the plugin architecture

Signed-off-by: Yoshiki Fujikane <[email protected]>

* Do gen/code

Signed-off-by: Yoshiki Fujikane <[email protected]>

* Fix comment

Signed-off-by: Yoshiki Fujikane <[email protected]>

* Fix for lint

Signed-off-by: Yoshiki Fujikane <[email protected]>

---------

Signed-off-by: Yoshiki Fujikane <[email protected]>
  • Loading branch information
ffjlabo authored Dec 25, 2024
1 parent 9b9fd28 commit 39b06ed
Show file tree
Hide file tree
Showing 11 changed files with 2,508 additions and 262 deletions.
891 changes: 630 additions & 261 deletions pkg/model/application_live_state.pb.go

Large diffs are not rendered by default.

328 changes: 328 additions & 0 deletions pkg/model/application_live_state.pb.validate.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions pkg/model/application_live_state.proto
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ message ApplicationLiveStateSnapshot {
ECSApplicationLiveState ecs = 14;

ApplicationLiveStateVersion version = 15 [(validate.rules).message.required = true];
ApplicationLiveState application_live_state = 16;
}

message ApplicationLiveStateVersion {
Expand Down Expand Up @@ -71,6 +72,47 @@ message LambdaApplicationLiveState {
repeated LambdaResourceState resources = 1;
}

message ApplicationLiveState {
repeated ResourceState resources = 1;

enum Status {
UNKNOWN = 0;
HEALTHY = 1;
OTHER = 2;
}
// The health status of the application.
Status health_status = 2;
}

// TODO: Add some more fields to consider about the deployment for multi clusters.
message ResourceState {
enum HealthStatus {
UNKNOWN = 0;
HEALTHY = 1;
UNHEALTHY = 2;
}

// The unique ID.
string id = 1 [(validate.rules).string.min_len = 1];
// The sorted list of unique IDs of the parents.
repeated string parent_ids = 2;
// The name of resource.
string name = 3 [(validate.rules).string.min_len = 1];
// The type of this resource.
string resource_type = 4;
// The metadata of this resource.
map<string, string> resource_metadata = 5;
// The health status of this resource.
HealthStatus health_status = 6 [(validate.rules).enum.defined_only = true];
// The description of the health status.
string health_description = 7;

// The timestamp when this resource was created.
int64 created_at = 10 [(validate.rules).int64.gt = 0];
// The timestamp of the last time when this resource was updated.
int64 updated_at = 11 [(validate.rules).int64.gt = 0];
}

// KubernetesResourceState represents the state of a single kubernetes resource object.
message KubernetesResourceState {
enum HealthStatus {
Expand Down
Loading

0 comments on commit 39b06ed

Please sign in to comment.