Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

As at Open-AudIT 2.0, users are assigned a role (or roles) and access is based upon the organisations a user has access to. Groups are used mainly for reporting convienence and Baselines within Open-AudIT Enterprise.

 

How Does it Work?

Groups are used as  simple lists of devices that match the required conditions. They no longer (as at 2.0) support returning different attribute lists for display. If requested using JSON they return a list of system.id's only. If requested using the web interface, they return the standard column attribute list.

...

Code Block
languagesql
CREATE TABLE `groups` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `org_id` int(10) unsigned NOT NULL DEFAULT '1',
  `name` varchar(100) NOT NULL DEFAULT '',
  `description` text NOT NULL,
  `sql` text NOT NULL,
  `link` text NOT NULL,
  `expose` enum('y','n') NOT NULL DEFAULT 'y',
  `edited_by` varchar(200) NOT NULL DEFAULT '',
  `edited_date` datetime NOT NULL DEFAULT '2000-01-01 00:00:00',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

 

Example Database Entry

Code Block
languagesql
         id: 15
     org_id: 1
       name: Windows Servers
description: Devices with type = computer and os_name like Windows Server.
        sql: SELECT DISTINCT(system.id) FROM system WHERE @filter AND system.type = 'computer' AND os_name LIKE '%windows%server%'
       link: 
     expose: y
  edited_by: system
edited_date: 2016-11-28 04:53:59

 

API / Web Access?

You can access the /scripts collection using the normal Open-AudIT JSON based API. Just like any other collection. Please see the API documentation for further details.

API Routes

Request MethodIDActionResulting FunctionPermission RequiredURL ExampleNotesExample Response
GETn collectiongroups::read/groupsReturns a list of groups. 
GETy readgroups::read/groups/{id}Returns a groups details. 
PATCHy updategroups::update/groups/{id}Update an attribute of a groups entry. 
POSTn creategroups::create/groupsInsert a new groups entry. 
DELETEy deletegroups::delete/groups/{id}Delete a groups entry. 

Web Application Routes

Request MethodIDActionResulting FunctionPermission RequiredURL ExampleNotes
GETncreatecreate_formgroups::create/groups/createDisplays a standard web form for submission to POST /scripts.
GETyupdateupdate_formgroups::update/groups/{id}/updateShow the script details with the option to update attributes using PATCH to /groups/{id}