summaryrefslogtreecommitdiffstats
path: root/tutorials/tutorial-enforcement/src/test
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2020-10-26 09:59:09 -0400
committerPamela Dragosh <pdragosh@research.att.com>2020-10-27 11:49:04 -0400
commitf0bd7f421948415b1c2f05cb39674f57f72218e0 (patch)
treebc63b71ad9a58f378072f98b50e4bce7d59c9a1f /tutorials/tutorial-enforcement/src/test
parent90b2d30c2546c1e79bb716fb97e479c076999693 (diff)
Submit Policy Tutorials
So app developers can more easily download and test client code etc. Issue-ID: POLICY-2876 Change-Id: I360cd0d637150cd0c2353c6284803f4438e96556 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'tutorials/tutorial-enforcement/src/test')
-rw-r--r--tutorials/tutorial-enforcement/src/test/resources/MyAnalytic.yaml16
-rw-r--r--tutorials/tutorial-enforcement/src/test/resources/MyPolicies.yaml14
-rw-r--r--tutorials/tutorial-enforcement/src/test/resources/postman/Policy Enforcement Tutorial.postman_collection.json597
3 files changed, 627 insertions, 0 deletions
diff --git a/tutorials/tutorial-enforcement/src/test/resources/MyAnalytic.yaml b/tutorials/tutorial-enforcement/src/test/resources/MyAnalytic.yaml
new file mode 100644
index 00000000..23cf3c60
--- /dev/null
+++ b/tutorials/tutorial-enforcement/src/test/resources/MyAnalytic.yaml
@@ -0,0 +1,16 @@
+tosca_definitions_version: tosca_simple_yaml_1_1_0
+policy_types:
+ onap.policies.Monitoring:
+ derived_from: tosca.policies.Root
+ version: 1.0.0
+ name: onap.policies.Monitoring
+ description: a base policy type for all policies that govern monitoring provisioning
+ onap.policies.monitoring.MyAnalytic:
+ derived_from: onap.policies.Monitoring
+ type_version: 1.0.0
+ version: 1.0.0
+ description: Example analytic
+ properties:
+ myProperty:
+ type: string
+ required: true \ No newline at end of file
diff --git a/tutorials/tutorial-enforcement/src/test/resources/MyPolicies.yaml b/tutorials/tutorial-enforcement/src/test/resources/MyPolicies.yaml
new file mode 100644
index 00000000..00c5ef91
--- /dev/null
+++ b/tutorials/tutorial-enforcement/src/test/resources/MyPolicies.yaml
@@ -0,0 +1,14 @@
+tosca_definitions_version: tosca_simple_yaml_1_1_0
+topology_template:
+ policies:
+ -
+ policy1:
+ type: onap.policies.monitoring.MyAnalytic
+ type_version: 1.0.0
+ version: 1.0.0
+ name: policy1
+ metadata:
+ policy-id: policy1
+ policy-version: 1.0.0
+ properties:
+ myProperty: value1 \ No newline at end of file
diff --git a/tutorials/tutorial-enforcement/src/test/resources/postman/Policy Enforcement Tutorial.postman_collection.json b/tutorials/tutorial-enforcement/src/test/resources/postman/Policy Enforcement Tutorial.postman_collection.json
new file mode 100644
index 00000000..85de39be
--- /dev/null
+++ b/tutorials/tutorial-enforcement/src/test/resources/postman/Policy Enforcement Tutorial.postman_collection.json
@@ -0,0 +1,597 @@
+{
+ "info": {
+ "_postman_id": "f00b4c77-8f4b-423f-a132-2bcdd4adf598",
+ "name": "Policy Enforcement Tutorial",
+ "description": "Collection of Postman API calls to support the Policy Enforcement Tutorial",
+ "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
+ },
+ "item": [
+ {
+ "name": "Api Healthcheck",
+ "request": {
+ "auth": {
+ "type": "basic",
+ "basic": [
+ {
+ "key": "password",
+ "value": "zb!XztG34",
+ "type": "string"
+ },
+ {
+ "key": "username",
+ "value": "healthcheck",
+ "type": "string"
+ }
+ ]
+ },
+ "method": "GET",
+ "header": [
+ {
+ "key": "Content-Type",
+ "type": "text",
+ "value": "application/json"
+ },
+ {
+ "key": "Accept",
+ "type": "text",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "https://0.0.0.0:6767/policy/api/v1/healthcheck",
+ "protocol": "https",
+ "host": [
+ "0",
+ "0",
+ "0",
+ "0"
+ ],
+ "port": "6767",
+ "path": [
+ "policy",
+ "api",
+ "v1",
+ "healthcheck"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "Create MyAnalytic Policy Type",
+ "request": {
+ "auth": {
+ "type": "basic",
+ "basic": [
+ {
+ "key": "password",
+ "value": "zb!XztG34",
+ "type": "string"
+ },
+ {
+ "key": "username",
+ "value": "healthcheck",
+ "type": "string"
+ }
+ ]
+ },
+ "method": "POST",
+ "header": [
+ {
+ "key": "Accept",
+ "type": "text",
+ "value": "application/yaml"
+ },
+ {
+ "key": "Content-Type",
+ "type": "text",
+ "value": "application/yaml"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "tosca_definitions_version: tosca_simple_yaml_1_1_0\npolicy_types:\n onap.policies.Monitoring:\n derived_from: tosca.policies.Root\n version: 1.0.0\n name: onap.policies.Monitoring\n description: a base policy type for all policies that govern monitoring provisioning\n onap.policies.monitoring.MyAnalytic:\n derived_from: onap.policies.Monitoring\n type_version: 1.0.0\n version: 1.0.0\n description: Example analytic\n properties:\n myProperty:\n type: string\n required: true"
+ },
+ "url": {
+ "raw": "https://0.0.0.0:6767/policy/api/v1/policytypes",
+ "protocol": "https",
+ "host": [
+ "0",
+ "0",
+ "0",
+ "0"
+ ],
+ "port": "6767",
+ "path": [
+ "policy",
+ "api",
+ "v1",
+ "policytypes"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "Create policy1 MyAnalytic Policy",
+ "request": {
+ "auth": {
+ "type": "basic",
+ "basic": [
+ {
+ "key": "password",
+ "value": "zb!XztG34",
+ "type": "string"
+ },
+ {
+ "key": "username",
+ "value": "healthcheck",
+ "type": "string"
+ }
+ ]
+ },
+ "method": "POST",
+ "header": [
+ {
+ "key": "Accept",
+ "type": "text",
+ "value": "application/yaml"
+ },
+ {
+ "key": "Content-Type",
+ "type": "text",
+ "value": "application/yaml"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "tosca_definitions_version: tosca_simple_yaml_1_1_0\ntopology_template:\n policies:\n -\n policy1:\n type: onap.policies.monitoring.MyAnalytic\n type_version: 1.0.0\n version: 1.0.0\n name: policy1\n metadata:\n policy-id: policy1\n policy-version: 1.0.0\n properties:\n myProperty: value1\n "
+ },
+ "url": {
+ "raw": "https://0.0.0.0:6767/policy/api/v1/policytypes/onap.policies.monitoring.MyAnalytic/versions/1.0.0/policies",
+ "protocol": "https",
+ "host": [
+ "0",
+ "0",
+ "0",
+ "0"
+ ],
+ "port": "6767",
+ "path": [
+ "policy",
+ "api",
+ "v1",
+ "policytypes",
+ "onap.policies.monitoring.MyAnalytic",
+ "versions",
+ "1.0.0",
+ "policies"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "PAP Healthcheck",
+ "request": {
+ "auth": {
+ "type": "basic",
+ "basic": [
+ {
+ "key": "password",
+ "value": "zb!XztG34",
+ "type": "string"
+ },
+ {
+ "key": "username",
+ "value": "healthcheck",
+ "type": "string"
+ }
+ ]
+ },
+ "method": "GET",
+ "header": [
+ {
+ "key": "Content-Type",
+ "type": "text",
+ "value": "application/json"
+ },
+ {
+ "key": "Accept",
+ "type": "text",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "https://0.0.0.0:6868/policy/pap/v1/healthcheck",
+ "protocol": "https",
+ "host": [
+ "0",
+ "0",
+ "0",
+ "0"
+ ],
+ "port": "6868",
+ "path": [
+ "policy",
+ "pap",
+ "v1",
+ "healthcheck"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "PAP Get PDPs",
+ "request": {
+ "auth": {
+ "type": "basic",
+ "basic": [
+ {
+ "key": "password",
+ "value": "zb!XztG34",
+ "type": "string"
+ },
+ {
+ "key": "username",
+ "value": "healthcheck",
+ "type": "string"
+ }
+ ]
+ },
+ "method": "GET",
+ "header": [
+ {
+ "key": "Accept",
+ "type": "text",
+ "value": "application/json"
+ },
+ {
+ "key": "Content-Type",
+ "type": "text",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "https://0.0.0.0:6868/policy/pap/v1/pdps",
+ "protocol": "https",
+ "host": [
+ "0",
+ "0",
+ "0",
+ "0"
+ ],
+ "port": "6868",
+ "path": [
+ "policy",
+ "pap",
+ "v1",
+ "pdps"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "Simple Deploy Policy - policy1",
+ "request": {
+ "auth": {
+ "type": "basic",
+ "basic": [
+ {
+ "key": "password",
+ "value": "zb!XztG34",
+ "type": "string"
+ },
+ {
+ "key": "username",
+ "value": "healthcheck",
+ "type": "string"
+ }
+ ]
+ },
+ "method": "POST",
+ "header": [
+ {
+ "key": "Content-Type",
+ "type": "text",
+ "value": "application/json"
+ },
+ {
+ "key": "Accept",
+ "type": "text",
+ "value": "application/json"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\r\n \"policies\" : [\r\n {\r\n \"policy-id\": \"policy1\",\r\n \"policy-version\": \"1.0.0\"\r\n }\r\n ]\r\n}"
+ },
+ "url": {
+ "raw": "{https://0.0.0.0:6868/policy/pap/v1/pdps/policies",
+ "protocol": "{https",
+ "host": [
+ "0",
+ "0",
+ "0",
+ "0"
+ ],
+ "port": "6868",
+ "path": [
+ "policy",
+ "pap",
+ "v1",
+ "pdps",
+ "policies"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "Xacml Healthcheck",
+ "request": {
+ "auth": {
+ "type": "basic",
+ "basic": [
+ {
+ "key": "password",
+ "value": "zb!XztG34",
+ "type": "string"
+ },
+ {
+ "key": "username",
+ "value": "healthcheck",
+ "type": "string"
+ }
+ ]
+ },
+ "method": "GET",
+ "header": [
+ {
+ "key": "Content-Type",
+ "type": "text",
+ "value": "application/json"
+ },
+ {
+ "key": "Accept",
+ "type": "text",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "https://0.0.0.0:6969/policy/pdpx/v1/healthcheck",
+ "protocol": "https",
+ "host": [
+ "0",
+ "0",
+ "0",
+ "0"
+ ],
+ "port": "6969",
+ "path": [
+ "policy",
+ "pdpx",
+ "v1",
+ "healthcheck"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "Xacml Statistics",
+ "request": {
+ "auth": {
+ "type": "basic",
+ "basic": [
+ {
+ "key": "password",
+ "value": "zb!XztG34",
+ "type": "string"
+ },
+ {
+ "key": "username",
+ "value": "healthcheck",
+ "type": "string"
+ }
+ ]
+ },
+ "method": "GET",
+ "header": [
+ {
+ "key": "Content-Type",
+ "type": "text",
+ "value": "application/json"
+ },
+ {
+ "key": "Accept",
+ "type": "text",
+ "value": "application/json"
+ }
+ ],
+ "url": {
+ "raw": "https://0.0.0.0:6969/policy/pdpx/v1/healthcheck",
+ "protocol": "https",
+ "host": [
+ "0",
+ "0",
+ "0",
+ "0"
+ ],
+ "port": "6969",
+ "path": [
+ "policy",
+ "pdpx",
+ "v1",
+ "healthcheck"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "Xacml Decision - MyAnalytic policy-type",
+ "request": {
+ "auth": {
+ "type": "basic",
+ "basic": [
+ {
+ "key": "password",
+ "value": "zb!XztG34",
+ "type": "string"
+ },
+ {
+ "key": "username",
+ "value": "healthcheck",
+ "type": "string"
+ }
+ ]
+ },
+ "method": "POST",
+ "header": [
+ {
+ "key": "Content-Type",
+ "type": "text",
+ "value": "application/json"
+ },
+ {
+ "key": "Accept",
+ "type": "text",
+ "value": "application/json"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"ONAPName\": \"myName\",\n \"ONAPComponent\": \"myComponent\",\n \"ONAPInstance\": \"myInstanceId\",\n \"requestId\": \"1\",\n \"action\": \"configure\",\n \"resource\": {\n \"policy-type\": \"onap.policies.monitoring.MyAnalytic\"\n }\n}"
+ },
+ "url": {
+ "raw": "https://0.0.0.0:6969/policy/pdpx/v1/decision",
+ "protocol": "https",
+ "host": [
+ "0",
+ "0",
+ "0",
+ "0"
+ ],
+ "port": "6969",
+ "path": [
+ "policy",
+ "pdpx",
+ "v1",
+ "decision"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "Dmaap Simulator - Policy Update Notification",
+ "request": {
+ "auth": {
+ "type": "noauth"
+ },
+ "method": "POST",
+ "header": [
+ {
+ "key": "Content-Type",
+ "type": "text",
+ "value": "application/json"
+ },
+ {
+ "key": "Accept",
+ "type": "text",
+ "value": "application/json"
+ }
+ ],
+ "body": {
+ "mode": "raw",
+ "raw": "{\n \"messageName\": \"PDP_STATE_CHANGE\",\n \"requestId\": \"05d08a05-e182-46fa-a6d1-5500e52cd3e5\",\n \"timestampMs\": \"1576598570797\", \n \"name\": \"PamelaDragosh.local\",\n \"pdpGroup\": \"defaultGroup\",\n \"pdpSubgroup\":\"XacmlPdpGroup\",\n \"state\":\"ACTIVE\"\n}"
+ },
+ "url": {
+ "raw": "http://localhost:3904/events/POLICY-PDP-PAP",
+ "protocol": "http",
+ "host": [
+ "localhost"
+ ],
+ "port": "3904",
+ "path": [
+ "events",
+ "POLICY-PDP-PAP"
+ ]
+ }
+ },
+ "response": []
+ },
+ {
+ "name": "Simple Undeploy Policy Copy",
+ "request": {
+ "auth": {
+ "type": "basic",
+ "basic": [
+ {
+ "key": "password",
+ "value": "zb!XztG34",
+ "type": "string"
+ },
+ {
+ "key": "username",
+ "value": "healthcheck",
+ "type": "string"
+ }
+ ]
+ },
+ "method": "DELETE",
+ "header": [
+ {
+ "key": "Accept",
+ "value": "application/json",
+ "type": "text"
+ },
+ {
+ "key": "Content-Type",
+ "value": "application/json",
+ "type": "text"
+ }
+ ],
+ "url": {
+ "raw": "https://0.0.0.0:6868/policy/pap/v1/pdps/policies/onap.policies.monitoring.MyAnalytic",
+ "protocol": "https",
+ "host": [
+ "0",
+ "0",
+ "0",
+ "0"
+ ],
+ "port": "6868",
+ "path": [
+ "policy",
+ "pap",
+ "v1",
+ "pdps",
+ "policies",
+ "onap.policies.monitoring.MyAnalytic"
+ ]
+ }
+ },
+ "response": []
+ }
+ ],
+ "auth": {
+ "type": "basic",
+ "basic": [
+ {
+ "key": "password",
+ "value": "",
+ "type": "string"
+ },
+ {
+ "key": "username",
+ "value": "",
+ "type": "string"
+ }
+ ]
+ },
+ "protocolProfileBehavior": {}
+} \ No newline at end of file