Update the env proto

This commit is contained in:
Nikolai Rodionov 2024-04-29 11:24:14 +02:00
parent 1ee96fbfd5
commit 1c1bb4672b
Signed by: allanger
GPG Key ID: 0AA46A90E25592AD

View File

@ -7,28 +7,84 @@ option go_package = "git.badhouseplants.net/softplayer/softplayer-go-proto/pkg/e
/** /**
* Service for handling environments * Service for handling environments
*/ */
service Environments { service Environments {
rpc Create(EnvironmentFull) returns (EnvironmentFull) {} rpc Create(CreateOptions) returns (EnvironmentFull) {}
rpc Update(EnvironmentFull) returns (EnvironmentFull) {} rpc Update(UpdateOptions) returns (EnvironmentFull) {}
rpc Delete(EnvironmentFull) returns (google.protobuf.Empty) {} rpc Delete(DeleteOptions) returns (google.protobuf.Empty) {}
rpc Get(EnvironmentName) returns (EnvironmentFull) {} rpc Get(GetOptions) returns (EnvironmentFull) {}
rpc List(google.protobuf.Empty) returns (stream EnvironmentName) {} rpc List(ListOptions) returns (stream EnvironmentFull) {}
} }
/** /**
* Represents a environment UUID only User related messages
* I don't think we need it
*/ */
message OwnerId {
string uuid = 1; // UUID of a user that is creating an environemnt
}
message Token {
string token = 1; // Token that should be used to create an environment
}
/**
Services options
*/
message CreateOptions {
EnvironmentName name = 1;
EnvironmentData data = 2;
OwnerId owner_id = 3;
Token token = 4;
}
message UpdateOptions {
EnvironmentName name = 1;
EnvironmentData data = 2;
OwnerId owner_id = 3;
Token token = 4;
}
message DeleteOptions {
EnvironmentName name = 1;
OwnerId owner_id = 3;
Token token = 4;
}
message GetOptions {
EnvironmentName name = 1;
OwnerId owner_id = 3;
Token token = 4;
}
message ListOptions {
EnvironmentName name = 1;
OwnerId owner_id = 3;
Token token = 4;
}
/**
Environment related messages
*/
message EnvironmentName { message EnvironmentName {
string name = 1; // Contour ID: UUID string name = 1; // A name of the environment
} }
message EnvironmentData { message EnvironmentData {
Provider provider = 2; // Provide Provider provider = 2; // Provide
Kubernetes kubernetes = 3; Kubernetes kubernetes = 3;
HetznerOptions hetzner_options = 4; HetznerOptions hetzner_options = 4;
} }
message EnvironmentFull {
EnvironmentName name = 1;
EnvironmentData data = 2;
}
/**
Helpers and other messages
*/
enum Provider { enum Provider {
PROVIDER_UNSPECIFIED = 0; PROVIDER_UNSPECIFIED = 0;
PROVIDER_HETZNER = 1; PROVIDER_HETZNER = 1;
@ -39,12 +95,7 @@ enum Kubernetes {
KUBERNETES_K3S = 1; KUBERNETES_K3S = 1;
} }
message HetznerOptions { message HetznerOptions {
string server_type = 1; string server_type = 1;
string server_location = 2; string server_location = 2;
} }
message EnvironmentFull {
EnvironmentName name = 1;
EnvironmentData data = 2;
}