Skip to main content
Version: 8.3

system.historian.queryMetadata

This function is used in Python Scripting.

Description​

Queries metadata for the specified historian. This function applies to the Core Historian and Internal Historian only.

Client Permission Restrictions​

This scripting function has no Client Permission restrictions.

Syntax​

system.historian.queryMetadata(paths, [startDate], [endDate])

Parameters​

TypeParameterDescription
StringpathsA list of historical paths to query metadata for.
DatestartDateA start time to query metadata for. This parameter is optional, unless an end time is specified. [optional]
DateendDateAn end time to query metadata for. If specifying an end time, a start time must be provided. [optional]

Returns​

Results - A Results object that contains a list of query results.

Scope​

Gateway, Vision Client, Perspective Session

Code Examples​

Code Snippet
# Query for a specified tag's metadata and display the result.

paths = "histprov:Historian:/sys:gw1:/prov:default:/tag:metafolder/metatag1"
endDate = system.date.now()
startDate = system.date.addDays(endDate, -5)

results = system.historian.queryMetadata(paths, startDate, endDate)
print results