@@ -120,6 +120,69 @@ paths:
120120 schema :
121121 $ref : " #/components/schemas/UnpublishNetworkContainerResponse"
122122
123+ /ibdevices/pod :
124+ post :
125+ summary : Assigns IB devices to a pod
126+ description : >-
127+ Assigns the specified IB devices to the pod identified by PodID. The
128+ MAC addresses of the devices are provided in the request body.
129+ requestBody :
130+ required : true
131+ content :
132+ application/json :
133+ schema :
134+ $ref : " #/components/schemas/AssignIBDevicesToPodRequest"
135+ responses :
136+ ' 200 ' :
137+ description : >-
138+ The request passed initial validation and CNS was able to propagate its state.
139+ content :
140+ application/json :
141+ schema :
142+ $ref : " #/components/schemas/AssignIBDevicesToPodResponse"
143+ ' 404 ' :
144+ description : >-
145+ The pod specified by PodID was not found
146+ content :
147+ application/json :
148+ schema :
149+ $ref : " #/components/schemas/AssignIBDevicesToPodResponse"
150+ ' 400 ' :
151+ description : >-
152+ One of the IB devices specified is not available
153+ content :
154+ application/json :
155+ schema :
156+ $ref : " #/components/schemas/AssignIBDevicesToPodResponse"
157+
158+ /ibdevices/{macaddress} :
159+ get :
160+ summary : Get status about an IB device
161+ description : >-
162+ Retrieves the current status of the specified IB device.
163+ parameters :
164+ - name : macaddress
165+ in : path
166+ required : true
167+ description : The MAC address of the IB device (with colons ":")
168+ schema :
169+ type : string
170+ responses :
171+ ' 200 ' :
172+ description : >-
173+ The request was successful and the status of the IB device is returned.
174+ content :
175+ application/json :
176+ schema :
177+ $ref : " #/components/schemas/GetIBDeviceStatusResponse"
178+ ' 404 ' :
179+ description : >-
180+ The IB device specified by MAC address was not found.
181+ content :
182+ application/json :
183+ schema :
184+ $ref : " #/components/schemas/GetIBDeviceStatusResponse"
185+
123186components :
124187 schemas :
125188 UnpublishNetworkContainerResponse :
@@ -351,3 +414,99 @@ components:
351414 Message :
352415 type : string
353416 description : The error message
417+
418+ AssignIBDevicesToPodRequest :
419+ type : object
420+ required :
421+ - PodID
422+ - MACAddresses
423+ properties :
424+ PodID :
425+ type : string
426+ description : podname-podnamespace of which pod to attach these devices through
427+ MACAddresses :
428+ type : array
429+ description : MAC addresses of IB devices such as "60:45:bd:a4:b5:7a"
430+ items :
431+ type : string
432+
433+ AssignIBDevicesToPodResponse :
434+ type : object
435+ required :
436+ - ErrorCode
437+ - Message
438+ properties :
439+ ErrorCode :
440+ $ref : " #/components/schemas/ErrorCode"
441+ Message :
442+ type : string
443+ description : Human-readable message or error description
444+
445+ GetIBDeviceStatusResponse :
446+ type : object
447+ required :
448+ - MACAddress
449+ - PodID
450+ - Status
451+ - ErrorCode
452+ - Message
453+ properties :
454+ MACAddress :
455+ type : string
456+ description : MAC address of the IB device
457+ PodID :
458+ type : string
459+ description : podname-podnamespace of the pod to which the device is assigned, if any
460+ Status :
461+ $ref : " #/components/schemas/Status"
462+ ErrorCode :
463+ $ref : " #/components/schemas/ErrorCode"
464+ Message :
465+ type : string
466+ description : Human-readable message or error description
467+
468+ ErrorCode :
469+ type : integer
470+ description : Pre-defined error code of what went wrong, if anything (see cns/types/infiniband/errorcodes.go)
471+ oneOf :
472+ - title : Success
473+ const : 0
474+ description : Successful operation
475+ - title : PodNotFound
476+ const : 1
477+ description : Pod not found
478+ - title : DeviceUnavailable
479+ const : 2
480+ description : Device is unavailable
481+ - title : DeviceNotFound
482+ const : 3
483+ description : Device not found
484+ - title : AnnotationNotFound
485+ const : 4
486+ description : Annotation not found on pod
487+ - title : PodAlreadyAllocated
488+ const : 5
489+ description : Pod was already assigned IB devices (and new ones don't match)
490+ - title : InternalProgrammingError
491+ const : 6
492+ description : Something went wrong programming the devices
493+
494+ Status :
495+ type : integer
496+ description : Status of IB device (see cns/types/infiniband/status.go)
497+ oneOf :
498+ - title : ProgrammingPending
499+ const : 0
500+ description : Programming of device is pending
501+ - title : ProgrammingFailed
502+ const : 1
503+ description : Programming of device failed
504+ - title : ProgrammingComplete
505+ const : 2
506+ description : Programming of device is complete
507+ - title : ReleasePending
508+ const : 3
509+ description : Release of device is pending
510+ - title : Available
511+ const : 4
512+ description : Device is available for use
0 commit comments