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.list[Asset]
assets.get()
Get a specific asset by ID or qualified name.Asset
Raises: NotFoundError if asset doesn’t exist
client.freshness
Monitor data freshness.freshness.summary()
Get aggregate freshness statistics.FreshnessSummary
freshness.list()
List freshness status for all assets.list[FreshnessStatus]
freshness.get()
Get freshness status for a specific asset.FreshnessStatus
freshness.require_fresh()
Require an asset to be fresh, raising an error if stale. This is the recommended gate pattern for pipelines.asset_id(str): Asset qualified name or UUIDmax_age_hours(float | None): Custom threshold. Uses asset’s configured threshold if not provided.
FreshnessStatus if fresh
Raises: StalenessError if stale, NotFoundError if not found
freshness.refresh()
Trigger a freshness check.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.SchemaSummary
schema.changes()
List recent schema changes.list[SchemaChange]
schema.refresh()
Trigger a schema check.dict with job_id, status
client.lineage
Explore data dependencies.lineage.list()
List assets with lineage information.list[LineageAsset]
lineage.get()
Get lineage for a specific asset.Lineage
client.tags
Manage data classification tags.tags.list()
List tags for an asset.list[Tag]
tags.create()
Create a tag on a database object.Tag
tags.apply()
Apply multiple tags to multiple objects.BulkApplyResult
client.intelligence
Query the AI knowledge base about your data.intelligence.ask()
Ask a question about an asset’s data.IntelligenceAnswer
Raises: NotFoundError if asset not found, ValidationError if intelligence not generated
intelligence.generate()
Generate AI intelligence for an asset (async job).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 citableEvidenceCapsule. 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.
investigations.explain()
Run a synchronous investigation against an asset. The same correlator pipeline that powers alert-driven investigations runs against the asset and returns anEvidenceCapsule. No row is persisted.
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.
Returns:
EvidenceCapsule
Raises: NotFoundError if no investigation matches.
EvidenceCapsule shape
Evidence shape
Each row intriggers / 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.JobStatus
client.metrics
Monitor data quality metrics like row counts, null percentages, and more.metrics.summary()
Get metrics summary for an asset.MetricsSummary
metrics.list()
List metrics for an asset.list[MetricDefinition]
metrics.get()
Get metric details with optional snapshots.MetricDefinition
metrics.create()
Create a new metric. Requiresread-write scope.
asset_id(str): Asset UUIDmetric_type(str):row_count,null_percent,distinct_count, etc.table_path(str): Full table pathcolumn_name(str | None): Column name for column metricscapture_interval(str):hourly,daily,weekly(default:daily)sensitivity(float): Anomaly detection sensitivity (default: 1.0)
MetricDefinition
metrics.update()
Update a metric. Requiresread-write scope.
MetricDefinition
metrics.delete()
Delete a metric. Requiresread-write scope.
metrics.capture()
Trigger an immediate metric capture. Requiresread-write scope.
dict with snapshot_count and snapshots
metrics.snapshots()
List historical snapshots for a metric.list[MetricSnapshot]
client.validity
Define and enforce data validity rules.validity.summary()
Get validity summary for an asset.ValiditySummary
validity.list()
List validity rules for an asset.list[ValidityRule]
validity.get()
Get validity rule details.ValidityRule
validity.create()
Create a new validity rule. Requiresread-write scope.
asset_id(str): Asset UUIDrule_type(str):NOT_NULL,UNIQUE,REGEX,RANGE,ENUM, etc.table_path(str): Full table pathcolumn_name(str | None): Column namerule_config(dict | None): Rule-specific configurationseverity(str):info,warning,critical(default:warning)check_interval(str):hourly,daily,weekly(default:daily)
ValidityRule
validity.update()
Update a validity rule. Requiresread-write scope.
ValidityRule
validity.delete()
Delete a validity rule. Requiresread-write scope.
validity.check()
Trigger an immediate validity check. Requiresread-write scope.
ValidityCheckResult
validity.results()
List historical check results.list[ValidityCheckResult]
client.referential
Monitor referential integrity between tables.referential.summary()
Get referential summary for an asset.ReferentialSummary
referential.list()
List referential checks for an asset.list[ReferentialCheck]
referential.get()
Get referential check details.ReferentialCheck
referential.create()
Create a new referential check. Requiresread-write scope.
asset_id(str): Asset UUIDchild_table_path(str): Child table path (contains FK)child_column_name(str): FK column nameparent_table_path(str): Parent table path (contains PK)parent_column_name(str): PK column namename(str | None): Check namemax_orphan_count(int | None): Alert threshold for orphan countmax_orphan_percent(float | None): Alert threshold for orphan %
ReferentialCheck
referential.update()
Update a referential check. Requiresread-write scope.
ReferentialCheck
referential.delete()
Delete a referential check. Requiresread-write scope.
referential.execute()
Execute a referential check immediately. Requiresread-write scope.
ReferentialCheckResult
referential.results()
List historical check results.list[ReferentialCheckResult]
client.alerts
Query alert history.alerts.summary()
Get alert summary statistics.AlertsSummary
alerts.list()
List alerts with filters.list[Alert]
alerts.rules()
List configured alert rules.list[AlertRule]
client.api_keys
Manage API keys (requiresadmin scope).
api_keys.list()
List your organization’s API keys.list[APIKey]
api_keys.create()
Create a new API key.CreatedAPIKey (includes full key)
api_keys.get()
Get details of a specific key.APIKey (without full key)
api_keys.revoke()
Revoke an API key. This cannot be undone.APIKey
api_keys.usage()
Get API key usage and limits.dict
