Foundation API POST resquest "primary_nic" returns "Unprocessable Entity" | Nutanix Community
Skip to main content
Solved

Foundation API POST resquest "primary_nic" returns "Unprocessable Entity"

  • January 17, 2024
  • 1 reply
  • 66 views

Hi,

I need to use the API to select the primary NIC that Foundation will use to discover nodes. When I try the request :

GET https://[fvm_ip]:8000/foundation/primary_nic

I get the following result :

{
    "primary_nic": 2
}

That is expected. But when I send the same request using POST, which is valid according the documentation, I now get :

{
    "error": {
        "details": [
            "'nic' is a required property"
        ],
        "message": "Unprocessable Entity",
        "session_id": null
    }
}

My understanding is that the request should be used with a parameter or a body specifying the new primary NIC. But The documentation does not state anything about it. So I tried to pass in “nic”:1 as a parameter and as a body, but still the same error.

Is it a bug ? Is the documentation missing some explanations ?

 

Source : Foundation – Nutanix.dev

Best answer by K_vin

It turns out the body of this request is of type “Form-data”. Maybe it should be made clear on the documentation.

Anyway problem solved.

View original
Did this topic help you find an answer to your question?
This topic has been closed for comments

1 reply

  • Author
  • Voyager
  • 1 reply
  • Answer
  • February 14, 2024

It turns out the body of this request is of type “Form-data”. Maybe it should be made clear on the documentation.

Anyway problem solved.