Skip to content

Commit 3455f42

Browse files
author
osimloeff
committed
Upgrade to 2018
1 parent 2396947 commit 3455f42

File tree

102 files changed

+6098
-116
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+6098
-116
lines changed

DOCUMENTATION.md

Lines changed: 45 additions & 2 deletions
Large diffs are not rendered by default.

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@
186186
same "printed page" as the copyright notice for easier
187187
identification within third-party archives.
188188

189-
Copyright {yyyy} {name of copyright owner}
189+
Copyright 2018 OSIsoft, LLC
190190

191191
Licensed under the Apache License, Version 2.0 (the "License");
192192
you may not use this file except in compliance with the License.

README.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
PI Web API client library for Python (2017 R2)
1+
PI Web API client library for Python (2018)
22
===
33

44
## Overview
5-
This repository has the source code package of the PI Web API client libraries for Python. This version was developed on top of the PI Web API 2017 R2 swagger specification.
5+
This repository has the source code package of the PI Web API client libraries for Python. This version was developed on top of the PI Web API 2018 swagger specification.
66

77
## Requirements
88

9-
- PI Web API 2017 R2 installed within your domain using Kerberos or Basic Authentication. If you are using an older version, some methods might not work.
9+
- PI Web API 2018 installed within your domain using Kerberos or Basic Authentication. If you are using an older version, some methods might not work.
1010
- Python 2.7 and 3.4+
1111

1212
## Installation
@@ -246,6 +246,25 @@ The path from the methods above should start with "pi:" (if your stream is a PI
246246
pi_attribute_web_id_info = client.webIdHelper.get_web_id_info(pi_attribute_web_id)
247247
pi_element_web_id_info= client.webIdHelper.get_web_id_info(pi_element_web_id)
248248
pi_dataServer_web_id_info = client.webIdHelper.get_web_id_info(pi_data_server_web_id)
249+
250+
### StreamUpdates
251+
252+
253+
```python
254+
events = list()
255+
piItemsStreamUpdatesRegister = client.streamSet.register_stream_set_updates(webIds)
256+
markers = [i.latest_marker for i in piItemsStreamUpdatesRegister.items]
257+
k = 3
258+
while k > 0:
259+
piItemsStreamUpdatesRetrieve = client.streamSet.retrieve_stream_set_updates(markers)
260+
markers = [i.latest_marker for i in piItemsStreamUpdatesRetrieve.items]
261+
for item in piItemsStreamUpdatesRetrieve.items:
262+
for event in item.events:
263+
events.append(event)
264+
time.sleep(30)
265+
k = k-1
266+
self.assertTrue(events.__len__() > 0)
267+
249268

250269

251270

docs/PIWebApiClient.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ Property | Controller
4242
**enumerationSet** | [**EnumerationSetApi**](/docs/api/EnumerationSetApi.md)
4343
**enumerationValue** | [**EnumerationValueApi**](/docs/api/EnumerationValueApi.md)
4444
**eventFrame** | [**EventFrameApi**](/docs/api/EventFrameApi.md)
45+
**notificationContactTemplate** | [**NotificationContactTemplateApi**](/docs/api/NotificationContactTemplateApi.md)
46+
**notificationRule** | [**NotificationRuleApi**](/docs/api/NotificationRuleApi.md)
47+
**notificationRuleSubscriber** | [**NotificationRuleSubscriberApi**](/docs/api/NotificationRuleSubscriberApi.md)
48+
**notificationRuleTemplate** | [**NotificationRuleTemplateApi**](/docs/api/NotificationRuleTemplateApi.md)
4549
**point** | [**PointApi**](/docs/api/PointApi.md)
4650
**securityIdentity** | [**SecurityIdentityApi**](/docs/api/SecurityIdentityApi.md)
4751
**securityMapping** | [**SecurityMappingApi**](/docs/api/SecurityMappingApi.md)

docs/api/AssetServerApi.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Method | HTTP request | Description
99
[**get_analysis_rule_plug_ins**](AssetServerApi.md#getanalysisruleplugins) | **GET** /assetservers/{webId}/analysisruleplugins | Retrieve a list of all Analysis Rule Plug-in's.
1010
[**get_databases**](AssetServerApi.md#getdatabases) | **GET** /assetservers/{webId}/assetdatabases | Retrieve a list of all Asset Databases on the specified Asset Server.
1111
[**create_asset_database**](AssetServerApi.md#createassetdatabase) | **POST** /assetservers/{webId}/assetdatabases | Create an asset database.
12+
[**get_notification_contact_templates**](AssetServerApi.md#getnotificationcontacttemplates) | **GET** /assetservers/{webId}/notificationcontacttemplates | Retrieve a list of all notification contact templates on the specified Asset Server.
1213
[**get_security**](AssetServerApi.md#getsecurity) | **GET** /assetservers/{webId}/security | Get the security information of the specified security item associated with the asset server for a specified user.
1314
[**get_security_entries**](AssetServerApi.md#getsecurityentries) | **GET** /assetservers/{webId}/securityentries | Retrieve the security entries of the specified security item associated with the asset server based on the specified criteria. By default, all security entries for this asset server are returned.
1415
[**create_security_entry**](AssetServerApi.md#createsecurityentry) | **POST** /assetservers/{webId}/securityentries | Create a security entry owned by the asset server.
@@ -164,6 +165,26 @@ None
164165

165166
[[Back to top]](#) [[Back to API list]](../../DOCUMENTATION.md#documentation-for-api-endpoints) [[Back to Model list]](../../DOCUMENTATION.md#documentation-for-models) [[Back to DOCUMENTATION]](../../DOCUMENTATION.md)
166167

168+
# **get_notification_contact_templates**
169+
> get_notification_contact_templates('web_id', 'selected_fields', 'web_id_type')
170+
171+
Retrieve a list of all notification contact templates on the specified Asset Server.
172+
173+
### Parameters
174+
175+
Name | Type | Description | Notes
176+
------------- | ------------- | ------------- | -------------
177+
**web_id** | **str**| The ID of the server.. | [required]
178+
**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]
179+
**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]
180+
181+
182+
### Return type
183+
184+
[**PIItemsNotificationContactTemplate**](../models/PIItemsNotificationContactTemplate.md)
185+
186+
[[Back to top]](#) [[Back to API list]](../../DOCUMENTATION.md#documentation-for-api-endpoints) [[Back to Model list]](../../DOCUMENTATION.md#documentation-for-models) [[Back to DOCUMENTATION]](../../DOCUMENTATION.md)
187+
167188
# **get_security**
168189
> get_security('web_id', 'security_item', 'user_identity', 'force_refresh', 'selected_fields', 'web_id_type')
169190

docs/api/AttributeApi.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ None
9494
[[Back to top]](#) [[Back to API list]](../../DOCUMENTATION.md#documentation-for-api-endpoints) [[Back to Model list]](../../DOCUMENTATION.md#documentation-for-models) [[Back to DOCUMENTATION]](../../DOCUMENTATION.md)
9595

9696
# **get_attributes**
97-
> get_attributes('web_id', 'category_name', 'max_count', 'name_filter', 'search_full_hierarchy', 'selected_fields', 'show_excluded', 'show_hidden', 'sort_field', 'sort_order', 'start_index', 'template_name', 'value_type', 'web_id_type')
97+
> get_attributes('web_id', 'category_name', 'max_count', 'name_filter', 'search_full_hierarchy', 'selected_fields', 'show_excluded', 'show_hidden', 'sort_field', 'sort_order', 'start_index', 'template_name', 'trait', 'trait_category', 'value_type', 'web_id_type')
9898
9999
Get the child attributes of the specified attribute.
100100

@@ -114,6 +114,8 @@ Name | Type | Description | Notes
114114
**sort_order** | **str**| The order that the returned collection is sorted. The default is 'Ascending'.. | [optional]
115115
**start_index** | **int**| The starting index (zero based) of the items to be returned. The default is 0.. | [optional]
116116
**template_name** | **str**| Specify that returned attributes must be members of this template. The default is no template filter.. | [optional]
117+
**trait** | **list[str]**| The name of the attribute trait. Multiple traits may be specified with multiple instances of the parameter.. | [optional]
118+
**trait_category** | **list[str]**| The category of the attribute traits. Multiple categories may be specified with multiple instances of the parameter. If the parameter is not specified, or if its value is "all", then all attribute traits of all categories will be returned.. | [optional]
117119
**value_type** | **str**| Specify that returned attributes' value type must be the given value type. The default is no value type filter.. | [optional]
118120
**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]
119121

docs/api/DataServerApi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ Retrieves the specified license for the given Data Server. The fields of the res
142142
Name | Type | Description | Notes
143143
------------- | ------------- | ------------- | -------------
144144
**web_id** | **str**| The ID of the server.. | [required]
145-
**module** | **str**| The case-sensitive name of the module.. | [required]
145+
**module** | **str**| The case-sensitive name of the module.. | [optional]
146146
**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]
147147
**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]
148148

docs/api/ElementApi.md

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ Method | HTTP request | Description
1616
[**get_elements**](ElementApi.md#getelements) | **GET** /elements/{webId}/elements | Retrieve elements based on the specified conditions. By default, this method selects immediate children of the specified element.
1717
[**create_element**](ElementApi.md#createelement) | **POST** /elements/{webId}/elements | Create a child element.
1818
[**get_event_frames**](ElementApi.md#geteventframes) | **GET** /elements/{webId}/eventframes | Retrieve event frames that reference this element based on the specified conditions. By default, returns all event frames that reference this element that have been active in the past 8 hours.
19+
[**get_notification_rules**](ElementApi.md#getnotificationrules) | **GET** /elements/{webId}/notificationrules | Retrieve notification rules for an element
20+
[**get_paths**](ElementApi.md#getpaths) | **GET** /elements/{webId}/paths | Get a list of the full or relative paths to this element.
1921
[**get_referenced_elements**](ElementApi.md#getreferencedelements) | **GET** /elements/{webId}/referencedelements | Retrieve referenced elements based on the specified conditions. By default, this method selects all referenced elements of the current resource.
2022
[**add_referenced_element**](ElementApi.md#addreferencedelement) | **POST** /elements/{webId}/referencedelements | Add a reference to an existing element to the child elements collection.
2123
[**remove_referenced_element**](ElementApi.md#removereferencedelement) | **DELETE** /elements/{webId}/referencedelements | Remove a reference to an existing element from the child elements collection.
@@ -153,7 +155,7 @@ None
153155
[[Back to top]](#) [[Back to API list]](../../DOCUMENTATION.md#documentation-for-api-endpoints) [[Back to Model list]](../../DOCUMENTATION.md#documentation-for-models) [[Back to DOCUMENTATION]](../../DOCUMENTATION.md)
154156

155157
# **get_attributes**
156-
> get_attributes('web_id', 'category_name', 'max_count', 'name_filter', 'search_full_hierarchy', 'selected_fields', 'show_excluded', 'show_hidden', 'sort_field', 'sort_order', 'start_index', 'template_name', 'value_type', 'web_id_type')
158+
> get_attributes('web_id', 'category_name', 'max_count', 'name_filter', 'search_full_hierarchy', 'selected_fields', 'show_excluded', 'show_hidden', 'sort_field', 'sort_order', 'start_index', 'template_name', 'trait', 'trait_category', 'value_type', 'web_id_type')
157159
158160
Get the attributes of the specified element.
159161

@@ -173,6 +175,8 @@ Name | Type | Description | Notes
173175
**sort_order** | **str**| The order that the returned collection is sorted. The default is 'Ascending'.. | [optional]
174176
**start_index** | **int**| The starting index (zero based) of the items to be returned. The default is 0.. | [optional]
175177
**template_name** | **str**| Specify that returned attributes must be members of this template. The default is no template filter.. | [optional]
178+
**trait** | **list[str]**| The name of the attribute trait. Multiple traits may be specified with multiple instances of the parameter.. | [optional]
179+
**trait_category** | **list[str]**| The category of the attribute traits. Multiple categories may be specified with multiple instances of the parameter. If the parameter is not specified, or if its value is "all", then all attribute traits of all categories will be returned.. | [optional]
176180
**value_type** | **str**| Specify that returned attributes' value type must be the given value type. The default is no value type filter.. | [optional]
177181
**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]
178182

@@ -359,6 +363,45 @@ Name | Type | Description | Notes
359363

360364
[[Back to top]](#) [[Back to API list]](../../DOCUMENTATION.md#documentation-for-api-endpoints) [[Back to Model list]](../../DOCUMENTATION.md#documentation-for-models) [[Back to DOCUMENTATION]](../../DOCUMENTATION.md)
361365

366+
# **get_notification_rules**
367+
> get_notification_rules('web_id', 'selected_fields', 'web_id_type')
368+
369+
Retrieve notification rules for an element
370+
371+
### Parameters
372+
373+
Name | Type | Description | Notes
374+
------------- | ------------- | ------------- | -------------
375+
**web_id** | **str**| The ID of the resource to use as the root of the search.. | [required]
376+
**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]
377+
**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]
378+
379+
380+
### Return type
381+
382+
[**PIItemsNotificationRule**](../models/PIItemsNotificationRule.md)
383+
384+
[[Back to top]](#) [[Back to API list]](../../DOCUMENTATION.md#documentation-for-api-endpoints) [[Back to Model list]](../../DOCUMENTATION.md#documentation-for-models) [[Back to DOCUMENTATION]](../../DOCUMENTATION.md)
385+
386+
# **get_paths**
387+
> get_paths('web_id', 'relative_path')
388+
389+
Get a list of the full or relative paths to this element.
390+
391+
### Parameters
392+
393+
Name | Type | Description | Notes
394+
------------- | ------------- | ------------- | -------------
395+
**web_id** | **str**| The ID of the element.. | [required]
396+
**relative_path** | **str**| The full path in ShortName format to the parent object that the returned paths should be relative. For example, "\\Server1\Database2" would return all the paths to the element relative to the database. A path of "\\Server1\Database2\RootElement" would return all paths to the element relative to "RootElement". If null, then all the full paths to the element will be returned.. | [optional]
397+
398+
399+
### Return type
400+
401+
[**PIItemsstring**](../models/PIItemsstring.md)
402+
403+
[[Back to top]](#) [[Back to API list]](../../DOCUMENTATION.md#documentation-for-api-endpoints) [[Back to Model list]](../../DOCUMENTATION.md#documentation-for-models) [[Back to DOCUMENTATION]](../../DOCUMENTATION.md)
404+
362405
# **get_referenced_elements**
363406
> get_referenced_elements('web_id', 'category_name', 'description_filter', 'element_type', 'max_count', 'name_filter', 'selected_fields', 'sort_field', 'sort_order', 'start_index', 'template_name', 'web_id_type')
364407

0 commit comments

Comments
 (0)