token获取修改提交
This commit is contained in:
parent
12b6eddab9
commit
5a87ab665b
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,42 @@
|
|||
package logic
|
||||
|
||||
import (
|
||||
"PCM/adaptor/AIComputing/modelarts/rpc/internal/common"
|
||||
"PCM/adaptor/AIComputing/modelarts/rpc/internal/svc"
|
||||
"PCM/adaptor/AIComputing/modelarts/rpc/modelarts"
|
||||
"PCM/common/tool"
|
||||
"context"
|
||||
"k8s.io/apimachinery/pkg/util/json"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type DeleteTrainingJobConfigLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewDeleteTrainingJobConfigLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteTrainingJobConfigLogic {
|
||||
return &DeleteTrainingJobConfigLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
// DeleteTrainingJobConfig 删除训练作业参数
|
||||
func (l *DeleteTrainingJobConfigLogic) DeleteTrainingJobConfig(in *modelarts.DeleteTrainingJobConfigReq) (*modelarts.DeleteTrainingJobConfigResp, error) {
|
||||
var resp modelarts.DeleteTrainingJobConfigResp
|
||||
url := "https://modelarts.cn-north-4.myhuaweicloud.com/v1/" + in.ProjectId + "/training-job-configs/" + in.ConfigName
|
||||
token := common.GetToken()
|
||||
body, err := tool.HttpClient(tool.DELETE, url, nil, token)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
json.Unmarshal(body, &resp)
|
||||
if &resp == nil {
|
||||
return nil, err
|
||||
}
|
||||
return &resp, nil
|
||||
}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -532,6 +532,19 @@ message CreateTrainingJobConfigResp{
|
|||
|
||||
/******************CreateTrainingJobConfig end*************************/
|
||||
|
||||
/******************DeleteTrainingJobConfig start*************************/
|
||||
message DeleteTrainingJobConfigReq{
|
||||
string project_id =1;
|
||||
string config_name=2;
|
||||
}
|
||||
message DeleteTrainingJobConfigResp{
|
||||
bool is_success =1;
|
||||
string error_message =2;
|
||||
string error_code =3;
|
||||
}
|
||||
|
||||
/******************DeleteTrainingJobConfig end*************************/
|
||||
|
||||
/******************Task(export) Start*************************/
|
||||
message ExportTaskReq{
|
||||
string annotation_format = 1; //标注格式
|
||||
|
@ -1128,9 +1141,9 @@ service ModelArts {
|
|||
//get modelarts Token
|
||||
rpc GetDatasetList(datasetReq) returns (datasetResp);
|
||||
|
||||
//creat task
|
||||
//creat task 创建导入任务
|
||||
rpc createTask(ImportTaskData) returns(ImprotTaskDataReq);
|
||||
//get taskList
|
||||
//get taskList 查询数据集导入任务列表
|
||||
rpc GetImportTaskList(ListImportTasks) returns (ReturnListImportTasks);
|
||||
// ListTrainingJobs 查询训练作业列表
|
||||
rpc GetListTrainingJobs(ListTrainingJobsreq) returns (ListTrainingJobsresp);
|
||||
|
@ -1138,6 +1151,9 @@ service ModelArts {
|
|||
rpc CreateTrainingJob(CreateTrainingJobReq) returns (CreateTrainingJobResp);
|
||||
// CreateTrainingJobConfig 创建训练作业参数
|
||||
rpc CreateTrainingJobConfig(CreateTrainingJobConfigReq) returns (CreateTrainingJobConfigResp);
|
||||
// DeleteTrainingJobConfig 删除训练作业参数
|
||||
rpc DeleteTrainingJobConfig(DeleteTrainingJobConfigReq) returns (DeleteTrainingJobConfigResp);
|
||||
|
||||
//export task
|
||||
rpc ExportTask(ExportTaskReq) returns (ExportTaskResp);
|
||||
rpc GetExportTasksOfDataset(GetExportTasksOfDatasetReq) returns (GetExportTasksOfDatasetResp);
|
||||
|
|
Loading…
Reference in New Issue