Skip to content

Python Client Reference — hydroserverpy

hydroserverpy is HydroServer's official Python client library. This page is a reference for the classes, properties, and methods it exposes. If you're new to the library, start with the Getting Started with hydroserverpy tutorial series.


Connection

python
from hydroserverpy import HydroServer

# Email/password authentication
hs_api = HydroServer(host, email, password)

# API key authentication
hs_api = HydroServer(host, apikey=apikey)
ParameterTypeDefaultDescription
hoststrBase URL of your HydroServer instance
emailstrNoneAccount email
passwordstrNoneAccount password
apikeystrNoneAPI key (alternative to email/password)

Methods

MethodDescription
login(email, password)Re-authenticate with new credentials without creating a new instance
logout()End the current session

Common Patterns

HydroServerCollection

list() methods return a HydroServerCollection rather than a plain list.

PropertyTypeDescription
itemsList[T]The resources on the current page
pageintCurrent page number (1-indexed)
page_sizeintNumber of items per page
total_pagesintTotal number of pages
total_countintTotal number of matching resources
MethodReturnsDescription
next_page()HydroServerCollectionFetch the next page
previous_page()HydroServerCollection | NoneFetch the previous page
fetch_all()HydroServerCollectionMerge all pages into a single collection

Common list() parameters

All list() methods accept these parameters in addition to any entity-specific filters:

ParameterTypeDefaultDescription
pageint1Page number to fetch
page_sizeint100Results per page
order_byList[str][]Fields to sort by; prefix with - for descending
fetch_allboolFalseIf True, fetches and merges all pages automatically

Model methods

All resource objects share these methods inherited from HydroServerBaseModel:

MethodDescription
save()Persist any modified editable fields back to HydroServer
refresh()Re-fetch this resource's data from HydroServer
delete()Delete this resource from HydroServer and set uid to None

save() only sends fields listed in the editable column of each entity's property table. Read-only fields are never sent. Fields marked computed are lazy-loaded properties — they trigger an API call on first access and are then cached on the object.

TaskRun

Returned by trigger() and list_runs() across ETL tasks, data product tasks, and monitoring tasks.

PropertyTypeDescription
idUUIDRun identifier
statusstr"PENDING", "STARTED", "SUCCESS", or "FAILURE"
messagestr | NoneHuman-readable status message
resultdict | NoneDetailed result payload
started_atdatetime | NoneWhen the run started
finished_atdatetime | NoneWhen the run finished

Workspaces

Property: hs_api.workspaces

Workspace properties

PropertyTypeEditableNotes
uidUUIDNo
namestrYes
is_privateboolYes
ownerAccountNoSee Account fields below
collaboratorsList[Collaborator]NoComputed
apikeysList[APIKey]NoComputed
rolesList[Role]NoComputed
thingsList[Thing]NoComputed
observedpropertiesList[ObservedProperty]NoComputed
unitsList[Unit]NoComputed
processinglevelsList[ProcessingLevel]NoComputed
sensorsList[Sensor]NoComputed
dataconnectionsList[DataConnection]NoComputed
tasksList[EtlTask]NoComputed; ETL tasks only

Account fields (accessible via workspace.owner):

FieldType
namestr
emailstr
organization_namestr | None
phonestr | None
addressstr | None
linkstr | None
user_typestr

Collaborator fields (items in workspace.collaborators):

FieldTypeNotes
uidUUID
userAccountThe collaborator's account info
role_idUUID
workspace_idUUID
roleRoleComputed; also settable via assignment
workspaceWorkspaceComputed

APIKey fields (items in workspace.apikeys):

FieldTypeEditable
uidUUIDNo
namestrYes
descriptionstr | NoneYes
role_idUUIDYes
workspace_idUUIDNo
is_activeboolYes
expires_atdatetime | NoneYes

APIKey objects support save(), refresh(), delete(), and regenerate() (invalidates the old key and returns a new key string).

Service methods

python
hs_api.workspaces.list(is_associated=None, is_private=None) -> HydroServerCollection[Workspace]
hs_api.workspaces.get(uid) -> Workspace
hs_api.workspaces.create(name, is_private=False) -> Workspace
FilterTypeDescription
is_associatedboolOnly return workspaces you're a member of
is_privateboolFilter by privacy setting

Workspace methods

MethodDescription
add_collaborator(email, role)Add a user as a collaborator; role accepts a UUID string or Role object
edit_collaborator_role(email, role)Change an existing collaborator's role
remove_collaborator(email)Remove a collaborator
transfer_ownership(email)Initiate an ownership transfer to another user
accept_ownership_transfer()Accept a pending incoming ownership transfer
cancel_ownership_transfer()Cancel a pending outgoing ownership transfer
create_api_key(name, role, description=None, is_active=True, expires_at=None)Create a new API key; returns (APIKey, key_string) where key_string is the raw key value — store it, it won't be shown again
delete_api_key(api_key_id)Delete an API key by its UUID

Things (Sites)

Property: hs_api.things

Thing properties

PropertyTypeEditableNotes
uidUUIDNo
namestrYes
descriptionstrYes
sampling_feature_typestrYes
sampling_feature_codestrYes
site_typestrYes
data_disclaimerstr | NoneYes
is_privateboolYes
latitudefloatYes
longitudefloatYes
elevation_mfloat | NoneYes
elevation_datumstr | NoneYes
admin_area_1str | NoneYesState/province
admin_area_2str | NoneYesCounty/district
countrystr | NoneYesISO 3166-1 alpha-2
workspace_idUUIDNo
tagsDict[str, str]NoUse tag methods to modify
file_attachmentsDict[str, dict]NoUse attachment methods to modify
workspaceWorkspaceNoComputed
datastreamsList[Datastream]NoComputed

Service methods

python
hs_api.things.list(workspace=None, bbox=None, site_type=None, sampling_feature_type=None,
                   tag=None, is_private=None) -> HydroServerCollection[Thing]
hs_api.things.get(uid) -> Thing
hs_api.things.create(workspace, name, description, sampling_feature_type, sampling_feature_code,
                     site_type, is_private, latitude, longitude, elevation_m=None,
                     elevation_datum=None, admin_area_1=None, admin_area_2=None,
                     country=None, data_disclaimer=None, uid=None) -> Thing
FilterTypeDescription
workspaceUUID | strFilter by workspace
bboxtuple(min_lon, min_lat, max_lon, max_lat) bounding box
site_typestrFilter by site type
sampling_feature_typestrFilter by sampling feature type
tagtuple(key, value) filter by tag
is_privateboolFilter by privacy setting

Tag and file attachment methods

MethodDescription
add_tag(key, value)Add a tag to this thing
update_tag(key, value)Update an existing tag's value
delete_tag(key)Remove a tag
add_file_attachment(file, file_attachment_type)Upload a file; file is an open binary file object
delete_file_attachment(name)Remove a file attachment by filename

Metadata

Sensors, observed properties, units, processing levels, and result qualifiers all follow the same shape: a small set of editable fields, a read-only workspace_id, and a computed workspace property. They all support the standard save(), refresh(), and delete() model methods.

Sensors

Property: hs_api.sensors

PropertyTypeEditable
uidUUIDNo
namestrYes
descriptionstrYes
encoding_typestrYes
manufacturerstr | NoneYes
sensor_modelstr | NoneYes
sensor_model_linkstr | NoneYes
method_typestrYes
method_linkstr | NoneYes
method_codestr | NoneYes
workspace_idUUID | NoneNo
workspaceWorkspace | NoneNo
python
hs_api.sensors.list(workspace=None) -> HydroServerCollection[Sensor]
hs_api.sensors.get(uid) -> Sensor
hs_api.sensors.create(workspace, name, description, encoding_type, method_type,
                      manufacturer=None, sensor_model=None, sensor_model_link=None,
                      method_link=None, method_code=None, uid=None) -> Sensor

Observed Properties

Property: hs_api.observedproperties

PropertyTypeEditable
uidUUIDNo
namestrYes
definitionstrYes
descriptionstrYes
observed_property_typestrYes
codestrYes
workspace_idUUID | NoneNo
workspaceWorkspace | NoneNo
python
hs_api.observedproperties.list(workspace=None) -> HydroServerCollection[ObservedProperty]
hs_api.observedproperties.get(uid) -> ObservedProperty
hs_api.observedproperties.create(workspace, name, definition, description,
                                 observed_property_type, code, uid=None) -> ObservedProperty

Units

Property: hs_api.units

PropertyTypeEditable
uidUUIDNo
namestrYes
symbolstrYes
definitionstrYes
unit_typestrYes
workspace_idUUID | NoneNo
workspaceWorkspace | NoneNo
python
hs_api.units.list(workspace=None) -> HydroServerCollection[Unit]
hs_api.units.get(uid) -> Unit
hs_api.units.create(workspace, name, symbol, definition, unit_type, uid=None) -> Unit

Processing Levels

Property: hs_api.processinglevels

PropertyTypeEditable
uidUUIDNo
codestrYes
definitionstr | NoneYes
explanationstr | NoneYes
workspace_idUUID | NoneNo
workspaceWorkspace | NoneNo
python
hs_api.processinglevels.list(workspace=None) -> HydroServerCollection[ProcessingLevel]
hs_api.processinglevels.get(uid) -> ProcessingLevel
hs_api.processinglevels.create(workspace, code, definition=None, explanation=None, uid=None) -> ProcessingLevel

Result Qualifiers

Property: hs_api.resultqualifiers

PropertyTypeEditable
uidUUIDNo
codestrYes
descriptionstrYes
workspace_idUUID | NoneNo
workspaceWorkspace | NoneNo
python
hs_api.resultqualifiers.list(workspace=None) -> HydroServerCollection[ResultQualifier]
hs_api.resultqualifiers.get(uid) -> ResultQualifier
hs_api.resultqualifiers.create(workspace, code, description, uid=None) -> ResultQualifier

Datastreams

Property: hs_api.datastreams

Datastream properties

PropertyTypeEditableNotes
uidUUIDNo
namestrYes
descriptionstrYes
observation_typestrYes
sampled_mediumstrYes
no_data_valuefloatYes
aggregation_statisticstrYes
time_aggregation_intervalfloatYes
time_aggregation_interval_unitstrYes"seconds", "minutes", "hours", "days"
intended_time_spacingfloat | NoneYes
intended_time_spacing_unitstr | NoneYes"seconds", "minutes", "hours", "days"
statusstr | NoneYes
result_typestrYes
value_countint | NoneYes
phenomenon_begin_timedatetime | NoneYes
phenomenon_end_timedatetime | NoneYes
result_begin_timedatetime | NoneYes
result_end_timedatetime | NoneYes
is_privateboolYes
is_visibleboolYes
thing_idUUIDYes
sensor_idUUIDYes
observed_property_idUUIDYes
processing_level_idUUIDYes
unit_idUUIDYes
workspace_idUUIDNo
tagsDict[str, str]NoUse tag methods to modify
file_attachmentsDict[str, dict]NoUse attachment methods to modify
workspaceWorkspaceNoComputed
thingThingNoComputed; also settable via assignment
sensorSensorNoComputed; also settable via assignment
observed_propertyObservedPropertyNoComputed; also settable via assignment
unitUnitNoComputed; also settable via assignment
processing_levelProcessingLevelNoComputed; also settable via assignment

The computed relationship properties (thing, sensor, etc.) can be assigned directly — assigning a new value updates the corresponding _id field and clears the cache:

python
datastream.sensor = new_sensor  # updates sensor_id and clears cached sensor
datastream.save()

Service methods

python
hs_api.datastreams.list(workspace=None, thing=None) -> HydroServerCollection[Datastream]
hs_api.datastreams.get(uid) -> Datastream
hs_api.datastreams.create(name, description, thing, sensor, observed_property, processing_level,
                          unit, observation_type, result_type, sampled_medium, no_data_value,
                          aggregation_statistic, time_aggregation_interval,
                          time_aggregation_interval_unit, intended_time_spacing=None,
                          intended_time_spacing_unit=None, status=None, value_count=None,
                          phenomenon_begin_time=None, phenomenon_end_time=None,
                          result_begin_time=None, result_end_time=None,
                          is_private=False, is_visible=True, uid=None) -> Datastream

Observation methods

python
datastream.get_observations(
    phenomenon_time_min=None,
    phenomenon_time_max=None,
    result_qualifier_code=None,
    page=1,
    page_size=100000,
    order_by=None,
    fetch_all=False,
) -> ObservationCollection

Returns an ObservationCollection with a dataframe property containing a pandas DataFrame with phenomenon_time (timezone-aware datetime) and result (float) columns.

python
datastream.load_observations(observations, mode='insert') -> None

observations must be a pandas DataFrame with phenomenon_time and result columns. phenomenon_time must be timezone-aware. mode is "insert" (skip existing timestamps) or "replace" (overwrite all observations in the datastream).

To load observations with result qualifiers, include a result_qualifier_codes column containing a list of qualifier code strings per row:

python
df = pd.DataFrame({
    'phenomenon_time': times,
    'result': values,
    'result_qualifier_codes': [['PF'], [], ['ICE'], ...]
})
datastream.load_observations(df)
python
datastream.delete_observations(phenomenon_time_start=None, phenomenon_time_end=None) -> None

Deletes observations within the given time range. If both parameters are omitted, all observations are deleted.

Tag and file attachment methods

Same as Things — add_tag, update_tag, delete_tag, add_file_attachment, delete_file_attachment.


ETL

Data Connections

Property: hs_api.dataconnections

DataConnection properties

PropertyTypeEditableNotes
uidUUIDNo
namestrYes
descriptionstr | NoneYes
source_urlstrYesURL template; use {variable_name} for placeholder substitution
timezone_typestr | NoneYes"offset" or "iana"
timezonestr | NoneYese.g. "+0000" or "America/Denver"
auth_header_namestr | NoneYes
auth_header_valuestr | NoneYes
payloadCSVPayload | JSONPayloadNoSee below
placeholder_variablesList[PlaceholderVariable]NoSee below
notificationNotification | NoneNo
workspace_idUUIDNo
workspace_namestrNo
task_countintNoNumber of ETL tasks using this connection
task_attention_countintNoTasks with a recent failure or overdue schedule

CSVPayload fields: payload_type ("CSV"), timestamp_key, timestamp_format, header_row, data_start_row, delimiter

JSONPayload fields: payload_type ("JSON"), timestamp_key, timestamp_format, jmespath

PlaceholderVariable fields:

FieldTypeDescription
namestrVariable name as it appears in {braces} in source_url
variable_typestr"per_task", "run_time", or "latest_observation_timestamp"
timestamp_formatstr | NoneCustom strftime format; None uses ISO 8601

Service methods

python
hs_api.dataconnections.list(workspace=None, payload_type=None) -> HydroServerCollection[DataConnection]
hs_api.dataconnections.get(uid) -> DataConnection
hs_api.dataconnections.create(
    name, workspace, source_url, payload_type, timestamp_key,
    description=None, timestamp_format=None, timezone_type=None, timezone=None,
    auth_header_name=None, auth_header_value=None,
    header_row=None, data_start_row=None, delimiter=None, jmespath=None,
    placeholder_variables=None, notification=None, uid=None
) -> DataConnection
hs_api.dataconnections.update(uid, name, source_url, payload_type, timestamp_key, ...) -> DataConnection

ETL Tasks

Property: hs_api.etltasks

EtlTask properties

PropertyTypeEditableNotes
uidUUIDNo
namestrYes
descriptionstr | NoneYes
task_variablesDict[str, Any]YesValues for per_task placeholder variables
data_connection_idUUIDNo
enabledbool | NoneYes
start_timedatetime | NoneYes
crontabstr | NoneYes
intervalint | NoneYes
interval_periodstr | NoneYes"minutes", "hours", "days"
next_run_atdatetime | NoneNo
latest_runTaskRun | NoneNo
mappingsList[EtlMapping]Yes
data_connectionDataConnectionNoComputed

EtlMapping fields: source_identifier (str), target_datastream (DatastreamSummary with id and name)

Service methods

python
hs_api.etltasks.list(
    workspace=None, data_connection=None, latest_run_status=None,
    latest_run_started_at_min=None, latest_run_started_at_max=None,
    latest_run_finished_at_min=None, latest_run_finished_at_max=None,
) -> HydroServerCollection[EtlTask]
hs_api.etltasks.get(uid) -> EtlTask
hs_api.etltasks.create(
    name, data_connection, description=None, task_variables=None,
    mappings=None, crontab=None, interval=None, interval_period=None,
    start_time=None, enabled=True, uid=None
) -> EtlTask

Mappings are a list of dicts with source_identifier and target_datastream_id keys.

Run methods

MethodReturnsDescription
trigger()TaskRunDispatch an immediate run
list_runs(status=None, started_at_min=None, started_at_max=None, finished_at_min=None, finished_at_max=None, page=1, page_size=100, order_by=None)List[TaskRun]Fetch run history
get_run(run_id)TaskRunFetch a single run by ID

Data Products

Rating Curves

Property: hs_api.ratingcurves

RatingCurve properties

PropertyTypeEditableNotes
uidUUIDNo
namestrYes
descriptionstr | NoneYes
fitting_methodstrYes"linear" or "power_law"
thing_idUUIDNo
thing_namestrNo
pointsList[Tuple[float, float]]YesList of (input, output) coordinate pairs

Service methods

python
hs_api.ratingcurves.list(workspace=None, thing=None) -> HydroServerCollection[RatingCurve]
hs_api.ratingcurves.get(uid) -> RatingCurve
hs_api.ratingcurves.create(name, thing, fitting_method, description=None, points=None, uid=None) -> RatingCurve

Data Product Tasks

Property: hs_api.dataproducttasks

DataProductTask properties

PropertyTypeEditableNotes
uidUUIDNo
namestrYes
descriptionstr | NoneYes
thing_idUUIDNo
thing_namestrNo
enabledbool | NoneYes
start_timedatetime | NoneYes
crontabstr | NoneYes
intervalint | NoneYes
interval_periodstr | NoneYes"minutes", "hours", "days"
next_run_atdatetime | NoneNo
latest_runTaskRun | NoneNo
rating_curve_transformationsList[RatingCurveTransformation]NoManage via hs_api.dataproducttransformations
expression_transformationsList[ExpressionTransformation]NoManage via hs_api.dataproducttransformations
composite_expression_transformationsList[CompositeExpressionTransformation]NoManage via hs_api.dataproducttransformations
aggregation_transformationsList[AggregationTransformation]NoManage via hs_api.dataproducttransformations

Service methods

python
hs_api.dataproducttasks.list(
    workspace=None, thing=None, latest_run_status=None, transformation_type=None,
    output_datastream=None, input_datastream=None, rating_curve=None,
) -> HydroServerCollection[DataProductTask]
hs_api.dataproducttasks.get(uid) -> DataProductTask
hs_api.dataproducttasks.create(
    name, thing, description=None, crontab=None, interval=None,
    interval_period=None, start_time=None, enabled=True, uid=None
) -> DataProductTask

Run methods

Same as ETL Tasks: trigger(), list_runs(...), get_run(run_id).


Data Product Transformations

Property: hs_api.dataproducttransformations

Transformations are always scoped to a specific data product task via task_id. All four types share a consistent set of CRUD methods.

Rating Curve Transformations

FieldTypeDescription
idUUID
output_datastreamDatastreamSummaryid and name
input_datastreamDatastreamSummaryid and name
rating_curveRatingCurveSummaryid, name, and fitting_method
python
hs_api.dataproducttransformations.list_rating_curve(task_id, output_datastream=None, input_datastream=None)
hs_api.dataproducttransformations.get_rating_curve(task_id, uid)
hs_api.dataproducttransformations.create_rating_curve(task_id, output_datastream, input_datastream, rating_curve, uid=None)
hs_api.dataproducttransformations.update_rating_curve(task_id, uid, input_datastream, rating_curve)
hs_api.dataproducttransformations.delete_rating_curve(task_id, uid)

Expression Transformations

FieldTypeDescription
idUUID
output_datastreamDatastreamSummary
input_datastreamDatastreamSummary
formulastrPython expression evaluated per observation
variable_namestr | NoneName of the variable representing the input value in the formula
python
hs_api.dataproducttransformations.list_expression(task_id, output_datastream=None, input_datastream=None)
hs_api.dataproducttransformations.get_expression(task_id, uid)
hs_api.dataproducttransformations.create_expression(task_id, output_datastream, input_datastream, formula, variable_name=None, uid=None)
hs_api.dataproducttransformations.update_expression(task_id, uid, input_datastream, formula, variable_name=None)
hs_api.dataproducttransformations.delete_expression(task_id, uid)

Composite Expression Transformations

Like expression transformations, but combine multiple input datastreams. Each input datastream is assigned a variable name used in the formula.

FieldTypeDescription
idUUID
output_datastreamDatastreamSummary
input_datastreamsList[TransformationInput]Each has datastream (id, name) and variable_name
formulastr
output_intervalint
output_interval_unitsstr"minutes", "hours", "days", "weeks", "months"
max_gap_intervalint | NoneMax gap in input data before output is suppressed
max_gap_interval_unitsstr | None
python
hs_api.dataproducttransformations.list_composite_expression(task_id, output_datastream=None, input_datastream=None)
hs_api.dataproducttransformations.get_composite_expression(task_id, uid)
hs_api.dataproducttransformations.create_composite_expression(
    task_id, output_datastream, input_datastreams, formula,
    output_interval, output_interval_units,
    max_gap_interval=None, max_gap_interval_units=None, uid=None
)
hs_api.dataproducttransformations.update_composite_expression(
    task_id, uid, input_datastreams, formula,
    output_interval, output_interval_units,
    max_gap_interval=None, max_gap_interval_units=None
)
hs_api.dataproducttransformations.delete_composite_expression(task_id, uid)

input_datastreams is a list of dicts with datastream_id and optionally variable_name.

Aggregation Transformations

FieldTypeDescription
idUUID
output_datastreamDatastreamSummary
input_datastreamDatastreamSummary
aggregation_methodstr"mean", "sum", "min", "max", "first", "last"
output_intervalint
output_interval_unitsstr"minutes", "hours", "days", "weeks", "months"
timezone_typestr | None"utc", "offset", or "iana"
timezonestr | NoneUsed to align interval boundaries (e.g. "America/Denver" for daily values in local time)
min_valuesint | NoneMinimum number of input observations required to produce an output
python
hs_api.dataproducttransformations.list_aggregation(task_id, output_datastream=None, input_datastream=None)
hs_api.dataproducttransformations.get_aggregation(task_id, uid)
hs_api.dataproducttransformations.create_aggregation(
    task_id, output_datastream, input_datastream, aggregation_method,
    output_interval, output_interval_units,
    timezone_type=None, timezone=None, min_values=None, uid=None
)
hs_api.dataproducttransformations.update_aggregation(
    task_id, uid, input_datastream, aggregation_method,
    output_interval, output_interval_units,
    timezone_type=None, timezone=None, min_values=None
)
hs_api.dataproducttransformations.delete_aggregation(task_id, uid)

Monitoring

Monitoring Tasks

Property: hs_api.monitoringtasks

MonitoringTask properties

PropertyTypeEditableNotes
uidUUIDNo
namestrYes
descriptionstr | NoneYes
thing_idUUIDNo
thing_namestrNo
recipientsList[str]YesEmail addresses to alert
enabledbool | NoneYes
start_timedatetime | NoneYes
crontabstr | NoneYes
intervalint | NoneYes
interval_periodstr | NoneYes"minutes", "hours", "days"
next_run_atdatetime | NoneNo
latest_runTaskRun | NoneNo
monitored_datastreamsList[MonitoredDatastream]NoInline summary; manage rules via hs_api.monitoringrules
rulesList[MonitoringRule]NoComputed; full rule objects for this task

MonitoredDatastream fields: datastream_id, datastream_name, rules (list of inline rule summaries with id, rule_type, last_checked_at, min_value, max_value, window_interval, window_interval_units)

Service methods

python
hs_api.monitoringtasks.list(
    workspace=None, thing=None, latest_run_status=None,
    datastream=None, rule_type=None,
) -> HydroServerCollection[MonitoringTask]
hs_api.monitoringtasks.get(uid) -> MonitoringTask
hs_api.monitoringtasks.create(
    name, thing, description=None, recipients=None,
    crontab=None, interval=None, interval_period=None,
    start_time=None, enabled=True, uid=None
) -> MonitoringTask

Run methods

Same as ETL Tasks: trigger(), list_runs(...), get_run(run_id).


Monitoring Rules

Property: hs_api.monitoringrules

Rules are always scoped to a monitoring task via task_id.

MonitoringRule properties

PropertyTypeEditableNotes
uidUUIDNo
task_idUUIDNo
datastream_idUUIDNo
datastream_namestrNo
rule_typestrNo"range", "rate_of_change", "persistence", or "missing_data"
last_checked_atdatetime | NoneNo
min_valuefloat | NoneYesUsed by range and rate_of_change
max_valuefloat | NoneYesUsed by range and rate_of_change
window_intervalint | NoneYesUsed by persistence and missing_data
window_interval_unitsstr | NoneYes"minutes", "hours", "days"

Rule types:

Rule typeAlert conditionParameters used
rangeLatest value outside [min_value, max_value]min_value, max_value
rate_of_changeChange between consecutive values outside [min_value, max_value]min_value, max_value
persistenceValue unchanged for longer than window_intervalwindow_interval, window_interval_units
missing_dataNo new observations within window_intervalwindow_interval, window_interval_units

Service methods

python
hs_api.monitoringrules.list(task_id, datastream=None, rule_type=None) -> HydroServerCollection[MonitoringRule]
hs_api.monitoringrules.get(task_id, uid) -> MonitoringRule
hs_api.monitoringrules.create(
    task_id, datastream, rule_type,
    min_value=None, max_value=None,
    window_interval=None, window_interval_units=None,
    uid=None
) -> MonitoringRule