6. Steps to Add a new asset to the Snapshot data

The scenario for this case describes the addition of a new asset to the snapshot data. This is just an overview of the steps that need to happen. To know how to set the different attributes, make sure to check the implementation of existing snapshot classes and follow it.

  1. create the new class AssetNameAssetSnapshot(BaseAssetSnaphot) in the category_file where the asset belong(path: pearlcertification/asset_inventory/snapshots/category_file.py)

  2. set the model.

  3. set fields: the fields that need to be included in the exported JSON.

  4. if one of the fields has a different label in the exported data than the existing label in the system, we need to update the labels dict : {‘field_name’ : ‘new_label’}

  5. add the new created class to the snapshot_model_classes list in the CategorySnapshot class