softplayer-proto/proto/environments/environments_v1.proto

126 lines
2.5 KiB
Protocol Buffer
Raw Normal View History

2024-03-17 18:23:28 +00:00
/// This file has messages for describing environments
syntax = "proto3";
package environments;
import "google/protobuf/empty.proto";
2024-03-17 18:27:20 +00:00
option go_package = "git.badhouseplants.net/softplayer/softplayer-go-proto/pkg/environments";
2024-03-17 18:23:28 +00:00
/**
* Service for handling environments
*/
2024-04-29 09:24:14 +00:00
service Environments {
rpc Create(CreateOptions) returns (EnvironmentFull) {}
rpc Update(UpdateOptions) returns (EnvironmentFull) {}
rpc Delete(DeleteOptions) returns (google.protobuf.Empty) {}
rpc Get(GetOptions) returns (EnvironmentFull) {}
rpc List(ListOptions) returns (stream EnvironmentFull) {}
2024-03-17 18:23:28 +00:00
}
/**
2024-04-29 09:24:14 +00:00
User related messages
2024-03-17 18:23:28 +00:00
*/
2024-04-29 09:24:14 +00:00
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 {
2024-04-29 12:02:16 +00:00
EnvironmentMetadata metadata = 1;
EnvironmentSpec spec = 2;
2024-04-29 09:24:14 +00:00
OwnerId owner_id = 3;
Token token = 4;
}
message UpdateOptions {
2024-05-02 10:41:18 +00:00
EnvironmentId id = 1;
EnvironmentMetadata metadata = 2;
EnvironmentSpec spec = 3;
OwnerId owner_id = 4;
Token token = 5;
2024-04-29 09:24:14 +00:00
}
message DeleteOptions {
2024-05-02 10:41:18 +00:00
EnvironmentId id = 1;
EnvironmentMetadata metadata = 2;
2024-04-29 09:24:14 +00:00
OwnerId owner_id = 3;
Token token = 4;
}
message GetOptions {
2024-05-02 10:41:18 +00:00
EnvironmentId id = 1;
EnvironmentMetadata metadata = 2;
2024-04-29 09:24:14 +00:00
OwnerId owner_id = 3;
Token token = 4;
}
message ListOptions {
2024-04-29 12:02:16 +00:00
EnvironmentMetadata metadata = 1;
2024-05-05 19:02:20 +00:00
string search_string = 2;
2024-04-29 09:24:14 +00:00
OwnerId owner_id = 3;
Token token = 4;
}
/**
Environment related messages
*/
2024-05-02 10:41:18 +00:00
message EnvironmentId {
string uuid = 1;
}
2024-04-29 12:02:16 +00:00
message EnvironmentMetadata {
2024-04-29 09:24:14 +00:00
string name = 1; // A name of the environment
2024-04-29 12:02:16 +00:00
string description = 2;
2024-03-17 18:23:28 +00:00
}
2024-04-29 12:02:16 +00:00
message EnvironmentSpec {
2024-04-29 17:45:31 +00:00
Provider provider = 1; // Provide
Kubernetes kubernetes = 2;
ServerType server_type = 3;
Location server_location = 4;
2024-05-06 19:41:41 +00:00
int32 disk_size = 5;
2024-03-18 09:41:09 +00:00
}
2024-04-29 09:24:14 +00:00
message EnvironmentFull {
2024-04-29 12:02:16 +00:00
EnvironmentMetadata metadata = 1;
EnvironmentSpec spec = 2;
2024-05-02 10:41:18 +00:00
EnvironmentId id = 3;
2024-04-29 09:24:14 +00:00
}
/**
Helpers and other messages
*/
2024-03-18 09:41:09 +00:00
enum Provider {
2024-03-21 09:20:03 +00:00
PROVIDER_UNSPECIFIED = 0;
PROVIDER_HETZNER = 1;
2024-03-17 18:23:28 +00:00
}
2024-04-29 15:48:18 +00:00
enum ServerType {
SERVER_TYPE_UNSPECIFIED = 0;
SERVER_TYPE_STARTER = 1;
SERVER_TYPE_REGULAR = 2;
SERVER_TYPE_PLUS = 3;
SERVER_TYPE_PRO = 4;
2024-04-29 17:45:31 +00:00
SERVER_TYPE_CUSTOM = 5;
2024-04-29 15:48:18 +00:00
}
2024-04-29 17:45:31 +00:00
enum Location {
LOCATION_UNSPECIFIED = 0;
LOCATION_HETZNER_NUREMBERG = 1;
LOCATION_HETZNER_FALKENSTEIN = 2;
LOCATION_HETZNER_HELSINKI = 3;
LOCATION_HETZNER_HILLSBORO = 4;
LOCATION_HETZNER_ASHBURN = 5;
2024-04-29 15:48:18 +00:00
}
2024-04-03 16:44:37 +00:00
enum Kubernetes {
KUBERNETES_UNSPECIFIED = 0;
KUBERNETES_K3S = 1;
2024-05-02 10:41:18 +00:00
}