diff --git a/api/cfm-openapi.yaml b/api/cfm-openapi.yaml index 813a27d..51ee97f 100644 --- a/api/cfm-openapi.yaml +++ b/api/cfm-openapi.yaml @@ -1405,6 +1405,9 @@ components: linkStatus: type: string description: Status of the link, such as LinkUp or LinkDown + linkState: + type: string + description: State of the link, such as Enabled or Disabled memoryDeviceInformation: type: object required: [id] diff --git a/pkg/backend/httpfish.go b/pkg/backend/httpfish.go index 58762f7..7d9d29e 100644 --- a/pkg/backend/httpfish.go +++ b/pkg/backend/httpfish.go @@ -1359,6 +1359,7 @@ func (service *httpfishService) GetPortDetails(ctx context.Context, settings *Co ret.PortInformation.Width = int32(width) } ret.PortInformation.LinkStatus, _ = response.stringFromJSON("LinkStatus") + ret.PortInformation.LinkState, _ = response.stringFromJSON("LinkState") status, _ := response.valueFromJSON("Status") @@ -1370,9 +1371,10 @@ func (service *httpfishService) GetPortDetails(ctx context.Context, settings *Co ret.PortInformation.StatusState = state ret.Status = healthAndState - speed, err := response.floatFromJSON("CurrentSpeedGbps") + portField, err := response.valueFromJSON("Port") if err == nil { - ret.PortInformation.CurrentSpeedGbps = int32(speed) + speedFloat, _ := portField.(map[string]interface{})["CurrentSpeedGbps"].(float64) + ret.PortInformation.CurrentSpeedGbps = int32(speedFloat) } // Extract GCXLID from endpoint diff --git a/pkg/backend/ops.go b/pkg/backend/ops.go index 71f6b0f..6922e99 100644 --- a/pkg/backend/ops.go +++ b/pkg/backend/ops.go @@ -116,6 +116,7 @@ type PortInformation struct { StatusState string // The state of the resource Width int32 // The number of lanes, phys, or other physical transport links that this port contains LinkStatus string // The CXL link status + LinkState string // The CXL link state } type GetPortDetailsResponse struct { diff --git a/pkg/manager/port.go b/pkg/manager/port.go index 9c3e275..0e08ec3 100644 --- a/pkg/manager/port.go +++ b/pkg/manager/port.go @@ -80,6 +80,7 @@ func (p *CxlBladePort) GetDetails(ctx context.Context) (openapi.PortInformation, StatusState: response.PortInformation.StatusState, Width: response.PortInformation.Width, LinkStatus: response.PortInformation.LinkStatus, + LinkState: response.PortInformation.StatusState, } p.ValidateCache()