Aether-3397: roc-umbrella add new 2.1.0 models

Change-Id: I935fad4da414c074831ae681f3c51048f88989c0
diff --git a/aether-roc-api/Chart.yaml b/aether-roc-api/Chart.yaml
index 7d4ad15..e77a1e4 100644
--- a/aether-roc-api/Chart.yaml
+++ b/aether-roc-api/Chart.yaml
@@ -7,8 +7,8 @@
 description: Aether ROC API
 kubeVersion: ">=1.15.0"
 type: application
-version: 1.7.3
-appVersion: v0.10.3
+version: 1.7.4
+appVersion: v0.10.6
 keywords:
   - aether
   - config
diff --git a/aether-roc-gui-v2/Chart.yaml b/aether-roc-gui-v2/Chart.yaml
index fa9b6f6..446e69a 100644
--- a/aether-roc-gui-v2/Chart.yaml
+++ b/aether-roc-gui-v2/Chart.yaml
@@ -7,7 +7,7 @@
 description: Aether ROC Graphical User Interface
 kubeVersion: ">=1.15.0"
 type: application
-version: 2.1.2
+version: 2.1.3
 appVersion: 2.0.0
 keywords:
   - aether
diff --git a/aether-roc-gui-v2/values.yaml b/aether-roc-gui-v2/values.yaml
index e7d2bfd..7cc91b1 100644
--- a/aether-roc-gui-v2/values.yaml
+++ b/aether-roc-gui-v2/values.yaml
@@ -10,7 +10,7 @@
 
 image:
   repository: onosproject/aether-roc-gui
-  tag: v0.9.16
+  tag: v0.9.17
   pullPolicy: IfNotPresent
   pullSecrets: []
 
diff --git a/aether-roc-umbrella/Chart.yaml b/aether-roc-umbrella/Chart.yaml
index 7ec97db..bad32a5 100644
--- a/aether-roc-umbrella/Chart.yaml
+++ b/aether-roc-umbrella/Chart.yaml
@@ -7,7 +7,7 @@
 description: Aether ROC Umbrella chart to deploy all Aether ROC
 kubeVersion: ">=1.18.0"
 type: application
-version: 2.1.6
+version: 2.1.7
 appVersion: v0.0.0
 keywords:
   - aether
@@ -20,19 +20,19 @@
   - name: onos-topo
     condition: import.onos-topo.enabled
     repository: https://charts.onosproject.org
-    version: 1.2.2
+    version: 1.3.2
   - name: onos-config
     condition: import.onos-config.enabled
     repository: https://charts.onosproject.org
-    version: 1.6.11
+    version: 1.7.4
   - name: onos-cli
     condition: import.onos-cli.enabled
     repository: https://charts.onosproject.org
-    version: 1.2.7
+    version: 1.3.2
   - name: aether-roc-api
     condition: import.aether-roc-api.enabled
     repository: "file://../aether-roc-api"
-    version: 1.7.3
+    version: 1.7.4
   - name: aether-roc-websocket
     condition: import.aether-roc-websocket.enabled
     repository: "file://../aether-roc-websocket"
@@ -44,7 +44,7 @@
   - name: aether-roc-gui-v2
     condition: import.aether-roc-gui.v2.enabled
     repository: "file://../aether-roc-gui-v2"
-    version: 2.1.2
+    version: 2.1.3
   - name: sdcore-adapter-v2
     condition: import.sdcore-adapter.v2.enabled
     repository: "file://../sdcore-adapter-v2"
diff --git a/aether-roc-umbrella/files/opa-rbac/aether-2.1.0.rego b/aether-roc-umbrella/files/opa-rbac/aether-2.1.0.rego
index d764f4a..c377dba 100644
--- a/aether-roc-umbrella/files/opa-rbac/aether-2.1.0.rego
+++ b/aether-roc-umbrella/files/opa-rbac/aether-2.1.0.rego
@@ -9,20 +9,36 @@
 }
 
 allowed[config] {
-    enterprise := enterprise_rule
+    application := application_rule
+    site := site_rule
+    template := template_rule
+    traffic_class := traffic_class_rule
     config := {
-        "connectivity_services": object.get(input, "connectivity_services", {}),
-        "enterprises": {
-            "enterprise": [
-                enterprise
-            ]
-        }
+        "application": application,
+        "site": site,
+        "template": template,
+        "traffic_class": traffic_class
     }
 }
 
-enterprise_rule[enterprise] {
-    enterprise := input.enterprises.enterprise[_]
-    ["AetherROCAdmin", enterprise.enterprise_id][_] == input.groups[i]
+application_rule[application] {
+    ["AetherROCAdmin", input.target][_] == input.groups[i]
+    application := input.application
+}
+
+site_rule[site] {
+    ["AetherROCAdmin", input.target][_] == input.groups[i]
+    site := input.site
+}
+
+template_rule[template] {
+    ["AetherROCAdmin", input.target][_] == input.groups[i]
+    template := input.template
+}
+
+traffic_class_rule[traffic_class] {
+    ["AetherROCAdmin", input.target][_] == input.groups[i]
+    traffic_class := input.traffic_class
 }
 
 can_update_enterprise = true {
diff --git a/aether-roc-umbrella/files/opa-rbac/test/aether-2.1.0-test-group-ent.json b/aether-roc-umbrella/files/opa-rbac/test/aether-2.1.0-test-group-ent.json
new file mode 100644
index 0000000..f57834f
--- /dev/null
+++ b/aether-roc-umbrella/files/opa-rbac/test/aether-2.1.0-test-group-ent.json
@@ -0,0 +1,46 @@
+{
+  "groups": [
+    "AetherROCAdmin"
+  ],
+  "target": "starbucks",
+  "site": [
+    {
+      "site_id": "site_1",
+      "display_name": "Site 1",
+      "small_cell": [
+        {
+          "small_cell_id": "sc_1_1",
+          "display_name": "SC 1_1"
+        },
+        {
+          "small_cell_id": "sc_1_2",
+          "display_name": "SC 1_2"
+        }
+      ]
+    },
+    {
+      "site_id": "site_2",
+      "display_name": "Site 2",
+      "small_cell": [
+        {
+          "small_cell_id": "sc_2_1",
+          "display_name": "SC 2_1"
+        },
+        {
+          "small_cell_id": "sc_2_2",
+          "display_name": "SC 2_2"
+        }
+      ]
+    }
+  ],
+  "template": [
+    {
+      "template_id": "template_1",
+      "display_name": "Template 1"
+    },
+    {
+      "template_id": "template_1",
+      "display_name": "Template 1"
+    }
+  ]
+}
diff --git a/aether-roc-umbrella/files/opa-rbac/test/aether-2.1.0-test-no-ent.json b/aether-roc-umbrella/files/opa-rbac/test/aether-2.1.0-test-no-ent.json
new file mode 100644
index 0000000..e3b5ca4
--- /dev/null
+++ b/aether-roc-umbrella/files/opa-rbac/test/aether-2.1.0-test-no-ent.json
@@ -0,0 +1,46 @@
+{
+  "groups": [
+    "mixedGroup"
+  ],
+  "target": "starbucks",
+  "site": [
+    {
+      "site_id": "site_1",
+      "display_name": "Site 1",
+      "small_cell": [
+        {
+          "small_cell_id": "sc_1_1",
+          "display_name": "SC 1_1"
+        },
+        {
+          "small_cell_id": "sc_1_2",
+          "display_name": "SC 1_2"
+        }
+      ]
+    },
+    {
+      "site_id": "site_2",
+      "display_name": "Site 2",
+      "small_cell": [
+        {
+          "small_cell_id": "sc_2_1",
+          "display_name": "SC 2_1"
+        },
+        {
+          "small_cell_id": "sc_2_2",
+          "display_name": "SC 2_2"
+        }
+      ]
+    }
+  ],
+  "template": [
+    {
+      "template_id": "template_1",
+      "display_name": "Template 1"
+    },
+    {
+      "template_id": "template_1",
+      "display_name": "Template 1"
+    }
+  ]
+}
diff --git a/aether-roc-umbrella/files/opa-rbac/test/aether-2.1.0-test-single-ent.json b/aether-roc-umbrella/files/opa-rbac/test/aether-2.1.0-test-single-ent.json
new file mode 100644
index 0000000..940f96c
--- /dev/null
+++ b/aether-roc-umbrella/files/opa-rbac/test/aether-2.1.0-test-single-ent.json
@@ -0,0 +1,46 @@
+{
+  "groups": [
+    "starbucks"
+  ],
+  "target": "starbucks",
+  "site": [
+    {
+      "site_id": "site_1",
+      "display_name": "Site 1",
+      "small_cell": [
+        {
+          "small_cell_id": "sc_1_1",
+          "display_name": "SC 1_1"
+        },
+        {
+          "small_cell_id": "sc_1_2",
+          "display_name": "SC 1_2"
+        }
+      ]
+    },
+    {
+      "site_id": "site_2",
+      "display_name": "Site 2",
+      "small_cell": [
+        {
+          "small_cell_id": "sc_2_1",
+          "display_name": "SC 2_1"
+        },
+        {
+          "small_cell_id": "sc_2_2",
+          "display_name": "SC 2_2"
+        }
+      ]
+    }
+  ],
+  "template": [
+    {
+      "template_id": "template_1",
+      "display_name": "Template 1"
+    },
+    {
+      "template_id": "template_1",
+      "display_name": "Template 1"
+    }
+  ]
+}
diff --git a/aether-roc-umbrella/files/opa-rbac/test/out/aether-2.1.0-test-group-ent.out b/aether-roc-umbrella/files/opa-rbac/test/out/aether-2.1.0-test-group-ent.out
new file mode 100644
index 0000000..4a617e4
--- /dev/null
+++ b/aether-roc-umbrella/files/opa-rbac/test/out/aether-2.1.0-test-group-ent.out
@@ -0,0 +1,50 @@
+[
+  {
+    "application": [],
+    "site": [
+      [
+        {
+          "display_name": "Site 1",
+          "site_id": "site_1",
+          "small_cell": [
+            {
+              "display_name": "SC 1_1",
+              "small_cell_id": "sc_1_1"
+            },
+            {
+              "display_name": "SC 1_2",
+              "small_cell_id": "sc_1_2"
+            }
+          ]
+        },
+        {
+          "display_name": "Site 2",
+          "site_id": "site_2",
+          "small_cell": [
+            {
+              "display_name": "SC 2_1",
+              "small_cell_id": "sc_2_1"
+            },
+            {
+              "display_name": "SC 2_2",
+              "small_cell_id": "sc_2_2"
+            }
+          ]
+        }
+      ]
+    ],
+    "template": [
+      [
+        {
+          "display_name": "Template 1",
+          "template_id": "template_1"
+        },
+        {
+          "display_name": "Template 1",
+          "template_id": "template_1"
+        }
+      ]
+    ],
+    "traffic_class": []
+  }
+]
\ No newline at end of file
diff --git a/aether-roc-umbrella/files/opa-rbac/test/out/aether-2.1.0-test-no-ent.out b/aether-roc-umbrella/files/opa-rbac/test/out/aether-2.1.0-test-no-ent.out
new file mode 100644
index 0000000..15e32dd
--- /dev/null
+++ b/aether-roc-umbrella/files/opa-rbac/test/out/aether-2.1.0-test-no-ent.out
@@ -0,0 +1,8 @@
+[
+  {
+    "application": [],
+    "site": [],
+    "template": [],
+    "traffic_class": []
+  }
+]
\ No newline at end of file
diff --git a/aether-roc-umbrella/files/opa-rbac/test/out/aether-2.1.0-test-single-ent.out b/aether-roc-umbrella/files/opa-rbac/test/out/aether-2.1.0-test-single-ent.out
new file mode 100644
index 0000000..4a617e4
--- /dev/null
+++ b/aether-roc-umbrella/files/opa-rbac/test/out/aether-2.1.0-test-single-ent.out
@@ -0,0 +1,50 @@
+[
+  {
+    "application": [],
+    "site": [
+      [
+        {
+          "display_name": "Site 1",
+          "site_id": "site_1",
+          "small_cell": [
+            {
+              "display_name": "SC 1_1",
+              "small_cell_id": "sc_1_1"
+            },
+            {
+              "display_name": "SC 1_2",
+              "small_cell_id": "sc_1_2"
+            }
+          ]
+        },
+        {
+          "display_name": "Site 2",
+          "site_id": "site_2",
+          "small_cell": [
+            {
+              "display_name": "SC 2_1",
+              "small_cell_id": "sc_2_1"
+            },
+            {
+              "display_name": "SC 2_2",
+              "small_cell_id": "sc_2_2"
+            }
+          ]
+        }
+      ]
+    ],
+    "template": [
+      [
+        {
+          "display_name": "Template 1",
+          "template_id": "template_1"
+        },
+        {
+          "display_name": "Template 1",
+          "template_id": "template_1"
+        }
+      ]
+    ],
+    "traffic_class": []
+  }
+]
\ No newline at end of file
diff --git a/aether-roc-umbrella/templates/topo.yaml b/aether-roc-umbrella/templates/topo.yaml
index 4185308..2a187c7 100644
--- a/aether-roc-umbrella/templates/topo.yaml
+++ b/aether-roc-umbrella/templates/topo.yaml
@@ -33,15 +33,14 @@
     onos.topo.Asset:
       name: 5G Core
     onos.topo.MastershipState: {}
-
 ---
 # The 4G/5G v2.1.0 sdcore-adapter
 apiVersion: topo.onosproject.org/v1beta1
 kind: Entity
 metadata:
-  name: connectivity-service-v2-1
+  name: starbucks
 spec:
-  uri: connectivity-service-v2-1
+  uri: starbucks
   kind:
     name: aether
   aspects:
@@ -55,5 +54,51 @@
     onos.topo.TLSOptions:
       insecure: true
     onos.topo.Asset:
-      name: 5G Core
+      name: Starbucks Enterprise
+    onos.topo.MastershipState: {}
+---
+# The 4G/5G v2.1.0 sdcore-adapter
+apiVersion: topo.onosproject.org/v1beta1
+kind: Entity
+metadata:
+  name: acme
+spec:
+  uri: acme
+  kind:
+    name: aether
+  aspects:
+    onos.topo.Configurable:
+      address: sdcore-adapter-v2-1:5150
+      version: 2.1.x
+      type: aether
+    onos.topo.Location:
+      lat: 52.5150
+      lng: 13.3885
+    onos.topo.TLSOptions:
+      insecure: true
+    onos.topo.Asset:
+      name: ACME Enterprise
+    onos.topo.MastershipState: {}
+---
+# The 4G/5G v2.1.0 sdcore-adapter
+apiVersion: topo.onosproject.org/v1beta1
+kind: Entity
+metadata:
+  name: defaultent
+spec:
+  uri: defaultent
+  kind:
+    name: aether
+  aspects:
+    onos.topo.Configurable:
+      address: sdcore-adapter-v2-1:5150
+      version: 2.1.x
+      type: aether
+    onos.topo.Location:
+      lat: 52.5150
+      lng: 13.3885
+    onos.topo.TLSOptions:
+      insecure: true
+    onos.topo.Asset:
+      name: Default Enterprise
     onos.topo.MastershipState: {}
diff --git a/aether-roc-umbrella/values.yaml b/aether-roc-umbrella/values.yaml
index cefc205..9831f84 100644
--- a/aether-roc-umbrella/values.yaml
+++ b/aether-roc-umbrella/values.yaml
@@ -365,7 +365,7 @@
       endpoint: localhost
       port: 5152
     - name: aether-2-1
-      image: onosproject/aether-2.1.x:2.1.1-aether-2.1.x
+      image: onosproject/aether-2.1.x:2.1.3-aether-2.1.x
       endpoint: localhost
       port: 5153