Migrates POL code from MON repo

Adds support for VDU metric autoscaling
Modifies env var names

Signed-off-by: Benjamin Diaz <bdiaz@whitestack.com>
Change-Id: If9587e1b8eacaf6fb297306050a97d33c8a63ead
diff --git a/osm_policy_module/tests/examples/cirros_vdu_scaling_nsd.yaml b/osm_policy_module/tests/examples/cirros_vdu_scaling_nsd.yaml
new file mode 100644
index 0000000..a9e0abd
--- /dev/null
+++ b/osm_policy_module/tests/examples/cirros_vdu_scaling_nsd.yaml
@@ -0,0 +1,42 @@
+nsd:nsd-catalog:
+    nsd:
+    -   id: cirros_vdu_scaling_ns
+        name: cirros_vdu_scaling_ns
+        short-name: cirros_vdu_scaling_ns
+        description: Simple NS example with a cirros_vdu_scaling_vnf
+        vendor: OSM
+        version: '1.0'
+
+        # Place the logo as png in icons directory and provide the name here
+        logo: osm.png
+
+        # Specify the VNFDs that are part of this NSD
+        constituent-vnfd:
+            # The member-vnf-index needs to be unique, starting from 1
+            # vnfd-id-ref is the id of the VNFD
+            # Multiple constituent VNFDs can be specified
+        -   member-vnf-index: '1'
+            vnfd-id-ref: cirros_vdu_scaling_vnf
+        -   member-vnf-index: '2'
+            vnfd-id-ref: cirros_vdu_scaling_vnf
+        vld:
+        # Networks for the VNFs
+            -   id: cirros_nsd_vld1
+                name: cirros_nsd_vld1
+                type: ELAN
+                mgmt-network: 'true'
+                # vim-network-name: <update>
+                # provider-network:
+                #     segmentation_id: <update>
+                vnfd-connection-point-ref:
+                # Specify the constituent VNFs
+                # member-vnf-index-ref - entry from constituent vnf
+                # vnfd-id-ref - VNFD id
+                # vnfd-connection-point-ref - connection point name in the VNFD
+                -   member-vnf-index-ref: 1
+                    vnfd-id-ref: cirros_vdu_scaling_vnf
+                    # NOTE: Validate the entry below
+                    vnfd-connection-point-ref: eth0
+                -   member-vnf-index-ref: 2
+                    vnfd-id-ref: cirros_vdu_scaling_vnf
+                    vnfd-connection-point-ref: eth0
\ No newline at end of file
diff --git a/osm_policy_module/tests/examples/cirros_vdu_scaling_vnfd.yaml b/osm_policy_module/tests/examples/cirros_vdu_scaling_vnfd.yaml
new file mode 100644
index 0000000..dc599f5
--- /dev/null
+++ b/osm_policy_module/tests/examples/cirros_vdu_scaling_vnfd.yaml
@@ -0,0 +1,74 @@
+vnfd:vnfd-catalog:
+    vnfd:
+    -   id: cirros_vdu_scaling_vnf
+        name: cirros_vdu_scaling_vnf
+        short-name: cirros_vdu_scaling_vnf
+        description: Simple VNF example with a cirros and a scaling group descriptor
+        vendor: OSM
+        version: '1.0'
+        # Place the logo as png in icons directory and provide the name here
+        logo: cirros-64.png
+        # Management interface
+        mgmt-interface:
+            cp: eth0
+        # Atleast one VDU need to be specified
+        vdu:
+        -   id: cirros_vnfd-VM
+            name: cirros_vnfd-VM
+            description: cirros_vnfd-VM
+            count: 1
+
+            # Flavour of the VM to be instantiated for the VDU
+            # flavor below can fit into m1.micro
+            vm-flavor:
+                vcpu-count: 1
+                memory-mb: 256
+                storage-gb: 2
+            # Image/checksum or image including the full path
+            image: 'cirros034'
+            #checksum:
+            interface:
+            # Specify the external interfaces
+            # There can be multiple interfaces defined
+            -   name: eth0
+                type: EXTERNAL
+                virtual-interface:
+                    type: VIRTIO
+                    bandwidth: '0'
+                    vpci: 0000:00:0a.0
+                external-connection-point-ref: eth0
+            monitoring-param:
+            -   id: "cirros_vnfd-VM_memory_util"
+                nfvi-metric: "average_memory_utilization" # The associated NFVI metric to be monitored. Id of the metric
+                #interface-name-ref: reference to interface name, required for some metrics
+        connection-point:
+        -   name: eth0
+            type: VPORT
+        scaling-group-descriptor:
+        -   name: "scale_cirros_vnfd-VM"
+            min-instance-count: 1
+            max-instance-count: 10
+            scaling-policy:
+            -   name: "auto_memory_util_above_threshold"
+                scaling-type: "automatic"
+                threshold-time: 10
+                cooldown-time: 60
+                scaling-criteria:
+                -   name: "group1_memory_util_above_threshold"
+                    scale-in-threshold: 20
+                    scale-in-relational-operation: "LT"
+                    scale-out-threshold: 80
+                    scale-out-relational-operation: "GT"
+                    vnf-monitoring-param-ref: "cirros_vnf_memory_util"
+            vdu:
+            -   vdu-id-ref: cirros_vnfd-VM
+                count: 1
+            # scaling-config-action:            # Para utilizar charms
+            # -   trigger: post-scale-out
+            #     vnf-config-primitive-name-ref:
+        monitoring-param:
+        -   id: "cirros_vnf_memory_util"
+            name: "cirros_vnf_memory_util"
+            aggregation-type: AVERAGE
+            vdu-ref: "cirros_vnfd-VM"
+            vdu-monitoring-param-ref: "cirros_vnfd-VM_memory_util"
\ No newline at end of file
diff --git a/osm_policy_module/tests/examples/instantiated.json b/osm_policy_module/tests/examples/instantiated.json
new file mode 100644
index 0000000..88b610d
--- /dev/null
+++ b/osm_policy_module/tests/examples/instantiated.json
@@ -0,0 +1,4 @@
+{
+  "nsr_id": "test_nsr_id",
+  "nslcmop_id": "test_nslcmop_id"
+}
\ No newline at end of file