This module is the main core of Hemlock and interfaces with and controls the majority of other modules in this package.
Created on 19 August 2013 @author: Charlie Lewis
This class is responsible for driving the API and the core functionality of Hemlock.
Checks arguments supplied.
Parameters: |
|
---|---|
Returns: | returns a dictionary of the arguments supplied |
Adds a specific schedule to a specific client.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Gets a specific client.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Lists all clients.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Purges a specific client.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Removes a specific schedule from a specific client.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Runs a client.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Schedules a client.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Lists all schedules assigned to a specific client.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Stores a client.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Lists all systems assigned to a specific client.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Connects to the Hemlock couchbase server.
Parameters: |
|
---|---|
Returns: | returns an instance of the couchbase or elasticsearch connection |
Deegisters a specific local system.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Deregisters a specific remote system.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Gets the authentication of supplied arguments, environment variables, or sets them to defaults.
Returns: | returns each of the parsed out arguments |
---|
Stores Hemlock server credentials.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Lists everything that is stored.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Connects to the Hemlock MySQL Server
Parameters: |
|
---|---|
Returns: | returns an instance of the mysql connection |
Parses options for authentication if supplied as arguments.
Returns: | returns an instance of PassThroughOptionParser |
---|
Prints out help.
Parameters: | action – list of API action parsed into elements |
---|
Processes the action that was supplied.
Parameters: |
|
---|---|
Returns: | list of results and any errors that may have occurred. |
Processes arguments by directing the supplied action to the proper function and ensure that all required fields are present.
Parameters: |
|
---|---|
Returns: | returns a dictionary of argument key/values and the API action |
Queries data stored in Hemlock filtering based on the authenticated user.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Reads in the credentials file for the Hemlock system and stores them in the local environment variables of the shell.
Parameters: | debug – instance of Hemlock_Debugger |
---|
Registers a local system.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Registers a remote system.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Creates a role.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Deletes a specific role.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Gets a specific role.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Lists all roles.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Lists all users assigned to a specific role.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Adds a specific client to a specific schedule.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Changes the server that a specific schedule runs on.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Lists all clients assigned to a specific schedule.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Deletes a specific schedule.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Gets a specific schedule.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Lists all schedules.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Removes a specific client from a specific schedule.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Creates a schedule server.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Deletes a specific schedule server.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Gets a specific scheduler server.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Lists all schedule servers.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Starts the scheduler daemon.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Adds a specific tenant to a specific system.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Lists all clients assigned to a specific system.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Gets a specific system.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Lists all clients assigned to a specific system.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Removes a specific tenant from a specific system.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Lists all tenants assigned to a specific system.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Creates a tenant.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Deletes a specific tenant.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Gets a specific tenant.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Lists all tenants.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Lists all systems assigned to a specific tenant.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Lists all users assigned to a specific tenant.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Adds a specific role to a specific user.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Adds a specific tenant to a specific user.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Creates a user.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Deletes a specific user.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Gets a specific user.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Lists all users.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Removes a specific role from a specific user.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Removes a specific tenant from a specific user.
Parameters: |
|
---|---|
Returns: | returns a list of the arguments supplied |
Bases: optparse.OptionParser
An unknown option pass-through implementation of OptionParser.
When unknown arguments are encountered, bundle with largs and try again, until rargs is depleted.
sys.exit(status) will still be called if a known argument is passed incorrectly (e.g. missing arguments or bad argument types, etc.)
This module controlls and runs the scheduler for performing actions between client systems and the Hemlock server.
Created on 30 August 2013 @author: Charlie Lewis
This class is responsible for spawning and controlling the the scheduler and all operations that are scheduled in a cron-like fashion.
Checks for existing schedules, cleans up ones that no longer need to run, starts new ones that need to be scheduled.
Do the actual work that was scheduled at the scheduled tiem.
Parameters: |
|
---|
Schedule a new job.
Parameters: |
|
---|
Schedule a new cron job.
Parameters: |
|
---|
Test module for hemlock.py
Created on 19 August 2013 @author: Charlie Lewis
Test class for hemlock.py
Makes a connection to the test Hemlock MySQL server.
Returns: | returns an instance of the MySQL connection |
---|
Tests client-get action.
Returns: | returns any data and a list of any errors |
---|
Tests client-list action.
Returns: | returns any data and a list of any errors |
---|
Tests client-purge action.
Returns: | returns any data and a list of any errors |
---|
Tests client-run action.
Returns: | returns any data and a list of any errors |
---|
Tests client-schedule action.
Returns: | returns any data and a list of any errors |
---|
Tests client-store action.
Returns: | returns any data and a list of any errors |
---|
Tests deregister-local-system action.
Returns: | returns any data and a list of any errors |
---|
Tests deregister-remote-system action.
Returns: | returns any data and a list of any errors |
---|
Tests list-all action.
Returns: | returns any data and a list of any errors |
---|
Tests query-data action.
Returns: | returns any data and a list of any errors |
---|
Tests register-remote-system action.
Returns: | returns any data and a list of any errors |
---|
Tests role-create action.
Returns: | returns any data and a list of any errors |
---|
Tests role-delete action.
Returns: | returns any data and a list of any errors |
---|
Tests role-list action.
Returns: | returns any data and a list of any errors |
---|
Tests role-users-list action.
Returns: | returns any data and a list of any errors |
---|
Tests schedule-change-server action.
Returns: | returns any data and a list of any errors |
---|
Tests schedule-get action.
Returns: | returns any data and a list of any errors |
---|
Tests schedule-list action.
Returns: | returns any data and a list of any errors |
---|
Tests schedule-server-create action.
Returns: | returns any data and a list of any errors |
---|
Tests schedule-server-delete action.
Returns: | returns any data and a list of any errors |
---|
Tests schedule-server-get action.
Returns: | returns any data and a list of any errors |
---|
Tests schedule-server-list action.
Returns: | returns any data and a list of any errors |
---|
Tests start-scheduler action.
Returns: | returns any data and a list of any errors |
---|
Tests system-add-tenant action.
Returns: | returns any data and a list of any errors |
---|
Tests system-get action.
Returns: | returns any data and a list of any errors |
---|
Tests system-list action.
Returns: | returns any data and a list of any errors |
---|
Tests system-remove-tenant action.
Returns: | returns any data and a list of any errors |
---|
Tests system-tenants-list action.
Returns: | returns any data and a list of any errors |
---|
Tests tenant-create action.
Returns: | returns any data and a list of any errors |
---|
Tests tenant-delete action.
Returns: | returns any data and a list of any errors |
---|
Tests tenant-get action.
Returns: | returns any data and a list of any errors |
---|
Tests tenant-list action.
Returns: | returns any data and a list of any errors |
---|
Tests tenant-systems-list action.
Returns: | returns any data and a list of any errors |
---|
Tests tenant-users-list action.
Returns: | returns any data and a list of any errors |
---|
Tests user-add-role action.
Returns: | returns any data and a list of any errors |
---|
Tests user-add-tenant action.
Returns: | returns any data and a list of any errors |
---|
Tests user-delete action.
Returns: | returns any data and a list of any errors |
---|
Tests user-get action.
Returns: | returns any data and a list of any errors |
---|
Tests user-list action.
Returns: | returns any data and a list of any errors |
---|
Tests user-remove-role action.
Returns: | returns any data and a list of any errors |
---|
Tests user-remove-tenant action.
Returns: | returns any data and a list of any errors |
---|
Tests user-roles-list action.
Returns: | returns any data and a list of any errors |
---|
Tests user-tenants-list action.
Returns: | returns any data and a list of any errors |
---|
Calls the test function for the deregister-local-system action.
Calls the test function for the deregister-remote-system action.
Calls the test function for the register-local-system action.
Calls the test function for the register-remote-system action.
Calls the test function for the schedule-change-server action.
Calls the test function for the schedule-server-create action.
Calls the test function for the schedule-server-delete action.
Calls the test function for the schedule-server-get action.
Calls the test function for the schedule-server-list action.
Calls the test function for the system-remove-tenant action.
Calls the test function for the system-tenants-list action.
Calls the test function for the tenant-systems-list action.