102 lines
1.9 KiB
Protocol Buffer
102 lines
1.9 KiB
Protocol Buffer
/// This file has messages for describing environments
|
|
syntax = "proto3";
|
|
package environments;
|
|
import "google/protobuf/empty.proto";
|
|
option go_package = "git.badhouseplants.net/softplayer/softplayer-go-proto/pkg/environments";
|
|
|
|
/**
|
|
* Service for handling environments
|
|
*/
|
|
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) {}
|
|
}
|
|
|
|
/**
|
|
User related messages
|
|
*/
|
|
|
|
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 {
|
|
string name = 1; // A name of the environment
|
|
}
|
|
|
|
message EnvironmentData {
|
|
Provider provider = 2; // Provide
|
|
Kubernetes kubernetes = 3;
|
|
HetznerOptions hetzner_options = 4;
|
|
}
|
|
|
|
message EnvironmentFull {
|
|
EnvironmentName name = 1;
|
|
EnvironmentData data = 2;
|
|
}
|
|
|
|
|
|
/**
|
|
Helpers and other messages
|
|
*/
|
|
enum Provider {
|
|
PROVIDER_UNSPECIFIED = 0;
|
|
PROVIDER_HETZNER = 1;
|
|
}
|
|
|
|
enum Kubernetes {
|
|
KUBERNETES_UNSPECIFIED = 0;
|
|
KUBERNETES_K3S = 1;
|
|
}
|
|
|
|
message HetznerOptions {
|
|
string server_type = 1;
|
|
string server_location = 2;
|
|
}
|