Inventory API Update
-
I have been battling this for the last few days. I don’t know if my json body is wrong or what?
I am trying to update the inventory item “other2” with an IP address
When I try to test doing this from Postman, I have tried formatting different ways and no luck. I am hoping you can help point me in the right direction. I am also using powershell to perform a fair amount of automation
$params = @{ Uri = "http://<URL>/fog/host/283" Headers = @{ 'fog-api-token' = "$fog_api_token" 'fog-user-token' = "$fog_user_token" 'Content-type' = "application/json" } Method = 'PUT' Body = $jsonbody } Invoke-RestMethod @params
JSON Body:
{ "inventory": { "other2": "10.1.5.35" } }
-
@george1421 Do you know of any pointers you could provide me?
-
@quinniedid I’m sorry I don’t use the API so I’m little to no help.
There are articles in the fog wiki that lay out what is needed: https://news.fogproject.org/simplified-api-documentation/
https://forums.fogproject.org/topic/12026/powershell-api-module
And @JJ-Fullmer has a bunch of experience using the FOG API.
-
@JJ-Fullmer I am sure you are incredibly busy. I was just wondering if you had a few minutes to help me out with the FOG API and changing inventory values?