diff --git a/README.md b/README.md index 6f84d64..13a6796 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,60 @@ ## Table of Contents +- [accounts/v1/accounts_v1.proto](#accounts_v1_accounts_v1-proto) + - [AccountData](#accounts-AccountData) + - [AccountFull](#accounts-AccountFull) + - [AccountFullWithToken](#accounts-AccountFullWithToken) + - [AccountId](#accounts-AccountId) + - [AccountPassword](#accounts-AccountPassword) + - [AccountWithPassword](#accounts-AccountWithPassword) + - [AccountWithPasswordAndCode](#accounts-AccountWithPasswordAndCode) + - [EmailVerified](#accounts-EmailVerified) + + - [Accounts](#accounts-Accounts) + +- [applications/v1/applications_v1.proto](#applications_v1_applications_v1-proto) + - [ApplicationFull](#applications-ApplicationFull) + - [ApplicationId](#applications-ApplicationId) + - [ApplicationMetadata](#applications-ApplicationMetadata) + - [ApplicationSpec](#applications-ApplicationSpec) + - [ApplicationSpec.ConfigEntry](#applications-ApplicationSpec-ConfigEntry) + - [CreateOptions](#applications-CreateOptions) + - [DeleteOptions](#applications-DeleteOptions) + - [GetOptions](#applications-GetOptions) + - [ListOptions](#applications-ListOptions) + - [OwnerId](#applications-OwnerId) + - [Token](#applications-Token) + - [UpdateOptions](#applications-UpdateOptions) + + - [Applications](#applications-Applications) + +- [email/v1/email_v1.proto](#email_v1_email_v1-proto) + - [ConfirmValidation](#email-ConfirmValidation) + - [RequestValidation](#email-RequestValidation) + + - [EmailValidation](#email-EmailValidation) + +- [environments/v1/environments_v1.proto](#environments_v1_environments_v1-proto) + - [CreateOptions](#environments-CreateOptions) + - [DeleteOptions](#environments-DeleteOptions) + - [EnvironmentFull](#environments-EnvironmentFull) + - [EnvironmentId](#environments-EnvironmentId) + - [EnvironmentMetadata](#environments-EnvironmentMetadata) + - [EnvironmentSpec](#environments-EnvironmentSpec) + - [GetOptions](#environments-GetOptions) + - [ListOptions](#environments-ListOptions) + - [OwnerId](#environments-OwnerId) + - [Token](#environments-Token) + - [UpdateOptions](#environments-UpdateOptions) + + - [Kubernetes](#environments-Kubernetes) + - [Location](#environments-Location) + - [Provider](#environments-Provider) + - [ServerType](#environments-ServerType) + + - [Environments](#environments-Environments) + - [test/v1/test_v1.proto](#test_v1_test_v1-proto) - [PingRequest](#test-v1-PingRequest) - [PingResponse](#test-v1-PingResponse) @@ -15,6 +69,728 @@ + +

Top

+ +## accounts/v1/accounts_v1.proto +This file has messages for describing environments + + + + +### AccountData + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| name | [string](#string) | | Account name | +| email | [string](#string) | | Account email | + + + + + + + + +### AccountFull + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [AccountId](#accounts-AccountId) | | | +| data | [AccountData](#accounts-AccountData) | | | + + + + + + + + +### AccountFullWithToken + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [AccountId](#accounts-AccountId) | | | +| data | [AccountData](#accounts-AccountData) | | | +| token | [string](#string) | | | + + + + + + + + +### AccountId +Represents a environment UUID only + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [string](#string) | | Contour ID: UUID | + + + + + + + + +### AccountPassword + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| password | [string](#string) | | | + + + + + + + + +### AccountWithPassword + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| data | [AccountData](#accounts-AccountData) | | | +| password | [AccountPassword](#accounts-AccountPassword) | | | + + + + + + + + +### AccountWithPasswordAndCode + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| data | [AccountData](#accounts-AccountData) | | | +| password | [AccountPassword](#accounts-AccountPassword) | | | +| code | [string](#string) | | | + + + + + + + + +### EmailVerified + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| verified | [bool](#bool) | | | + + + + + + + + + + + + + + +### Accounts +Service for handling environments + +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| SignUp | [AccountWithPassword](#accounts-AccountWithPassword) | [AccountFullWithToken](#accounts-AccountFullWithToken) | | +| SignIn | [AccountWithPassword](#accounts-AccountWithPassword) | [AccountFullWithToken](#accounts-AccountFullWithToken) | | +| ResetPassword | [AccountData](#accounts-AccountData) | [.google.protobuf.Empty](#google-protobuf-Empty) | | +| NewPassword | [AccountWithPasswordAndCode](#accounts-AccountWithPasswordAndCode) | [.google.protobuf.Empty](#google-protobuf-Empty) | | +| IsEmailVerified | [AccountData](#accounts-AccountData) | [EmailVerified](#accounts-EmailVerified) | | + + + + + + +

Top

+ +## applications/v1/applications_v1.proto +This file has messages for describing applications + + + + +### ApplicationFull + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| metadata | [ApplicationMetadata](#applications-ApplicationMetadata) | | | +| spec | [ApplicationSpec](#applications-ApplicationSpec) | | | +| id | [ApplicationId](#applications-ApplicationId) | | | + + + + + + + + +### ApplicationId + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| uuid | [string](#string) | | | + + + + + + + + +### ApplicationMetadata + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| name | [string](#string) | | | +| description | [string](#string) | | | + + + + + + + + +### ApplicationSpec + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| application | [string](#string) | | | +| version | [string](#string) | | | +| environemnt_id | [string](#string) | | | +| config | [ApplicationSpec.ConfigEntry](#applications-ApplicationSpec-ConfigEntry) | repeated | | +| raw_config | [string](#string) | | | + + + + + + + + +### ApplicationSpec.ConfigEntry + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| key | [string](#string) | | | +| value | [string](#string) | | | + + + + + + + + +### CreateOptions + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| metadata | [ApplicationMetadata](#applications-ApplicationMetadata) | | | +| spec | [ApplicationSpec](#applications-ApplicationSpec) | | | +| owner_id | [OwnerId](#applications-OwnerId) | | | +| token | [Token](#applications-Token) | | | + + + + + + + + +### DeleteOptions + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [ApplicationId](#applications-ApplicationId) | | | +| metadata | [ApplicationMetadata](#applications-ApplicationMetadata) | | | +| owner_id | [OwnerId](#applications-OwnerId) | | | +| token | [Token](#applications-Token) | | | + + + + + + + + +### GetOptions + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [ApplicationId](#applications-ApplicationId) | | | +| metadata | [ApplicationMetadata](#applications-ApplicationMetadata) | | | +| owner_id | [OwnerId](#applications-OwnerId) | | | +| token | [Token](#applications-Token) | | | + + + + + + + + +### ListOptions + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| metadata | [ApplicationMetadata](#applications-ApplicationMetadata) | | | +| owner_id | [OwnerId](#applications-OwnerId) | | | +| token | [Token](#applications-Token) | | | + + + + + + + + +### OwnerId + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| uuid | [string](#string) | | UUID of a user that is creating an environemnt | + + + + + + + + +### Token + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| token | [string](#string) | | Token that should be used to create an environment | + + + + + + + + +### UpdateOptions + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [ApplicationId](#applications-ApplicationId) | | | +| metadata | [ApplicationMetadata](#applications-ApplicationMetadata) | | | +| spec | [ApplicationSpec](#applications-ApplicationSpec) | | | +| owner_id | [OwnerId](#applications-OwnerId) | | | +| token | [Token](#applications-Token) | | | + + + + + + + + + + + + + + +### Applications +Service for handling applications + +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| Create | [CreateOptions](#applications-CreateOptions) | [ApplicationFull](#applications-ApplicationFull) | | +| Update | [UpdateOptions](#applications-UpdateOptions) | [ApplicationFull](#applications-ApplicationFull) | | +| Delete | [DeleteOptions](#applications-DeleteOptions) | [.google.protobuf.Empty](#google-protobuf-Empty) | | +| Get | [GetOptions](#applications-GetOptions) | [ApplicationFull](#applications-ApplicationFull) | | +| List | [ListOptions](#applications-ListOptions) | [ApplicationFull](#applications-ApplicationFull) stream | | + + + + + + +

Top

+ +## email/v1/email_v1.proto + + + + + +### ConfirmValidation + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| user_id | [string](#string) | | | +| code | [int32](#int32) | | | + + + + + + + + +### RequestValidation + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| user_id | [string](#string) | | | + + + + + + + + + + + + + + +### EmailValidation +A service that should handle email validation + +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| SendRequest | [RequestValidation](#email-RequestValidation) | [.google.protobuf.Empty](#google-protobuf-Empty) | | +| ValidateEmail | [ConfirmValidation](#email-ConfirmValidation) | [.google.protobuf.Empty](#google-protobuf-Empty) | | + + + + + + +

Top

+ +## environments/v1/environments_v1.proto +This file has messages for describing environments + + + + +### CreateOptions + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| metadata | [EnvironmentMetadata](#environments-EnvironmentMetadata) | | | +| spec | [EnvironmentSpec](#environments-EnvironmentSpec) | | | +| owner_id | [OwnerId](#environments-OwnerId) | | | +| token | [Token](#environments-Token) | | | + + + + + + + + +### DeleteOptions + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [EnvironmentId](#environments-EnvironmentId) | | | +| metadata | [EnvironmentMetadata](#environments-EnvironmentMetadata) | | | +| owner_id | [OwnerId](#environments-OwnerId) | | | +| token | [Token](#environments-Token) | | | + + + + + + + + +### EnvironmentFull + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| metadata | [EnvironmentMetadata](#environments-EnvironmentMetadata) | | | +| spec | [EnvironmentSpec](#environments-EnvironmentSpec) | | | +| id | [EnvironmentId](#environments-EnvironmentId) | | | + + + + + + + + +### EnvironmentId + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| uuid | [string](#string) | | | + + + + + + + + +### EnvironmentMetadata + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| name | [string](#string) | | A name of the environment | +| description | [string](#string) | | | + + + + + + + + +### EnvironmentSpec + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| provider | [Provider](#environments-Provider) | | Provide | +| kubernetes | [Kubernetes](#environments-Kubernetes) | | | +| server_type | [ServerType](#environments-ServerType) | | | +| server_location | [Location](#environments-Location) | | | +| disk_size | [int32](#int32) | | | + + + + + + + + +### GetOptions + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [EnvironmentId](#environments-EnvironmentId) | | | +| metadata | [EnvironmentMetadata](#environments-EnvironmentMetadata) | | | +| owner_id | [OwnerId](#environments-OwnerId) | | | +| token | [Token](#environments-Token) | | | + + + + + + + + +### ListOptions + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| metadata | [EnvironmentMetadata](#environments-EnvironmentMetadata) | | | +| search_string | [string](#string) | | | +| owner_id | [OwnerId](#environments-OwnerId) | | | +| token | [Token](#environments-Token) | | | + + + + + + + + +### OwnerId + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| uuid | [string](#string) | | UUID of a user that is creating an environemnt | + + + + + + + + +### Token + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| token | [string](#string) | | Token that should be used to create an environment | + + + + + + + + +### UpdateOptions + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| id | [EnvironmentId](#environments-EnvironmentId) | | | +| metadata | [EnvironmentMetadata](#environments-EnvironmentMetadata) | | | +| spec | [EnvironmentSpec](#environments-EnvironmentSpec) | | | +| owner_id | [OwnerId](#environments-OwnerId) | | | +| token | [Token](#environments-Token) | | | + + + + + + + + + + +### Kubernetes + + +| Name | Number | Description | +| ---- | ------ | ----------- | +| KUBERNETES_UNSPECIFIED | 0 | | +| KUBERNETES_K3S | 1 | | + + + + + +### Location + + +| Name | Number | Description | +| ---- | ------ | ----------- | +| LOCATION_UNSPECIFIED | 0 | | +| LOCATION_HETZNER_NUREMBERG | 1 | | +| LOCATION_HETZNER_FALKENSTEIN | 2 | | +| LOCATION_HETZNER_HELSINKI | 3 | | +| LOCATION_HETZNER_HILLSBORO | 4 | | +| LOCATION_HETZNER_ASHBURN | 5 | | + + + + + +### Provider +Helpers and other messages + +| Name | Number | Description | +| ---- | ------ | ----------- | +| PROVIDER_UNSPECIFIED | 0 | | +| PROVIDER_HETZNER | 1 | | + + + + + +### ServerType + + +| Name | Number | Description | +| ---- | ------ | ----------- | +| SERVER_TYPE_UNSPECIFIED | 0 | | +| SERVER_TYPE_STARTER | 1 | | +| SERVER_TYPE_REGULAR | 2 | | +| SERVER_TYPE_PLUS | 3 | | +| SERVER_TYPE_PRO | 4 | | +| SERVER_TYPE_CUSTOM | 5 | | + + + + + + + + + +### Environments +Service for handling environments + +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| Create | [CreateOptions](#environments-CreateOptions) | [EnvironmentFull](#environments-EnvironmentFull) | | +| Update | [UpdateOptions](#environments-UpdateOptions) | [EnvironmentFull](#environments-EnvironmentFull) | | +| Delete | [DeleteOptions](#environments-DeleteOptions) | [.google.protobuf.Empty](#google-protobuf-Empty) | | +| Get | [GetOptions](#environments-GetOptions) | [EnvironmentFull](#environments-EnvironmentFull) | | +| List | [ListOptions](#environments-ListOptions) | [EnvironmentFull](#environments-EnvironmentFull) stream | | + + + + +

Top

diff --git a/proto/accounts/v1/accounts_v1.proto b/proto/accounts/v1/accounts_v1.proto new file mode 100644 index 0000000..6c8fe28 --- /dev/null +++ b/proto/accounts/v1/accounts_v1.proto @@ -0,0 +1,60 @@ +/// This file has messages for describing environments +syntax = "proto3"; +package accounts; +import "google/protobuf/empty.proto"; +option go_package = "gitea.badhouseplants.net/softplayer/softplayer-go-proto/pkg/accounts"; + +/** + * Service for handling environments + */ +service Accounts { + rpc SignUp (AccountWithPassword) returns (AccountFullWithToken) {} + rpc SignIn (AccountWithPassword) returns (AccountFullWithToken) {} + rpc ResetPassword (AccountData) returns (google.protobuf.Empty) {} + rpc NewPassword (AccountWithPasswordAndCode) returns (google.protobuf.Empty) {} + rpc IsEmailVerified (AccountData) returns (EmailVerified) {} +} + +message EmailVerified { + bool verified = 1; +} +/** + * Represents a environment UUID only + */ +message AccountId { + string id = 1; // Contour ID: UUID +} + +message AccountPassword { + string password = 1; +} + + +message AccountData { + string name = 1; // Account name + string email = 2; // Account email +} + +message AccountWithPassword { + AccountData data = 1; + AccountPassword password = 2; +} + +message AccountWithPasswordAndCode { + AccountData data = 1; + AccountPassword password = 2; + string code = 3; +} + + +message AccountFull { + AccountId id = 1; + AccountData data = 2; +} + +message AccountFullWithToken { + AccountId id = 1; + AccountData data = 2; + string token = 3; +} + diff --git a/proto/applications/v1/applications_v1.proto b/proto/applications/v1/applications_v1.proto new file mode 100644 index 0000000..0972545 --- /dev/null +++ b/proto/applications/v1/applications_v1.proto @@ -0,0 +1,93 @@ +/// This file has messages for describing applications +syntax = "proto3"; +package applications; +import "google/protobuf/empty.proto"; +option go_package = "gitea.badhouseplants.net/softplayer/softplayer-go-proto/pkg/applications"; + +/** + * Service for handling applications + */ +service Applications { + rpc Create(CreateOptions) returns (ApplicationFull) {} + rpc Update(UpdateOptions) returns (ApplicationFull) {} + rpc Delete(DeleteOptions) returns (google.protobuf.Empty) {} + rpc Get(GetOptions) returns (ApplicationFull) {} + rpc List(ListOptions) returns (stream ApplicationFull) {} +} + +/** + 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 { + ApplicationMetadata metadata = 1; + ApplicationSpec spec = 2; + OwnerId owner_id = 3; + Token token = 4; +} + +message UpdateOptions { + ApplicationId id = 1; + ApplicationMetadata metadata = 2; + ApplicationSpec spec = 3; + OwnerId owner_id = 4; + Token token = 5; +} + +message DeleteOptions { + ApplicationId id = 1; + ApplicationMetadata metadata = 2; + OwnerId owner_id = 3; + Token token = 4; +} + +message GetOptions { + ApplicationId id = 1; + ApplicationMetadata metadata = 2; + OwnerId owner_id = 3; + Token token = 4; +} + +message ListOptions { + ApplicationMetadata metadata = 1; + OwnerId owner_id = 2; + Token token = 3; +} +/** + Environment related messages + */ + +message ApplicationId { + string uuid = 1; +} + +message ApplicationMetadata { + string name = 1; + string description = 2; +} + +message ApplicationSpec { + string application = 1; + string version = 2; + string environemnt_id = 3; + map config = 4; + string raw_config = 5; +} + +message ApplicationFull { + ApplicationMetadata metadata = 1; + ApplicationSpec spec = 2; + ApplicationId id = 3; +} diff --git a/proto/email/v1/email_v1.proto b/proto/email/v1/email_v1.proto new file mode 100644 index 0000000..41e78a4 --- /dev/null +++ b/proto/email/v1/email_v1.proto @@ -0,0 +1,22 @@ +syntax = "proto3"; +package email; +import "google/protobuf/empty.proto"; +option go_package = "gitea.badhouseplants.net/softplayer/softplayer-go-proto/pkg/email"; + +/* + * A service that should handle email validation + */ +service EmailValidation { + rpc SendRequest (RequestValidation) returns (google.protobuf.Empty) {} + rpc ValidateEmail (ConfirmValidation) returns (google.protobuf.Empty) {} +} + +message RequestValidation { + string user_id = 1; +} + +message ConfirmValidation { + string user_id = 1; + int32 code = 2; +} + diff --git a/proto/environments/v1/environments_v1.proto b/proto/environments/v1/environments_v1.proto new file mode 100644 index 0000000..f6148a9 --- /dev/null +++ b/proto/environments/v1/environments_v1.proto @@ -0,0 +1,125 @@ +/// 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; +}