6.7.3 Delete

Delete is used to delete a specified event from the event Log.

The following is an example for using Delete:

logging_handle.call('Delete', {'Type': u'Log', 'Data': {'id': log_id,}})

The following table summarizes the specification of Delete:

Interface IDataSource
Description Deletes events in the event log.
Response Model Synchronous and asynchronous
Pre-condition IDataSource interface is loaded.
Post-condition Nil

Input Parameters

Input parameter specifies the Type and its Id for performing the delete operation.

Table 6.154: Input parameters for Delete
Name Type Range Description
Type unicode string Log Specifies the Content Type.
Data map
Id: unicode string
NA Deletes the event specified by the Id.


Output Parameters

Output contains ErrorCode and ErrorMessage, if the operation fails.

Table 6.155: Output parameters for Delete
Name Type Range Description
ErrorMessage string NA Error Description in Engineering English.
ErrorCode 32 bit int NA Contains the SAPI specific error code when the operation fails.


Errors

The following table lists the error codes and their values:

Table 6.156: Error codes
Error code value Description
1000 Invalid service argument
1002 Bad argument type
1003 Missing argument
1004 Service not supported
1012 Item not found


Error Messages

The following table lists the error messages and their description:

Table 6.157: Error messages
Error messages Description
Logging:Delete:TypeInvalid Invalid Type is passed to contenttype parameter.
Logging:Delete:TypeMissing Content Type missing in the inputparam list.
Logging:Delete:DataInvalid Invalid Type is passed to Data parameter.
Logging:Delete:DataMissing Data map missing in inputparam list.
Logging:Delete:idInvalid Invalid Type is passed to Id parameter.
Logging:Delete:idMissing Id field is missing in the Data map.


Example

The following sample code illustrates how to delete an entry from the log:

import scriptext

logging_handle = scriptext.load('Service.Logging','IDataSource')
logging_handle.call('Delete', {'Type': u'Log', 'Data': {'id': log_id,}})

See About this document... for information on suggesting changes.