|
- syntax = "proto3";
-
- package adminserver.api.v1;
-
- option go_package = "server/admin-server/api/v1;v1";
-
-
-
- import "google/api/annotations.proto";
- import "validate/validate.proto";
-
- service Algorithm {
- // 查询预置算法列表
- rpc ListPreAlgorithm (ListPreAlgorithmRequest) returns (ListPreAlgorithmReply) {
- option (google.api.http) = {
- get: "/v1/algorithmmanage/prealgorithm"
- };
- };
- // 查询所有用户算法列表
- rpc ListAllAlgorithm (ListAllAlgorithmRequest) returns (ListAllAlgorithmReply) {
- option (google.api.http) = {
- get: "/v1/algorithmmanage/allalgorithm"
- };
- };
- // 查询算法版本列表
- rpc ListAlgorithmVersion (ListAlgorithmVersionRequest) returns (ListAlgorithmVersionReply) {
- option (google.api.http) = {
- get: "/v1/algorithmmanage/algorithm/{algorithmId}"
- };
- };
- // 删除预置算法
- rpc DeletePreAlgorithm (DeletePreAlgorithmRequest) returns (DeletePreAlgorithmReply) {
- option (google.api.http) = {
- delete: "/v1/algorithmmanage/prealgorithm/{algorithmId}"
- };
- };
- // 删除预置算法版本
- rpc DeletePreAlgorithmVersion (DeletePreAlgorithmVersionRequest) returns (DeletePreAlgorithmVersionReply) {
- option (google.api.http) = {
- delete: "/v1/algorithmmanage/prealgorithm/{algorithmId}/version/{version}"
- };
- };
-
- // 压缩算法包
- rpc DownloadAlgorithmVersionCompress (DownloadAlgorithmVersionCompressRequest) returns (DownloadAlgorithmVersionCompressReply) {
- option (google.api.http) = {
- post: "/v1/algorithmmanage/algorithm/{algorithmId}/version/{version}/downloadcompress"
- body: "*"
- };
- };
-
- // 下载算法版本
- rpc DownloadAlgorithmVersion (DownloadAlgorithmVersionRequest) returns (DownloadAlgorithmVersionReply) {
- option (google.api.http) = {
- get: "/v1/algorithmmanage/algorithm/{algorithmId}/version/{version}/download"
- };
- };
-
- // 新增预置算法版本
- rpc AddPreAlgorithmVersion(AddPreAlgorithmVersionRequest) returns (AddPreAlgorithmVersionReply){
- option (google.api.http) = {
- post: "/v1/algorithmmanage/prealgorithm/{algorithmId}"
- body: "*"
- };
- }
-
- // 新增预置算法
- rpc AddPreAlgorithm(AddAlgorithmRequest) returns (AddAlgorithmReply) {
- option (google.api.http) = {
- post: "/v1/algorithmmanage/prealgorithm"
- body: "*"
- };
- };
-
- // 上传预置算法
- rpc UploadPreAlgorithm(UploadPreAlgorithmRequest) returns (UploadPreAlgorithmReply) {
- option (google.api.http) = {
- post: "/v1/algorithmmanage/prealgorithm/{algorithmId}/version/{version}/upload"
- body: "*"
- };
- };
-
- // 上传预置算法确认
- rpc ConfirmUploadPreAlgorithm(ConfirmUploadPreAlgorithmRequest) returns (ConfirmUploadPreAlgorithmReply) {
- option (google.api.http) = {
- put: "/v1/algorithmmanage/prealgorithm/{algorithmId}/version/{version}/uploadconfirm"
- body: "*"
- };
- };
-
- // 查询算法版本详情
- rpc QueryAlgorithmVersion (QueryAlgorithmVersionRequest) returns (QueryAlgorithmVersionReply) {
- option (google.api.http) = {
- get: "/v1/algorithmmanage/algorithm/{algorithmId}/version/{version}"
- };
- }
-
- }
-
- message AlgorithmDetail {
- string algorithmId = 1;
- string algorithmVersion = 2;
- string spaceId = 3;
- string spaceName = 4;
- string userId = 5;
- string userName = 6;
- string algorithmName = 7;
- string modelName = 8;
- int64 fileStatus = 9;
- int64 latestCompressed = 10;
- string algorithmDescript = 11;
- string path = 12;
- bool isPrefab = 13;
- int64 createdAt = 14;
- }
-
- message MyAlgorithmDetail {
- bool isShared = 1;
- AlgorithmDetail algorithmDetail = 2;
- }
-
- message ListPreAlgorithmRequest {
- int64 pageIndex = 1[(validate.rules).int64 = {gte:1}];
- int64 pageSize = 2[(validate.rules).int64 = {gte:1,lt:100}];
- string sortBy = 3[(validate.rules).string = {in: ["", "asc", "desc"]}];
- string orderBy = 4[(validate.rules).string = {max_len: 20}];
- string algorithmVersion = 5[(validate.rules).string = {max_len: 50}];
- string searchKey = 6[(validate.rules).string = {max_len:512}];
- int64 createdAtGte = 7;
- int64 createdAtLt = 8;
- }
- message ListPreAlgorithmReply {
- int64 totalSize = 1;
- repeated AlgorithmDetail algorithms = 2;
- }
-
- message ListAllAlgorithmRequest {
- int64 pageIndex = 1[(validate.rules).int64 = {gte:1}];
- int64 pageSize = 2[(validate.rules).int64 = {gte:1,lt:100}];
- string sortBy = 3[(validate.rules).string = {in: ["", "asc", "desc"]}];
- string orderBy = 4[(validate.rules).string = {max_len: 20}];
- string algorithmVersion = 5[(validate.rules).string = {max_len: 50}];
- string searchKey = 6[(validate.rules).string = {max_len:512}];
- int64 createdAtGte = 7;
- int64 createdAtLt = 8;
- }
- message ListAllAlgorithmReply {
- int64 totalSize = 1;
- repeated AlgorithmDetail algorithms = 2;
- }
-
- message ListAlgorithmVersionRequest {
- string algorithmId = 1[(validate.rules).string = {min_len:32,pattern:"^[A-Za-z0-9]+$"}];
- int64 pageIndex = 2[(validate.rules).int64 = {gte:1}];
- int64 pageSize = 3[(validate.rules).int64 = {gte:1,lt:100}];
- int64 fileStatus = 4;
- }
- message ListAlgorithmVersionReply {
- int64 totalSize = 1;
- repeated AlgorithmDetail algorithms = 2;
- }
-
- message DeletePreAlgorithmVersionRequest {
- string algorithmId = 1[(validate.rules).string = {len:32,pattern:"^[A-Za-z0-9]+$"}];
- string version = 2[(validate.rules).string = {min_len:2,pattern:"^V[0-9]+$"}];
- }
- message DeletePreAlgorithmVersionReply {
- int64 deletedAt = 1;
- }
-
- message DeletePreAlgorithmRequest {
- string algorithmId = 1[(validate.rules).string = {len:32,pattern:"^[A-Za-z0-9]+$"}];
- }
- message DeletePreAlgorithmReply {
- int64 deletedAt = 1;
- }
-
- message AddAlgorithmRequest {
- string spaceId = 1;
- string userId = 2;
- bool isPrefab = 3;
- bool isEmpty = 4;
- string algorithmName = 5[(validate.rules).string = {min_len:1,max_len:128}];
- string modelName = 6[(validate.rules).string = {min_len:1,max_len:128}];
- string algorithmDescript = 7;
- }
- message AddAlgorithmReply {
- string algorithmId = 1;
- string version = 2;
- int64 createdAt = 3;
- }
- message UploadPreAlgorithmRequest {
- string algorithmId = 1[(validate.rules).string = {len:32,pattern:"^[A-Za-z0-9]+$"}];
- string version = 2[(validate.rules).string = {min_len:2,pattern:"^V[0-9]+$"}];
- string fileName = 3[(validate.rules).string = {min_len:3,pattern:".*\\.zip+$"}];
- string domain = 4[(validate.rules).string = {min_len: 1,pattern:"(https?)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]"}];
- }
- message UploadPreAlgorithmReply {
- string uploadUrl = 1;
- }
- message ConfirmUploadPreAlgorithmRequest {
- string algorithmId = 1;
- string version = 2[(validate.rules).string = {min_len:2,pattern:"^V[0-9]+$"}];
- string fileName = 3;
- }
- message ConfirmUploadPreAlgorithmReply {
- int64 updatedAt = 1;
- }
-
- message DownloadAlgorithmVersionCompressRequest {
- string algorithmId = 1;
- string version = 2[(validate.rules).string = {min_len:2,pattern:"^V[0-9]+$"}];
- }
- message DownloadAlgorithmVersionCompressReply {
- int64 compressAt = 1;
- }
-
- message DownloadAlgorithmVersionRequest {
- string algorithmId = 1[(validate.rules).string = {len:32,pattern:"^[A-Za-z0-9]+$"}];
- string version = 2[(validate.rules).string = {min_len:2,pattern:"^V[0-9]+$"}];
- int64 compressAt = 3[(validate.rules).int64 = {gte:1}];
- string domain = 4[(validate.rules).string = {min_len: 1,pattern:"(https?)://[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]"}];
- }
- message DownloadAlgorithmVersionReply {
- string downloadUrl = 1;
- }
-
- message AddPreAlgorithmVersionRequest {
- string spaceId = 1;
- string userId = 2;
- string algorithmId = 3;
- string algorithmDescript = 4;
- }
- message AddPreAlgorithmVersionReply {
- string algorithmId = 1;
- string version = 2;
- int64 createdAt = 3;
- }
-
- message QueryAlgorithmVersionRequest {
- string algorithmId = 1[(validate.rules).string = {len:32,pattern:"^[A-Za-z0-9]+$"}];
- string version = 2[(validate.rules).string = {min_len:2,pattern:"^V[0-9]+$"}];
- }
- message QueryAlgorithmVersionReply {
- AlgorithmDetail algorithm = 1;
- repeated AlgorithmVersionAccess versionAccesses = 2;
- }
- message AlgorithmVersionAccess {
- string algorithmId = 1;
- string version = 2;
- string spaceId = 3;
- }
|