Skip to content

Commit 5b074bf

Browse files
committed
changing ibmacs to request body
1 parent a5cb82a commit 5b074bf

File tree

2 files changed

+35
-27
lines changed

2 files changed

+35
-27
lines changed

cns/api.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,15 @@ type GetVMUniqueIDResponse struct {
386386
VMUniqueID string `json:"vmuniqueid"`
387387
}
388388

389+
// AssignIBDevicesToPodRequest represents the request for assigning InfiniBand devices to a pod
390+
type AssignIBDevicesToPodRequest struct {
391+
IBMACs []net.HardwareAddr `json:"ibmacs"` // List of IB device MAC addresses to assign
392+
PodNamespace string `json:"podNamespace"` // Namespace of the target pod
393+
PodName string `json:"podName"` // Name of the target pod
394+
}
395+
396+
// AssignIBDevicesToPodRequest
397+
389398
// AssignIBDevicesToPodResponse represents the response for assigning InfiniBand devices to a pod
390399
type AssignIBDevicesToPodResponse struct {
391400
Message string `json:"message"` // Additional message or error description

cns/swagger.yaml

Lines changed: 26 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -120,35 +120,17 @@ paths:
120120
schema:
121121
$ref: "#/components/schemas/UnpublishNetworkContainerResponse"
122122

123-
/ibdevices:assign:
123+
/ibdevices:
124124
post:
125125
summary: Assign IB devices to a pod
126126
description: >
127127
Assigns one or more Infiniband devices by MAC address to a given pod.
128-
parameters:
129-
- name: ibmacs
130-
in: query
131-
required: true
132-
description: Comma-separated list of IB device MAC addresses.
133-
schema:
134-
type: array
135-
items:
136-
type: string
137-
example: ["60:45:bd:a4:b5:7a", "7c:1e:52:07:11:36"]
138-
- name: podnamespace
139-
in: query
140-
required: true
141-
description: The namespace of the target pod.
142-
schema:
143-
type: string
144-
example: "podnamespace"
145-
- name: podname
146-
in: query
147-
required: true
148-
description: The name of the target pod.
149-
schema:
150-
type: string
151-
example: "podname"
128+
requestBody:
129+
required: true
130+
content:
131+
application/json:
132+
schema:
133+
$ref: "#/components/schemas/AssignIBDevicesToPodRequest"
152134
responses:
153135
'200':
154136
description: >-
@@ -171,8 +153,6 @@ paths:
171153
application/json:
172154
schema:
173155
$ref: "#/components/schemas/AssignIBDevicesToPodResponse"
174-
175-
/ibdevices:
176156
get:
177157
summary: Get status of an IB device
178158
description: >-
@@ -433,6 +413,25 @@ components:
433413
type: string
434414
description: The error message
435415

416+
AssignIBDevicesToPodRequest:
417+
type: object
418+
required:
419+
- ibmacs
420+
- podNamespace
421+
- podName
422+
properties:
423+
ibmacs:
424+
type: array
425+
items:
426+
type: string
427+
description: List of IB device MAC addresses to assign such as "60:45:bd:a4:b5:7a"
428+
podNamespace:
429+
type: string
430+
description: Namespace of the target pod
431+
podName:
432+
type: string
433+
description: Name of the target pod
434+
436435
AssignIBDevicesToPodResponse:
437436
type: object
438437
required:

0 commit comments

Comments
 (0)