Elipse Plant Manager — EPM Web API
Version 6.50.41
epmwebapi.epmconnection
Enumeration with all types of import modes.
Inherited Members
- enum.Enum
- name
- value
Class representing an EPM Connection.
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.EpmConnectionContextto create a new Connection. Default is None.
Gets an epmwebapi.portalresources.PortalResources object to manage resources from EPM Portal.
Returns
A class representing an EPM Portal Resources Manager.
Gets an epmwebapi.processorresources.ProcessorResources object to manage resources from EPM Processor.
Returns
A class representing an EPM Processor Resources Manager.
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
- names: Names of Data Objects. Default is None.
- attributes: Attributes to return from Data Objects. Default is
epmwebapi.dataobjectattributes.DataObjectAttributes.Unspecified.
Returns
An Ordered Dictionary (
collections.OrderedDict) object with all Data Objects found on an EPM Server with the specified attributes.
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
- names: Names of Basic Variables.
- attributes: Attributes to return from Basic Variables. Default is
epmwebapi.dataobjectattributes.DataObjectAttributes.Unspecified.
Returns
An Ordered Dictionary (
collections.OrderedDict) object with all Basic Variables found on an EPM Server with the specified attributes.
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
- names: Names of Expression Variables.
- attributes: Attributes to return from Expression Variables. Default is
epmwebapi.dataobjectattributes.DataObjectAttributes.Unspecified.
Returns
An Ordered Dictionary (
collections.OrderedDict) object with all Expression Variables found on an EPM Server with the specified attributes.
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.BasicVariableobject.
Raises
- Basic Variable already exists.
- Basic Variable contains an invalid name.
- Storage Set does not exist.
- Interface does not exist.
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.
Deletes one or more Basic Variables.
Parameters
- names: A list of Basic Variables to delete.
Returns
Trueif the Basic Variables were deleted.
Returns all existing custom types on an EPM Server.
Returns
A list of all custom types of an EPM Server.
Raises
- A call error.
Returns a specific custom type.
Parameters
- name: Name of a custom type.
Returns
An
epmwebapi.customtypedefinition.CustomTypeDefinitionobject.
Raises
- Invalid custom type name.
- Bad argument.
- Custom type not found.
- Cannot parse a path with informed name.
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.CustomTypeDefinitionobject.
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.
Deletes a custom type.
Parameters
- name: Name of a custom type to delete.
Raises
- InvalidCustomTypeNameException: Invalid custom type name.
- Exception: Custom type not found.
Exports custom types to a file in JSON format.
Parameters
- fileName: Name of a file to save custom types.
- pathName: Path where
fileNamemust be saved. Default is None, that is, saves to the current directory.
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
importModeparameter. - CustomTypeDependenciesException: Custom type dependencies already exist.
Returns all objects that satisfy the specified filter on the startedObjects list.
Parameters
- startObjects: The nodes where a search starts.
- nameFilter: An optional parameter indicating a name to an Object Instance Filter. Use
*for All. Default is None. - objectType: A string value indicating the
UserTypeto search on Elipse Data Model. Default is None. - filter: An
ElementOperanddescribing a filter to apply toobjectTyperesult nodes. Default is None.
Returns
An Ordered Dictionary with all objects found.
Examples
The following examples show how to use the filterModel function.
- Creates a filter looking for all items on the
CityAobject that have "PUMP" in their names:
obj = connection.getElipseDataModelObjects('water/CityA')['water/CityA']
result = filterModel([obj], '*PUMP*')
- Creates a filter looking for all Pumps on the
CityAobject that have "302" in their names:
obj = connection.getElipseDataModelObjects('water/CityA')['water/CityA']
result = filterModel([obj], '*302*', 'PUMP')
- Creates a filter looking for all items on the
CityAobject with type WaterStation that have the ShortName property equal to "PCP_Name1":
from epmwebapi.elementoperand import ElementOperand, Operator
from epmwebapi.literaloperand import LiteralOperand
from epmwebapi.simpleattributeoperand import SimpleAttributeOperand
obj = connection.getElipseDataModelObjects('water/CityA')['water/CityA']
filter = ElementOperand(Operator.Equals, [SimpleAttributeOperand('ShortName'), LiteralOperand('PCP_Name1')])
objects = connection.filterModel([obj], '*', 'WaterStation', filter)
- Creates a filter looking for all Pumps on the
CityAobject that have the Temperature1 property greater than the Temperature2 property:
from epmwebapi.elementoperand import ElementOperand, Operator
from epmwebapi.literaloperand import LiteralOperand
from epmwebapi.simpleattributeoperand import SimpleAttributeOperand
cityA = connection.getElipseDataModelObjects('water/CityA')['water/CityA']
filter = ElementOperand(Operator.GreaterThan, [SimpleAttributeOperand('Temperature1'), SimpleAttributeOperand('Temperature2')])
objects = connection.filterModel([cityA], '*', 'PUMP', filter)
- Creates a filter looking for all Pumps on
CityAandCityBobjects in which temperature is greater than 15 degrees:
from epmwebapi.elementoperand import ElementOperand, Operator
from epmwebapi.literaloperand import LiteralOperand
from epmwebapi.simpleattributeoperand import SimpleAttributeOperand
cityA = connection.getElipseDataModelObjects('water/CityA')['water/CityA']
cityB = connection.getElipseDataModelObjects('water/CityB')['water/CityB']
filter = ElementOperand(Operator.GreaterThan, [SimpleAttributeOperand('Temperature'), LiteralOperand(15)])
result = filterModel([cityA, cityB], '*', 'PUMP', filter)
Returns all objects that satisfy the specified filter in Elipse Data Model tree.
Parameters
- nameFilter: An optional parameter indicating a name to an Object Instance Filter. Use
*for All. Default is None. - objectType: A string value indicating the
UserTypeto search on Elipse Data Model. Default is None. - filter: An
ElementOperanddescribing a filter to apply toobjectTyperesult nodes. Default is None.
Returns
An Ordered Dictionary with all objects found.
Examples
The following examples show how to use the filterDataModel function.
- Creates a filter looking for all items on the ElipseDataModel folder that have "PUMP" in their names:
result = filterDataModel('*PUMP*')
- Creates a filter looking for all Pumps on the ElipseDataModel folder that have "302" in their names:
result = filterDataModel('*302*', 'PUMP')
- Creates a filter looking for all Pumps on the ElipseDataModel folder in which temperature is greater than 15 degrees:
from epmwebapi.elementoperand import ElementOperand, Operator
from epmwebapi.literaloperand import LiteralOperand
from epmwebapi.simpleattributeoperand import SimpleAttributeOperand
filter = ElementOperand(Operator.GreaterThan, [SimpleAttributeOperand('Temperature'), LiteralOperand(15)])
result = filterDataModel('*', 'PUMP', filter)
Returns all objects that satisfy the specified filter in EPM Model tree.
Parameters
- nameFilter: An optional parameter indicating a name to an Object Instance Filter. Use
*for All. Default is None. - objectType: A string value indicating the
UserTypeto search on Elipse Data Model. Default is None. - filter: An
ElementOperanddescribing a filter to apply toobjectTyperesult nodes. Default is None.
Returns
An Ordered Dictionary with all objects found.
Examples
The following examples show how to use the filterEpmModel function.
- Creates a filter looking for all items on the EPMModel folder that have "PUMP" in their names:
result = filterEpmModel('*PUMP*')
- Creates a filter looking for all Pumps on the EPMModel folder that have "302" in their names:
result = filterEpmModel('*302*', 'PUMP')
- Creates a filter looking for all Pumps on the EPMModel folder in which temperature is greater than 15 degrees:
from epmwebapi.elementoperand import ElementOperand, Operator
from epmwebapi.literaloperand import LiteralOperand
from epmwebapi.simpleattributeoperand import SimpleAttributeOperand
filter = ElementOperand(Operator.GreaterThan, [SimpleAttributeOperand('Temperature'), LiteralOperand(15)])
result = filterEpmModel('*', 'PUMP', filter)
Returns all Data Objects that satisfy the specified filter.
Parameters
- filter: An
epmwebapi.dataobjectsfilter.DataObjectsFilterobject defining a search. Default is None. - attributes: An
epmwebapi.dataobjectattributes.DataObjectAttributesvalue indicating the attributes to read from Data Objects. Default isepmwebapi.dataobjectattributes.DataObjectAttributes.Unspecified.
Returns
An Ordered Dictionary with all Data Objects found.
Returns all instances from the specified type name.
Parameters
- typeName: A type to search for.
- discoverInstancePaths: An optional parameter indicating whether to retrieve the address space path for each instance or not. Default is
True.
Returns
A list of all instances found.
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.
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.
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.
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.
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.
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
fileNameis located. Default is None, that is, searches the current directory.
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.
Gets an object representing an Advanced event.
Parameters
- eventName: The name of an event.
Examples
The following examples show how to use the getAdvancedEvent function.
- Retrieves all events from a period of time:
ini_date = dt.datetime.now(dt.timezone.utc) - dt.timedelta(hours=1)
end_date = dt.datetime.now(dt.timezone.utc)
queryPeriod = epm.QueryPeriod(ini_date, end_date)
typeEvent = connection.getAdvancedEvent('EventName')
result = typeEvent.historyRead(queryPeriod)
- Retrieves all events in which
Tag0023is greater than 30 (Tag0023must be inserted on Payload):
ini_date = dt.datetime.now(dt.timezone.utc) - dt.timedelta(hours=1)
end_date = dt.datetime.now(dt.timezone.utc)
queryPeriod = epm.QueryPeriod(ini_date, end_date)
typeEvent = connection.getTypeEvent('PumpEventName')
where = ElementOperand(Operator.Greater, [SimpleAttributeOperand('Tag0023'), LiteralOperand(30)])
result = typeEvent.historyRead(queryPeriod, where)
Gets an object representing a TypeEvent event.
Parameters
- eventName: The name of an event.
Examples
The following examples show how to use the getTypeEvent function.
- Retrieves all events from a period of time:
ini_date = dt.datetime.now(dt.timezone.utc) - dt.timedelta(hours=1)
end_date = dt.datetime.now(dt.timezone.utc)
queryPeriod = epm.QueryPeriod(ini_date, end_date)
typeEvent = connection.getTypeEvent('EventName')
result = typeEvent.historyRead(queryPeriod)
- Retrieves all events from
Pump14in the last hour:
ini_date = dt.datetime.now(dt.timezone.utc) - dt.timedelta(hours=1)
end_date = dt.datetime.now(dt.timezone.utc)
queryPeriod = epm.QueryPeriod(ini_date, end_date)
typeEvent = connection.getTypeEvent('PumpEventName')
where = ElementOperand(Operator.Like, [SimpleAttributeOperand('SourceInstance'), LiteralOperand('Pump14')])
result = typeEvent.historyRead(queryPeriod, where)
- Retrieves all Pumps in which temperature is greater than 30 degrees (Pump's Temperature property must be inserted on Payload):
ini_date = dt.datetime.now(dt.timezone.utc) - dt.timedelta(hours=1)
end_date = dt.datetime.now(dt.timezone.utc)
queryPeriod = epm.QueryPeriod(ini_date, end_date)
typeEvent = connection.getTypeEvent('PumpEventName')
where = ElementOperand(Operator.Greater, [SimpleAttributeOperand('Temperature'), LiteralOperand(30)])
result = typeEvent.historyRead(queryPeriod, where, ['SourceInstance'])
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.DatasetConfigobject.
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.DatasetConfigobject.
Raises
- BadArgumentException: Dataset already exists.
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.DatasetConfigobject.
Raises
- BadArgumentException: Dataset already exists on the server.
Loads a Dataset file from the local computer.
Parameters
- filePath: Path of a Dataset file.
Returns
An
epmwebapi.datasetconfig.DatasetConfigobject.
Raises
- BadArgumentException: Invalid file extension.
Loads a local Dataset from the local computer.
Parameters
- fileName: Name of a Dataset.
Returns
An
epmwebapi.datasetconfig.DatasetConfigobject.
Loads a Dataset from an EPM Server.
Parameters
- name: Name of a Dataset.
Returns
An
epmwebapi.datasetconfig.DatasetConfigobject.
Returns all Datasets on the local computer.
Returns
A
List[str]with all Datasets found.
Returns all Datasets from an EPM Server.
Returns
A
List[str]with all Datasets found.
Writes an array of values, with Value, Timestamp, and Quality, for each specified variable.
Parameters
- variables: List of variables to write the specified values.
- numpyArrays: List of
numpyarrays with values to write.
Retrieves the specified property for each object in the provided list.
Parameters
- objects: A list of
EpmModelObjectinstances to query. - propertyName: The name of a property to retrieve.
Returns
An Ordered Dictionary mapping each object's ID (
string) to its correspondingEpmPropertyinstance for the specified property.
Retrieves the value of a specified property for each object in the provided list.
Parameters
- objects: A list of
EpmModelObjectinstances to query. - propertyName: The name of a property to retrieve.
Returns
An Ordered Dictionary mapping object property paths (
string) to the corresponding property values asDataValueJSON.
Gets the parent object from all provided objects.
Parameters
- objects: List of
EpmModelObjectinstances.
Returns
An Ordered Dictionary mapping object paths (
string) to their corresponding parentEpmModelObjectinstances.
Common base class for all non-exit exceptions.
Inherited Members
- builtins.Exception
- Exception
- builtins.BaseException
- with_traceback
- add_note
- args