查询、导入任务合并分支

This commit is contained in:
Diva123456 2023-02-27 14:59:48 +08:00
parent 5df5ab1d87
commit c5cc1e982c
4 changed files with 235 additions and 1 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -165,6 +165,147 @@ message File_statistics{
/******************Job End*************************/
/******************Task(export) Start*************************/
message ExportTaskReq{
string annotation_format = 1; //
int64 export_format = 2; //
ExportParams export_params = 3; //
int32 export_type = 4; //
string path = 5; //OBS的输出路径
string sample_state = 6; //
string source_type_header = 7; //OBS路径前缀
int32 status = 8; //
string task_id = 9; //ID
string version_format = 10; //
string version_id = 11; //ID
bool with_column_header = 12; //CSV文件的第一行
string dataset_id = 13; //ID
string project_id = 14; //ID
}
message ExportTaskResp{
uint32 create_time = 1; //
string error_code = 2; //
string error_msg = 3; //
int64 export_format = 4; //
ExportParams export_params = 5; //
int32 finished_sample_count = 6; //
string path = 7; //
float progress = 8; //
string status = 9; //
string task_id = 10; //ID
int64 total_sample_count = 11; //
uint32 update_time = 12; //
string version_format = 13; //
string version_id = 14; //ID
int32 code = 15; // @gotags: copier:"Code"
}
message ExportParams{
bool clear_hard_property = 1; //
string export_dataset_version_format = 2; //
string export_dataset_version_name = 3; //
string export_dest = 4; //
string export_new_dataset_work_name = 5; //
string export_new_dataset_work_path = 6; //
bool ratio_sample_usage = 7; //-
string sample_state = 8; //
repeated string sample = 9; //ID列表
repeated SearchCondition search_conditions = 10; //(OR)
string train_sample_ratio = 11; //-
}
message SearchCondition {
string coefficient = 1; //
int64 frame_in_video = 2; //
string hard = 3; //
string import_origin = 4; //
string kvp = 5; //CT剂量
SearchLabels label_list = 6; //
string labeler = 7; //
SearchProp metadata = 8; //
string parent_sample_id = 9; //ID
string sample_dir = 10; //
string sample_name = 11; //
string sample_time = 12; //OBS上的最后修改时间()
string score = 13; //
string slice_thickness = 14; //DICOM层厚
string study_date = 15; //DICOM扫描时间
string time_in_video = 16; //
}
message SearchLabels {
repeated SearchLabel labels = 1; //
string op = 2; //op需要有值op的值
}
message weigou{
repeated string aaa = 1;
}
message SearchLabel {
string name = 1; //
string op = 2; //
map<string,weigou> property = 3; //Object格式key是属性名称value是取值列表
int64 type = 4; //
}
message SearchProp {
string op = 1; //
map<string,weigou> props = 2; //
}
/******************Task(export) End*************************/
/******************Get Export Tasks Of Dataset Start*************************/
message GetExportTasksOfDatasetReq{
string dataset_id = 1;
string project_id = 2;
int32 export_type = 3;
int32 limit = 4;
int32 offset = 5;
}
message GetExportTasksOfDatasetResp{
uint32 code = 1; // @gotags: copier:"Code"
uint32 create_time = 2;
string error_code = 3;
string error_msg = 4;
int32 export_format = 5;
ExportParams export_params = 6;
repeated ExportTaskStatus export_tasks = 7;
int32 export_type = 8;
int32 finished_sample_count = 9;
string path = 10;
float progress = 11;
string status = 12;
string task_id = 13;
int64 total_count = 14;
int64 total_sample = 15;
uint32 update_time = 16;
string version_format = 17;
string version_id = 18;
}
message ExportTaskStatus {
uint32 code = 1;
uint32 create_time = 2;
string error_code = 3;
string error_msg = 4;
int32 export_format = 5;
ExportParams export_params = 6;
int32 export_type = 7;
int32 finished_sample_count = 8;
string path = 9;
float progress = 10;
string status = 11;
string task_id = 12;
int64 total_count = 13;
int64 total_sample = 14;
uint32 update_time = 15;
string version_format = 16;
string version_id = 17;
}
/******************Get Export Tasks Of Dataset End*************************/
// Slurm Services for Shuguang Branch
@ -177,4 +318,9 @@ service ModelArts {
rpc findDatasetList(findDatasetReq) returns (findDatasetResp);
rpc ListJob(ListImportTasks) returns (ReturnListImportTasks);
//export task
rpc ExportTask(ExportTaskReq) returns (ExportTaskResp);
rpc GetExportTasksOfDataset(GetExportTasksOfDatasetReq) returns (GetExportTasksOfDatasetResp);
}

View File

@ -17,7 +17,7 @@ func HttpClient(method string, url string, payload io.Reader, token string) ([]b
request, err := http.NewRequest(method, url, payload)
request.Header.Add("Content-Type", "application/json")
request.Header.Add("User-Agent", "API Explorer")
request.Header.Add("token", token)
request.Header.Add("x-auth-token", token)
client := &http.Client{}
res, err := client.Do(request)
if err != nil {
@ -28,5 +28,6 @@ func HttpClient(method string, url string, payload io.Reader, token string) ([]b
if err != nil {
log.Fatal(err)
}
return body, err
}