CLI commands

CLI commands

Here is the list of SQL procedures available since Asqatasun 4.0.4+. Each SQL procedure has a shell script wrapper, located in source code in web-app/resources/sql-management/. Wrappers name begin with ASQA_.

Last_audit

List last audits.

call last_audits(n);

With:

  • n: INT, number of audits to list.

List_running_acts

List all running acts. May be useful if an audit crashes, you can find its Id_Acts and Id_Audit and delete them manually.

call list_running_acts();

Delete_audit_from_id

Delete an audit based on its id.

call delete_audit_from_id(id);

With:

  • id: INT, the id of the audit to delete

Contract_create

Create a contract for a given user.

call contract_create(idUser, label, url, referential, audit_page, audit_site, audit_file, audit_scenario, audit_manual,
                     maxDoc, timeSpan, timeSpanUnit);

With:

  • idUser: INT, the id of the user to whom the contract is added
  • label: VARCHAR(255), the name you give to the contract
  • url: VARCHAR(1024), if specified all audits will be restricted to that domain (http://mysite.org/) or URL (i.e. http://mysite.org/directory/). This does not apply to file-audit or scenario-audit.
  • referential: VARCHAR(10), code name of the referential. As of february 2017, to be choosen amongst RGAA3, RGAA32016, SEO
  • audit_page: BOOLEAN, whether to authorize page audit
  • audit_site: BOOLEAN, whether to authorize site-wide audit (i.e. authorize crawler usage)
  • audit_file: BOOLEAN, whether to authorize audit of uploaded HTML files
  • audit_scenario: BOOLEAN, whether to authorize audit of scenarios
  • audit_manual: BOOLEAN, whether to authorize a manual audit to be ran (after the automated audit is complete). Works only for page-audit.
  • maxDoc: for site audit, maximum number of pages the crawler has to browse (say 1'000). Warning: 10'000 is a huge value. Important note: for contract without site-audit permitted, maxDoc must have a NULL value.
  • timeSpan: duration contract. You can use NULL value for default duration (3).
  • timeSpanUnit: duration contract unit : YEAR, MONTH or DAY. You can use NULL value for default unit (YEAR).

Mandatory fields

  • idUser
  • label
  • url is needed only for contract authorizing site-audit (otherwise you allow your user to audit the whole internet).
  • at least one type of audit amongst audit_page, audit_site, audit_file, audit_scenario

Example of contract: Site-wide audit on Wikipedia for accessibility (RGAA)

We want to create a contract:

  • to user whose id is 1,
  • on https://en.wikipedia.org/
  • for accessibility (referential RGAA3),
  • allowing only site-audit (none of the other kinds of audit),
  • in this case manual-audit is not relevant,
  • and we limit the crawler action to 1000 pages
  • and we limit the contract duration to the default duration (3 years)
call contract_create(1, "Wikipedia RGAA", "https://en.wikipedia.org/", "RGAA3", 0, 1, 0, 0, 0, "1000", NULL, NULL);

Note the NULL value for timeSpan and timeSpanUnit parameters.

Example of contract: Site-wide audit on Wikipedia for SEO

We want to create the same contract but only for SEO. Easy, just change the referential (don’t forget, this is the technical codename of the referential that must be passed as argument)

call contract_create(1, "Wikipedia RGAA", "https://en.wikipedia.org/", "SEO", 0, 1, 0, 0, 0, "1000", NULL, NULL);

Example of contract: Site-wide audit + page-audit + manual-audit on Wikipedia for accessibility

Like the previous one, but we add the page-audit feature, and enable the manual-audit option.

call contract_create(1, "Wikipedia RGAA", "https://en.wikipedia.org/", "SEO", 1, 1, 0, 0, 1, "1000", NULL, NULL);

Note: the manual-audit option concerns only page-audit.

Example of contract: page-audit on any webpage over the internet, for accessibility

This time, we do not provide any url parameter. We use to call this kind of contract “openbar”.

call contract_create(1, "Openbar RGAA", "", "RGAA3", 1, 0, 0, 0, 0, NULL, NULL, NULL);

Note the NULL value for maxDoc parameter.

Example of contract: page-audit + file-audit + scenario-audit on any webpage, for accessibility, plus manual-audit

Taking the previous example, we just add features file-audit and scenario-audit, and enable the manual-audit option.

call contract_create(1, "Openbar RGAA", "", "RGAA3", 1, 0, 1, 1, 1, NULL, NULL, NULL);

Examples of contract: 10 years, 2 months or 7 days

Taking the previous example, we just provide the timeSpan and timeSpanUnit parameters.

call contract_create(1, "Openbar RGAA - 10 YEARS", "", "RGAA3", 1, 0, 1, 1, 1, NULL, 10, "YEAR");
call contract_create(1, "Openbar RGAA - 2 MONTHS", "", "RGAA3", 1, 0, 1, 1, 1, NULL, 2, "MONTH");
call contract_create(1, "Openbar RGAA - 7 DAYS", "", "RGAA3", 1, 0, 1, 1, 1, NULL, 7, "DAY");