Rig

Represents a drilling rig device. Inherits data and feed operations from Asset and device operations from Device.

class roak_sdk.semantics.devices.rig.Rig(data, registry)[source]

Bases: Device

Represents a drilling rig in the ROAK system.

Parameters:
  • data (dict)

  • registry (ClientRegistry)

guid

The unique identifier for the rig.

Type:

str

name

The name of the rig.

Type:

str

DEFAULT_FEEDS: list[str] = ['Pulldown Pressure', 'Pullup Pressure', 'Flushing Pressure', 'Flushing Debit', 'Torque', 'Rotation Speed', 'Penetration Speed', 'Sonic Speed', 'Sonic Frequency']
get_boreholes()[source]

Retrieve all boreholes associated with this rig.

Returns:

A list of Borehole objects.

Return type:

list[Borehole]

get_borehole_by_name(name, allow_first_match=False)[source]

Retrieve a specific borehole by name.

Parameters:
  • name (str) – The name of the borehole to retrieve.

  • allow_first_match (bool) – If True, return the first matching borehole when multiple are found.

Returns:

The Borehole object with the specified name.

Return type:

Borehole

Raises:

ValueError – If no borehole with the given name is found.

get_borehole_by_guid(guid)[source]

Retrieve a specific borehole by its GUID.

Parameters:

guid (str) – The GUID of the borehole to retrieve.

Returns:

The Borehole object with the specified GUID.

Return type:

Borehole

Raises:

ValueError – If no borehole with the given GUID is found.

DEFAULT_TIMEFRAME_DAYS: int = 30
get_attributes()

Get the locally cached attribute dictionary.

Returns:

Raw data dictionary.

Return type:

dict

get_children()

Fetch child devices of this device.

Returns:

List of child Device instances.

Return type:

list[Device]

get_data(start_datetime=None, end_datetime=None, feeds=None)

First check if requested feeds exist. Fetch data for this asset within a date range.

Parameters:
  • start_datetime (datetime | int | None) – Start of the date range as timezone-aware datetime or milliseconds since epoch.

  • end_datetime (datetime | int | None) – End of the date range as timezone-aware datetime or milliseconds since epoch.

  • feeds (list[str] | None)

Returns:

List of data records.

Return type:

list[dict]

Raises:

AssetValidationError – If provided datetimes are naive or invalid.

get_feeds()

Fetch available data feeds for this asset.

Returns:

List of feed definitions.

Return type:

list[dict]

get_last_values()

Get one last-reading summary row per feed for this semantic.

Returns rows with:
  • feedname

  • last_value

  • unit (unit.name)

  • record_time

Return type:

list[dict]

refresh_attributes()

Fetch semantic attributes for this semantic and merge into _data.

Expects the API payload shape to be paged, with the attribute list in payload["content"].

Returns:

Updated attributes dictionary.

Return type:

dict

Raises:
  • KeyError – If content is missing from the API payload.

  • TypeError – If content is not iterable as expected.

guid: str
name: str