Compliance Policies YAML Runner

Compliance Policy Actions Used with the Yaml Runner

Note: To use the YAML Runner you will need to install the datatrails-archivist python package.

Click here for installation instructions.

Compliance Policies Create

This action creates a Compliance Policy that assets may be tested against.

The specific fields required for creating Compliance Policies vary depending on the type of policy being used. Please see the Compliance Policies section for details regarding Compliance Policy types and YAML Runner examples of each.

For example, a COMPLIANCE_RICHNESS policy that asserts radiation level must be less than 7:

---
steps:
  - step:
      action: COMPLIANCE_POLICIES_CREATE
      description: Create COMPLIANCE_RICHNESS policy
      print_response: true
    description: "Radiation level must be less than 7"
    display_name: Rad Limit
    compliance_type: COMPLIANCE_RICHNESS
    asset_filter:
      - or: [ "attributes.arc_home_location_identity=locations/<location-id>" ]
    richness_assertions: 
      - or: [ "radiation_level<7" ]

Compliance Compliant At

The COMPLIANCE_COMPLIANT_AT action checks an Asset against its Compliance Policies.

asset_label is required, and may be specified as the friendly name defined in a previous step or as the Asset ID of an existing subject, in the form assets/<asset-id>. Setting report: true will trigger a report to be printed on the Asset’s compliance status.

---
steps:
  - step:
      action: COMPLIANCE_COMPLIANT_AT
      description: Check Compliance of EV pump 1.
      report: true
      asset_label: ev pump 1