Resources¶
Synchronous resource classes. Reach them through an AtonixClient:
client.assets, client.issues, client.models, and client.process_data.
Assets
¶
Assets(client: AtonixClient)
Bases: BaseResource
Interface for the Atonix Assets API.
get_top
¶
Retrieve top level of available assets.
Automatically handles pagination starting from the skip offset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
skip
|
int
|
Number of assets to skip for initial offset. |
0
|
take
|
int
|
Number of assets to retrieve per API page. |
50
|
Yields:
| Type | Description |
|---|---|
Asset
|
Asset objects one by one. |
get_asset_details
¶
Get the details for a single asset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
asset_id
|
str
|
The unique identifier (GUID) of the asset. |
required |
Returns:
| Type | Description |
|---|---|
Asset
|
An Asset object. |
Raises:
| Type | Description |
|---|---|
NotFoundError
|
If the asset does not exist. |
APIError
|
On unexpected API failure. |
get_children
¶
get_children(
asset_id: str,
include_descendants: bool = False,
changed_after: datetime | None = None,
changed_before: datetime | None = None,
include_self: bool = False,
skip: int = 0,
take: int = 500,
) -> Iterator[Asset]
Get the children assets of a given parent asset.
Offers various filters including descendant recursion and date-based modification filters. Automatically handles pagination.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
asset_id
|
str
|
The unique identifier (GUID) of the parent asset. |
required |
include_descendants
|
bool
|
Whether to include all levels of children (recursive). |
False
|
changed_after
|
datetime | None
|
Filter assets modified after this date (ISO 8601). |
None
|
changed_before
|
datetime | None
|
Filter assets modified before this date (ISO 8601). |
None
|
include_self
|
bool
|
Whether to include the parent asset in the result. |
False
|
skip
|
int
|
Number of assets to skip for initial offset. |
0
|
take
|
int
|
Number of assets to retrieve per API page (max 500). |
500
|
Yields:
| Type | Description |
|---|---|
Asset
|
Asset objects one by one. |
Issues
¶
Issues(client: AtonixClient)
Bases: BaseResource
Interface for the Atonix Issues API.
get_issues
¶
get_issues(
asset_id: str,
include_descendants: bool = False,
status: str | None = None,
changed_after: datetime | None = None,
changed_before: datetime | None = None,
skip: int = 0,
take: int = 500,
) -> Iterator[BareIssue]
List issues for a specific asset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
asset_id
|
str
|
The unique identifier (GUID) of the asset. |
required |
include_descendants
|
bool
|
Whether to include issues from child assets. |
False
|
status
|
str | None
|
Filter by issue status (e.g., 'open', 'closed'). |
None
|
changed_after
|
datetime | None
|
Filter issues changed on or after this date. |
None
|
changed_before
|
datetime | None
|
Filter issues changed on or before this date. |
None
|
skip
|
int
|
Number of issues to skip for initial offset. |
0
|
take
|
int
|
Number of issues to retrieve per API page (max 500). |
500
|
Yields:
| Type | Description |
|---|---|
BareIssue
|
BareIssue objects one by one. |
get_issue
¶
create_issue
¶
create_issue(issue: IssueCreate) -> Issue
Create a new issue.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
issue
|
IssueCreate
|
An IssueCreate object containing the issue details. |
required |
Returns:
| Type | Description |
|---|---|
Issue
|
The created Issue object (full details). |
patch_issue
¶
patch_issue(issue_id: str, patch: IssuePatch) -> Issue
Update an existing issue.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
issue_id
|
str
|
The unique identifier (GUID) of the issue. |
required |
patch
|
IssuePatch
|
An IssuePatch object containing the fields to update. |
required |
Returns:
| Type | Description |
|---|---|
Issue
|
The updated Issue object. |
get_keywords
¶
get_keywords(
issue_id: str, skip: int = 0, take: int = 50
) -> Iterator[IssueKeyword]
Get keywords associated with an issue.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
issue_id
|
str
|
The unique identifier (GUID) of the issue. |
required |
skip
|
int
|
Number of keywords to skip for initial offset. |
0
|
take
|
int
|
Number of keywords to retrieve per API page. |
50
|
Yields:
| Type | Description |
|---|---|
IssueKeyword
|
IssueKeyword objects one by one. |
add_keyword
¶
add_keyword(
issue_id: str, keyword_desc: str
) -> IssueKeyword
Add a keyword to an issue.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
issue_id
|
str
|
The unique identifier (GUID) of the issue. |
required |
keyword_desc
|
str
|
The text of the keyword to add. |
required |
Returns:
| Type | Description |
|---|---|
IssueKeyword
|
The created IssueKeyword object. |
delete_keywords
¶
get_discussion_entries
¶
get_discussion_entries(
issue_id: str, skip: int = 0, take: int = 50
) -> Iterator[IssueDiscussionEntryDetails]
Get discussion entries for an issue.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
issue_id
|
str
|
The unique identifier (GUID) of the issue. |
required |
skip
|
int
|
Number of entries to skip. |
0
|
take
|
int
|
Number of entries to retrieve per page. |
50
|
Yields:
| Type | Description |
|---|---|
IssueDiscussionEntryDetails
|
IssueDiscussionEntryDetails objects one by one. |
get_resolution_statuses
¶
get_resolution_statuses(
category_id: int,
) -> Iterator[IssueResolutionStatus]
List of resolution statuses for a specific Category Id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
category_id
|
int
|
The category ID to filter by. |
required |
Yields:
| Type | Description |
|---|---|
IssueResolutionStatus
|
IssueResolutionStatus objects one by one. |
Models
¶
Models(client: AtonixClient)
Bases: BaseResource
Interface for the Atonix Models (Monitoring) API.
get_models
¶
get_models(
asset_id: str,
include_descendants: bool = False,
skip: int = 0,
take: int = 500,
) -> Iterator[Model]
List models for a specific asset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
asset_id
|
str
|
The unique identifier (GUID) of the asset. |
required |
include_descendants
|
bool
|
Whether to include models from child assets. |
False
|
skip
|
int
|
Number of models to skip for initial offset. |
0
|
take
|
int
|
Number of models to retrieve per API page (max 500). |
500
|
Yields:
| Type | Description |
|---|---|
Model
|
Model objects one by one. |
get_model_state
¶
get_model_state(model_id: str) -> AlertState
Get the current alert and value state for a model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model_id
|
str
|
The unique identifier (GUID) of the model. |
required |
Returns:
| Type | Description |
|---|---|
AlertState
|
An AlertState object. |
get_model_actions
¶
get_model_actions(
model_id: str,
changed_after: datetime | None = None,
changed_before: datetime | None = None,
skip: int = 0,
take: int = 500,
) -> Iterator[Action]
Get action items/events for a specific model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model_id
|
str
|
The unique identifier (GUID) of the model. |
required |
changed_after
|
datetime | None
|
Filter actions modified after this date. |
None
|
changed_before
|
datetime | None
|
Filter actions modified before this date. |
None
|
skip
|
int
|
Number of actions to skip. |
0
|
take
|
int
|
Number of actions to retrieve per page. |
500
|
Yields:
| Type | Description |
|---|---|
Action
|
Action objects one by one. |
get_model_config
¶
get_model_config(
model_id: str,
) -> ModelConfiguration | ExternalModelConfiguration
Get the configuration for a model.
Automatically detects if the model is a standard Atonix model or an External (API-based) model and returns the appropriate configuration object.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model_id
|
str
|
The unique identifier (GUID) of the model. |
required |
Returns:
| Type | Description |
|---|---|
ModelConfiguration | ExternalModelConfiguration
|
ModelConfiguration or ExternalModelConfiguration. |
get_model_states_by_asset
¶
get_model_states_by_asset(
asset_id: str,
include_descendants: bool = False,
include_inactive: bool = False,
skip: int = 0,
take: int = 500,
) -> Iterator[AlertState]
List states for all models under an asset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
asset_id
|
str
|
The unique identifier (GUID) of the asset. |
required |
include_descendants
|
bool
|
Whether to include models from child assets. |
False
|
include_inactive
|
bool
|
Whether to include models that are not currently running/active. |
False
|
skip
|
int
|
Offset for pagination. |
0
|
take
|
int
|
Results per page. |
500
|
Yields:
| Type | Description |
|---|---|
AlertState
|
AlertState objects one by one. |
get_model_actions_by_asset
¶
get_model_actions_by_asset(
asset_id: str,
changed_after: datetime,
changed_before: datetime,
favorite: bool = False,
include_descendants: bool = False,
skip: int = 0,
take: int = 500,
) -> Iterator[Action]
Get all action items for an asset's models within a date range.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
asset_id
|
str
|
The unique identifier (GUID) of the asset. |
required |
changed_after
|
datetime
|
Start date for the window. |
required |
changed_before
|
datetime
|
End date for the window. |
required |
favorite
|
bool
|
Filter for only 'favorite' or starred actions. |
False
|
include_descendants
|
bool
|
Whether to include models from child assets. |
False
|
skip
|
int
|
Offset for pagination. |
0
|
take
|
int
|
Results per page. |
500
|
Yields:
| Type | Description |
|---|---|
Action
|
Action objects one by one. |
get_model
¶
get_model(
model: str | Model,
include_config: bool = False,
include_state: bool = False,
include_actions: bool = False,
actions_changed_after: datetime | None = None,
actions_changed_before: datetime | None = None,
) -> Model
Get a Model object, optionally including configuration, state, and actions.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
str | Model
|
Either a Model ID (str) or a Model object (which must have an ID). |
required |
include_config
|
bool
|
Whether to fetch and include the model configuration. |
False
|
include_state
|
bool
|
Whether to fetch and include the current alert state. |
False
|
include_actions
|
bool
|
Whether to fetch and include recent actions. |
False
|
actions_changed_after
|
datetime | None
|
Filter actions modified after this date (only used if include_actions=True). |
None
|
actions_changed_before
|
datetime | None
|
Filter actions modified before this date (only used if include_actions=True). |
None
|
Returns:
| Type | Description |
|---|---|
Model
|
A Model object with the requested information populated. |
ProcessData
¶
ProcessData(client: AtonixClient)
Bases: BaseResource
Interface for the Atonix ProcessData (Time-Series) API.
get_servers
¶
get_tags_list
¶
get_tags_list(
server_id: str,
changed_after: datetime | None = None,
changed_before: datetime | None = None,
skip: int = 0,
take: int = 50,
) -> Iterator[Tag]
List tags available on a specific server.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
server_id
|
str
|
The unique identifier (GUID) of the historian server. |
required |
changed_after
|
datetime | None
|
Filter tags modified after this date. |
None
|
changed_before
|
datetime | None
|
Filter tags modified before this date. |
None
|
skip
|
int
|
Offset for pagination. |
0
|
take
|
int
|
Results per page. |
50
|
Yields:
| Type | Description |
|---|---|
Tag
|
Tag objects (basic info) one by one. |
get_tag_details
¶
get_archives
¶
get_data_for_range
¶
get_data_for_range(
server_id: str,
start_time: datetime,
end_time: datetime,
tag_ids: list[str],
archive: str,
chunk: bool = True,
) -> list[TagData]
Retrieve time-series data for a set of tags over a date range.
Automatically calculates requirements for interval/sampling based on the archive.
Queries larger than _READ_CHUNK_LIMIT (250,000 tag x timestamp points) are split
into sub-queries by tag group and, when a single tag exceeds the limit, by time window.
The per-tag series are reassembled before returning.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
server_id
|
str
|
The unique identifier (GUID) of the historian server. |
required |
start_time
|
datetime
|
Start of the query window (UTC). |
required |
end_time
|
datetime
|
End of the query window (UTC). |
required |
tag_ids
|
list[str]
|
List of tag GUIDs to retrieve data for. |
required |
archive
|
str
|
Archive name to query (e.g., '1min', 'raw'). |
required |
chunk
|
bool
|
When True (default), split oversized queries automatically. When False,
raise |
True
|
Returns:
| Type | Description |
|---|---|
list[TagData]
|
A list of TagData objects, one per tag requested. |
Raises:
| Type | Description |
|---|---|
QuerySizeError
|
If the query exceeds the point limit and |
write_tag_data
¶
Write time-series data back to Atonix.
Handles large payloads by automatically chunking data into manageable sizes
for the Atonix API (limit approx 30,000 points per call). Multiple tags are
packed into a single POST whenever their combined point count fits within
_WRITE_CHUNK_LIMIT, which dramatically reduces request count for
wide-but-shallow uploads (many tags, few points each).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
server_id
|
str
|
The unique identifier (GUID) of the target server. |
required |
archive
|
str
|
The archive to write to. |
required |
data
|
list[TagData]
|
List of TagData objects containing the data to write. |
required |