Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update doRedfishEndpointPut to create/update entry instead of just update #45

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

davidallendj
Copy link
Collaborator

@davidallendj davidallendj commented Jan 17, 2025

Addresses #44 by changing the behavior of doRedfishEndpointPut to create a new RedfishEndpoint if it does not exist for the /Inventory/RedfishEndpoints/{xname} endpoint. It should also parse data with Systems and Managers properties similar to the doRedfishEndpointPost function and create RedfishEndpoint, Components, and ComponentEndpoints.

To test, try sending data to the endpoint mentioned above (may need verification):

curl -X PUT  $SMD_BASE_URL/Inventory/RedfishEndpoints/x1000c1s7b0 -d @data.json  --cacert $CACERT_PATH -H "Authorization: Bearer $ACCESS_TOKEN"

Where data.json is something like the following:

{
  "ID": "x1000c1s7b0",
  "Type": "NodeBMC",
  "Name": "cg01",
  "MACAddr": "b4:2e:99:a6:63:cf",
  "IPAddress": "172.16.0.101",
  "SchemaVersion": 1,
  "Systems": [
    {
      "uri": "https://cable-guys.si.usrc/redfish/v1/Systems/x1000c1s7b0n0",
      "name": "cg01",
      "ethernet_interfaces": [
        {
          "mac": "b4:2e:99:a6:06:47",
          "ip": "172.16.0.1",
          "name": "x1000c1s7b0n0",
          "description": "Interface 0 for cg01"
        }
      ]
    }
  ],
  "Managers": [
    {
      "uri": "https://cable-guys.si.usrc/redfish/v1/Managers/x1000c1s7b0",
      "name": "x1000c1s7b0",
      "ethernet_interfaces": [
        {
          "mac": "b4:2e:99:a6:63:cf",
          "ip": "172.16.0.101",
          "name": "x1000c1s7b0",
          "description": "Interface for BMC x1000c1s7b0"
        }
      ],
      "type": "NodeBMC"
    }
  ]
}

Some other things to consider before merging:

  • Should there also be a check that limits the parsing to a single entry in the data?
  • Should we use the xname provided in the URL or in the request body (it's usually specified in the body like seen above)?

@davidallendj davidallendj added question Further information is requested needs testing labels Jan 17, 2025
@davidallendj davidallendj linked an issue Jan 17, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs testing question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] PUT misbehavior for RedfishEndpoints API
1 participant