maikBat last edited by maikBat
Hi, I need to know if FOG has an API implemented. I’m trying to build a script that to create “Tasks” for specifics computers. Is there any way to do this in an elegant way with the current version of Fog? If not, there is a way to get the specific table and fields that need be changed/added on the DB for do this.
i.e: I have a list of MACs. I want to deploy a specific image to these PCs without any user interaction. I know the Image ID Number.
Thanks so much
@wayne-workman Just let you know that everything is working now. The problem was that I was using the “Host’s name” instead “Host’s ID” as parameter.
Thanks so much
@maikbat Read through this entire thread: https://forums.fogproject.org/topic/9779/can-i-use-some-kind-of-script-to-create-image-and-ghost-my-lab-machines/12?page=2
@wayne-workman I got everything setup in my server but when I try to send a post i’m receiving this:
<!DOCTYPE HTML PUBLIC “-//IETF//DTD HTML 2.0//EN”>
<title>404 Not Found</title>
<p>The requested URL /fog/host/AABBCC/task was not found on this server.</p>
<address>Apache/2.4.29 (Ubuntu) Server at 192.168.70.3 Port 9000</address>
I’m using port 9000 because I have other service running on 80. I need to run fog and my app in the same server.
The Fog management, PXE and image clone services are working properly and the API is enabled.
Fog running Version: 1.4.4
@maikbat this will probably get you going :
@george1421 I checked the API info, Is amazing to know that this is available. Now I have a couple questions:
Where I can find the task IDs? Will be great to have the “Task IDs” and other options related with them.
In summary, this is what I want to try to do:
- Register a host (name:MAC, MAC:MAC, ImageID:ImageIDNumber)
- Deploy Image on host
- Unregister Host
I pretend do all this using php and json
@Tom-Elliott could you post a copy of your Insomnia environment export for the FOG API? If you don’t have it anymore I can create one - but was just asking since it’s only like 15 seconds to export and post here. I’m sure others here would like to have it besides me.
@george1421 Ah hidden under news (??) https://news.fogproject.org/simplified-api-documentation/
Thank so much for the fast respond. I will check it.
Yes there is a restful api that you communicate with json files.
I can’t seem to find the wiki page at the moment, but here is some examples @Wayne-Workman posted in this thread: https://forums.fogproject.org/topic/9779/can-i-use-some-kind-of-script-to-create-image-and-ghost-my-lab-machines/11