Elipse Plant Manager — EPM Web API

Version 5.0.45

epmwebapi.epmconnection

class ImportMode(enum.Enum):

Enumeration with all types of import modes.

OnlyAdd = <ImportMode.OnlyAdd: 0>
OnlyEdit = <ImportMode.OnlyEdit: 1>
AddAndEdit = <ImportMode.AddAndEdit: 2>
Inherited Members
enum.Enum
name
value
class EpmConnection:

EPM Connection class.

EpmConnection( authServer: str = None, webApi: str = None, userName: str = None, password: str = None, clientId: str = 'EpmRestApiClient', programId: str = 'B39C3503-C374-3227-83FE-EEA7A9BD1FDC', connectionContext: epmwebapi.epmconnectioncontext.EpmConnectionContext = None)

Class constructor.

Parameters
  • authServer: An optional URL to an authorization server. Default is None.
  • webApi: An optional URL to a Web API. Default is None.
  • userName: An optional name of a user to access an EPM Server. Default is None.
  • password: An optional password of a user to access an EPM Server. Default is None.
  • clientId: An optional client identity to access an EPM Server. Default is EpmRestApiClient.
  • programId: An optional program identity to access an EPM Server. Default is B39C3503-C374-3227-83FE-EEA7A9BD1FDC.
  • connectionContext: An optional epmwebapi.epmconnectioncontext.EpmConnectionContext to create a new Connection. Default is None.
def getPortalResourcesManager(self) -> epmwebapi.portalresources.PortalResources:

Gets an epmwebapi.portalresources.PortalResources object to manage resources from EPM Portal.

Returns

A class representing an EPM Portal Resources Manager.

def getProcessorResourcesManager(self) -> epmwebapi.processorresources.ProcessorResources:

Gets an epmwebapi.processorresources.ProcessorResources object to manage resources from EPM Processor.

Returns

A class representing an EPM Processor Resources Manager.

def getDataObjects( self, names: str = None, attributes: epmwebapi.dataobjectattributes.DataObjectAttributes = <DataObjectAttributes.Unspecified: 0>) -> OrderedDict[str, epmwebapi.epmdataobject.EpmDataObject]:

Returns an Ordered Dictionary (collections.OrderedDict) object with one or more Data Objects. If a name does not exist, this function returns None as the Data Object's value.

Parameters
Returns

An Ordered Dictionary (collections.OrderedDict) object with all Data Objects found on an EPM Server with the specified attributes.

def getBasicVariables( self, names: str = None, attributes: epmwebapi.dataobjectattributes.DataObjectAttributes = <DataObjectAttributes.Unspecified: 0>) -> OrderedDict[str, epmwebapi.epmdataobject.EpmDataObject]:

Returns an Ordered Dictionary (collections.OrderedDict) object with one or more Basic Variables. If a name does not exists, this function returns None as the Basic Variable's value.

Parameters
Returns

An Ordered Dictionary (collections.OrderedDict) object with all Basic Variables found on an EPM Server with the specified attributes.

def getExpressionVariables( self, names: str = None, attributes: epmwebapi.dataobjectattributes.DataObjectAttributes = <DataObjectAttributes.Unspecified: 0>) -> OrderedDict[str, epmwebapi.epmdataobject.EpmDataObject]:

Returns an Ordered Dictionary (collections.OrderedDict) object with one or more Expression Variables. If a name does not exist, this function returns None as the Expression Variable's object.

Parameters
Returns

An Ordered Dictionary (collections.OrderedDict) object with all Expression Variables found on an EPM Server with the specified attributes.

def createBasicVariable( self, name: str, description: str = None, tagType: Union[str, epmwebapi.basicvariable.TagType] = None, realTimeEnabled: bool = None, deadBandFilter: float = None, deadBandUnit: str = None, eu: str = None, lowLimit: float = None, highLimit: float = None, scaleEnable: bool = None, inputLowLimit: float = None, inputHighLimit: float = None, clamping: str = None, domain: str = None, interface: str = None, ioTagAddress: str = None, processingEnabled: bool = None, isRecording: bool = None, isCompressing: bool = None, storeMillisecondsEnabled: bool = None, storageSet: bool = None) -> epmwebapi.basicvariable.BasicVariable:

Creates a Basic Variable on an EPM Server.

Parameters
  • name: Optional parameter indicating a name for this Basic Variable. Default is None.
  • description: Optional parameter indicating a description for this Basic Variable. Default is None.
  • tagType: Optional parameter indicating a type of Tag of a Basic Variable. Possible values are SourceType, Bit, Int, UInt, Float, Double, String, or DateTime. Default is None.
  • realTimeEnabled: Optional parameter indicating whether real-time is enabled. Default is None.
  • deadBandFilter: Optional parameter indicating a dead band value. Default is None.
  • deadBandUnit: Optional parameter indicating a dead band unit. Default is None.
  • eu: Optional parameter indicating an engineering unit. Default is None
  • lowLimit: Optional parameter indicating a low limit. Default is None.
  • highLimit: Optional parameter indicating a high limit. Default is None.
  • scaleEnable: Optional parameter indicating whether scale is enabled or not. Default is None.
  • inputLowLimit: Optional parameter indicating an input low limit. Default is None.
  • inputRightLimit: Optional parameter indicating an input right limit. Default is None.
  • clamping: Optional parameter indicating a type of clamping. Possible values are ClampToRange or Discard. Default is None.
  • domain: Optional parameter indicating a domain from a variable. Possible values are Continuous or Discrete. Default is None.
  • interface: Optional parameter indicating the name of an Interface, in the format InterfaceServerName\interfacename. Default is None.
  • ioTagAddress: Optional parameter indicating the Interface's source path. Default is None.
  • processingEnabled: Optional parameter indicating whether scale is enabled or not. Default is None.
  • isRecording: Optional parameter indicating whether recording values is enabled or not. Default is None.
  • isCompressing: Optional parameter indicating whether compression values is enabled or not. Default is None.
  • storeMillisecondsEnabled: Optional parameter indicating whether storing milliseconds from timestamp values is enabled or not. Default is None.
  • storageSet: Optional Storage Set name. Default is None.
Returns

An epmwebapi.basicvariable.BasicVariable object.

Raises
  • Basic Variable already exists.
  • Basic Variable contains an invalid name.
  • Storage Set does not exist.
  • Interface does not exist.
def updateBasicVariable( self, name: str, newName: str = None, description: str = None, tagType: Union[str, epmwebapi.basicvariable.TagType] = None, realTimeEnabled: bool = None, deadBandFilter: float = None, deadBandUnit: str = None, eu: str = None, lowLimit: float = None, highLimit: float = None, scaleEnable: bool = None, inputLowLimit: float = None, inputHighLimit: float = None, clamping: str = None, domain: str = None, interface: str = None, ioTagAddress: str = None, processingEnabled: bool = None, isRecording: bool = None, isCompressing: bool = None, storeMillisecondsEnabled: bool = None, storageSet: bool = None):

Updates a Basic Variable. Parameters set as None are not updated.

Parameters
  • name: Name of a Basic Variable to update.
  • newName: An optional new name for a Basic Variable.
  • description: An optional description to update.
  • tagType: An optional type of Tag to update. Possible values are SourceType, Bit, Int, UInt, Float, Double, String, or DateTime. Default is None.
  • realtimeEnabled: Optional parameter indicating whether real-time is enabled or not. Default is None.
  • deadBandFilter: Optional parameter indicating a dead band value. Default is None.
  • deadBandUnit: Optional parameter indicating a dead band unit. Possible values are Absolute, PercentOfEURange, or PercentOfValue. Default is None.
  • eu: Optional parameter indicating an engineering unit for the Basic Variable. Default is None.
  • lowLimit: Optional parameter indicating a low limit. Default is None.
  • highLimit: Optional parameter indicating a high limit. Default is None.
  • scaleEnable: Optional parameter indicating whether a scale is enabled. Default is None.
  • inputLowLimit: Optional parameter indicating an input low limit. Default is None.
  • inputHighLimit: Optional parameter indicating an input high limit. Default is None.
  • clamping: Optional parameter indicating a type of clamping. Possible values are ClampToRange or Discard. Default is None.
  • domain: Optional parameter indicating a domain from a variable. Possible values are Continuous or Discrete. Default is None.
  • interface: Optional parameter indicating an Interface name, in the format interfaceServerName\interfaceName. Default is None.
  • ioTagAddress: Optional parameter indicating the Interface's source path. Default is None.
  • processingEnabled: Optional parameter indicating whether a scale is enabled. Default is None.
  • isRecording: Optional parameter indicating whether recording values is enabled or not. Default is None.
  • isCompressing: Optinal parameter indicating whether compressing values is enabled or not. Default is None.
  • storeMillisecondsEnabled: Optional parameter indicating whether storing milliseconds from timestamp values. Default is None.
  • storageSet: Optional Storage Set name. Default is None.
Raises
  • Basic Variable already exists.
  • Invalid name of Basic Variable.
  • Storage Set does not exist.
  • Interface does not exist.
def deleteBasicVariable(self, names: List[str]) -> Union[bool, List[bool]]:

Deletes one or more Basic Variables.

Parameters
  • names: A list of Basic Variables to delete.
Returns

True if the Basic Variables were deleted.

def getAllCustomTypes(self) -> List[str]:

Returns all existing custom types on an EPM Server.

Returns

A list of all custom types of an EPM Server.

Raises
  • A call error.
def getCustomType(self, name: str) -> epmwebapi.customtypedefinition.CustomTypeDefinition:

Returns a specific custom type.

Parameters
  • name: Name of a custom type.
Returns

An epmwebapi.customtypedefinition.CustomTypeDefinition object.

Raises
  • Invalid custom type name.
  • Bad argument.
  • Custom type not found.
  • Cannot parse a path with informed name.
def createCustomType( self, name: str, propertiesFilePath: str = None) -> epmwebapi.customtypedefinition.CustomTypeDefinition:

Creates a new custom type.

Parameters
  • name: Name of a new custom type.
  • propertiesFilePath: Optional parameter indicating a file with custom type configurations. Default is None.
Returns

An epmwebapi.customtypedefinition.CustomTypeDefinition object.

Raises
  • CustomTypeDependenciesException: Object properties or placeholder dependencies do not exist.
  • CustomTypeAlreadyExistsException: Custom type already exists.
  • DuplicatedPropertiesNamesException: Duplicated property names.
  • InvalidCustomTypeNameException: Invalid custom type name.
  • InvalidPropertyNameException: Invalid property name.
  • DuplicatedPropertiesTypeException: Duplicated property type.
  • MissingPropertyNameException: Missing property name.
  • InvalidPropertyTypeException: Invalid object or placeholder property type.
  • InvalidIconException: Invalid icon.
def deleteCustomType(self, name: str):

Deletes a custom type.

Parameters
  • name: Name of a custom type to delete.
Raises
  • InvalidCustomTypeNameException: Invalid custom type name.
  • Exception: Custom type not found.
def exportCustomTypes(self, fileName: str, pathName: str = None):

Exports custom types to a file in JSON format.

Parameters
  • fileName: Name of a file to save custom types.
  • pathName: Path where fileName must be saved. Default is None, that is, saves to the current directory.
def importCustomTypes( self, filePath: str, importMode: ImportMode = <ImportMode.OnlyAdd: 0>):

Imports definitions of custom types from a file to an EPM Server.

Parameters
  • filePath: Path to a file with custom type configurations.
  • importMode: Optional parameter indicating a type of import. Default is ImportMode.OnlyAdd.
Raises
  • BadArgumentException: Invalid importMode parameter.
  • CustomTypeDependenciesException: Custom type dependencies already exist.
def filterDataObjects( self, filter: epmwebapi.dataobjectsfilter.DataObjectsFilter = None, attributes: epmwebapi.dataobjectattributes.DataObjectAttributes = <DataObjectAttributes.Unspecified: 0>) -> OrderedDict[str, Union[epmwebapi.epmdataobject.EpmDataObject, epmwebapi.basicvariable.BasicVariable]]:

Returns all Data Objects that satisfy the specified filter.

Parameters
Returns

An Ordered Dictionary with all Data Objects found.

def getObjectsFromType( self, typeName: str, discoverInstancePaths: bool = True) -> List[epmwebapi.epmobject.EpmObject]:

Returns all instances from the specified type name.

Parameters
  • typeName: A type to search for.
  • discoverInstancePaths: An optional paramter indicating whether to retrieve the address space path for each instance or not. Default is True.
Returns

A list of all instances found.

def getObjects( self, objectsPaths: Union[List[str], str]) -> OrderedDict[str, epmwebapi.epmmodelobject.EpmModelObject]:

Returns all objects from specific address space paths.

Parameters
  • objectPaths: A list with all objects to return.
Returns

An Ordered Dictionary with all objects found or None if some paths were not found.

def getEpmModelObjects( self, objectsPaths: Union[List[str], str]) -> OrderedDict[str, epmwebapi.epmmodelobject.EpmModelObject]:

Returns all objects from specific address space paths inside an EPM Model folder.

Parameters
  • objectsPaths: A list with all objects to return.
Returns

An Ordered Dictionary with all objects found or None if some paths were not found.

def getElipseDataModelObjects( self, objectsPaths: Union[List[str], str]) -> OrderedDict[str, epmwebapi.epmmodelobject.EpmModelObject]:

Returns all objects from specific address space paths inside an Elipse Data Model folder.

Parameters
  • objectsPath: List with all objects to return.
Returns

An Ordered Dictionary with all objects found or None if some paths were not found.

def getDataModelObjectProperties(self, objectPath: str) -> OrderedDict:

Returns all object properties from specific address space paths inside an Elipse Data Model folder.

Parameters
  • objectPath: Path to start after the Elipse Data Model node.
Returns

An Ordered Dictionary with all properties from the target object.

Raises
  • InvalidObjectNameException: Object not found.
def getEpmModelObjectProperties(self, objectPath: str) -> OrderedDict:

Returns all object properties from specific address space paths inside an EPM Model folder.

Parameters
  • objectPath: Path to start searching after the EPM Model node.
Returns

An Ordered Dictionary with properties from the target object.

Raises
  • InvalidObjectNameException: Object not found.
def exportEpmModel(self, fileName: str, pathName: str = None):

Exports an EPM Model configuration to a file in JSON format.

Parameters
  • fileName: Name of a file to save the EPM Model.
  • pathName: An optional path where fileName is located. Default is None, that is, searches the current directory.
def importEpmModel( self, filePath: str, importMode: ImportMode = <ImportMode.OnlyAdd: 0>):

Imports an EPM Model configuration saved to a file in JSON format to EPM Model.

Parameters
  • filePath: Path to a configuration file.
  • importMode: Optional parameter indicating how to import data. Default is ImportMode.OnlyAdd.
def newDataset( self, name: str, description: str = None) -> epmwebapi.datasetconfig.DatasetConfig:

Creates a new Dataset.

Parameters
  • name: Name of this new Dataset.
  • description: Optional parameter indicating a description for this Dataset. Default is None.
Returns

An epmwebapi.datasetconfig.DatasetConfig object.

def newDatasetLocal( self, name: str, description: str = None) -> epmwebapi.datasetconfig.DatasetConfig:

Creates a new local Dataset.

Parameters
  • name: Name of this new local Dataset.
  • description: Optional parameter indicating a description for this local Dataset. Default is None.
Returns

An epmwebapi.datasetconfig.DatasetConfig object.

Raises
  • BadArgumentException: Dataset already exists.
def newDatasetServer( self, name: str, description: str = None) -> epmwebapi.datasetconfig.DatasetConfig:

Creates a new Dataset on the server.

Parameters
  • name: Name of this new Dataset.
  • description: An optional parameter indicating a description for this new Dataset. Default is None.
Returns

An epmwebapi.datasetconfig.DatasetConfig object.

Raises
  • BadArgumentException: Dataset already exists on the server.
def loadDatasetFile(self, filePath: str) -> epmwebapi.datasetconfig.DatasetConfig:

Loads a file Dataset from the local computer.

Parameters
  • filePath: Path of the file Dataset.
Returns

An epmwebapi.datasetconfig.DatasetConfig object.

Raises
  • BadArgumentException: Invalid file extension.
def loadDatasetLocal(self, fileName: str) -> epmwebapi.datasetconfig.DatasetConfig:

Loads a local Dataset from the local computer.

Parameters
  • fileName: Name of a Dataset.
Returns

An epmwebapi.datasetconfig.DatasetConfig object.

def loadDatasetServer(self, name: str) -> epmwebapi.datasetconfig.DatasetConfig:

Loads a Dataset from an EPM Server.

Parameters
  • name: Name of a Dataset.
Returns

An epmwebapi.datasetconfig.DatasetConfig object.

def listDatasetLocal(self) -> List[str]:

Returns all Datasets on the local computer.

Returns

A List[str] with all Datasets found.

def listDatasetServer(self) -> List[str]:

Returns all Datasets from an EPM Server.

Returns

A List[str] with all Datasets found.

def close(self):

Closes the current EPM Connection.

def historyUpdate( self, variables: List[Union[epmwebapi.epmdataobject.EpmDataObject, epmwebapi.epmvariable.EpmVariable]], numpyArrays: List[numpy.ndarray]):

Writes an array of values, with Value, Timestamp, and Quality, for each specified variable.

Parameters
  • variables: List of variable to write the specified values.
  • numpyArrays: List of numpy arrays with values to write.
class BadArgumentException(builtins.Exception):

Common base class for all non-exit exceptions.

Inherited Members
builtins.Exception
Exception
builtins.BaseException
with_traceback
add_note
args