Skip to main content
Complete reference for all anomalyarmor-cli SDK classes and methods.

Client

The main entry point for the SDK.

Constructor

Context Manager


client.assets

Interact with data assets (tables, views, models).

assets.list()

List assets with optional filters.
Returns: list[Asset]

assets.get()

Get a specific asset by ID or qualified name.
Returns: Asset Raises: NotFoundError if asset doesn’t exist

client.freshness

Monitor data freshness.

freshness.summary()

Get aggregate freshness statistics.
Returns: FreshnessSummary

freshness.list()

List freshness status for all assets.
Returns: list[FreshnessStatus]

freshness.get()

Get freshness status for a specific asset.
Returns: FreshnessStatus

freshness.require_fresh()

Require an asset to be fresh, raising an error if stale. This is the recommended gate pattern for pipelines.
Parameters:
  • asset_id (str): Asset qualified name or UUID
  • max_age_hours (float | None): Custom threshold. Uses asset’s configured threshold if not provided.
Returns: FreshnessStatus if fresh Raises: StalenessError if stale, NotFoundError if not found

freshness.refresh()

Trigger a freshness check.
Returns: dict with job_id, status, message Raises: NotFoundError, AuthorizationError (requires read-write scope)

client.schema

Monitor schema drift.

schema.summary()

Get schema drift summary statistics.
Returns: SchemaSummary

schema.changes()

List recent schema changes.
Returns: list[SchemaChange]

schema.refresh()

Trigger a schema check.
Returns: dict with job_id, status

client.lineage

Explore data dependencies.

lineage.list()

List assets with lineage information.
Returns: list[LineageAsset]

lineage.get()

Get lineage for a specific asset.
Returns: Lineage

client.tags

Manage data classification tags.

tags.list()

List tags for an asset.
Returns: list[Tag]

tags.create()

Create a tag on a database object.
Returns: Tag

tags.apply()

Apply multiple tags to multiple objects.
Returns: BulkApplyResult

client.intelligence

Query the AI knowledge base about your data.

intelligence.ask()

Ask a question about an asset’s data.
Returns: IntelligenceAnswer Raises: NotFoundError if asset not found, ValidationError if intelligence not generated

intelligence.generate()

Generate AI intelligence for an asset (async job).
Returns: dict with job_id, status
Requires asset discovery to be run first. Use the UI or API to discover schema before generating intelligence.

client.investigations

Run structured root-cause investigations against an asset and return a citable EvidenceCapsule. Each piece of evidence links back to the underlying alert, schema event, metric, or lineage edge so the answer is auditable, not free-form prose.
EvidenceCapsule value: one typed call replaces a five-step recipe and returns root cause, confidence, and citation chips that link back to source rows.

investigations.explain()

Run a synchronous investigation against an asset. The same correlator pipeline that powers alert-driven investigations runs against the asset and returns an EvidenceCapsule. No row is persisted.
Arguments: Returns: EvidenceCapsule Raises: NotFoundError if the asset is not found, ValidationError if asset_id is not a valid UUID.

investigations.get()

Fetch a persisted investigation (one created when an alert fires) and project it into the same capsule shape.
Arguments: Returns: EvidenceCapsule Raises: NotFoundError if no investigation matches.

EvidenceCapsule shape

Evidence shape

Each row in triggers / consequences:
investigations.explain() replaces a previous five-step recipe (combining client.health.summary(), client.freshness.status(), client.lineage.get(), client.intelligence.ask(), and client.alerts.list()). The backend already runs those five in parallel inside the correlator pipeline; the SDK now returns the aggregated, citable result directly.

client.jobs

Monitor async job status.

jobs.status()

Get status of an async job.
Returns: JobStatus

client.metrics

Monitor data quality metrics like row counts, null percentages, and more.

metrics.summary()

Get metrics summary for an asset.
Returns: MetricsSummary

metrics.list()

List metrics for an asset.
Returns: list[MetricDefinition]

metrics.get()

Get metric details with optional snapshots.
Returns: MetricDefinition

metrics.create()

Create a new metric. Requires read-write scope.
Parameters:
  • asset_id (str): Asset UUID
  • metric_type (str): row_count, null_percent, distinct_count, etc.
  • table_path (str): Full table path
  • column_name (str | None): Column name for column metrics
  • capture_interval (str): hourly, daily, weekly (default: daily)
  • sensitivity (float): Anomaly detection sensitivity (default: 1.0)
Returns: MetricDefinition

metrics.update()

Update a metric. Requires read-write scope.
Returns: MetricDefinition

metrics.delete()

Delete a metric. Requires read-write scope.

metrics.capture()

Trigger an immediate metric capture. Requires read-write scope.
Returns: dict with snapshot_count and snapshots

metrics.snapshots()

List historical snapshots for a metric.
Returns: list[MetricSnapshot]

client.validity

Define and enforce data validity rules.

validity.summary()

Get validity summary for an asset.
Returns: ValiditySummary

validity.list()

List validity rules for an asset.
Returns: list[ValidityRule]

validity.get()

Get validity rule details.
Returns: ValidityRule

validity.create()

Create a new validity rule. Requires read-write scope.
Parameters:
  • asset_id (str): Asset UUID
  • rule_type (str): NOT_NULL, UNIQUE, REGEX, RANGE, ENUM, etc.
  • table_path (str): Full table path
  • column_name (str | None): Column name
  • rule_config (dict | None): Rule-specific configuration
  • severity (str): info, warning, critical (default: warning)
  • check_interval (str): hourly, daily, weekly (default: daily)
Returns: ValidityRule

validity.update()

Update a validity rule. Requires read-write scope.
Returns: ValidityRule

validity.delete()

Delete a validity rule. Requires read-write scope.

validity.check()

Trigger an immediate validity check. Requires read-write scope.
Returns: ValidityCheckResult

validity.results()

List historical check results.
Returns: list[ValidityCheckResult]

client.referential

Monitor referential integrity between tables.

referential.summary()

Get referential summary for an asset.
Returns: ReferentialSummary

referential.list()

List referential checks for an asset.
Returns: list[ReferentialCheck]

referential.get()

Get referential check details.
Returns: ReferentialCheck

referential.create()

Create a new referential check. Requires read-write scope.
Parameters:
  • asset_id (str): Asset UUID
  • child_table_path (str): Child table path (contains FK)
  • child_column_name (str): FK column name
  • parent_table_path (str): Parent table path (contains PK)
  • parent_column_name (str): PK column name
  • name (str | None): Check name
  • max_orphan_count (int | None): Alert threshold for orphan count
  • max_orphan_percent (float | None): Alert threshold for orphan %
Returns: ReferentialCheck

referential.update()

Update a referential check. Requires read-write scope.
Returns: ReferentialCheck

referential.delete()

Delete a referential check. Requires read-write scope.

referential.execute()

Execute a referential check immediately. Requires read-write scope.
Returns: ReferentialCheckResult

referential.results()

List historical check results.
Returns: list[ReferentialCheckResult]

client.alerts

Query alert history.

alerts.summary()

Get alert summary statistics.
Returns: AlertsSummary

alerts.list()

List alerts with filters.
Returns: list[Alert]

alerts.rules()

List configured alert rules.
Returns: list[AlertRule]

client.api_keys

Manage API keys (requires admin scope).

api_keys.list()

List your organization’s API keys.
Returns: list[APIKey]

api_keys.create()

Create a new API key.
The full key is only returned once. Store it securely!
Returns: CreatedAPIKey (includes full key)

api_keys.get()

Get details of a specific key.
Returns: APIKey (without full key)

api_keys.revoke()

Revoke an API key. This cannot be undone.
Returns: APIKey

api_keys.usage()

Get API key usage and limits.
Returns: dict

Models

Asset

FreshnessStatus

APIKey

CreatedAPIKey

Tag

BulkApplyResult

IntelligenceAnswer

JobStatus

MetricsSummary

MetricDefinition

MetricSnapshot

ValiditySummary

ValidityRule

ValidityCheckResult

ReferentialSummary

ReferentialCheck

ReferentialCheckResult