Delete
is used to delete the user specified object or data from the active or specified landmark database. It accepts a set of input parameters that define the Type and data for performing the delete operation. It is available only in synchronous mode.
The following is an example for using Delete
:
getlist_output = landmark_handle.call('GetList', {'Type': u'Landmark', 'Filter': {'LandmarkName': u'land1'}})
The following table summarizes the specification of Delete
:
Interface | IDataSource |
Description | Deletes an object from the active or specified landmark database. |
Response Model | Synchronous |
Pre-condition | IDataSource interface is loaded. |
Post-condition | The default or active database opened for reading landmarks and categories. A default database is created, if it does not exist and is set as active.
A Landmark/category is deleted from an active or specified database. Deleting a database, deletes it from terminal. |
Input Parameters
Input parameter specifies the Type Landmark/category to delete and details of the particular Type.
|
Output Parameters
Output parameters contain ErrorCode
, and ErrorMessage
if the operation fails.
|
Errors
The following table lists the error codes and their values:
|
Error Messages
The following table lists the error messages and their description:
|
Example
The following sample code illustrates how to delete an object from the active / specified landmark database:
import scriptext landmark_handle = scriptext.load('Service.Landmarks', 'IDataSource') try: getlist_output = landmark_handle.call('GetList', {'Type': u'Landmark', 'Filter': {'LandmarkName': u'land1'}}) getlist_error = getlist_output['ErrorCode'] if getlist_error != 0: print "GetList error" else: retval = getlist_output['ReturnValue'] id = retval['id'] delete_output = landmark_handle.call('Delete',{'Type': u'Landmark', 'Data': {'id': unicode(id)}}) delete_error = delete_output['ErrorCode'] if delete_error != 0: print "Error in deleting landmark" else: print "Landmark deleted" except scriptext.ScriptextError, err: print "Error performing the operation : ", err
See About this document... for information on suggesting changes.