mirror of
https://github.com/onepanelio/onepanel.git
synced 2025-11-02 21:55:05 +08:00
This is so we can get the options from a workflow template version, since the parameters for a workspace do not store options.
147 lines
3.3 KiB
Protocol Buffer
147 lines
3.3 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
package api;
|
|
|
|
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 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"
|
|
};
|
|
}
|
|
|
|
rpc DeleteWorkspace (DeleteWorkspaceRequest) returns (google.protobuf.Empty) {
|
|
option (google.api.http) = {
|
|
delete: "/apis/v1beta1/{namespace}/workspaces/{uid}"
|
|
};
|
|
}
|
|
}
|
|
|
|
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;
|
|
}
|
|
|
|
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;
|
|
}
|
|
|
|
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;
|
|
}
|
|
|
|
message ListWorkspaceResponse {
|
|
int32 count = 1;
|
|
repeated Workspace workspaces = 2;
|
|
int32 page = 3;
|
|
int32 pages = 4;
|
|
int32 totalCount = 5;
|
|
}
|
|
|
|
message PauseWorkspaceRequest {
|
|
string namespace = 1;
|
|
string uid = 2;
|
|
}
|
|
|
|
message ResumeWorkspaceRequest {
|
|
string namespace = 1;
|
|
string uid = 2;
|
|
}
|
|
|
|
message DeleteWorkspaceRequest {
|
|
string namespace = 1;
|
|
string uid = 2;
|
|
} |