Skip to content

Commit

Permalink
feat: Add agent API's proto
Browse files Browse the repository at this point in the history
Add a proto file in order to specify the agent API routes and types

Close #7
  • Loading branch information
EstebanBAR0N authored Apr 13, 2022
2 parents 2a40371 + 7515326 commit 4a27bf7
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions docs/proposals/agent.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
syntax "proto3";
package node_agent;

// Represents an Instance (eg. a container, VM ...)
message Instance {
string id = 1;
string name = 2;
Type type = 3;
State state = 4;
string uri = 5;
[]string environement = 6;
Resource resource = 7;
[]string ports = 8;
string ip = 9;
}

// Represents a summary of all necessary resources
message ResourceSummary {
int cpu = 1;
int memory = 2;
int disk = 3;
}

// Represent the maximum/usage of a Instance or a Node
message Resource {
ResourceSummary max = 1;
ResourceSummary usage = 2;
}


// Represents a Instance action message
message InstanceAction {
string id = 1;
Action action = 2;
}

// Represents the different Instance actions possible
enum Action {
START = 0;
STOP = 1;
DESTROY = 2;
KILL = 3;
}

// Represents the different Type of a workflow
enum Type {
CONTAINER = 0;
}

service SchedulerService {
rpc InstanceCreate (Instance) returns (google.protobuf.Empty) {}
rpc InstanceUpdate (InstanceAction) returns (google.protobuf.Empty) {}
}

0 comments on commit 4a27bf7

Please sign in to comment.