• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Inventory API Update

    Scheduled Pinned Locked Moved
    General Problems
    2
    4
    616
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Q
      quinniedid
      last edited by

      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"
                        }
      }
      
      1 Reply Last reply Reply Quote 0
      • Q
        quinniedid
        last edited by

        @george1421 Do you know of any pointers you could provide me?

        george1421G 1 Reply Last reply Reply Quote 0
        • george1421G
          george1421 Moderator @quinniedid
          last edited by

          @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.

          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

          Q 1 Reply Last reply Reply Quote 0
          • Q
            quinniedid @george1421
            last edited by

            @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?

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post

            168

            Online

            12.0k

            Users

            17.3k

            Topics

            155.2k

            Posts
            Copyright © 2012-2024 FOG Project