The watcher.api.controllers.v1.audit_template Module

An Audit may be launched several times with the same settings (Goal, thresholds, ...). Therefore it makes sense to save those settings in some sort of Audit preset object, which is known as an Audit Template.

An Audit Template contains at least the Goal of the Audit.

It may also contain some error handling settings indicating whether:

and how many retries should be attempted before failure occurs (also the latter can be complex: for example the scenario in which there are many first-time failures on ultimately successful Actions).

Moreover, an Audit Template may contain some settings related to the level of automation for the Action Plan that will be generated by the Audit. A flag will indicate whether the Action Plan will be launched automatically or will need a manual confirmation from the Administrator.

class watcher.api.controllers.v1.audit_template.AuditTemplate(**kwargs)[source]

Bases: watcher.api.controllers.base.APIBase

API representation of a audit template.

This class enforces type checking and value constraints, and converts between the internal object model and the API representation of an audit template.

classmethod sample(expand=True)[source]
class watcher.api.controllers.v1.audit_template.AuditTemplateCollection(**kwargs)[source]

Bases: watcher.api.controllers.v1.collection.Collection

API representation of a collection of audit templates.

classmethod sample()[source]
class watcher.api.controllers.v1.audit_template.AuditTemplatePatchType(**kw)[source]

Bases: watcher.api.controllers.v1.types.JsonPatchType

static mandatory_attrs()[source]
static validate(patch)[source]
class watcher.api.controllers.v1.audit_template.AuditTemplatePostType(**kw)[source]

Bases: wsme.types.Base

as_audit_template()[source]
static validate(audit_template)[source]
class watcher.api.controllers.v1.audit_template.AuditTemplatesController[source]

Bases: pecan.rest.RestController

REST controller for AuditTemplates.

delete(*args, **kwargs)[source]

Delete a audit template.

Parameters:template_uuid (audit) – UUID or name of an audit template.
detail(*args, **kwargs)[source]

Retrieve a list of audit templates with detail.

Parameters:
  • goal – goal UUID or name to filter by
  • strategy – strategy UUID or name to filter by
  • marker – pagination marker for large data sets.
  • limit – maximum number of resources to return in a single result.
  • sort_key – column to sort results by. Default: id.
  • sort_dir – direction to sort. “asc” or “desc”. Default: asc.
get_all(*args, **kwargs)[source]

Retrieve a list of audit templates.

Parameters:
  • goal – goal UUID or name to filter by
  • strategy – strategy UUID or name to filter by
  • marker – pagination marker for large data sets.
  • limit – maximum number of resources to return in a single result.
  • sort_key – column to sort results by. Default: id.
  • sort_dir – direction to sort. “asc” or “desc”. Default: asc.
get_one(*args, **kwargs)[source]

Retrieve information about the given audit template.

Parameters:audit_template (audit) – UUID or name of an audit template.
patch(*args, **kwargs)[source]

Update an existing audit template.

Parameters:
  • template_uuid (audit) – UUID of a audit template.
  • patch – a json PATCH document to apply to this audit template.
post(*args, **kwargs)[source]

Create a new audit template.

Parameters:audit_template_postdata – the audit template POST data from the request body.