Uploaded image for project: 'Policy Framework'
  1. Policy Framework
  2. POLICY-654

Policy Search based on Matching Attributes in TOSCA models

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: High High
    • Beijing Release
    • None
    • None

      The policy system is expected to return a policy if the values of matching attributes in a query are the subset of the values captures in a policy. For example, consider the following policy example with serviceType, geoRegion, networkType, and resourceInstanceType matching attributes and getConfig queries. In this scenario, the policy system should only return the hpaNumaPolicy for query 1.

       

      Policy example:

      {

          "service": "hpaNumaPolicy",

          "policyName": "oofBeijing.hpaNumaPolicy_vGMuxInfra",

          "description": "Hyper NUMA policy for vGMuxInfra",

          "templateVersion": "0.0.1",

          "version": "oofBeijing",

          "priority": "3",

          "riskType": "test",

          "riskLevel": "2",

          "guard": "False",

          "content": {

              "numaProperties": {

                  "version": { "values": 1.0, "operator": "="},

                  "hwArch": { "values": "*", "operator": "="},

                  "numaNodes": { "values": 2, "operator": "="},

                  "complexAttributes": [

                      {

                          "numaCpu": { "values": [0, 1], "operator": "="},

                          "numaMem": { "values": 2, "operator": "=", "unit": "GB"},

                      },

                      {

                          "numaCpu": { "values": [2, 3, 4, 5], "operator": "="},

                          "numaMem": { "values": 4, "operator": "=", "unit": "GB"},     

                      }

                  ]

              },

              "identity": "numa_vGMuxInfra",

              "policyScope": {

                  "serviceType": ["vCPE"],

                  "geoRegion": ["US", "INTERNATIONAL"],

                  "networkType": ["ip"],

                  "resourceInstanceType": ["vGMuxInfra"]

              },

              "type": "hpaNumaPolicy",

              "resourceInstanceType": ["vGMuxInfra"]

          }

      }

       

      getConfig query 1:

       

      {

        "policyName": "OOF.*",

        "configAttributes": {

          "serviceType": ["vCPE"],

          "geoRegion": ["US"]

        }

      }

       

       

      getConfig query 2:

       

      {

        "policyName": "OOF.*",

        "configAttributes": {

          "serviceType": ["vCPE"],

          "geoRegion": ["IND"]

        }

      }

       

      getConfig query 3:

       

      {

        "policyName": "OOF.*",

        "configAttributes": {

          "serviceType": ["vCPE", “VoLTE”],

          "geoRegion": ["US"]

        }

      }

       

      OOF/SNIRO models the scope of a policy using a set of matching attributes, and these attributes can be modeled as a list of tags/strings. So, matching attributes in both policy and getConfig query are of type list. I have not yet seen use cases that require to model matching attributes as of type string or map.

            mmokry mmokry
            ankit7453 ankit7453
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: