<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def listPrimaryDatasets(self, primary_ds_name="", primary_ds_type=""):
 """ API to list primary datasets :param primary_ds_type: List primary datasets with primary dataset type (Optional) :type primary_ds_type: str :param primary_ds_name: List that primary dataset (Optional) :type primary_ds_name: str :returns: List of dictionaries containing the following keys (primary_ds_type_id, data_type) :rtype: list of dicts :returns: List of dictionaries containing the following keys (create_by, primary_ds_type, primary_ds_id, primary_ds_name, creation_date) :rtype: list of dicts """

        primary_ds_name = primary_ds_name.replace("*", "%")
        primary_ds_type = primary_ds_type.replace("*", "%")
        try:
            return self.dbsPrimaryDataset.listPrimaryDatasets(primary_ds_name, primary_ds_type)
        except dbsException as de:
            dbsExceptionHandler(de.eCode, de.message, self.logger.exception, de.message)
        except Exception as ex:
            sError = "DBSReaderModel/listPrimaryDatasets. %s\n Exception trace: \n %s." \
                    % (ex, traceback.format_exc() )
            dbsExceptionHandler('dbsException-server-error',  dbsExceptionCode['dbsException-server-error'], self.logger.exception, sError)