Define a tailored Scoper for each CDM

Problem description

Storage cluster data model was introduced in Pike cycle. Since the model is different from compute data model, current single CDM scoper does not work for the model.

Use Cases

As a Watcher user, I want to restrict scope of storage cluster data model.

Proposed change

  • Add _audit_scope instance attribute to the BaseClusterDataModelCollector and initialize when instantiated.

  • Remove audit_scope_handler from the current BaseStrategy and move it within the BaseClusterDataModelCollector.

  • Add audit_scope argument to CollectorManager’s get_cluster_model_collector method.

  • Change compute_model method to use Collector’s audit_scope_handler.

  • Change original DefaultScope.

    • get_scoped_model simply returns cluster_model.

    • For representing multi data model for JSON shema, we change DEFAULT_SCHEMA as the following:

          "$schema": "",
          "type": "object",
          "properties": {
              "compute": {
                  # current JSON schema moved to NovaClusterDataModelCollector
                  # retrieved from NovaClusterDataModelCollector
              "storage": {
                  # retrieved from CinderClusterDatamodelCollector

      Properties are dynamically retrieved from collector plugins.

    • Update validate method in AuditTemplatePostType in accordance with the above change.

  • Rename the DefaultScope as ComputeScope and override the audit_scope_handler property in the Compute Collector.

  • Change audit template help message in python-watcherclient.



Data model impact


REST API impact

Scope JSON schema definition for the audit template POST data from the request body will be changed in accordance with DEFAULT_SCHEMA change.

Security impact


Notifications impact


Other end user impact

End user defines audit scope in each audit template by specifying yaml or json file with –scope option. The file format will be changed according to JSON schema change.

Performance Impact


Other deployer impact


Developer impact




Primary assignee:


Other contributors:


Work Items

  • Add or remove audit_scope and audit_scope_handler from/to base classes.

  • Change original DefaultScope.

  • Change Compute Collector to use ComputeScope instead of DefaultScope.

  • Change python-watcherclient.




Unit test will be updated.

Documentation Impact

None, but it is preferable to adding more.