Purging Database Tables and Modifying Retention > Configure Data Retention for SDK User-Defined Objects
  
Version 10.2.00
Configure Data Retention for SDK User-Defined Objects
Because data collection continuously adds data to the database, management of the database size becomes an essential task. For objects created via the SDK, a data retention period can be defined along with the database schema, to align with your StorageConsole reporting requirements. Data retention (purging rules) described in this section apply only to user-defined objects defined by an SDK project; API and APTARE database objects are handled by system parameters, as described in Configure Data Retention Periods.
Purging rules (data retention periods) are specific to an object, such as array disk performance, and they are used to maintain corresponding database tables. These rules are configured at the beginning of the object’s definition in the schema template json file. See also, Example of a Purging Rule for an SDK User-Defined Object.
Best Practice: Configure retention days for objects that accumulate historical data over time, such as array performance. Other objects should not have data retention days.
Refer to the following sections to understand how purging rules are defined and used.
SDK Data-Purging Parameter
Configure Data Purging for SDK User-Defined Database Objects
SDK Data-Purging Parameter
The following parameter can be configured to define a data purging rule (data retention period).
Note: The DataRetentionDays parameter controls purging. If a value is not specified, the object is not eligible for purging.
DataRetentionDays: This optional component defines the retention period—that is, the number of days the data is retained, after which it is purged. The value configured here can be modified later, if you determine that you need the data for a longer or shorter period of time.
Configure Data Purging for SDK User-Defined Database Objects
Note: This section covers the procedure for modifying data retention periods for systems that are collected by Data Collectors deployed via the SDK. For systems collected by traditional Data Collectors, use the procedure described in: Configure Data Retention Periods.
To enable purging for a user-defined object, add a DataRetentionDays line to the schema definition, as illustrated in Example of a Purging Rule for an SDK User-Defined Object.
1. Navigate to the schema template {product}_schema.json located under %APTARE_HOME%/mbs/conf/subsystem/{vendor}/{product}/conf
For example: %APTARE_HOME%/mbs/conf/subsystem/ACMECorp/ACMEBlockStorage/conf/new_schema.json
2. Edit{product}_schema.json to list the required data models for the Connector to persist data.
3. Refer to Example of a Purging Rule for an SDK User-Defined Object for the correct format and syntax when adding the dataRetentionDays line to the schema definition.
Example of a Purging Rule for an SDK User-Defined Object
{
"name": "disk_perf",
"comment": "Used to persist performance data for the array's disks.",
"dataRetentionDays": 50, -- (Optional) Number of days, after which data needs to be purged.
"attributes": [
{
"name": "aps_pdev.aps_storage_array#object_id",
"required": "true",
"type": "string",
"comment": ""
},
{
"name": "aps_pdev.object_id",
"required": "true",
"type": "string",
"comment": ""
},
{
"name": "percentBusy",
"required": "false",
"type": "float",
"comment": "The percent of time that the disk is busy serving IOs."
},
{
"name": "avgQueueDepth",
"required": "false",
"type": "float",
"comment": "Calculated value: Accumulated queue depth/total SCSI command per sec."
}
]
}