Cleaning up the Siebel File System
This topic describes how to clean up the Siebel File System by removing orphan records using an API. Orphan records are those that remain if a user deletes a parent record in the Siebel CRM application that has associated child records. The child records are not deleted from the Siebel File System with the parent record and so you must remove them by executing this API.
This API builds on the functionalities provided by sfscleanup service available with Siebel CRM installations and described in details in Siebel CRM System Administration Guide in Siebel Bookshelf. Executing the API will process records for every file in the file attachment directories (the att subdirectories) of the specified Siebel File System directories and performs one of several available operations to each record and file, depending on the file type and on the parameters that you set. For descriptions of the run-time parameters that you can set, refer to the payload parameters. The API call will trigger the file system cleanup job and after the clean up is done, reports will be generated.
Execute the clean up by calling POST API as follows:
POST endpoint:
https://<CM_Instance_IP>:16690/scm/api/v1.0/environment/{ENV_ID}/sfscleanup
Sample payload:
{
"discarded_files_path": "/some/path",
"remove_old_revisions": true,
"generate_report_only": true,
"append_att_directory_path": true,
"remove_non_siebel_files": true,
"query_by_attachment_file": true,
"no_of_file_id_per_query": "10",
"use_or_clause_for_file_id": true,
"run_for_specified_minutes": "10",
"file_system_name": "namespace-siebfs0"
}
Payload Parameter | Section | Definition |
---|---|---|
generate_report_only | Top Level | (required) If set to false, the service cleans up the specified file system else only generates a report without any cleanup actions. |
remove_old_revisions | Top Level | Determines whether old versions of file attachments are to be removed. To remove old versions, set this value to true. |
move_discarded_files | Top Level | Set this value to the move the discarded files. Files can be found at
the location inside the Siebel Cloud Manager container -
/home/opc/siebel/{ENV_ID}/{namespace}-siebfs{index}/{namespace}/SFSUTILS/SFSCLEANUP/discarded_files/{RUN_ID} |
append_att_directory_path | Top Level | Set this value to true If you want the service to automatically append att to each directory. |
remove_non_siebel_files | Top Level | Set this value to remove garbage files or non-Siebel files. |
query_by_attachment_file | Top Level | Set this value to perform query by attachment files records. |
no_of_file_id_per_query | Top Level | Set this value to the number of file attachment records to query. |
use_or_clause_for_file_id | Top Level | Set this value when the service needs to use an OR clause to constrain the query row IDs, like this: (ROW_ID = 'Id1' OR ROW_ID = 'Id2' OR ...) |
run_for_specified_minutes | Top Level | Set this value to the number of minutes to run the query. |
file_system_name | Top Level | (required) Name of the file system in the format of
{namespace}-siebfs{index}. Mounted file systems can be found in the
environment directory inside the SCM container -
/home/opc/siebel/{env_id}/ . |
Note that files in Siebel file system that are less than one hour old may not cleaned up.
For every cleanup job triggered via the POST API, a unique 6 character identifier "RUN_ID" will be generated through which the status can be checked. To get the details of the current job, execute a GET method API call on the following endpoint:
https://<CM_Instance_IP>:16690/scm/api/v1.0/environment/{ENV_ID}/sfscleanup/{RUN_ID}
After successful completion of the cleanup job, the reports of the run can be verified at the location inside the SCM container:
/home/opc/siebel/{ENV_ID}/{namespace}-siebfs{fs-index}/{NAMESPACE}/SFSUTILS/SFSCLEANUP
The report name can be fetched from the GET method response in the key - report_name. The
report name follows a naming convention of -
sfs_cleanup_{unix_timestamp}.txt
.
An overall report containing historical statistics is also generated or updated at the
location - /home/opc/siebel/{ENV_ID}/sfscleanup/overall_stats.txt
.