Simple API for Fog
Python
Switch branches/tags
Nothing to show
Clone or download
JC-SoCal Merge pull request #1 from Laird-Dave/master
clearer error messages and adapted deployment
Latest commit 5ba1ef0 Jul 7, 2015
Permalink
Failed to load latest commit information.
.gitattributes First Apr 6, 2014
.gitignore First Apr 6, 2014
example.py updated example.py Apr 12, 2014
pyFog.py fixed accidentally broken spacing, sorry for that Jul 7, 2015
readme.md Added the ability to schedule WoL Apr 12, 2014

readme.md

pyFog

pyFog is a simple API which uses mechanize to complete tasks through the FOG Project web interface. There is example code in the example.py file.

I wrote this API to easily automate a few tasks I need to commonly perform with FOG. If you do not see a function that you need to perform feel free to make a feature request or message me on twitter: @JC_SoCal

Requirments

Functions

All functions return a tuple of a status and a message:
status is a boolean.

  • True -- The function completed successfully.
  • False -- There was a problem.

message is a string. The string will contain information relating to the status.

pyFog.open(url):
    Opens a connection to the webpage. This is required prior to login.
Arguments:

pyFog.login(username, password):
    Logs in to the fog web interface.
Arguments:

  • username -- string, username used to login to fog
  • password -- string, password used to login to fog

pyFog.logout():
     Logs out of the fog web interface.
Arguments:

  • None

pyFog.upload(hostname):
    Upload will pull an image from a client computer that will be saved on the server.
Arguments:

  • hostname -- string, valid hostname from the host managment console

pyFog.deploy(hostname):
    Deploy action will send an image saved on the FOG server to the client computer with all included snapins.
Arguments:

  • hostname -- string, valid hostname from the host managment console

pyFog.wol(hostname, schedule):
    Wake Up will attempt to send the Wake-On-LAN packet to the computer to turn the computer on. In switched environments, you typically need to configure your hardware to allow for this (iphelper).
Arguments:

  • hostname -- string, valid hostname from the host managment console
  • schedule -- string, optional. FORMAT: 'YYYY/MM/DD HH:MM' example: '2014/08/17 15:25' If not set the task will execute immediately.