Skip to content

AsqRule

armis_sdk.entities.asq_rule.AsqRule

Bases: BaseEntity

A class representing an ASQ Rule. An ASQ rule consist of a set of conditions with either "and" or "or" relationship between them. Each item in a set of rules can be a string or a (nested) instance of AsqRule.

Examples:

A simple rule that only matches asq1.

AsqRule(and_=["asq1"])
# or
AsqRule(or_=["asq1"])
# or
AsqRule.from_asq("asq1")

A rule that matches either asq1 or asq2 (or both).

AsqRule(or_=["asq1", "asq2"])

A rule that matches both asq1 and asq2.

AsqRule(and_=["asq1", "asq2"])

A rule that matches asq1 and either asq2 or asq3 (or both).

AsqRule(and_=["asq1", AsqRule(or_=["asq2", "asq3"])])

Methods:

Name Description
from_asq

Create a AsqRule object from a single ASQ string.

Attributes:

Name Type Description
and_ list[str | AsqRule] | None

Rules that all must match.

or_ list[str | AsqRule] | None

Rules that at least one of them must match.

and_ = Field(alias='and', default=None) class-attribute instance-attribute

Rules that all must match.

or_ = Field(alias='or', default=None) class-attribute instance-attribute

Rules that at least one of them must match.

from_asq(asq) classmethod

Create a AsqRule object from a single ASQ string.