modelarts notebook接口调整
Former-commit-id: 024d983ce69d9e5ba53c981675485d1011c9a58a
This commit is contained in:
parent
b1ed4cb501
commit
8b68433d14
|
@ -7,7 +7,6 @@ import (
|
||||||
"PCM/common/tool"
|
"PCM/common/tool"
|
||||||
"context"
|
"context"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
|
||||||
"github.com/zeromicro/go-zero/core/logx"
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -31,19 +30,25 @@ func (l *CreateNotebookLogic) CreateNotebook(in *modelarts.CreateNotebookReq) (*
|
||||||
|
|
||||||
token := common.GetToken()
|
token := common.GetToken()
|
||||||
|
|
||||||
|
var createResp modelarts.NotebookResp
|
||||||
|
|
||||||
req := tool.GetACHttpRequest()
|
req := tool.GetACHttpRequest()
|
||||||
res, err := req.
|
res, err := req.
|
||||||
SetHeader("x-auth-token", token).
|
SetHeader("x-auth-token", token).
|
||||||
SetPathParam("project_id", in.ProjectId).
|
SetPathParam("project_id", in.ProjectId).
|
||||||
SetBody(in.Param).
|
SetBody(in.Param).
|
||||||
SetResult(resp.NotebookResp).
|
SetResult(&createResp).
|
||||||
Post(createUrl)
|
Post(createUrl)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if res.StatusCode() != 200 || res.StatusCode() != 201 {
|
if res.StatusCode() == 200 || res.StatusCode() == 201 {
|
||||||
|
resp.NotebookResp = &createResp
|
||||||
|
resp.Code = int32(res.StatusCode())
|
||||||
|
resp.Msg = "Success"
|
||||||
|
} else {
|
||||||
resp.Code = int32(res.StatusCode())
|
resp.Code = int32(res.StatusCode())
|
||||||
resp.Msg = "Failure"
|
resp.Msg = "Failure"
|
||||||
|
|
||||||
|
@ -53,9 +58,6 @@ func (l *CreateNotebookLogic) CreateNotebook(in *modelarts.CreateNotebookReq) (*
|
||||||
errMsg.ErrorMsg = ""
|
errMsg.ErrorMsg = ""
|
||||||
}
|
}
|
||||||
resp.ErrorMsg = errMsg.ErrorMsg
|
resp.ErrorMsg = errMsg.ErrorMsg
|
||||||
} else {
|
|
||||||
resp.Code = int32(res.StatusCode())
|
|
||||||
resp.Msg = "Success"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return resp, nil
|
return resp, nil
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -13,6 +13,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type (
|
type (
|
||||||
|
ActionProgress = modelarts.ActionProgress
|
||||||
AdvancedConfigAl = modelarts.AdvancedConfigAl
|
AdvancedConfigAl = modelarts.AdvancedConfigAl
|
||||||
AlgoConfigs = modelarts.AlgoConfigs
|
AlgoConfigs = modelarts.AlgoConfigs
|
||||||
Algorithm = modelarts.Algorithm
|
Algorithm = modelarts.Algorithm
|
||||||
|
@ -35,6 +36,7 @@ type (
|
||||||
ConstraintAlRq = modelarts.ConstraintAlRq
|
ConstraintAlRq = modelarts.ConstraintAlRq
|
||||||
ConstraintCreateTraining = modelarts.ConstraintCreateTraining
|
ConstraintCreateTraining = modelarts.ConstraintCreateTraining
|
||||||
ContainerHooks = modelarts.ContainerHooks
|
ContainerHooks = modelarts.ContainerHooks
|
||||||
|
ContainerHooksResp = modelarts.ContainerHooksResp
|
||||||
Cpu = modelarts.Cpu
|
Cpu = modelarts.Cpu
|
||||||
CreateAlgorithmReq = modelarts.CreateAlgorithmReq
|
CreateAlgorithmReq = modelarts.CreateAlgorithmReq
|
||||||
CreateAlgorithmResp = modelarts.CreateAlgorithmResp
|
CreateAlgorithmResp = modelarts.CreateAlgorithmResp
|
||||||
|
@ -113,6 +115,7 @@ type (
|
||||||
GetVisualizationJobResp = modelarts.GetVisualizationJobResp
|
GetVisualizationJobResp = modelarts.GetVisualizationJobResp
|
||||||
Gpu = modelarts.Gpu
|
Gpu = modelarts.Gpu
|
||||||
GuideDoc = modelarts.GuideDoc
|
GuideDoc = modelarts.GuideDoc
|
||||||
|
Hooks = modelarts.Hooks
|
||||||
I18NDescription = modelarts.I18NDescription
|
I18NDescription = modelarts.I18NDescription
|
||||||
Identity = modelarts.Identity
|
Identity = modelarts.Identity
|
||||||
Image = modelarts.Image
|
Image = modelarts.Image
|
||||||
|
@ -191,6 +194,8 @@ type (
|
||||||
Policies = modelarts.Policies
|
Policies = modelarts.Policies
|
||||||
PoliciesCreateTraining = modelarts.PoliciesCreateTraining
|
PoliciesCreateTraining = modelarts.PoliciesCreateTraining
|
||||||
Pool = modelarts.Pool
|
Pool = modelarts.Pool
|
||||||
|
PostStart = modelarts.PostStart
|
||||||
|
PreStart = modelarts.PreStart
|
||||||
ProcessorDataSource = modelarts.ProcessorDataSource
|
ProcessorDataSource = modelarts.ProcessorDataSource
|
||||||
Project = modelarts.Project
|
Project = modelarts.Project
|
||||||
QueryServiceConfig = modelarts.QueryServiceConfig
|
QueryServiceConfig = modelarts.QueryServiceConfig
|
||||||
|
@ -237,6 +242,8 @@ type (
|
||||||
TokenReq = modelarts.TokenReq
|
TokenReq = modelarts.TokenReq
|
||||||
TokenResp = modelarts.TokenResp
|
TokenResp = modelarts.TokenResp
|
||||||
User = modelarts.User
|
User = modelarts.User
|
||||||
|
UserNotebookDomain = modelarts.UserNotebookDomain
|
||||||
|
UserNotebookResp = modelarts.UserNotebookResp
|
||||||
VolumeReq = modelarts.VolumeReq
|
VolumeReq = modelarts.VolumeReq
|
||||||
VolumeRes = modelarts.VolumeRes
|
VolumeRes = modelarts.VolumeRes
|
||||||
Volumes = modelarts.Volumes
|
Volumes = modelarts.Volumes
|
||||||
|
|
|
@ -1779,7 +1779,7 @@ message DataVolumesRes{
|
||||||
}
|
}
|
||||||
|
|
||||||
message NotebookResp{
|
message NotebookResp{
|
||||||
repeated JobProgress action_progress = 1; // @gotags: copier:"ActionProgress"
|
repeated ActionProgress action_progress = 1; // @gotags: copier:"ActionProgress"
|
||||||
string description = 2; // @gotags: copier:"Description"
|
string description = 2; // @gotags: copier:"Description"
|
||||||
repeated EndpointsRes endpoints = 3; // @gotags: copier:"Endpoints"
|
repeated EndpointsRes endpoints = 3; // @gotags: copier:"Endpoints"
|
||||||
string fail_reason = 4; // @gotags: copier:"FailReason"
|
string fail_reason = 4; // @gotags: copier:"FailReason"
|
||||||
|
@ -1795,7 +1795,53 @@ message NotebookResp{
|
||||||
VolumeRes volume = 14; // @gotags: copier:"Volume"
|
VolumeRes volume = 14; // @gotags: copier:"Volume"
|
||||||
string workspace_id = 15; // @gotags: copier:"WorkspaceId"
|
string workspace_id = 15; // @gotags: copier:"WorkspaceId"
|
||||||
string feature = 16; // @gotags: copier:"Feature"
|
string feature = 16; // @gotags: copier:"Feature"
|
||||||
|
int64 create_at = 17; // @gotags: copier:"CreateAt" *
|
||||||
|
Hooks hooks = 18; // @gotags: copier:"Hooks" *
|
||||||
|
repeated string tags = 19; // @gotags: copier:"Tags" *
|
||||||
|
int64 update_at = 20; // @gotags: copier:"UpdateAt" *
|
||||||
|
UserNotebookResp user = 21; // @gotags: copier:"UserNotebookResp" *
|
||||||
|
string user_id = 22; // @gotags: copier:"UserId" *
|
||||||
|
repeated string billing_items = 23; // @gotags: copier:"BillingItems" *
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message UserNotebookResp{
|
||||||
|
UserNotebookDomain domain = 1; // @gotags: copier:"UserNotebookDomain" *
|
||||||
|
string id = 2; // @gotags: copier:"Id" *
|
||||||
|
string name = 3; // @gotags: copier:"Name" *
|
||||||
|
}
|
||||||
|
|
||||||
|
message UserNotebookDomain{
|
||||||
|
string id = 1; // @gotags: copier:"Id" *
|
||||||
|
string name = 2; // @gotags: copier:"Name" *
|
||||||
|
}
|
||||||
|
|
||||||
|
message Hooks {
|
||||||
|
ContainerHooksResp containerHooks =1; // @gotags: copier:"ContainerHooksResp" *
|
||||||
|
}
|
||||||
|
|
||||||
|
message ContainerHooksResp{
|
||||||
|
PostStart postStart=1; // @gotags: copier:"PostStart" *
|
||||||
|
PreStart preStart=2; // @gotags: copier:"PreStart" *
|
||||||
|
}
|
||||||
|
|
||||||
|
message PostStart{
|
||||||
|
string mode=1; // @gotags: copier:"Mode" *
|
||||||
|
string script=2; // @gotags: copier:"Script" *
|
||||||
|
string type=3; // @gotags: copier:"Type" *
|
||||||
|
}
|
||||||
|
|
||||||
|
message PreStart{
|
||||||
|
string mode=1; // @gotags: copier:"Mode" *
|
||||||
|
string script=2; // @gotags: copier:"Script" *
|
||||||
|
string type=3; // @gotags: copier:"Type" *
|
||||||
|
}
|
||||||
|
|
||||||
|
message ActionProgress{
|
||||||
|
int32 step = 1; // @gotags: copier:"Step" *
|
||||||
|
string status = 2; // @gotags: copier:"Status" *
|
||||||
|
string description = 3; // @gotags: copier:"Description" *
|
||||||
|
}
|
||||||
|
|
||||||
message JobProgress{
|
message JobProgress{
|
||||||
string notebook_id = 1; // @gotags: copier:"NotebookId"
|
string notebook_id = 1; // @gotags: copier:"NotebookId"
|
||||||
string status = 2; // @gotags: copier:"Status"
|
string status = 2; // @gotags: copier:"Status"
|
||||||
|
|
|
@ -1089,7 +1089,7 @@ type (
|
||||||
PoolId string `json:"pool_id,optional" copier:"PoolId"`
|
PoolId string `json:"pool_id,optional" copier:"PoolId"`
|
||||||
Volume VolumeReq `json:"volume" copier:"Volume"`
|
Volume VolumeReq `json:"volume" copier:"Volume"`
|
||||||
WorkspaceId string `json:"workspace_id,optional" copier:"WorkspaceId"`
|
WorkspaceId string `json:"workspace_id,optional" copier:"WorkspaceId"`
|
||||||
Hooks CustomHooks `json:"hooks,optional" copier:"Hooks"`
|
Hooks CustomHooks `json:"hooks" copier:"Hooks"`
|
||||||
Lease LeaseReq `json:"lease,optional" copier:"Lease"`
|
Lease LeaseReq `json:"lease,optional" copier:"Lease"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1158,73 +1158,118 @@ type (
|
||||||
Uri string `json:"uri" copier:"Uri"`
|
Uri string `json:"uri" copier:"Uri"`
|
||||||
}
|
}
|
||||||
NotebookResp {
|
NotebookResp {
|
||||||
ActionProgress []JobProgress `json:"action_progress" copier:"ActionProgress"`
|
ActionProgress []ActionProgress `json:"action_progress,omitempty" copier:"ActionProgress"`
|
||||||
Description string `json:"description" copier:"Description"`
|
Description string `json:"description,omitempty" copier:"Description"`
|
||||||
Endpoints []EndpointsRes `json:"endpoints" copier:"Endpoints"`
|
Endpoints []EndpointsRes `json:"endpoints,omitempty" copier:"Endpoints"`
|
||||||
FailReason string `json:"fail_reason" copier:"FailReason"`
|
FailReason string `json:"fail_reason,omitempty" copier:"FailReason"`
|
||||||
Flavor string `json:"flavor" copier:"Flavor"`
|
Flavor string `json:"flavor,omitempty" copier:"Flavor"`
|
||||||
Id string `json:"id" copier:"Id"`
|
Id string `json:"id,omitempty" copier:"Id"`
|
||||||
Image Image `json:"image" copier:"Image"`
|
Image Image `json:"image,omitempty" copier:"Image"`
|
||||||
Lease Lease `json:"lease" copier:"Lease"`
|
Lease Lease `json:"lease,omitempty" copier:"Lease"`
|
||||||
Name string `json:"name" copier:"Name"`
|
Name string `json:"name,omitempty" copier:"Name"`
|
||||||
Pool Pool `json:"pool" copier:"Pool"`
|
Pool Pool `json:"pool,omitempty" copier:"Pool"`
|
||||||
Status string `json:"status" copier:"Status"`
|
Status string `json:"status,omitempty" copier:"Status"`
|
||||||
Token string `json:"token" copier:"Token"`
|
Token string `json:"token,omitempty" copier:"Token"`
|
||||||
Url string `json:"url" copier:"Url"`
|
Url string `json:"url,omitempty" copier:"Url"`
|
||||||
Volume VolumeRes `json:"volume" copier:"Volume"`
|
Volume VolumeRes `json:"volume,omitempty" copier:"Volume"`
|
||||||
WorkspaceId string `json:"workspace_id" copier:"WorkspaceId"`
|
WorkspaceId string `json:"workspace_id,omitempty" copier:"WorkspaceId"`
|
||||||
Feature string `json:"feature" copier:"Feature"`
|
Feature string `json:"feature,omitempty" copier:"Feature"`
|
||||||
|
CreateAt int64 `json:"create_at,omitempty" copier:"CreateAt"` // *
|
||||||
|
Hooks Hooks `json:"hooks,omitempty" copier:"Hooks"` // *
|
||||||
|
Tags []string `json:"tags,omitempty" copier:"Tags"` // *
|
||||||
|
UpdateAt int64 `json:"update_at,omitempty" copier:"UpdateAt"` // *
|
||||||
|
UserNotebookResp UserNotebookResp `json:"user,omitempty" copier:"UserNotebookResp"` // *
|
||||||
|
UserId string `json:"user_id,omitempty" copier:"UserId"` // *
|
||||||
|
BillingItems []string `json:"billing_items,omitempty" copier:"BillingItems"` // *
|
||||||
|
}
|
||||||
|
|
||||||
|
UserNotebookResp{
|
||||||
|
UserNotebookDomain UserNotebookDomain `json:"domain,omitempty" copier:"UserNotebookDomain"` // *
|
||||||
|
Id string `json:"id,omitempty" copier:"Id"` // *
|
||||||
|
Name string `json:"name,omitempty" copier:"Name"` // *
|
||||||
|
}
|
||||||
|
|
||||||
|
UserNotebookDomain{
|
||||||
|
Id string `json:"id,omitempty" copier:"Id"` // *
|
||||||
|
Name string `json:"name,omitempty" copier:"Name"` // *
|
||||||
|
}
|
||||||
|
|
||||||
|
Hooks{
|
||||||
|
ContainerHooksResp ContainerHooksResp `json:"containerHooks,omitempty" copier:"ContainerHooksResp"` // *
|
||||||
|
}
|
||||||
|
|
||||||
|
ContainerHooksResp{
|
||||||
|
PostStart PostStart `json:"postStart,omitempty" copier:"PostStart"` // *
|
||||||
|
PreStart PreStart `json:"preStart,omitempty" copier:"PreStart"` // *
|
||||||
|
}
|
||||||
|
|
||||||
|
PostStart{
|
||||||
|
Mode string `json:"mode,omitempty" copier:"Mode"` // *
|
||||||
|
Script string `json:"script,omitempty" copier:"Script"` // *
|
||||||
|
Type string `json:"type,omitempty" copier:"Type"` // *
|
||||||
|
}
|
||||||
|
|
||||||
|
PreStart{
|
||||||
|
Mode string `json:"mode,omitempty" copier:"Mode"` // *
|
||||||
|
Script string `json:"script,omitempty" copier:"Script"` // *
|
||||||
|
Type string `json:"type,omitempty" copier:"Type"` // *
|
||||||
|
}
|
||||||
|
|
||||||
|
ActionProgress{
|
||||||
|
Step int32 `json:"step,omitempty" copier:"Step"` // *
|
||||||
|
Status string `json:"status,omitempty" copier:"Status"` // *
|
||||||
|
Description string `json:"description,omitempty" copier:"Description"` // *
|
||||||
}
|
}
|
||||||
JobProgress {
|
JobProgress {
|
||||||
NotebookId string `json:"notebook_id" copier:"NotebookId"`
|
NotebookId string `json:"notebook_id" copier:"NotebookId"`
|
||||||
Status string `json:"status" copier:"Status"`
|
Status string `json:"status,omitempty" copier:"Status"`
|
||||||
Step int32 `json:"step" copier:"Step"`
|
Step int32 `json:"step,omitempty" copier:"Step"`
|
||||||
StepDescription string `json:"step_description" copier:"StepDescription"`
|
StepDescription string `json:"step_description,omitempty" copier:"StepDescription"`
|
||||||
}
|
}
|
||||||
EndpointsRes {
|
EndpointsRes {
|
||||||
AllowedAccessIps []string `json:"allowed_access_ips" copier:"AllowedAccessIps"`
|
AllowedAccessIps []string `json:"allowed_access_ips,omitempty" copier:"AllowedAccessIps"`
|
||||||
DevService string `json:"dev_service" copier:"DevService"`
|
DevService string `json:"dev_service,omitempty" copier:"DevService"`
|
||||||
SshKeys []string `json:"ssh_keys" copier:"SshKeys"`
|
SshKeys []string `json:"ssh_keys,omitempty" copier:"SshKeys"`
|
||||||
}
|
}
|
||||||
Image {
|
Image {
|
||||||
Arch string `json:"arch" copier:"Arch"`
|
Arch string `json:"arch,omitempty" copier:"Arch"`
|
||||||
CreateAt int64 `json:"create_at" copier:"CreateAt"`
|
CreateAt int64 `json:"create_at,omitempty" copier:"CreateAt"`
|
||||||
Description string `json:"description" copier:"Description"`
|
Description string `json:"description,omitempty" copier:"Description"`
|
||||||
DevServices []string `json:"dev_services" copier:"DevServices"`
|
DevServices []string `json:"dev_services,omitempty" copier:"DevServices"`
|
||||||
Id string `json:"id" copier:"Id"`
|
Id string `json:"id,omitempty" copier:"Id"`
|
||||||
Name string `json:"name" copier:"Name"`
|
Name string `json:"name,omitempty" copier:"Name"`
|
||||||
Namespace string `json:"namespace" copier:"Namespace"`
|
Namespace string `json:"namespace,omitempty" copier:"Namespace"`
|
||||||
Origin string `json:"origin" copier:"Origin"`
|
Origin string `json:"origin,omitempty" copier:"Origin"`
|
||||||
ResourceCategories []string `json:"resource_categories" copier:"ResourceCategories"`
|
ResourceCategories []string `json:"resource_categories,omitempty" copier:"ResourceCategories"`
|
||||||
ServiceType string `json:"service_type" copier:"ServiceType"`
|
ServiceType string `json:"service_type,omitempty" copier:"ServiceType"`
|
||||||
Size int64 `json:"size" copier:"Size"`
|
Size int64 `json:"size,omitempty" copier:"Size"`
|
||||||
Status string `json:"status" copier:"Status"`
|
Status string `json:"status,omitempty" copier:"Status"`
|
||||||
StatusMessage string `json:"status_message" copier:"StatusMessage"`
|
StatusMessage string `json:"status_message,omitempty" copier:"StatusMessage"`
|
||||||
SupportResCategories []string `json:"support_res_categories" copier:"SupportResCategories"`
|
SupportResCategories []string `json:"support_res_categories,omitempty" copier:"SupportResCategories"`
|
||||||
SwrPath string `json:"swr_path" copier:"SwrPath"`
|
SwrPath string `json:"swr_path,omitempty" copier:"SwrPath"`
|
||||||
Tag string `json:"tag" copier:"Tag"`
|
Tag string `json:"tag,omitempty" copier:"Tag"`
|
||||||
TypeImage string `json:"type" copier:"TypeImage"`
|
TypeImage string `json:"type,omitempty" copier:"TypeImage"`
|
||||||
UpdateAt int64 `json:"update_at" copier:"UpdateAt"`
|
UpdateAt int64 `json:"update_at,omitempty" copier:"UpdateAt"`
|
||||||
Visibility string `json:"visibility" copier:"Visibility"`
|
Visibility string `json:"visibility,omitempty" copier:"Visibility"`
|
||||||
WorkspaceId string `json:"workspace_id" copier:"WorkspaceId"`
|
WorkspaceId string `json:"workspace_id,omitempty" copier:"WorkspaceId"`
|
||||||
}
|
}
|
||||||
Lease {
|
Lease {
|
||||||
CreateAt int64 `json:"create_at" copier:"CreateAt"`
|
CreateAt int64 `json:"create_at,omitempty" copier:"CreateAt"`
|
||||||
Duration int64 `json:"duration" copier:"Duration"`
|
Duration int64 `json:"duration,omitempty" copier:"Duration"`
|
||||||
Enable bool `json:"enable" copier:"Enable"`
|
Enable bool `json:"enable,omitempty" copier:"Enable"`
|
||||||
TypeLease string `json:"type" copier:"TypeLease"`
|
TypeLease string `json:"type,omitempty" copier:"TypeLease"`
|
||||||
UpdateAt int64 `json:"update_at" copier:"UpdateAt"`
|
UpdateAt int64 `json:"update_at,omitempty" copier:"UpdateAt"`
|
||||||
}
|
}
|
||||||
Pool {
|
Pool {
|
||||||
Id string `json:"id" copier:"Id"`
|
Id string `json:"id,omitempty" copier:"Id"`
|
||||||
Name string `json:"name" copier:"Name"`
|
Name string `json:"name,omitempty" copier:"Name"`
|
||||||
}
|
}
|
||||||
VolumeRes {
|
VolumeRes {
|
||||||
Capacity int64 `json:"capacity" copier:"Capacity"`
|
Capacity int64 `json:"capacity,omitempty" copier:"Capacity"`
|
||||||
Category string `json:"category" copier:"Category"`
|
Category string `json:"category,omitempty" copier:"Category"`
|
||||||
MountPath string `json:"mount_path" copier:"MountPath"`
|
MountPath string `json:"mount_path,omitempty" copier:"MountPath"`
|
||||||
Ownership string `json:"ownership" copier:"Ownership"`
|
Ownership string `json:"ownership,omitempty" copier:"Ownership"`
|
||||||
Status string `json:"status" copier:"Status"`
|
Status string `json:"status,omitempty" copier:"Status"`
|
||||||
}
|
}
|
||||||
EndpointsReq {
|
EndpointsReq {
|
||||||
AllowedAccessIps []string `json:"allowed_access_ips" copier:"AllowedAccessIps"`
|
AllowedAccessIps []string `json:"allowed_access_ips" copier:"AllowedAccessIps"`
|
||||||
|
@ -1249,8 +1294,8 @@ type (
|
||||||
TypeConfig string `json:"type" copier:"TypeConfig"`
|
TypeConfig string `json:"type" copier:"TypeConfig"`
|
||||||
}
|
}
|
||||||
LeaseReq {
|
LeaseReq {
|
||||||
Duration int64 `json:"duration" copier:"Duration"`
|
Duration int64 `json:"duration,omitempty" copier:"Duration"`
|
||||||
TypeLeaseReq string `json:"type" copier:"TypeLeaseReq"`
|
TypeLeaseReq string `json:"type,omitempty" copier:"TypeLeaseReq"`
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
/******************Notebook Type end*************************/
|
/******************Notebook Type end*************************/
|
||||||
|
|
|
@ -37,7 +37,7 @@ func (l *CreateNotebookLogic) CreateNotebook(req *types.CreateNotebookReq) (resp
|
||||||
return nil, errors.Wrapf(xerr.NewErrMsg("Failed to create notebook"), "Failed to create notebook err : %v ,req:%+v", err, req)
|
return nil, errors.Wrapf(xerr.NewErrMsg("Failed to create notebook"), "Failed to create notebook err : %v ,req:%+v", err, req)
|
||||||
}
|
}
|
||||||
resp = &types.CreateNotebookResp{}
|
resp = &types.CreateNotebookResp{}
|
||||||
err = copier.CopyWithOption(resp, createNotebookResp, copier.Option{Converters: tool.Converters})
|
err = copier.CopyWithOption(resp, createNotebookResp, copier.Option{IgnoreEmpty: true, DeepCopy: true, Converters: tool.Converters})
|
||||||
|
|
||||||
return resp, nil
|
return resp, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -1478,7 +1478,7 @@ type CreateNotebookParam struct {
|
||||||
PoolId string `json:"pool_id,optional" copier:"PoolId"`
|
PoolId string `json:"pool_id,optional" copier:"PoolId"`
|
||||||
Volume VolumeReq `json:"volume" copier:"Volume"`
|
Volume VolumeReq `json:"volume" copier:"Volume"`
|
||||||
WorkspaceId string `json:"workspace_id,optional" copier:"WorkspaceId"`
|
WorkspaceId string `json:"workspace_id,optional" copier:"WorkspaceId"`
|
||||||
Hooks CustomHooks `json:"hooks,optional" copier:"Hooks"`
|
Hooks CustomHooks `json:"hooks" copier:"Hooks"`
|
||||||
Lease LeaseReq `json:"lease,optional" copier:"Lease"`
|
Lease LeaseReq `json:"lease,optional" copier:"Lease"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1554,79 +1554,124 @@ type DataVolumesRes struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type NotebookResp struct {
|
type NotebookResp struct {
|
||||||
ActionProgress []JobProgress `json:"action_progress" copier:"ActionProgress"`
|
ActionProgress []ActionProgress `json:"action_progress,omitempty" copier:"ActionProgress"`
|
||||||
Description string `json:"description" copier:"Description"`
|
Description string `json:"description,omitempty" copier:"Description"`
|
||||||
Endpoints []EndpointsRes `json:"endpoints" copier:"Endpoints"`
|
Endpoints []EndpointsRes `json:"endpoints,omitempty" copier:"Endpoints"`
|
||||||
FailReason string `json:"fail_reason" copier:"FailReason"`
|
FailReason string `json:"fail_reason,omitempty" copier:"FailReason"`
|
||||||
Flavor string `json:"flavor" copier:"Flavor"`
|
Flavor string `json:"flavor,omitempty" copier:"Flavor"`
|
||||||
Id string `json:"id" copier:"Id"`
|
Id string `json:"id,omitempty" copier:"Id"`
|
||||||
Image Image `json:"image" copier:"Image"`
|
Image Image `json:"image,omitempty" copier:"Image"`
|
||||||
Lease Lease `json:"lease" copier:"Lease"`
|
Lease Lease `json:"lease,omitempty" copier:"Lease"`
|
||||||
Name string `json:"name" copier:"Name"`
|
Name string `json:"name,omitempty" copier:"Name"`
|
||||||
Pool Pool `json:"pool" copier:"Pool"`
|
Pool Pool `json:"pool,omitempty" copier:"Pool"`
|
||||||
Status string `json:"status" copier:"Status"`
|
Status string `json:"status,omitempty" copier:"Status"`
|
||||||
Token string `json:"token" copier:"Token"`
|
Token string `json:"token,omitempty" copier:"Token"`
|
||||||
Url string `json:"url" copier:"Url"`
|
Url string `json:"url,omitempty" copier:"Url"`
|
||||||
Volume VolumeRes `json:"volume" copier:"Volume"`
|
Volume VolumeRes `json:"volume,omitempty" copier:"Volume"`
|
||||||
WorkspaceId string `json:"workspace_id" copier:"WorkspaceId"`
|
WorkspaceId string `json:"workspace_id,omitempty" copier:"WorkspaceId"`
|
||||||
Feature string `json:"feature" copier:"Feature"`
|
Feature string `json:"feature,omitempty" copier:"Feature"`
|
||||||
|
CreateAt int64 `json:"create_at,omitempty" copier:"CreateAt"` // *
|
||||||
|
Hooks Hooks `json:"hooks,omitempty" copier:"Hooks"`
|
||||||
|
Tags []string `json:"tags,omitempty" copier:"Tags"` // *
|
||||||
|
UpdateAt int64 `json:"update_at,omitempty" copier:"UpdateAt"` // *
|
||||||
|
UserNotebookResp UserNotebookResp `json:"user,omitempty" copier:"UserNotebookResp"` // *
|
||||||
|
UserId string `json:"user_id,omitempty" copier:"UserId"` // *
|
||||||
|
BillingItems []string `json:"billing_items,omitempty" copier:"BillingItems"` // *
|
||||||
|
}
|
||||||
|
|
||||||
|
type UserNotebookResp struct {
|
||||||
|
UserNotebookDomain UserNotebookDomain `json:"domain,omitempty" copier:"UserNotebookDomain"` // *
|
||||||
|
Id string `json:"id,omitempty" copier:"Id"` // *
|
||||||
|
Name string `json:"name,omitempty" copier:"Name"` // *
|
||||||
|
}
|
||||||
|
|
||||||
|
type UserNotebookDomain struct {
|
||||||
|
Id string `json:"id,omitempty" copier:"Id"` // *
|
||||||
|
Name string `json:"name,omitempty" copier:"Name"` // *
|
||||||
|
}
|
||||||
|
|
||||||
|
type Hooks struct {
|
||||||
|
ContainerHooksResp ContainerHooksResp `json:"containerHooks,omitempty" copier:"ContainerHooksResp"` // *
|
||||||
|
}
|
||||||
|
|
||||||
|
type ContainerHooksResp struct {
|
||||||
|
PostStart PostStart `json:"postStart,omitempty" copier:"PostStart"` // *
|
||||||
|
PreStart PreStart `json:"preStart,omitempty" copier:"PreStart"` // *
|
||||||
|
}
|
||||||
|
|
||||||
|
type PostStart struct {
|
||||||
|
Mode string `json:"mode,omitempty" copier:"Mode"` // *
|
||||||
|
Script string `json:"script,omitempty" copier:"Script"` // *
|
||||||
|
Type string `json:"type,omitempty" copier:"Type"` // *
|
||||||
|
}
|
||||||
|
|
||||||
|
type PreStart struct {
|
||||||
|
Mode string `json:"mode,omitempty" copier:"Mode"` // *
|
||||||
|
Script string `json:"script,omitempty" copier:"Script"` // *
|
||||||
|
Type string `json:"type,omitempty" copier:"Type"` // *
|
||||||
|
}
|
||||||
|
|
||||||
|
type ActionProgress struct {
|
||||||
|
Step int32 `json:"step,omitempty" copier:"Step"` // *
|
||||||
|
Status string `json:"status,omitempty" copier:"Status"` // *
|
||||||
|
Description string `json:"description,omitempty" copier:"Description"` // *
|
||||||
}
|
}
|
||||||
|
|
||||||
type JobProgress struct {
|
type JobProgress struct {
|
||||||
NotebookId string `json:"notebook_id" copier:"NotebookId"`
|
NotebookId string `json:"notebook_id" copier:"NotebookId"`
|
||||||
Status string `json:"status" copier:"Status"`
|
Status string `json:"status,omitempty" copier:"Status"`
|
||||||
Step int32 `json:"step" copier:"Step"`
|
Step int32 `json:"step,omitempty" copier:"Step"`
|
||||||
StepDescription string `json:"step_description" copier:"StepDescription"`
|
StepDescription string `json:"step_description,omitempty" copier:"StepDescription"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type EndpointsRes struct {
|
type EndpointsRes struct {
|
||||||
AllowedAccessIps []string `json:"allowed_access_ips" copier:"AllowedAccessIps"`
|
AllowedAccessIps []string `json:"allowed_access_ips,omitempty" copier:"AllowedAccessIps"`
|
||||||
DevService string `json:"dev_service" copier:"DevService"`
|
DevService string `json:"dev_service,omitempty" copier:"DevService"`
|
||||||
SshKeys []string `json:"ssh_keys" copier:"SshKeys"`
|
SshKeys []string `json:"ssh_keys,omitempty" copier:"SshKeys"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Image struct {
|
type Image struct {
|
||||||
Arch string `json:"arch" copier:"Arch"`
|
Arch string `json:"arch,omitempty" copier:"Arch"`
|
||||||
CreateAt int64 `json:"create_at" copier:"CreateAt"`
|
CreateAt int64 `json:"create_at,omitempty" copier:"CreateAt"`
|
||||||
Description string `json:"description" copier:"Description"`
|
Description string `json:"description,omitempty" copier:"Description"`
|
||||||
DevServices []string `json:"dev_services" copier:"DevServices"`
|
DevServices []string `json:"dev_services,omitempty" copier:"DevServices"`
|
||||||
Id string `json:"id" copier:"Id"`
|
Id string `json:"id,omitempty" copier:"Id"`
|
||||||
Name string `json:"name" copier:"Name"`
|
Name string `json:"name,omitempty" copier:"Name"`
|
||||||
Namespace string `json:"namespace" copier:"Namespace"`
|
Namespace string `json:"namespace,omitempty" copier:"Namespace"`
|
||||||
Origin string `json:"origin" copier:"Origin"`
|
Origin string `json:"origin,omitempty" copier:"Origin"`
|
||||||
ResourceCategories []string `json:"resource_categories" copier:"ResourceCategories"`
|
ResourceCategories []string `json:"resource_categories,omitempty" copier:"ResourceCategories"`
|
||||||
ServiceType string `json:"service_type" copier:"ServiceType"`
|
ServiceType string `json:"service_type,omitempty" copier:"ServiceType"`
|
||||||
Size int64 `json:"size" copier:"Size"`
|
Size int64 `json:"size,omitempty" copier:"Size"`
|
||||||
Status string `json:"status" copier:"Status"`
|
Status string `json:"status,omitempty" copier:"Status"`
|
||||||
StatusMessage string `json:"status_message" copier:"StatusMessage"`
|
StatusMessage string `json:"status_message,omitempty" copier:"StatusMessage"`
|
||||||
SupportResCategories []string `json:"support_res_categories" copier:"SupportResCategories"`
|
SupportResCategories []string `json:"support_res_categories,omitempty" copier:"SupportResCategories"`
|
||||||
SwrPath string `json:"swr_path" copier:"SwrPath"`
|
SwrPath string `json:"swr_path,omitempty" copier:"SwrPath"`
|
||||||
Tag string `json:"tag" copier:"Tag"`
|
Tag string `json:"tag,omitempty" copier:"Tag"`
|
||||||
TypeImage string `json:"type" copier:"TypeImage"`
|
TypeImage string `json:"type,omitempty" copier:"TypeImage"`
|
||||||
UpdateAt int64 `json:"update_at" copier:"UpdateAt"`
|
UpdateAt int64 `json:"update_at,omitempty" copier:"UpdateAt"`
|
||||||
Visibility string `json:"visibility" copier:"Visibility"`
|
Visibility string `json:"visibility,omitempty" copier:"Visibility"`
|
||||||
WorkspaceId string `json:"workspace_id" copier:"WorkspaceId"`
|
WorkspaceId string `json:"workspace_id,omitempty" copier:"WorkspaceId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Lease struct {
|
type Lease struct {
|
||||||
CreateAt int64 `json:"create_at" copier:"CreateAt"`
|
CreateAt int64 `json:"create_at,omitempty" copier:"CreateAt"`
|
||||||
Duration int64 `json:"duration" copier:"Duration"`
|
Duration int64 `json:"duration,omitempty" copier:"Duration"`
|
||||||
Enable bool `json:"enable" copier:"Enable"`
|
Enable bool `json:"enable,omitempty" copier:"Enable"`
|
||||||
TypeLease string `json:"type" copier:"TypeLease"`
|
TypeLease string `json:"type,omitempty" copier:"TypeLease"`
|
||||||
UpdateAt int64 `json:"update_at" copier:"UpdateAt"`
|
UpdateAt int64 `json:"update_at,omitempty" copier:"UpdateAt"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Pool struct {
|
type Pool struct {
|
||||||
Id string `json:"id" copier:"Id"`
|
Id string `json:"id,omitempty" copier:"Id"`
|
||||||
Name string `json:"name" copier:"Name"`
|
Name string `json:"name,omitempty" copier:"Name"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type VolumeRes struct {
|
type VolumeRes struct {
|
||||||
Capacity int64 `json:"capacity" copier:"Capacity"`
|
Capacity int64 `json:"capacity,omitempty" copier:"Capacity"`
|
||||||
Category string `json:"category" copier:"Category"`
|
Category string `json:"category,omitempty" copier:"Category"`
|
||||||
MountPath string `json:"mount_path" copier:"MountPath"`
|
MountPath string `json:"mount_path,omitempty" copier:"MountPath"`
|
||||||
Ownership string `json:"ownership" copier:"Ownership"`
|
Ownership string `json:"ownership,omitempty" copier:"Ownership"`
|
||||||
Status string `json:"status" copier:"Status"`
|
Status string `json:"status,omitempty" copier:"Status"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type EndpointsReq struct {
|
type EndpointsReq struct {
|
||||||
|
@ -1657,8 +1702,8 @@ type Config struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type LeaseReq struct {
|
type LeaseReq struct {
|
||||||
Duration int64 `json:"duration" copier:"Duration"`
|
Duration int64 `json:"duration,omitempty" copier:"Duration"`
|
||||||
TypeLeaseReq string `json:"type" copier:"TypeLeaseReq"`
|
TypeLeaseReq string `json:"type,omitempty" copier:"TypeLeaseReq"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type GetVisualizationJobReq struct {
|
type GetVisualizationJobReq struct {
|
||||||
|
|
Loading…
Reference in New Issue