Skip to content

AIS-958 - Changes for GET Resources API#797

Open
prachikurade1 wants to merge 2 commits into
IBM:mainfrom
prachikurade1:AIS_1084
Open

AIS-958 - Changes for GET Resources API#797
prachikurade1 wants to merge 2 commits into
IBM:mainfrom
prachikurade1:AIS_1084

Conversation

@prachikurade1
Copy link
Copy Markdown
Contributor

@prachikurade1 prachikurade1 commented May 22, 2026

  • Changes to get the resource utilization - cpu, memory, accelerators
  • Dev Testing Results:
  1. Get API - no auth
unauthorized_missing_token
  1. Get API - invalid token
unauthorized_invalid_token
  1. Get API - cards not found
spyre_cards_not_found
  1. Get API - all cards available
spyre_cards_available
  1. Get API - when app is running
spyre_cards_in_use

response := ResourcesResponse{}

// Get Podman system info for CPU and memory
cpuInfo, memInfo, err := h.getPodmanSystemInfo()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this call should be made to generic systemInfo call and then respective runtime call needs to be make, calling directly the podmansysteminfo here is not a good idea and this will break immediately when you run this api on openshift api

and for openshift implementation - you can return an empty response..

totalCards, err := helpers.ListSpyreCards()
if err != nil {
logger.Errorf("Could not list Spyre cards: %v", err)
accelerators["ibm.com/spyre_pf"] = &AcceleratorInfo{
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why you even want to include if no spyre cards found, ideally it should be an empty array in the accelerator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants