From ba563e662e397f1f515b63b4e75621bb567c4900 Mon Sep 17 00:00:00 2001 From: Ray Labbe Date: Thu, 26 Jun 2025 16:35:38 -0400 Subject: [PATCH 1/7] doc: cleaned up comments --- kepconfig/adv_tags/adv_tag_group.py | 1 - 1 file changed, 1 deletion(-) diff --git a/kepconfig/adv_tags/adv_tag_group.py b/kepconfig/adv_tags/adv_tag_group.py index 4de3f02..f1d4baf 100644 --- a/kepconfig/adv_tags/adv_tag_group.py +++ b/kepconfig/adv_tags/adv_tag_group.py @@ -1,4 +1,3 @@ -# filepath: c:\Users\rlabbe\OneDrive - PTC\Documents\GitHub\Kepware-ConfigAPI-SDK-Python\kepconfig\connectivity\adv_tag_group.py # ------------------------------------------------------------------------- # Copyright (c) PTC Inc. and/or all its affiliates. All rights reserved. # See License.txt in the project root for From 248f2beb74ec93b3cd9f1b095d6ee7c7dcfea835 Mon Sep 17 00:00:00 2001 From: Ray Labbe Date: Thu, 26 Jun 2025 16:36:37 -0400 Subject: [PATCH 2/7] Added deprication decorator support --- kepconfig/helpers/deprecation_utils.py | 33 ++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 kepconfig/helpers/deprecation_utils.py diff --git a/kepconfig/helpers/deprecation_utils.py b/kepconfig/helpers/deprecation_utils.py new file mode 100644 index 0000000..f30fb82 --- /dev/null +++ b/kepconfig/helpers/deprecation_utils.py @@ -0,0 +1,33 @@ +# ------------------------------------------------------------------------- +# Copyright (c) PTC Inc. and/or all its affiliates. All rights reserved. +# See License.txt in the project root for +# license information. +# -------------------------------------------------------------------------- + +# Note: The code within this file was created in total or in part +# with the use of AI tools. + +import warnings +import functools + +def _deprecated(reason): + """ + A decorator to mark functions as deprecated. + + Args: + reason (str): The reason why the function is deprecated. + + Returns: + function: The decorated function that emits a DeprecationWarning when called. + """ + def decorator(func): + @functools.wraps(func) + def wrapper(*args, **kwargs): + warnings.warn( + f"{func.__name__} is deprecated: {reason}", + category=DeprecationWarning, + stacklevel=2 + ) + return func(*args, **kwargs) + return wrapper + return decorator From c240bb83d745050d255333818145cfc6d7a580d6 Mon Sep 17 00:00:00 2001 From: Ray Labbe Date: Thu, 26 Jun 2025 16:40:44 -0400 Subject: [PATCH 3/7] Deprecate notification added --- kepconfig/ua_gateway/certificates.py | 38 ++++++++++++++-------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/kepconfig/ua_gateway/certificates.py b/kepconfig/ua_gateway/certificates.py index 06d5913..400b3c4 100644 --- a/kepconfig/ua_gateway/certificates.py +++ b/kepconfig/ua_gateway/certificates.py @@ -12,8 +12,20 @@ from ..error import KepHTTPError from ..ua_gateway.common import _INTER_TYPE, _create_url_cert, INSTANCE_CERTIFICATE +import warnings +from ..helpers.deprecation_utils import _deprecated + + +# Enable DeprecationWarnings to be visible +warnings.simplefilter('always', DeprecationWarning) + +@_deprecated("This function is deprecated and will be removed in a future release. Use `get_instance_certificate()` in UAG client or server module instead.") def get_instance_certificate(server: server) -> dict: - '''Returns the properties of the UAG instance certificate object in the UAG certificate store. + ''' + DEPRECATED: This function is deprecated and will be removed in a future release. Use `get_instance_certificate()` + in UAG client or server module instead for Kepware 6.18+. + + Returns the properties of the UAG instance certificate object in the UAG certificate store. These are UAG instance certificates that are used by UAG for trust purposes in the UA security model. :param server: instance of the `server` class @@ -26,25 +38,13 @@ def get_instance_certificate(server: server) -> dict: r = server._config_get(server.url + _create_url_cert(_INTER_TYPE.CERTS, INSTANCE_CERTIFICATE)) return r.payload -# def get_all_certificates(server: server, *, options: dict = None) -> list: -# TODO: Implement if/when multiple instance certificates can be configured. -# '''Returns list of all UAG instance certificate objects and their properties in the UAG certificate store. -# These are UAG instance certificates that are used by UAG for trust purposes in the UA security model. - -# :param server: instance of the `server` class -# :param options: *(optional)* Dict of parameters to filter, sort or pagenate the list of certificates. Options are `filter`, -# `sortOrder`, `sortProperty`, `pageNumber`, and `pageSize` - -# :return: List of data for all certificates in Kepware server UAG server endpoint certificate store - -# :raises KepHTTPError: If urllib provides an HTTPError -# :raises KepURLError: If urllib provides an URLError -# ''' -# r = server._config_get(server.url + _create_url_cert(_INTER_TYPE.CERTS), params= options) -# return r.payload - +@_deprecated("This function is deprecated and will be removed in a future release. Use `TBD` instead.") def reissue_self_signed_instance_certificate(server: server) -> bool: - '''Deletes and reissues a self-signed UAG instance certificate object in the UAG certificate store. + ''' + DEPRECATED: This function is deprecated and will be removed in a future release. Use `get_instance_certificate()` + in UAG client or server module instead for Kepware 6.18+. + + Deletes and reissues a self-signed UAG instance certificate object in the UAG certificate store. This is the UAG instance certificate that are used by UAG for trust purposes in the UA security model. :param server: instance of the `server` class From feedbf796929e1334bd24d1a2d219ee4ba76f29f Mon Sep 17 00:00:00 2001 From: Ray Labbe Date: Thu, 26 Jun 2025 16:41:25 -0400 Subject: [PATCH 4/7] Added methods for instance certificate management changes in UAG --- kepconfig/ua_gateway/client.py | 41 ++++++++++++++++++++++++++++++++-- kepconfig/ua_gateway/common.py | 26 +++++++++++++++++++-- kepconfig/ua_gateway/server.py | 41 ++++++++++++++++++++++++++++++++-- 3 files changed, 102 insertions(+), 6 deletions(-) diff --git a/kepconfig/ua_gateway/client.py b/kepconfig/ua_gateway/client.py index f2208c1..fb4608b 100644 --- a/kepconfig/ua_gateway/client.py +++ b/kepconfig/ua_gateway/client.py @@ -11,9 +11,13 @@ """ from typing import Union + +from kepconfig.structures import KepServiceResponse from ..connection import server from ..error import KepError, KepHTTPError -from ..ua_gateway.common import _INTER_TYPE, _change_cert_trust, _create_url_cert, _create_url_client, _delete_cert_truststore +from ..ua_gateway.common import _INTER_TYPE, _change_cert_trust, _create_url_cert, _create_url_client, _delete_cert_truststore, _create_url_inst_cert + +CLIENT_INSTANCE_CERTIFICATE = "Client Instance Certificate" def get_ua_client_connection(server: server, ua_client_connection: str) -> dict: '''Returns the properties of the UAG client connection object. @@ -192,4 +196,37 @@ def delete_certificate(server: server, certificate: str) -> bool: :raises KepHTTPError: If urllib provides an HTTPError :raises KepURLError: If urllib provides an URLError ''' - return _delete_cert_truststore(server, _INTER_TYPE.CLIENT, certificate) \ No newline at end of file + return _delete_cert_truststore(server, _INTER_TYPE.CLIENT, certificate) + +def get_instance_certificate(server: server) -> dict: + '''Returns the properties of the UAG client instance certificate object in the UAG certificate store. + These are UAG instance certificates that are used by UAG for trust purposes in the UA security model. + + :param server: instance of the `server` class + + :return: Dict of properties for the certificate requested + + :raises KepHTTPError: If urllib provides an HTTPError + :raises KepURLError: If urllib provides an URLError + ''' + r = server._config_get(server.url + _create_url_inst_cert(_INTER_TYPE.CLIENT, CLIENT_INSTANCE_CERTIFICATE)) + return r.payload + +def reissue_self_signed_instance_certificate(server: server, job_ttl: int = None) -> KepServiceResponse: + '''Deletes and reissues a self-signed UAG server instance certificate object in the UAG certificate store. + This is the UAG instance certificate that are used by UAG for trust purposes in the UA security model. + + :param server: instance of the `server` class + :param job_ttl: *(optional)* Determines the number of seconds a job instance will exist following completion. + + :return: `KepServiceResponse` instance with job information + + :raises KepHTTPError: If urllib provides an HTTPError + :raises KepURLError: If urllib provides an URLError + ''' + url = server.url + _create_url_inst_cert(_INTER_TYPE.CLIENT, CLIENT_INSTANCE_CERTIFICATE) + '/services/ReIssueInstanceCertificate' + try: + job = server._kep_service_execute(url, TTL= job_ttl) + return job + except Exception as err: + raise err \ No newline at end of file diff --git a/kepconfig/ua_gateway/common.py b/kepconfig/ua_gateway/common.py index 9a0e21c..7de14af 100644 --- a/kepconfig/ua_gateway/common.py +++ b/kepconfig/ua_gateway/common.py @@ -16,9 +16,11 @@ CLIENT_ROOT = f'{UA_GATEWAY_ROOT}/ua_client_interfaces/Client Interface' CONN_ROOT = f'{CLIENT_ROOT}/ua_client_connections' CLIENT_CERT_ROOT = f'{CLIENT_ROOT}/certificates' +CLIENT_INST_CERT_ROOT = f'{CLIENT_ROOT}/client_instance_certificates' SERVER_ROOT = f'{UA_GATEWAY_ROOT}/ua_server_interfaces/Server Interface' ENDPOINT_ROOT = f'{SERVER_ROOT}/ua_server_endpoints' SERVER_CERT_ROOT = f'{SERVER_ROOT}/certificates' +SERVER_INST_CERT_ROOT = f'{SERVER_ROOT}/server_instance_certificates' class _INTER_TYPE(Enum): @@ -26,13 +28,12 @@ class _INTER_TYPE(Enum): CLIENT = 1 CERTS = 2 +# TODO: DEPRECATED: This constant is deprecated and will be removed in a future release. INSTANCE_CERTIFICATE = "Instance Certificate" def _create_url_cert(interface, certificate = None): '''Creates url object for the "certificate" branch of Kepware's UA Gateway. Used to build a part of Kepware Configuration API URL structure - - Returns the UA Gateway client interfaces specific certificate url when a value is passed as the certificate name. ''' if interface == _INTER_TYPE.SERVER: if certificate == None: @@ -44,6 +45,27 @@ def _create_url_cert(interface, certificate = None): return CLIENT_CERT_ROOT else: return f'{CLIENT_CERT_ROOT}/{_url_parse_object(certificate)}' + # TODO: DEPRECATED: This interface type is deprecated and will be removed in a future release. + else: + if certificate == None: + return CERT_ROOT + else: + return '{}/{}'.format(CERT_ROOT,_url_parse_object(certificate)) + +def _create_url_inst_cert(interface, certificate = None): + '''Creates url object for the "instance certificate" branch of Kepware's UA Gateway interfaces. Used + to build a part of Kepware Configuration API URL structure + ''' + if interface == _INTER_TYPE.SERVER: + if certificate == None: + return SERVER_INST_CERT_ROOT + else: + return f'{SERVER_INST_CERT_ROOT}/{_url_parse_object(certificate)}' + elif interface == _INTER_TYPE.CLIENT: + if certificate == None: + return CLIENT_INST_CERT_ROOT + else: + return f'{CLIENT_INST_CERT_ROOT}/{_url_parse_object(certificate)}' else: if certificate == None: return CERT_ROOT diff --git a/kepconfig/ua_gateway/server.py b/kepconfig/ua_gateway/server.py index 725936d..7563f21 100644 --- a/kepconfig/ua_gateway/server.py +++ b/kepconfig/ua_gateway/server.py @@ -11,9 +11,13 @@ """ from typing import Union + +from kepconfig.structures import KepServiceResponse from ..connection import server from ..error import KepError, KepHTTPError -from ..ua_gateway.common import _INTER_TYPE, _change_cert_trust, _create_url_cert, _create_url_server, _delete_cert_truststore, SERVER_ROOT +from ..ua_gateway.common import _INTER_TYPE, _change_cert_trust, _create_url_cert, _create_url_server, _delete_cert_truststore, SERVER_ROOT, _create_url_inst_cert + +SERVER_INSTANCE_CERTIFICATE = 'Server Instance Certificate' def get_uag_server_interface_properties(server: server) -> dict: ''' Get the UAG Server Interface Properties of the Kepware instance. These properties expose User Identify @@ -224,4 +228,37 @@ def delete_certificate(server: server, certificate: str) -> bool: :raises KepHTTPError: If urllib provides an HTTPError :raises KepURLError: If urllib provides an URLError ''' - return _delete_cert_truststore(server, _INTER_TYPE.SERVER, certificate) \ No newline at end of file + return _delete_cert_truststore(server, _INTER_TYPE.SERVER, certificate) + +def get_instance_certificate(server: server) -> dict: + '''Returns the properties of the UAG server instance certificate object in the UAG certificate store. + These are UAG instance certificates that are used by UAG for trust purposes in the UA security model. + + :param server: instance of the `server` class + + :return: Dict of properties for the certificate requested + + :raises KepHTTPError: If urllib provides an HTTPError + :raises KepURLError: If urllib provides an URLError + ''' + r = server._config_get(server.url + _create_url_inst_cert(_INTER_TYPE.SERVER, SERVER_INSTANCE_CERTIFICATE)) + return r.payload + +def reissue_self_signed_instance_certificate(server: server, job_ttl: int = None) -> KepServiceResponse: + '''Deletes and reissues a self-signed UAG server instance certificate object in the UAG certificate store. + This is the UAG instance certificate that are used by UAG for trust purposes in the UA security model. + + :param server: instance of the `server` class + :param job_ttl: *(optional)* Determines the number of seconds a job instance will exist following completion. + + :return: `KepServiceResponse` instance with job information + + :raises KepHTTPError: If urllib provides an HTTPError + :raises KepURLError: If urllib provides an URLError + ''' + url = server.url + _create_url_inst_cert(_INTER_TYPE.SERVER, SERVER_INSTANCE_CERTIFICATE) + '/services/ReIssueInstanceCertificate' + try: + job = server._kep_service_execute(url, TTL= job_ttl) + return job + except Exception as err: + raise err \ No newline at end of file From 9e8386e2cf249660be532e2b7290246a36da8053 Mon Sep 17 00:00:00 2001 From: Ray Labbe Date: Thu, 26 Jun 2025 16:41:46 -0400 Subject: [PATCH 5/7] Update Tests for Instance Certificate changes in UAG --- tests/ua_gateway_test.py | 46 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/tests/ua_gateway_test.py b/tests/ua_gateway_test.py index f533af1..e295bf3 100644 --- a/tests/ua_gateway_test.py +++ b/tests/ua_gateway_test.py @@ -8,6 +8,7 @@ # features import os, sys +import time sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from kepconfig import error, connection from kepconfig.ua_gateway import common, certificates, client, server as UAGServers @@ -68,6 +69,7 @@ def test_UAG_server_interface_properties_modify(server: connection.server): assert UAGServers.modify_uag_server_interface_properties(server, propertychange, force= False) def test_UAG_instance_certificate_get(server: connection.server): + pytest.skip("Skipping Deprecated Method Test", allow_module_level=True) # Get all UAG instance certs # TODO: Implement if/when multiple instance certificates can be configured. # cert_list = certificates.get_all_certificates(server) @@ -78,10 +80,52 @@ def test_UAG_instance_certificate_get(server: connection.server): # TODO: Create test for filter -def test_UAG_instance_certificate_reissue(server: connection.server): +def test_UAG_server_instance_certificate_get(server: connection.server): + # Get all UAG instance certs + # TODO: Implement if/when multiple instance certificates can be configured. + # cert_list = certificates.get_all_certificates(server) + # assert type(cert_list) == list + + # Read a specific instance cert + assert type(UAGServers.get_instance_certificate(server)) == dict + +def test_UAG_client_instance_certificate_get(server: connection.server): # Get all UAG instance certs + # TODO: Implement if/when multiple instance certificates can be configured. + # cert_list = certificates.get_all_certificates(server) + # assert type(cert_list) == list + + # Read a specific instance cert + assert type(client.get_instance_certificate(server)) == dict + +def test_UAG_instance_certificate_reissue(server: connection.server): + pytest.skip("Skipping Deprecated Method Test", allow_module_level=True) assert certificates.reissue_self_signed_instance_certificate(server) +def test_UAG_server_instance_certificate_reissue(server: connection.server): + job = UAGServers.reissue_self_signed_instance_certificate(server) + assert type(job) == connection.KepServiceResponse + time.sleep(1) + + # Wait for service to be completed + while True: + time.sleep(1) + status = server.service_status(job) + if (status.complete == True): break + assert type(status) == connection.KepServiceStatus + +def test_UAG_client_instance_certificate_reissue(server: connection.server): + job = client.reissue_self_signed_instance_certificate(server) + assert type(job) == connection.KepServiceResponse + time.sleep(1) + + # Wait for service to be completed + while True: + time.sleep(1) + status = server.service_status(job) + if (status.complete == True): break + assert type(status) == connection.KepServiceStatus + def test_UAG_client_conn_add(server: connection.server): # Add one client sClient = { From 090e34c1e8673cdf79e0a4b00e73da5198e17e18 Mon Sep 17 00:00:00 2001 From: Ray Labbe Date: Thu, 26 Jun 2025 16:50:07 -0400 Subject: [PATCH 6/7] Updated docs for 1.4.1 --- docs/kepconfig.html | 4 +- docs/kepconfig/admin.html | 2 +- docs/kepconfig/admin/lls.html | 274 ++++- docs/kepconfig/admin/ua_server.html | 39 +- docs/kepconfig/admin/user_groups.html | 62 +- docs/kepconfig/admin/users.html | 62 +- docs/kepconfig/adv_tags.html | 21 +- docs/kepconfig/adv_tags/adv_tag_group.html | 564 +++++----- docs/kepconfig/adv_tags/average_tags.html | 39 +- docs/kepconfig/adv_tags/complex_tags.html | 39 +- docs/kepconfig/adv_tags/cumulative_tags.html | 39 +- docs/kepconfig/adv_tags/derived_tags.html | 39 +- docs/kepconfig/adv_tags/link_tags.html | 39 +- docs/kepconfig/adv_tags/max_tags.html | 39 +- docs/kepconfig/adv_tags/min_tags.html | 39 +- docs/kepconfig/connection.html | 236 +++-- docs/kepconfig/connectivity.html | 2 +- docs/kepconfig/connectivity/channel.html | 43 +- docs/kepconfig/connectivity/device.html | 66 +- docs/kepconfig/connectivity/egd.html | 32 +- docs/kepconfig/connectivity/egd/exchange.html | 62 +- docs/kepconfig/connectivity/egd/name.html | 39 +- docs/kepconfig/connectivity/egd/range.html | 43 +- docs/kepconfig/connectivity/tag.html | 84 +- docs/kepconfig/connectivity/udd.html | 2 +- docs/kepconfig/connectivity/udd/profile.html | 37 +- docs/kepconfig/datalogger.html | 2 +- docs/kepconfig/datalogger/log_group.html | 81 +- docs/kepconfig/datalogger/log_items.html | 39 +- docs/kepconfig/datalogger/mapping.html | 31 +- docs/kepconfig/datalogger/triggers.html | 39 +- docs/kepconfig/error.html | 144 ++- docs/kepconfig/iot_gateway.html | 62 +- docs/kepconfig/iot_gateway/agent.html | 99 +- docs/kepconfig/iot_gateway/iot_items.html | 43 +- docs/kepconfig/structures.html | 205 +++- docs/kepconfig/ua_gateway.html | 2 +- docs/kepconfig/ua_gateway/certificates.html | 118 ++- docs/kepconfig/ua_gateway/client.html | 848 +++++++++------- docs/kepconfig/ua_gateway/common.html | 384 +++++-- docs/kepconfig/ua_gateway/server.html | 960 ++++++++++-------- docs/kepconfig/utils.html | 10 +- docs/search.js | 2 +- 43 files changed, 3435 insertions(+), 1581 deletions(-) diff --git a/docs/kepconfig.html b/docs/kepconfig.html index 6ba5111..e9bc8b8 100644 --- a/docs/kepconfig.html +++ b/docs/kepconfig.html @@ -3,7 +3,7 @@ - + kepconfig API documentation @@ -370,7 +370,7 @@

Need More Information

18.. include:: ../README.md 19 20""" -21__version__ = "1.3.0" +21__version__ = "1.4.0" 22from . import connection, error diff --git a/docs/kepconfig/admin.html b/docs/kepconfig/admin.html index 65650c3..3289303 100644 --- a/docs/kepconfig/admin.html +++ b/docs/kepconfig/admin.html @@ -3,7 +3,7 @@ - + kepconfig.admin API documentation diff --git a/docs/kepconfig/admin/lls.html b/docs/kepconfig/admin/lls.html index b9703a3..fbf35bf 100644 --- a/docs/kepconfig/admin/lls.html +++ b/docs/kepconfig/admin/lls.html @@ -3,7 +3,7 @@ - + kepconfig.admin.lls API documentation @@ -30,12 +30,63 @@

API Documentation

    +
  • + LLS_ROOT +
  • +
  • + FORCE_CHECK_URL +
  • +
  • + LICENSING_SERVER_PORT +
  • +
  • + LICENSING_SERVER_NAME +
  • +
  • + LICENSING_SERVER_ENABLE +
  • +
  • + LICENSING_CHECK_PERIOD_MINS +
  • +
  • + LICENSING_SERVER_SSL_PORT +
  • +
  • + LICENSING_SERVER_ALLOW_INSECURE_COMMS +
  • +
  • + LICENSING_SERVER_ALLOW_SELF_SIGNED_CERTS +
  • +
  • + LICENSING_CLIENT_ALIAS +
  • lls_config
  • @@ -105,7 +156,7 @@

    25LICENSING_CLIENT_ALIAS = "libadminsettings.LICENSING_CLIENT_ALIAS" 26 27class lls_config: - 28 '''A class to represent a admin properties for the Local License Server connection from an instance of Kepware. + 28 '''A class to represent a admin properties for the Local License Server connection from an instance of Kepware. 29 This object is used to easily manage the LLS parameters for a Kepware instance. 30 31 :param server_name: Host name or IP address of the LLS server @@ -141,7 +192,7 @@

    61 return "{}".format(self._get_dict()) 62 63def get_lls_config(server: connection.server) -> lls_config: - 64 '''Returns the properties of the Local License server connection properties. Returned object is `lls_config` class object. + 64 '''Returns the properties of the Local License server connection properties. Returned object is `lls_config` class object. 65 66 :param server: instance of the `server` class 67 @@ -155,7 +206,7 @@

    75 return lls_config(r.payload) 76 77def update_lls_config(server: connection.server, config: lls_config) -> bool: - 78 '''Updates the Local License Server connection properties for Kepware. + 78 '''Updates the Local License Server connection properties for Kepware. 79 80 :param server: instance of the `server` class 81 :param config: `lls_config` class object with lls connection configuration @@ -172,7 +223,7 @@

    92 else: raise KepHTTPError(r.url, r.code, r.msg, r.hdrs, r.payload) 93 94def enable_lls(server: connection.server) -> bool: - 95 '''Enables the Local License Server connection for Kepware. + 95 '''Enables the Local License Server connection for Kepware. 96 97 :param server: instance of the `server` class 98 @@ -187,7 +238,7 @@

    107 else: raise KepHTTPError(r.url, r.code, r.msg, r.hdrs, r.payload) 108 109def disable_lls(server: connection.server) -> bool: -110 '''Disables the Local License Server connection for Kepware. +110 '''Disables the Local License Server connection for Kepware. 111 112 :param server: instance of the `server` class 113 @@ -202,7 +253,7 @@

    122 else: raise KepHTTPError(r.url, r.code, r.msg, r.hdrs, r.payload) 123 124def force_license_check(server: connection.server, job_ttl: int = None): -125 '''Executes a ForceLicenseCheck service call to the Kepware instance. This triggers the server to verify the +125 '''Executes a ForceLicenseCheck service call to the Kepware instance. This triggers the server to verify the 126 license state of the license received from the Local License Server. 127 128 :param server: instance of the `server` class @@ -221,6 +272,126 @@

    +
    +
    + LLS_ROOT = +'/admin' + + +
    + + + + +
    +
    +
    + FORCE_CHECK_URL = +'/project/services/ForceLicenseCheck' + + +
    + + + + +
    +
    +
    + LICENSING_SERVER_PORT = +'libadminsettings.LICENSING_SERVER_PORT' + + +
    + + + + +
    +
    +
    + LICENSING_SERVER_NAME = +'libadminsettings.LICENSING_SERVER_NAME' + + +
    + + + + +
    +
    +
    + LICENSING_SERVER_ENABLE = +'libadminsettings.LICENSING_SERVER_ENABLE' + + +
    + + + + +
    +
    +
    + LICENSING_CHECK_PERIOD_MINS = +'libadminsettings.LICENSING_CHECK_PERIOD_MINS' + + +
    + + + + +
    +
    +
    + LICENSING_SERVER_SSL_PORT = +'libadminsettings.LICENSING_SERVER_SSL_PORT' + + +
    + + + + +
    +
    +
    + LICENSING_SERVER_ALLOW_INSECURE_COMMS = +'libadminsettings.LICENSING_SERVER_ALLOW_INSECURE_COMMS' + + +
    + + + + +
    +
    +
    + LICENSING_SERVER_ALLOW_SELF_SIGNED_CERTS = +'libadminsettings.LICENSING_SERVER_ALLOW_SELF_SIGNED_CERTS' + + +
    + + + + +
    +
    +
    + LICENSING_CLIENT_ALIAS = +'libadminsettings.LICENSING_CLIENT_ALIAS' + + +
    + + + + +
    @@ -233,7 +404,7 @@

    28class lls_config:
    -29    '''A class to represent a admin properties for the Local License Server connection from an instance of Kepware. 
    +29    '''A class to represent a admin properties for the Local License Server connection from an instance of Kepware. 
     30    This object is used to easily manage the LLS parameters for a Kepware instance. 
     31
     32    :param server_name: Host name or IP address of the LLS server
    @@ -310,6 +481,83 @@ 
    Parameters
    +
    +
    +
    + server_name + + +
    + + + + +
    +
    +
    + server_port + + +
    + + + + +
    +
    +
    + check_period + + +
    + + + + +
    +
    +
    + server_port_SSL + + +
    + + + + +
    +
    +
    + allow_insecure_comms + + +
    + + + + +
    +
    +
    + allow_self_signed_certs + + +
    + + + + +
    +
    +
    + instance_alias_name + + +
    + + + +
    @@ -324,7 +572,7 @@
    Parameters
    64def get_lls_config(server: connection.server) -> lls_config:
    -65    '''Returns the properties of the Local License server connection properties. Returned object is `lls_config` class object.
    +65    '''Returns the properties of the Local License server connection properties. Returned object is `lls_config` class object.
     66    
     67    :param server: instance of the `server` class
     68    
    @@ -375,7 +623,7 @@ 
    Raises
    78def update_lls_config(server: connection.server, config: lls_config) -> bool:
    -79    '''Updates the Local License Server connection properties for Kepware.
    +79    '''Updates the Local License Server connection properties for Kepware.
     80    
     81    :param server: instance of the `server` class
     82    :param config: `lls_config` class object with lls connection configuration
    @@ -430,7 +678,7 @@ 
    Raises
     95def enable_lls(server: connection.server) -> bool:
    - 96    '''Enables the Local License Server connection for Kepware.
    + 96    '''Enables the Local License Server connection for Kepware.
      97    
      98    :param server: instance of the `server` class
      99    
    @@ -482,7 +730,7 @@ 
    Raises
    110def disable_lls(server: connection.server) -> bool:
    -111    '''Disables the Local License Server connection for Kepware.
    +111    '''Disables the Local License Server connection for Kepware.
     112    
     113    :param server: instance of the `server` class
     114    
    @@ -534,7 +782,7 @@ 
    Raises
    125def force_license_check(server: connection.server, job_ttl: int = None):
    -126    '''Executes a ForceLicenseCheck service call to the Kepware instance. This triggers the server to verify the 
    +126    '''Executes a ForceLicenseCheck service call to the Kepware instance. This triggers the server to verify the 
     127    license state of the license received from the Local License Server.
     128
     129    :param server: instance of the `server` class
    diff --git a/docs/kepconfig/admin/ua_server.html b/docs/kepconfig/admin/ua_server.html
    index 532048b..3d684f2 100644
    --- a/docs/kepconfig/admin/ua_server.html
    +++ b/docs/kepconfig/admin/ua_server.html
    @@ -3,7 +3,7 @@
     
         
         
    -    
    +    
         kepconfig.admin.ua_server API documentation
     
         
    @@ -30,6 +30,9 @@
     
                 

    API Documentation

      +
    • + UA_ROOT +
    • add_endpoint
    • @@ -87,7 +90,7 @@

      16UA_ROOT = '/admin/ua_endpoints' 17 18def _create_url(endpoint = None): - 19 '''Creates url object for the "server_users" branch of Kepware's project tree. Used + 19 '''Creates url object for the "server_users" branch of Kepware's project tree. Used 20 to build a part of Kepware Configuration API URL structure 21 22 Returns the user specific url when a value is passed as the user name. @@ -99,7 +102,7 @@

      28 return '{}/{}'.format(UA_ROOT, _url_parse_object(endpoint)) 29 30def add_endpoint(server: server, DATA: Union[dict, list]) -> Union[bool, list]: - 31 '''Add an `"endpoint"` or multiple `"endpoint"` objects to Kepware UA Server by passing a + 31 '''Add an `"endpoint"` or multiple `"endpoint"` objects to Kepware UA Server by passing a 32 list of endpoints to be added all at once. 33 34 :param server: instance of the `server` class @@ -124,7 +127,7 @@

      53 else: raise KepHTTPError(r.url, r.code, r.msg, r.hdrs, r.payload) 54 55def del_endpoint(server: server, endpoint: str) -> bool: - 56 '''Delete an `"endpoint"` object in Kepware UA Server + 56 '''Delete an `"endpoint"` object in Kepware UA Server 57 58 :param server: instance of the `server` class 59 :param endpoint: name of endpoint to delete @@ -140,7 +143,7 @@

      69 else: raise KepHTTPError(r.url, r.code, r.msg, r.hdrs, r.payload) 70 71def modify_endpoint(server: server, DATA: dict, endpoint: str = None) -> bool: - 72 '''Modify a `"endpoint"` object and it's properties in Kepware UA Server. If a `"endpoint"` is not provided as an input, + 72 '''Modify a `"endpoint"` object and it's properties in Kepware UA Server. If a `"endpoint"` is not provided as an input, 73 you need to identify the endpoint in the *'common.ALLTYPES_NAME'* property field in the `"DATA"`. It will 74 assume that is the endpoint that is to be modified. 75 @@ -168,7 +171,7 @@

      97 else: raise KepHTTPError(r.url, r.code, r.msg, r.hdrs, r.payload) 98 99def get_endpoint(server: server, endpoint: str) -> dict: -100 '''Returns the properties of the `"endpoint"` object. +100 '''Returns the properties of the `"endpoint"` object. 101 102 :param server: instance of the `server` class 103 :param endpoint: name of endpoint to retrieve @@ -183,7 +186,7 @@

      112 return r.payload 113 114def get_all_endpoints(server: server, *, options: dict = None) -> list: -115 '''Returns list of all `"endpoint"` objects and their properties. +115 '''Returns list of all `"endpoint"` objects and their properties. 116 117 :param server: instance of the `server` class 118 :param options: *(optional)* Dict of parameters to filter, sort or pagenate the list of UA endpoints. Options are 'filter', @@ -201,6 +204,18 @@

    +
    +
    + UA_ROOT = +'/admin/ua_endpoints' + + +
    + + + + +
    @@ -213,7 +228,7 @@

    31def add_endpoint(server: server, DATA: Union[dict, list]) -> Union[bool, list]:
    -32    '''Add an `"endpoint"` or multiple `"endpoint"` objects to Kepware UA Server by passing a 
    +32    '''Add an `"endpoint"` or multiple `"endpoint"` objects to Kepware UA Server by passing a 
     33    list of endpoints to be added all at once.
     34
     35    :param server: instance of the `server` class
    @@ -284,7 +299,7 @@ 
    Raises
    56def del_endpoint(server: server, endpoint: str) -> bool:
    -57    '''Delete an `"endpoint"` object in Kepware UA Server
    +57    '''Delete an `"endpoint"` object in Kepware UA Server
     58    
     59    :param server: instance of the `server` class
     60    :param endpoint: name of endpoint to delete
    @@ -338,7 +353,7 @@ 
    Raises
    72def modify_endpoint(server: server, DATA: dict, endpoint: str = None) -> bool:
    -73    '''Modify a `"endpoint"` object and it's properties in Kepware UA Server. If a `"endpoint"` is not provided as an input,
    +73    '''Modify a `"endpoint"` object and it's properties in Kepware UA Server. If a `"endpoint"` is not provided as an input,
     74    you need to identify the endpoint in the *'common.ALLTYPES_NAME'* property field in the `"DATA"`. It will 
     75    assume that is the endpoint that is to be modified.
     76
    @@ -407,7 +422,7 @@ 
    Raises
    100def get_endpoint(server: server, endpoint: str) -> dict:
    -101    '''Returns the properties of the `"endpoint"` object.
    +101    '''Returns the properties of the `"endpoint"` object.
     102    
     103    :param server: instance of the `server` class
     104    :param endpoint: name of endpoint to retrieve
    @@ -460,7 +475,7 @@ 
    Raises
    115def get_all_endpoints(server: server, *, options: dict = None) -> list:
    -116    '''Returns list of all `"endpoint"` objects and their properties.
    +116    '''Returns list of all `"endpoint"` objects and their properties.
     117    
     118    :param server: instance of the `server` class
     119    :param options: *(optional)* Dict of parameters to filter, sort or pagenate the list of UA endpoints. Options are 'filter', 
    diff --git a/docs/kepconfig/admin/user_groups.html b/docs/kepconfig/admin/user_groups.html
    index 2cfa9ad..9df7996 100644
    --- a/docs/kepconfig/admin/user_groups.html
    +++ b/docs/kepconfig/admin/user_groups.html
    @@ -3,7 +3,7 @@
     
         
         
    -    
    +    
         kepconfig.admin.user_groups API documentation
     
         
    @@ -30,6 +30,12 @@
     
                 

    API Documentation

      +
    • + USERGROUPS_ROOT +
    • +
    • + ENABLE_PROPERTY +
    • add_user_group
    • @@ -94,7 +100,7 @@

      17ENABLE_PROPERTY = 'libadminsettings.USERMANAGER_GROUP_ENABLED' 18 19def _create_url(user_group = None): - 20 '''Creates url object for the "server_usergroups" branch of Kepware's project tree. Used + 20 '''Creates url object for the "server_usergroups" branch of Kepware's project tree. Used 21 to build a part of Kepware Configuration API URL structure 22 23 Returns the user group specific url when a value is passed as the user_group name. @@ -106,7 +112,7 @@

      29 return '{}/{}'.format(USERGROUPS_ROOT, _url_parse_object(user_group)) 30 31def add_user_group(server: server, DATA: Union[dict, list]) -> Union[bool, list]: - 32 '''Add a `"user group"` or multiple `"user group"` objects to Kepware User Manager by passing a + 32 '''Add a `"user group"` or multiple `"user group"` objects to Kepware User Manager by passing a 33 list of user groups to be added all at once. 34 35 :param server: instance of the `server` class @@ -131,7 +137,7 @@

      54 else: raise KepHTTPError(r.url, r.code, r.msg, r.hdrs, r.payload) 55 56def del_user_group(server: server, user_group: str) -> bool: - 57 '''Delete a `"user group"` object in Kepware User Manager + 57 '''Delete a `"user group"` object in Kepware User Manager 58 59 :param server: instance of the `server` class 60 :param user_group: name of user group to delete @@ -147,7 +153,7 @@

      70 else: raise KepHTTPError(r.url, r.code, r.msg, r.hdrs, r.payload) 71 72def modify_user_group(server: server, DATA: dict, *, user_group: str = None) -> bool: - 73 '''Modify a `"user group"` object and it's properties in Kepware User Manager. If a `"user group"` is not provided as an input, + 73 '''Modify a `"user group"` object and it's properties in Kepware User Manager. If a `"user group"` is not provided as an input, 74 you need to identify the user group in the *'common.ALLTYPES_NAME'* property field in the `"DATA"`. It will 75 assume that is the user group that is to be modified. 76 @@ -175,7 +181,7 @@

      98 else: raise KepHTTPError(r.url, r.code, r.msg, r.hdrs, r.payload) 99 100def get_user_group(server: server, user_group: str) -> dict: -101 '''Returns the properties of the `"user group"` object. +101 '''Returns the properties of the `"user group"` object. 102 103 :param server: instance of the `server` class 104 :param user_group: name of user group to retrieve @@ -190,7 +196,7 @@

      113 return r.payload 114 115def get_all_user_groups(server: server, *, options: dict = None) -> list: -116 '''Returns list of all `"user group"` objects and their properties. +116 '''Returns list of all `"user group"` objects and their properties. 117 118 :param server: instance of the `server` class 119 :param options: *(optional)* Dict of parameters to filter, sort or pagenate the list of user groups. Options are 'filter', @@ -206,7 +212,7 @@

      129 return r.payload 130 131def enable_user_group(server: server, user_group: str) -> bool: -132 '''Enable the `"user group"`. +132 '''Enable the `"user group"`. 133 134 :param server: instance of the `server` class 135 :param user_group: name of user group @@ -220,7 +226,7 @@

      143 return modify_user_group(server, DATA, user_group= user_group) 144 145def disable_user_group(server: server, user_group: str) -> bool: -146 '''Disable the `"user group"`. +146 '''Disable the `"user group"`. 147 148 :param server: instance of the `server` class 149 :param user_group: name of user group @@ -236,6 +242,30 @@

    +
    +
    + USERGROUPS_ROOT = +'/admin/server_usergroups' + + +
    + + + + +
    +
    +
    + ENABLE_PROPERTY = +'libadminsettings.USERMANAGER_GROUP_ENABLED' + + +
    + + + + +
    @@ -248,7 +278,7 @@

    32def add_user_group(server: server, DATA: Union[dict, list]) -> Union[bool, list]:
    -33    '''Add a `"user group"` or multiple `"user group"` objects to Kepware User Manager by passing a 
    +33    '''Add a `"user group"` or multiple `"user group"` objects to Kepware User Manager by passing a 
     34    list of user groups to be added all at once.
     35
     36    :param server: instance of the `server` class
    @@ -319,7 +349,7 @@ 
    Raises
    57def del_user_group(server: server, user_group: str) -> bool:
    -58    '''Delete a `"user group"` object in Kepware User Manager
    +58    '''Delete a `"user group"` object in Kepware User Manager
     59    
     60    :param server: instance of the `server` class
     61    :param user_group: name of user group to delete
    @@ -373,7 +403,7 @@ 
    Raises
    73def modify_user_group(server: server, DATA: dict, *, user_group: str = None) -> bool:
    -74    '''Modify a `"user group"` object and it's properties in Kepware User Manager. If a `"user group"` is not provided as an input,
    +74    '''Modify a `"user group"` object and it's properties in Kepware User Manager. If a `"user group"` is not provided as an input,
     75    you need to identify the user group in the *'common.ALLTYPES_NAME'* property field in the `"DATA"`. It will 
     76    assume that is the user group that is to be modified.
     77
    @@ -442,7 +472,7 @@ 
    Raises
    101def get_user_group(server: server, user_group: str) -> dict:
    -102    '''Returns the properties of the `"user group"` object.
    +102    '''Returns the properties of the `"user group"` object.
     103    
     104    :param server: instance of the `server` class
     105    :param user_group: name of user group to retrieve
    @@ -495,7 +525,7 @@ 
    Raises
    116def get_all_user_groups(server: server, *, options: dict = None) -> list:
    -117    '''Returns list of all `"user group"` objects and their properties.
    +117    '''Returns list of all `"user group"` objects and their properties.
     118    
     119    :param server: instance of the `server` class
     120    :param options: *(optional)* Dict of parameters to filter, sort or pagenate the list of user groups. Options are 'filter', 
    @@ -550,7 +580,7 @@ 
    Raises
    132def enable_user_group(server: server, user_group: str) -> bool:
    -133    '''Enable the `"user group"`.
    +133    '''Enable the `"user group"`.
     134    
     135    :param server: instance of the `server` class
     136    :param user_group: name of user group
    @@ -602,7 +632,7 @@ 
    Raises
    146def disable_user_group(server: server, user_group: str) -> bool:
    -147    '''Disable the `"user group"`.
    +147    '''Disable the `"user group"`.
     148    
     149    :param server: instance of the `server` class
     150    :param user_group: name of user group
    diff --git a/docs/kepconfig/admin/users.html b/docs/kepconfig/admin/users.html
    index 7a4a5b5..a3b198b 100644
    --- a/docs/kepconfig/admin/users.html
    +++ b/docs/kepconfig/admin/users.html
    @@ -3,7 +3,7 @@
     
         
         
    -    
    +    
         kepconfig.admin.users API documentation
     
         
    @@ -30,6 +30,12 @@
     
                 

    API Documentation

      +
    • + USERS_ROOT +
    • +
    • + ENABLE_PROPERTY +
    • add_user
    • @@ -94,7 +100,7 @@

      17ENABLE_PROPERTY = 'libadminsettings.USERMANAGER_USER_ENABLED' 18 19def _create_url(user = None): - 20 '''Creates url object for the "server_users" branch of Kepware's project tree. Used + 20 '''Creates url object for the "server_users" branch of Kepware's project tree. Used 21 to build a part of Kepware Configuration API URL structure 22 23 Returns the user specific url when a value is passed as the user name. @@ -106,7 +112,7 @@

      29 return '{}/{}'.format(USERS_ROOT, _url_parse_object(user)) 30 31def add_user(server: server, DATA: Union[dict, list]) -> Union[bool, list]: - 32 '''Add a `"user"` or multiple `"user"` objects to Kepware User Manager by passing a + 32 '''Add a `"user"` or multiple `"user"` objects to Kepware User Manager by passing a 33 list of users to be added all at once. 34 35 :param server: instance of the `server` class @@ -131,7 +137,7 @@

      54 else: raise KepHTTPError(r.url, r.code, r.msg, r.hdrs, r.payload) 55 56def del_user(server: server, user: str) -> bool: - 57 '''Delete a `"user"` object in Kepware User Manager + 57 '''Delete a `"user"` object in Kepware User Manager 58 59 :param server: instance of the `server` class 60 :param user: name of user to delete @@ -147,7 +153,7 @@

      70 else: raise KepHTTPError(r.url, r.code, r.msg, r.hdrs, r.payload) 71 72def modify_user(server: server , DATA: dict, *, user: str = None) -> bool: - 73 '''Modify a `"user object"` and it's properties in Kepware User Manager. If a `"user"` is not provided as an input, + 73 '''Modify a `"user object"` and it's properties in Kepware User Manager. If a `"user"` is not provided as an input, 74 you need to identify the user in the *'common.ALLTYPES_NAME'* property field in the `"DATA"`. It will 75 assume that is the user that is to be modified. 76 @@ -175,7 +181,7 @@

      98 else: raise KepHTTPError(r.url, r.code, r.msg, r.hdrs, r.payload) 99 100def get_user(server: server, user: str) -> dict: -101 '''Returns the properties of the `"user"` object. +101 '''Returns the properties of the `"user"` object. 102 103 :param server: instance of the `server` class 104 :param user: name of user to retrieve @@ -190,7 +196,7 @@

      113 return r.payload 114 115def get_all_users(server: server, *, options: dict = None) -> list: -116 '''Returns list of all `"user"` objects and their properties. +116 '''Returns list of all `"user"` objects and their properties. 117 118 :param server: instance of the `server` class 119 :param options: *(optional)* Dict of parameters to filter, sort or pagenate the list of users. Options are 'filter', @@ -206,7 +212,7 @@

      129 return r.payload 130 131def enable_user(server: server, user: str) -> bool: -132 '''Enable the `"user"`. +132 '''Enable the `"user"`. 133 134 :param server: instance of the `server` class 135 :param user: name of user @@ -220,7 +226,7 @@

      143 return modify_user(server, DATA, user= user) 144 145def disable_user(server: server, user: str) -> bool: -146 '''Disable the `"user"`. +146 '''Disable the `"user"`. 147 148 :param server: instance of the `server` class 149 :param user: name of user @@ -236,6 +242,30 @@

    +
    +
    + USERS_ROOT = +'/admin/server_users' + + +
    + + + + +
    +
    +
    + ENABLE_PROPERTY = +'libadminsettings.USERMANAGER_USER_ENABLED' + + +
    + + + + +
    @@ -248,7 +278,7 @@

    32def add_user(server: server, DATA: Union[dict, list]) -> Union[bool, list]:
    -33    '''Add a `"user"` or multiple `"user"` objects to Kepware User Manager by passing a 
    +33    '''Add a `"user"` or multiple `"user"` objects to Kepware User Manager by passing a 
     34    list of users to be added all at once.
     35
     36    :param server: instance of the `server` class
    @@ -319,7 +349,7 @@ 
    Raises
    57def del_user(server: server, user: str) -> bool:
    -58    '''Delete a `"user"` object in Kepware User Manager
    +58    '''Delete a `"user"` object in Kepware User Manager
     59    
     60    :param server: instance of the `server` class
     61    :param user: name of user to delete
    @@ -373,7 +403,7 @@ 
    Raises
    73def modify_user(server: server , DATA: dict, *, user: str = None) -> bool:
    -74    '''Modify a `"user object"` and it's properties in Kepware User Manager. If a `"user"` is not provided as an input,
    +74    '''Modify a `"user object"` and it's properties in Kepware User Manager. If a `"user"` is not provided as an input,
     75    you need to identify the user in the *'common.ALLTYPES_NAME'* property field in the `"DATA"`. It will 
     76    assume that is the user that is to be modified.
     77
    @@ -442,7 +472,7 @@ 
    Raises
    101def get_user(server: server, user: str) -> dict:
    -102    '''Returns the properties of the `"user"` object.
    +102    '''Returns the properties of the `"user"` object.
     103    
     104    :param server: instance of the `server` class
     105    :param user: name of user to retrieve
    @@ -495,7 +525,7 @@ 
    Raises
    116def get_all_users(server: server, *, options: dict = None) -> list:
    -117    '''Returns list of all `"user"` objects and their properties.
    +117    '''Returns list of all `"user"` objects and their properties.
     118    
     119    :param server: instance of the `server` class
     120    :param options: *(optional)* Dict of parameters to filter, sort or pagenate the list of users. Options are 'filter', 
    @@ -550,7 +580,7 @@ 
    Raises
    132def enable_user(server: server, user: str) -> bool:
    -133    '''Enable the `"user"`.
    +133    '''Enable the `"user"`.
     134    
     135    :param server: instance of the `server` class
     136    :param user: name of user
    @@ -602,7 +632,7 @@ 
    Raises
    146def disable_user(server: server, user: str) -> bool:
    -147    '''Disable the `"user"`.
    +147    '''Disable the `"user"`.
     148    
     149    :param server: instance of the `server` class
     150    :param user: name of user
    diff --git a/docs/kepconfig/adv_tags.html b/docs/kepconfig/adv_tags.html
    index e48d046..344e083 100644
    --- a/docs/kepconfig/adv_tags.html
    +++ b/docs/kepconfig/adv_tags.html
    @@ -3,7 +3,7 @@
     
         
         
    -    
    +    
         kepconfig.adv_tags API documentation
     
         
    @@ -41,6 +41,9 @@ 

    Submodules

    API Documentation

    @@ -79,7 +82,7 @@

    12ADV_TAGS_ROOT = '/project/_advancedtags' 13 14def _adv_tag_path_split(path: str, *, isItem=False) -> dict: -15 '''Used to split the standard Kepware address decimal notation into a dict that contains the +15 '''Used to split the standard Kepware address decimal notation into a dict that contains the 16 advanced tag path components. 17 18 :param path: standard Kepware address in decimal notation ("_advancedtags.tg1.tg2.tg3") @@ -108,7 +111,7 @@

    41 return path_obj 42 43def _create_adv_tags_base_url(base_url, path_obj): -44 '''Creates url object for the "path_obj" which provides the adv tags tag group structure of Kepware's project tree. Used +44 '''Creates url object for the "path_obj" which provides the adv tags tag group structure of Kepware's project tree. Used 45 to build a part of Kepware Configuration API URL structure 46 47 Returns the advanced tag group specific url when a value is passed as the tag group name. @@ -121,6 +124,18 @@

    +
    +
    + ADV_TAGS_ROOT = +'/project/_advancedtags' + + +
    + + + + +