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

API Help

Scheduled Pinned Locked Moved
General
2
4
494
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.
  • C
    Chris Whiteley
    last edited by Nov 6, 2020, 10:53 PM

    I am trying to do something fairly simple with the API and that is just to find the host that I am currently on and start the image that is already associated with it.

    I have the API stuff done and that works, and I can pull information from stealing other people’s work, but I can’t figure out the simple start a task with the image assigned to it.

    Thanks!

    1 Reply Last reply Reply Quote 0
    • C
      Chris Whiteley
      last edited by Nov 7, 2020, 12:06 AM

      I figured this out. Nevermind!

      1 Reply Last reply Reply Quote 0
      • C
        Chris Whiteley
        last edited by Nov 7, 2020, 12:25 AM

        I figured out my question now. I have it to where it will create a host within fog via the API. The only thing I can’t figure out is how to make that host be associated with a SnapinID. For instance, I want it to be associated with a SnapinID of 1. How can I do that?

        1 Reply Last reply Reply Quote 0
        • S
          Sebastian Roth Moderator
          last edited by Nov 8, 2020, 2:20 PM

          @chris-whiteley said in API Help:

          The only thing I can’t figure out is how to make that host be associated with a SnapinID. For instance, I want it to be associated with a SnapinID of 1. How can I do that?

          While I haven’t tested lately I would think you should be able to create a snapin association like this:

          curl -X PUT -d '{"snapins":[1]}' http://x.x.x.x/fog/host/33/edit
          

          Assuming the host you want to associate the snapin (ID 1) to has host ID 33. Don’t forget the API tokens in the call.

          Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

          Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

          1 Reply Last reply Reply Quote 1
          • 1 / 1
          1 / 1
          • First post
            2/4
            Last post

          216

          Online

          12.0k

          Users

          17.3k

          Topics

          155.2k

          Posts
          Copyright © 2012-2024 FOG Project