@@ -32,6 +32,9 @@ const (
3232 V1Prefix = "/v0.1"
3333 V2Prefix = "/v0.2"
3434 EndpointPath = "/network/endpoints/"
35+ // IBDevice API paths
36+ IBDevicesPodPath = "/ibdevices/pod/" // PUT /ibdevices/pod/{podname-podnamespace}
37+ IBDevicesPath = "/ibdevices/" // GET /ibdevices/{mac-address-of-device}
3538 // Service Fabric SWIFTV2 mode
3639 StandaloneSWIFTV2 SWIFTV2Mode = "StandaloneSWIFTV2"
3740 // K8s SWIFTV2 mode
@@ -382,3 +385,33 @@ type GetVMUniqueIDResponse struct {
382385 Response Response `json:"response"`
383386 VMUniqueID string `json:"vmuniqueid"`
384387}
388+
389+ // IBDevice API Contracts
390+
391+ // AssignIBDevicesToPodRequest represents the request to assign InfiniBand devices to a pod
392+ // PUT /ibdevices/pod/{podname-podnamespace}
393+ type AssignIBDevicesToPodRequest struct {
394+ PodID string `json:"podID"` // podname-podnamespace format
395+ DeviceIDs []string `json:"deviceIds"` // Array of MAC addresses like ["60:45:bd:a4:b5:7a", "7c:1e:52:07:11:36"]
396+ }
397+
398+ // AssignIBDevicesToPodResponse represents the response for assigning InfiniBand devices to a pod
399+ type AssignIBDevicesToPodResponse struct {
400+ Response Response `json:"response"` // Contains cnsCode (int) and message (string)
401+ }
402+
403+ // GetIBDeviceInfoRequest represents the request to get InfiniBand device information
404+ // GET /ibdevices/{mac-address-of-device} - no request body needed for GET
405+ type GetIBDeviceInfoRequest struct {
406+ DeviceID string `json:"deviceID"` // MAC address of the device (from URL path)
407+ }
408+
409+ // GetIBDeviceInfoResponse represents the response containing InfiniBand device information
410+ type GetIBDeviceInfoResponse struct {
411+ Response Response `json:"response,omitempty"` // Standard CNS response (optional for success cases)
412+ DeviceID string `json:"deviceID"` // MAC address of the device
413+ PodID string `json:"podID"` // Pod that the device is assigned to
414+ Status string `json:"status"` // Device status (e.g., "assigned", "available")
415+ ErrorCode int `json:"errorCode"` // Error code if applicable
416+ Msg string `json:"msg"` // Additional message or error description
417+ }
0 commit comments