mirror of
https://github.com/onepanelio/onepanel.git
synced 2025-09-27 01:56:03 +08:00
234 lines
5.4 KiB
Protocol Buffer
234 lines
5.4 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package api;
|
|
option go_package = "github.com/onepanelio/core/api/gen";
|
|
|
|
|
|
import "google/api/annotations.proto";
|
|
import "google/protobuf/empty.proto";
|
|
import "workspace_template.proto";
|
|
import "common.proto";
|
|
import "label.proto";
|
|
|
|
service WorkspaceService {
|
|
rpc CreateWorkspace (CreateWorkspaceRequest) returns (Workspace) {
|
|
option (google.api.http) = {
|
|
post: "/apis/v1beta1/{namespace}/workspaces"
|
|
body: "body"
|
|
};
|
|
}
|
|
|
|
rpc GetWorkspaceStatisticsForNamespace (GetWorkspaceStatisticsForNamespaceRequest) returns (GetWorkspaceStatisticsForNamespaceResponse) {
|
|
option (google.api.http) = {
|
|
get: "/apis/v1beta1/{namespace}/workspace/statistics"
|
|
};
|
|
}
|
|
|
|
rpc GetWorkspace (GetWorkspaceRequest) returns (Workspace) {
|
|
option (google.api.http) = {
|
|
get: "/apis/v1beta1/{namespace}/workspaces/{uid}"
|
|
};
|
|
}
|
|
|
|
rpc ListWorkspaces (ListWorkspaceRequest) returns (ListWorkspaceResponse) {
|
|
option (google.api.http) = {
|
|
get: "/apis/v1beta1/{namespace}/workspaces"
|
|
};
|
|
}
|
|
|
|
rpc UpdateWorkspaceStatus (UpdateWorkspaceStatusRequest) returns (google.protobuf.Empty) {
|
|
option (google.api.http) = {
|
|
put: "/apis/v1beta1/{namespace}/workspaces/{uid}/status"
|
|
body: "status"
|
|
};
|
|
}
|
|
|
|
rpc UpdateWorkspace (UpdateWorkspaceRequest) returns (google.protobuf.Empty) {
|
|
option (google.api.http) = {
|
|
put: "/apis/v1beta1/{namespace}/workspaces/{uid}"
|
|
body: "body"
|
|
};
|
|
}
|
|
|
|
rpc PauseWorkspace (PauseWorkspaceRequest) returns (google.protobuf.Empty) {
|
|
option (google.api.http) = {
|
|
put: "/apis/v1beta1/{namespace}/workspaces/{uid}/pause"
|
|
};
|
|
}
|
|
|
|
rpc ResumeWorkspace (ResumeWorkspaceRequest) returns (google.protobuf.Empty) {
|
|
option (google.api.http) = {
|
|
put: "/apis/v1beta1/{namespace}/workspaces/{uid}/resume"
|
|
body: "body"
|
|
};
|
|
}
|
|
|
|
rpc DeleteWorkspace (DeleteWorkspaceRequest) returns (google.protobuf.Empty) {
|
|
option (google.api.http) = {
|
|
delete: "/apis/v1beta1/{namespace}/workspaces/{uid}"
|
|
};
|
|
}
|
|
|
|
rpc RetryLastWorkspaceAction (RetryActionWorkspaceRequest) returns (google.protobuf.Empty) {
|
|
option (google.api.http) = {
|
|
put: "/apis/v1beta1/{namespace}/workspaces/{uid}/retry"
|
|
};
|
|
}
|
|
|
|
rpc GetWorkspaceContainerLogs (GetWorkspaceContainerLogsRequest) returns (stream LogStreamResponse) {
|
|
option (google.api.http) = {
|
|
get: "/apis/v1beta1/{namespace}/workspaces/{uid}/containers/{containerName}/logs"
|
|
};
|
|
}
|
|
|
|
rpc ListWorkspacesField (ListWorkspacesFieldRequest) returns (ListWorkspacesFieldResponse) {
|
|
option (google.api.http) = {
|
|
get: "/apis/v1beta/{namespace}/field/workspaces/{fieldName}"
|
|
};
|
|
}
|
|
}
|
|
|
|
message WorkspaceComponent {
|
|
string name = 1;
|
|
string url = 2;
|
|
}
|
|
|
|
message Workspace {
|
|
string uid = 1;
|
|
string name = 2;
|
|
int64 version = 3;
|
|
string createdAt = 4;
|
|
repeated Parameter parameters = 5;
|
|
WorkspaceTemplate workspaceTemplate = 6;
|
|
WorkspaceStatus status = 7;
|
|
repeated KeyValue labels = 8;
|
|
string url = 9;
|
|
repeated Parameter templateParameters = 10;
|
|
repeated WorkspaceComponent workspaceComponents = 11;
|
|
MachineType machineType = 12;
|
|
}
|
|
|
|
message WorkspaceStatus {
|
|
string phase = 1;
|
|
string startedAt = 2;
|
|
string pausedAt = 3;
|
|
string terminatedAt = 4;
|
|
}
|
|
|
|
message CreateWorkspaceBody {
|
|
string workspaceTemplateUid = 1;
|
|
int64 workspaceTemplateVersion = 2;
|
|
|
|
repeated Parameter parameters = 3;
|
|
repeated KeyValue labels = 4;
|
|
bool captureNode = 5;
|
|
}
|
|
|
|
message CreateWorkspaceRequest {
|
|
string namespace = 1;
|
|
|
|
CreateWorkspaceBody body = 2;
|
|
}
|
|
|
|
message GetWorkspaceRequest {
|
|
string namespace = 1;
|
|
string uid = 2;
|
|
}
|
|
|
|
message UpdateWorkspaceStatusRequest {
|
|
string namespace = 1;
|
|
string uid = 2;
|
|
WorkspaceStatus status = 3;
|
|
}
|
|
|
|
message UpdateWorkspaceBody {
|
|
repeated Parameter parameters = 1;
|
|
repeated KeyValue labels = 2;
|
|
}
|
|
|
|
message UpdateWorkspaceRequest {
|
|
string namespace = 1;
|
|
string uid = 2;
|
|
UpdateWorkspaceBody body = 3;
|
|
}
|
|
|
|
message ListWorkspaceRequest {
|
|
string namespace = 1;
|
|
int32 pageSize = 2;
|
|
int32 page = 3;
|
|
string order = 4;
|
|
string labels = 5;
|
|
string phase = 6;
|
|
}
|
|
|
|
message ListWorkspaceResponse {
|
|
int32 count = 1;
|
|
repeated Workspace workspaces = 2;
|
|
int32 page = 3;
|
|
int32 pages = 4;
|
|
int32 totalCount = 5;
|
|
int32 totalAvailableCount = 6;
|
|
}
|
|
|
|
message PauseWorkspaceRequest {
|
|
string namespace = 1;
|
|
string uid = 2;
|
|
}
|
|
|
|
message ResumeWorkspaceRequest {
|
|
string namespace = 1;
|
|
string uid = 2;
|
|
UpdateWorkspaceBody body = 3;
|
|
}
|
|
|
|
message DeleteWorkspaceRequest {
|
|
string namespace = 1;
|
|
string uid = 2;
|
|
}
|
|
|
|
message RetryActionWorkspaceRequest {
|
|
string namespace = 1;
|
|
string uid = 2;
|
|
}
|
|
|
|
message WorkspaceStatisticReport {
|
|
int32 total = 1;
|
|
string lastCreated = 2;
|
|
int32 launching = 3;
|
|
int32 running = 4;
|
|
int32 updating = 5;
|
|
int32 pausing = 6;
|
|
int32 paused = 7;
|
|
int32 terminating = 8;
|
|
int32 terminated = 9;
|
|
int32 failedToPause = 10;
|
|
int32 failedToResume = 11;
|
|
int32 failedToTerminate = 12;
|
|
int32 failedToLaunch = 13;
|
|
int32 failedToUpdate = 14;
|
|
int32 failed = 15;
|
|
}
|
|
|
|
message GetWorkspaceStatisticsForNamespaceRequest {
|
|
string namespace = 1;
|
|
}
|
|
|
|
message GetWorkspaceStatisticsForNamespaceResponse {
|
|
WorkspaceStatisticReport stats = 1;
|
|
}
|
|
|
|
message GetWorkspaceContainerLogsRequest {
|
|
string namespace = 1;
|
|
string uid = 2;
|
|
string containerName = 3;
|
|
int64 sinceTime = 4;
|
|
}
|
|
|
|
message ListWorkspacesFieldRequest {
|
|
string namespace = 1;
|
|
string fieldName = 2;
|
|
}
|
|
|
|
message ListWorkspacesFieldResponse {
|
|
repeated string values = 1;
|
|
} |