/// This file has messages for describing environments syntax = "proto3"; package environments; import "google/protobuf/empty.proto"; option go_package = "gitea.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 { EnvironmentMetadata metadata = 1; EnvironmentSpec spec = 2; OwnerId owner_id = 3; Token token = 4; } message UpdateOptions { EnvironmentId id = 1; EnvironmentMetadata metadata = 2; EnvironmentSpec spec = 3; OwnerId owner_id = 4; Token token = 5; } message DeleteOptions { EnvironmentId id = 1; EnvironmentMetadata metadata = 2; OwnerId owner_id = 3; Token token = 4; } message GetOptions { EnvironmentId id = 1; EnvironmentMetadata metadata = 2; OwnerId owner_id = 3; Token token = 4; } message ListOptions { EnvironmentMetadata metadata = 1; string search_string = 2; OwnerId owner_id = 3; Token token = 4; } /** Environment related messages */ message EnvironmentId { string uuid = 1; } message EnvironmentMetadata { string name = 1; // A name of the environment string description = 2; } message EnvironmentSpec { Provider provider = 1; // Provide Kubernetes kubernetes = 2; ServerType server_type = 3; Location server_location = 4; int32 disk_size = 5; } message EnvironmentFull { EnvironmentMetadata metadata = 1; EnvironmentSpec spec = 2; EnvironmentId id = 3; } /** Helpers and other messages */ enum Provider { PROVIDER_UNSPECIFIED = 0; PROVIDER_HETZNER = 1; } enum ServerType { SERVER_TYPE_UNSPECIFIED = 0; SERVER_TYPE_STARTER = 1; SERVER_TYPE_REGULAR = 2; SERVER_TYPE_PLUS = 3; SERVER_TYPE_PRO = 4; SERVER_TYPE_CUSTOM = 5; } 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; } enum Kubernetes { KUBERNETES_UNSPECIFIED = 0; KUBERNETES_K3S = 1; }