Skip to content

Commit effd07b

Browse files
committed
Update API CreateTrainingJob: add request parameters body.AssignNodeSpec.
1 parent ac77718 commit effd07b

File tree

6 files changed

+63
-0
lines changed

6 files changed

+63
-0
lines changed

ChangeLog.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
2025-11-25 Version: v2.1.18
2+
- Update API CreateTrainingJob: add request parameters body.AssignNodeSpec.
3+
- Update API GetTrainingJob: add response parameters Body.AssignNodeSpec.
4+
- Update API ListTrainingJobs: add response parameters Body.TrainingJobs.$.AssignNodeSpec.
5+
6+
17
2025-11-12 Version: v2.1.17
28
- Update API GetQuota: add request parameters WithNodeMeta.
39

client/client.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,10 @@ func (client *Client) CreateTrainingJobWithOptions(request *CreateTrainingJobReq
574574
body["AlgorithmVersion"] = request.AlgorithmVersion
575575
}
576576

577+
if !dara.IsNil(request.AssignNodeSpec) {
578+
body["AssignNodeSpec"] = request.AssignNodeSpec
579+
}
580+
577581
if !dara.IsNil(request.CodeDir) {
578582
body["CodeDir"] = request.CodeDir
579583
}

client/client_context_func.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,10 @@ func (client *Client) CreateTrainingJobWithContext(ctx context.Context, request
392392
body["AlgorithmVersion"] = request.AlgorithmVersion
393393
}
394394

395+
if !dara.IsNil(request.AssignNodeSpec) {
396+
body["AssignNodeSpec"] = request.AssignNodeSpec
397+
}
398+
395399
if !dara.IsNil(request.CodeDir) {
396400
body["CodeDir"] = request.CodeDir
397401
}

client/create_training_job_request_model.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ type iCreateTrainingJobRequest interface {
1717
GetAlgorithmSpec() *AlgorithmSpec
1818
SetAlgorithmVersion(v string) *CreateTrainingJobRequest
1919
GetAlgorithmVersion() *string
20+
SetAssignNodeSpec(v *AssignNodeSpec) *CreateTrainingJobRequest
21+
GetAssignNodeSpec() *AssignNodeSpec
2022
SetCodeDir(v *Location) *CreateTrainingJobRequest
2123
GetCodeDir() *Location
2224
SetComputeResource(v *CreateTrainingJobRequestComputeResource) *CreateTrainingJobRequest
@@ -67,6 +69,7 @@ type CreateTrainingJobRequest struct {
6769
//
6870
// v1.0.0
6971
AlgorithmVersion *string `json:"AlgorithmVersion,omitempty" xml:"AlgorithmVersion,omitempty"`
72+
AssignNodeSpec *AssignNodeSpec `json:"AssignNodeSpec,omitempty" xml:"AssignNodeSpec,omitempty"`
7073
CodeDir *Location `json:"CodeDir,omitempty" xml:"CodeDir,omitempty"`
7174
ComputeResource *CreateTrainingJobRequestComputeResource `json:"ComputeResource,omitempty" xml:"ComputeResource,omitempty" type:"Struct"`
7275
Environments map[string]*string `json:"Environments,omitempty" xml:"Environments,omitempty"`
@@ -126,6 +129,10 @@ func (s *CreateTrainingJobRequest) GetAlgorithmVersion() *string {
126129
return s.AlgorithmVersion
127130
}
128131

132+
func (s *CreateTrainingJobRequest) GetAssignNodeSpec() *AssignNodeSpec {
133+
return s.AssignNodeSpec
134+
}
135+
129136
func (s *CreateTrainingJobRequest) GetCodeDir() *Location {
130137
return s.CodeDir
131138
}
@@ -214,6 +221,11 @@ func (s *CreateTrainingJobRequest) SetAlgorithmVersion(v string) *CreateTraining
214221
return s
215222
}
216223

224+
func (s *CreateTrainingJobRequest) SetAssignNodeSpec(v *AssignNodeSpec) *CreateTrainingJobRequest {
225+
s.AssignNodeSpec = v
226+
return s
227+
}
228+
217229
func (s *CreateTrainingJobRequest) SetCodeDir(v *Location) *CreateTrainingJobRequest {
218230
s.CodeDir = v
219231
return s
@@ -305,6 +317,11 @@ func (s *CreateTrainingJobRequest) Validate() error {
305317
return err
306318
}
307319
}
320+
if s.AssignNodeSpec != nil {
321+
if err := s.AssignNodeSpec.Validate(); err != nil {
322+
return err
323+
}
324+
}
308325
if s.CodeDir != nil {
309326
if err := s.CodeDir.Validate(); err != nil {
310327
return err

client/get_training_job_response_body_model.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ type iGetTrainingJobResponseBody interface {
1919
GetAlgorithmSpec() *AlgorithmSpec
2020
SetAlgorithmVersion(v string) *GetTrainingJobResponseBody
2121
GetAlgorithmVersion() *string
22+
SetAssignNodeSpec(v *AssignNodeSpec) *GetTrainingJobResponseBody
23+
GetAssignNodeSpec() *AssignNodeSpec
2224
SetComputeResource(v *GetTrainingJobResponseBodyComputeResource) *GetTrainingJobResponseBody
2325
GetComputeResource() *GetTrainingJobResponseBodyComputeResource
2426
SetDuration(v int64) *GetTrainingJobResponseBody
@@ -103,6 +105,7 @@ type GetTrainingJobResponseBody struct {
103105
//
104106
// v0.0.1
105107
AlgorithmVersion *string `json:"AlgorithmVersion,omitempty" xml:"AlgorithmVersion,omitempty"`
108+
AssignNodeSpec *AssignNodeSpec `json:"AssignNodeSpec,omitempty" xml:"AssignNodeSpec,omitempty"`
106109
ComputeResource *GetTrainingJobResponseBodyComputeResource `json:"ComputeResource,omitempty" xml:"ComputeResource,omitempty" type:"Struct"`
107110
// example:
108111
//
@@ -207,6 +210,10 @@ func (s *GetTrainingJobResponseBody) GetAlgorithmVersion() *string {
207210
return s.AlgorithmVersion
208211
}
209212

213+
func (s *GetTrainingJobResponseBody) GetAssignNodeSpec() *AssignNodeSpec {
214+
return s.AssignNodeSpec
215+
}
216+
210217
func (s *GetTrainingJobResponseBody) GetComputeResource() *GetTrainingJobResponseBodyComputeResource {
211218
return s.ComputeResource
212219
}
@@ -360,6 +367,11 @@ func (s *GetTrainingJobResponseBody) SetAlgorithmVersion(v string) *GetTrainingJ
360367
return s
361368
}
362369

370+
func (s *GetTrainingJobResponseBody) SetAssignNodeSpec(v *AssignNodeSpec) *GetTrainingJobResponseBody {
371+
s.AssignNodeSpec = v
372+
return s
373+
}
374+
363375
func (s *GetTrainingJobResponseBody) SetComputeResource(v *GetTrainingJobResponseBodyComputeResource) *GetTrainingJobResponseBody {
364376
s.ComputeResource = v
365377
return s
@@ -526,6 +538,11 @@ func (s *GetTrainingJobResponseBody) Validate() error {
526538
return err
527539
}
528540
}
541+
if s.AssignNodeSpec != nil {
542+
if err := s.AssignNodeSpec.Validate(); err != nil {
543+
return err
544+
}
545+
}
529546
if s.ComputeResource != nil {
530547
if err := s.ComputeResource.Validate(); err != nil {
531548
return err

client/list_training_jobs_response_body_model.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ type ListTrainingJobsResponseBodyTrainingJobs struct {
9090
//
9191
// v0.0.1
9292
AlgorithmVersion *string `json:"AlgorithmVersion,omitempty" xml:"AlgorithmVersion,omitempty"`
93+
AssignNodeSpec *AssignNodeSpec `json:"AssignNodeSpec,omitempty" xml:"AssignNodeSpec,omitempty"`
9394
ComputeResource *ListTrainingJobsResponseBodyTrainingJobsComputeResource `json:"ComputeResource,omitempty" xml:"ComputeResource,omitempty" type:"Struct"`
9495
DlcJobId *string `json:"DlcJobId,omitempty" xml:"DlcJobId,omitempty"`
9596
Environments map[string]*string `json:"Environments,omitempty" xml:"Environments,omitempty"`
@@ -169,6 +170,10 @@ func (s *ListTrainingJobsResponseBodyTrainingJobs) GetAlgorithmVersion() *string
169170
return s.AlgorithmVersion
170171
}
171172

173+
func (s *ListTrainingJobsResponseBodyTrainingJobs) GetAssignNodeSpec() *AssignNodeSpec {
174+
return s.AssignNodeSpec
175+
}
176+
172177
func (s *ListTrainingJobsResponseBodyTrainingJobs) GetComputeResource() *ListTrainingJobsResponseBodyTrainingJobsComputeResource {
173178
return s.ComputeResource
174179
}
@@ -280,6 +285,11 @@ func (s *ListTrainingJobsResponseBodyTrainingJobs) SetAlgorithmVersion(v string)
280285
return s
281286
}
282287

288+
func (s *ListTrainingJobsResponseBodyTrainingJobs) SetAssignNodeSpec(v *AssignNodeSpec) *ListTrainingJobsResponseBodyTrainingJobs {
289+
s.AssignNodeSpec = v
290+
return s
291+
}
292+
283293
func (s *ListTrainingJobsResponseBodyTrainingJobs) SetComputeResource(v *ListTrainingJobsResponseBodyTrainingJobsComputeResource) *ListTrainingJobsResponseBodyTrainingJobs {
284294
s.ComputeResource = v
285295
return s
@@ -401,6 +411,11 @@ func (s *ListTrainingJobsResponseBodyTrainingJobs) SetWorkspaceId(v string) *Lis
401411
}
402412

403413
func (s *ListTrainingJobsResponseBodyTrainingJobs) Validate() error {
414+
if s.AssignNodeSpec != nil {
415+
if err := s.AssignNodeSpec.Validate(); err != nil {
416+
return err
417+
}
418+
}
404419
if s.ComputeResource != nil {
405420
if err := s.ComputeResource.Validate(); err != nil {
406421
return err

0 commit comments

Comments
 (0)