Skip to content

Latest commit

 

History

History
303 lines (205 loc) · 26.2 KB

StreamApi.md

File metadata and controls

303 lines (205 loc) · 26.2 KB

StreamApi

Method HTTP request Description
get_channel GET /streams/{webId}/channel Opens a channel that will send messages about any value changes for the specified stream.
get_end GET /streams/{webId}/end Returns the end-of-stream value of the stream.
get_interpolated GET /streams/{webId}/interpolated Retrieves interpolated values over the specified time range at the specified sampling interval.
get_interpolated_at_times GET /streams/{webId}/interpolatedattimes Retrieves interpolated values over the specified time range at the specified sampling interval.
get_plot GET /streams/{webId}/plot Retrieves values over the specified time range suitable for plotting over the number of intervals (typically represents pixels).
get_recorded GET /streams/{webId}/recorded Returns a list of compressed values for the requested time range from the source provider.
update_values POST /streams/{webId}/recorded Updates multiple values for the specified stream.
get_recorded_at_time GET /streams/{webId}/recordedattime Returns a single recorded value based on the passed time and retrieval mode from the stream.
get_recorded_at_times GET /streams/{webId}/recordedattimes Retrieves recorded values at the specified times.
get_summary GET /streams/{webId}/summary Returns a summary over the specified time range for the stream.
get_value GET /streams/{webId}/value Returns the value of the stream at the specified time. By default, this is usually the current value.
update_value POST /streams/{webId}/value Updates a value for the specified stream.

get_channel

get_channel('web_id', 'heartbeat_rate', 'include_initial_values', 'web_id_type')

Opens a channel that will send messages about any value changes for the specified stream.

Parameters

Name Type Description Notes
web_id str The ID of the stream.. [required]
heartbeat_rate int HeartbeatRate is an integer multiple of the Polling Interval. It specifies the rate at which a client will receive an empty message if there are no data updates. It can be used to check that the connection is still alive. Zero/negative values correspond to no heartbeat. By default, no empty messages will be sent to the user.. [optional]
include_initial_values bool Specified if the channel should send a message with the current value of the stream after the connection is opened. The default is 'false'.. [optional]
web_id_type str Optional parameter. Used to specify the type of WebID. Useful for URL brevity and other special cases. Default is the value of the configuration item "WebIDType".. [optional]

Return type

PIItemsStreamValues

[Back to top] [Back to API list] [Back to Model list] [Back to DOCUMENTATION]

get_end

get_end('web_id', 'desired_units', 'selected_fields')

Returns the end-of-stream value of the stream.

Parameters

Name Type Description Notes
web_id str The ID of the stream.. [required]
desired_units str The name or abbreviation of the desired units of measure for the returned value, as found in the UOM database associated with the attribute. If not specified for an attribute, the attribute's default unit of measure is used. If the underlying stream is a point, this value may not be specified, as points are not associated with a unit of measure.. [optional]
selected_fields str List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned.. [optional]

Return type

PITimedValue

[Back to top] [Back to API list] [Back to Model list] [Back to DOCUMENTATION]

get_interpolated

get_interpolated('web_id', 'desired_units', 'end_time', 'filter_expression', 'include_filtered_values', 'interval', 'selected_fields', 'start_time', 'sync_time', 'sync_time_boundary_type', 'time_zone')

Retrieves interpolated values over the specified time range at the specified sampling interval.

Parameters

Name Type Description Notes
web_id str The ID of the stream.. [required]
desired_units str The name or abbreviation of the desired units of measure for the returned value, as found in the UOM database associated with the attribute. If not specified for an attribute, the attribute's default unit of measure is used. If the underlying stream is a point, this value may not be specified, as points are not associated with a unit of measure.. [optional]
end_time str An optional end time. The default is '' for element attributes and points. For event frame attributes, the default is the event frame's end time, or '' if that is not set. Note that if endTime is earlier than startTime, the resulting values will be in time-descending order.. [optional]
filter_expression str An optional string containing a filter expression. Expression variables are relative to the data point. Use '.' to reference the containing attribute. If the attribute does not support filtering, the filter will be ignored. The default is no filtering.. [optional]
include_filtered_values bool Specify 'true' to indicate that values which fail the filter criteria are present in the returned data at the times where they occurred with a value set to a 'Filtered' enumeration value with bad status. Repeated consecutive failures are omitted.. [optional]
interval str The sampling interval, in AFTimeSpan format.. [optional]
selected_fields str List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned.. [optional]
start_time str An optional start time. The default is '-1d' for element attributes and points. For event frame attributes, the default is the event frame's start time, or '-1d' if that is not set.. [optional]
sync_time str An optional start time anchor, in AFTime format. When specified, interpolated data retrieval will use the sync time as the origin for calculating the interval times.. [optional]
sync_time_boundary_type str An optional string specifying the boundary type to use when applying a syncTime. The allowed values are 'Inside' and 'Outside'. The default is 'Inside'.. [optional]
time_zone str The time zone in which the time string will be interpreted. This parameter will be ignored if a time zone is specified in the time string. If no time zone is specified in either places, the PI Web API server time zone will be used.. [optional]

Return type

PITimedValues

[Back to top] [Back to API list] [Back to Model list] [Back to DOCUMENTATION]

get_interpolated_at_times

get_interpolated_at_times('web_id', 'desired_units', 'filter_expression', 'include_filtered_values', 'selected_fields', 'sort_order', 'time', 'time_zone')

Retrieves interpolated values over the specified time range at the specified sampling interval.

Parameters

Name Type Description Notes
web_id str The ID of the stream.. [required]
desired_units str The name or abbreviation of the desired units of measure for the returned value, as found in the UOM database associated with the attribute. If not specified for an attribute, the attribute's default unit of measure is used. If the underlying stream is a point, this value may not be specified, as points are not associated with a unit of measure.. [optional]
filter_expression str An optional string containing a filter expression. Expression variables are relative to the data point. Use '.' to reference the containing attribute. If the attribute does not support filtering, the filter will be ignored. The default is no filtering.. [optional]
include_filtered_values bool Specify 'true' to indicate that values which fail the filter criteria are present in the returned data at the times where they occurred with a value set to a 'Filtered' enumeration value with bad status. Repeated consecutive failures are omitted.. [optional]
selected_fields str List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned.. [optional]
sort_order str The order that the returned collection is sorted. The default is 'Ascending'.. [optional]
time list[str] The timestamp at which to retrieve an interpolated value. Multiple timestamps may be specified with multiple instances of the parameter.. [optional]
time_zone str The time zone in which the time string will be interpreted. This parameter will be ignored if a time zone is specified in the time string. If no time zone is specified in either places, the PI Web API server time zone will be used.. [optional]

Return type

PITimedValues

[Back to top] [Back to API list] [Back to Model list] [Back to DOCUMENTATION]

get_plot

get_plot('web_id', 'desired_units', 'end_time', 'intervals', 'selected_fields', 'start_time', 'time_zone')

Retrieves values over the specified time range suitable for plotting over the number of intervals (typically represents pixels).

Parameters

Name Type Description Notes
web_id str The ID of the stream.. [required]
desired_units str The name or abbreviation of the desired units of measure for the returned value, as found in the UOM database associated with the attribute. If not specified for an attribute, the attribute's default unit of measure is used. If the underlying stream is a point, this value may not be specified, as points are not associated with a unit of measure.. [optional]
end_time str An optional end time. The default is '' for element attributes and points. For event frame attributes, the default is the event frame's end time, or '' if that is not set. Note that if endTime is earlier than startTime, the resulting values will be in time-descending order.. [optional]
intervals int The number of intervals to plot over. Typically, this would be the number of horizontal pixels in the trend. The default is '24'. For each interval, the data available is examined and significant values are returned. Each interval can produce up to 5 values if they are unique, the first value in the interval, the last value, the highest value, the lowest value and at most one exceptional point (bad status or digital state).. [optional]
selected_fields str List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned.. [optional]
start_time str An optional start time. The default is '-1d' for element attributes and points. For event frame attributes, the default is the event frame's start time, or '-1d' if that is not set.. [optional]
time_zone str The time zone in which the time string will be interpreted. This parameter will be ignored if a time zone is specified in the time string. If no time zone is specified in either places, the PI Web API server time zone will be used.. [optional]

Return type

PITimedValues

[Back to top] [Back to API list] [Back to Model list] [Back to DOCUMENTATION]

get_recorded

get_recorded('web_id', 'boundary_type', 'desired_units', 'end_time', 'filter_expression', 'include_filtered_values', 'max_count', 'selected_fields', 'start_time', 'time_zone')

Returns a list of compressed values for the requested time range from the source provider.

Parameters

Name Type Description Notes
web_id str The ID of the stream.. [required]
boundary_type str An optional value that determines how the times and values of the returned end points are determined. The default is 'Inside'.. [optional]
desired_units str The name or abbreviation of the desired units of measure for the returned value, as found in the UOM database associated with the attribute. If not specified for an attribute, the attribute's default unit of measure is used. If the underlying stream is a point, this value may not be specified, as points are not associated with a unit of measure.. [optional]
end_time str An optional end time. The default is '' for element attributes and points. For event frame attributes, the default is the event frame's end time, or '' if that is not set. Note that if endTime is earlier than startTime, the resulting values will be in time-descending order.. [optional]
filter_expression str An optional string containing a filter expression. Expression variables are relative to the data point. Use '.' to reference the containing attribute. The default is no filtering.. [optional]
include_filtered_values bool Specify 'true' to indicate that values which fail the filter criteria are present in the returned data at the times where they occurred with a value set to a 'Filtered' enumeration value with bad status. Repeated consecutive failures are omitted.. [optional]
max_count int The maximum number of values to be returned. The default is 1000.. [optional]
selected_fields str List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned.. [optional]
start_time str An optional start time. The default is '-1d' for element attributes and points. For event frame attributes, the default is the event frame's start time, or '-1d' if that is not set.. [optional]
time_zone str The time zone in which the time string will be interpreted. This parameter will be ignored if a time zone is specified in the time string. If no time zone is specified in either places, the PI Web API server time zone will be used.. [optional]

Return type

PITimedValues

[Back to top] [Back to API list] [Back to Model list] [Back to DOCUMENTATION]

update_values

update_values('web_id', 'values', 'buffer_option', 'update_option')

Updates multiple values for the specified stream.

Parameters

Name Type Description Notes
web_id str The ID of the stream.. [required]
values list[PITimedValue] The values to add or update.. [required]
buffer_option str The desired AFBufferOption. The default is 'BufferIfPossible'.. [optional]
update_option str The desired AFUpdateOption. The default is 'Replace'.. [optional]

Return type

PIItemsSubstatus

[Back to top] [Back to API list] [Back to Model list] [Back to DOCUMENTATION]

get_recorded_at_time

get_recorded_at_time('web_id', 'time', 'desired_units', 'retrieval_mode', 'selected_fields', 'time_zone')

Returns a single recorded value based on the passed time and retrieval mode from the stream.

Parameters

Name Type Description Notes
web_id str The ID of the stream.. [required]
time str The timestamp at which the value is desired.. [required]
desired_units str The name or abbreviation of the desired units of measure for the returned value, as found in the UOM database associated with the attribute. If not specified for an attribute, the attribute's default unit of measure is used. If the underlying stream is a point, this value may not be specified, as points are not associated with a unit of measure.. [optional]
retrieval_mode str An optional value that determines the value to return when a value doesn't exist at the exact time specified. The default is 'Auto'.. [optional]
selected_fields str List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned.. [optional]
time_zone str The time zone in which the time string will be interpreted. This parameter will be ignored if a time zone is specified in the time string. If no time zone is specified in either places, the PI Web API server time zone will be used.. [optional]

Return type

PITimedValue

[Back to top] [Back to API list] [Back to Model list] [Back to DOCUMENTATION]

get_recorded_at_times

get_recorded_at_times('web_id', 'desired_units', 'retrieval_mode', 'selected_fields', 'sort_order', 'time', 'time_zone')

Retrieves recorded values at the specified times.

Parameters

Name Type Description Notes
web_id str The ID of the stream.. [required]
desired_units str The name or abbreviation of the desired units of measure for the returned value, as found in the UOM database associated with the attribute. If not specified for an attribute, the attribute's default unit of measure is used. If the underlying stream is a point, this value may not be specified, as points are not associated with a unit of measure.. [optional]
retrieval_mode str An optional value that determines the value to return when a value doesn't exist at the exact time specified. The default is 'Auto'.. [optional]
selected_fields str List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned.. [optional]
sort_order str The order that the returned collection is sorted. The default is 'Ascending'.. [optional]
time list[str] The timestamp at which to retrieve a recorded value. Multiple timestamps may be specified with multiple instances of the parameter.. [optional]
time_zone str The time zone in which the time string will be interpreted. This parameter will be ignored if a time zone is specified in the time string. If no time zone is specified in either places, the PI Web API server time zone will be used.. [optional]

Return type

PITimedValues

[Back to top] [Back to API list] [Back to Model list] [Back to DOCUMENTATION]

get_summary

get_summary('web_id', 'calculation_basis', 'end_time', 'filter_expression', 'sample_interval', 'sample_type', 'selected_fields', 'start_time', 'summary_duration', 'summary_type', 'time_type', 'time_zone')

Returns a summary over the specified time range for the stream.

Parameters

Name Type Description Notes
web_id str The ID of the stream.. [required]
calculation_basis str Specifies the method of evaluating the data over the time range. The default is 'TimeWeighted'.. [optional]
end_time str An optional end time. The default is '' for element attributes and points. For event frame attributes, the default is the event frame's end time, or '' if that is not set. Note that if endTime is earlier than startTime, the resulting values will be in time-descending order.. [optional]
filter_expression str A string containing a filter expression. Expression variables are relative to the attribute. Use '.' to reference the containing attribute.. [optional]
sample_interval str When the sampleType is Interval, sampleInterval specifies how often the filter expression is evaluated when computing the summary for an interval.. [optional]
sample_type str Defines the evaluation of an expression over a time range. The default is 'ExpressionRecordedValues'.. [optional]
selected_fields str List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned.. [optional]
start_time str An optional start time. The default is '-1d' for element attributes and points. For event frame attributes, the default is the event frame's start time, or '-1d' if that is not set.. [optional]
summary_duration str The duration of each summary interval. If specified in hours, minutes, seconds, or milliseconds, the summary durations will be evenly spaced UTC time intervals. Longer interval types are interpreted using wall clock rules and are time zone dependent.. [optional]
summary_type list[str] Specifies the kinds of summaries to produce over the range. The default is 'Total'. Multiple summary types may be specified by using multiple instances of summaryType.. [optional]
time_type str Specifies how to calculate the timestamp for each interval. The default is 'Auto'.. [optional]
time_zone str The time zone in which the time string will be interpreted. This parameter will be ignored if a time zone is specified in the time string. If no time zone is specified in either places, the PI Web API server time zone will be used.. [optional]

Return type

PIItemsSummaryValue

[Back to top] [Back to API list] [Back to Model list] [Back to DOCUMENTATION]

get_value

get_value('web_id', 'desired_units', 'selected_fields', 'time', 'time_zone')

Returns the value of the stream at the specified time. By default, this is usually the current value.

Parameters

Name Type Description Notes
web_id str The ID of the stream.. [required]
desired_units str The name or abbreviation of the desired units of measure for the returned value, as found in the UOM database associated with the attribute. If not specified for an attribute, the attribute's default unit of measure is used. If the underlying stream is a point, this value may not be specified, as points are not associated with a unit of measure.. [optional]
selected_fields str List of fields to be returned in the response, separated by semicolons (;). If this parameter is not specified, all available fields will be returned.. [optional]
time str An optional time. The default time context is determined from the owning object - for example, the time range of the event frame or transfer which holds this attribute. Otherwise, the implementation of the Data Reference determines the meaning of no context. For Points or simply configured PI Point Data References, this means the snapshot value of the PI Point on the Data Server.. [optional]
time_zone str The time zone in which the time string will be interpreted. This parameter will be ignored if a time zone is specified in the time string. If no time zone is specified in either places, the PI Web API server time zone will be used.. [optional]

Return type

PITimedValue

[Back to top] [Back to API list] [Back to Model list] [Back to DOCUMENTATION]

update_value

update_value('web_id', 'value', 'buffer_option', 'update_option', 'web_id_type')

Updates a value for the specified stream.

Parameters

Name Type Description Notes
web_id str The ID of the stream.. [required]
value PITimedValue The value to add or update.. [required]
buffer_option str The desired AFBufferOption. The default is 'BufferIfPossible'.. [optional]
update_option str The desired AFUpdateOption. The default is 'Replace'. This parameter is ignored if the attribute is a configuration item.. [optional]
web_id_type str Optional parameter. Used to specify the type of WebID. Useful for URL brevity and other special cases. Default is the value of the configuration item "WebIDType".. [optional]

Return type

None

[Back to top] [Back to API list] [Back to Model list] [Back to DOCUMENTATION]