blob: 4e873dbaf9e5a98ddf3f8f9cce6a31765f9092be [file] [log] [blame]
elinuxhenrikb033eaf2020-02-03 16:02:21 +01001#!/bin/bash
2# Different commands for the simulator.
3# By running this, nothing should return an error.
4
5# Make a test
6curl -v "http://localhost:8085/"
7
8# PUT a policy type STD_QoSNudging_0.2.0
9curl -X PUT -v "http://localhost:8085/policytypes/STD_QoSNudging_0.2.0" -H "accept: application/json" -H "Content-Type: application/json" --data-binary @policy_type_STD_QoSNudging_0.2.0.json
10
11# GET policy types
12curl -v "http://localhost:8085/A1-P/v1/policytypes"
13
14# GET policy type STD_QoSNudging_0.2.0
15curl -v "http://localhost:8085/A1-P/v1/policytypes/STD_QoSNudging_0.2.0"
16
17# PUT a policy instance pi1
18curl -X PUT -v "http://localhost:8085/A1-P/v1/policies/pi1?policyTypeId=STD_QoSNudging_0.2.0" -H "accept: application/json" -H "Content-Type: application/json" --data-binary @policy_instance_1_STD_QoSNudging_0.2.0.json
19
20# PUT a policy instance pi2
21curl -X PUT -v "http://localhost:8085/A1-P/v1/policies/pi2?policyTypeId=STD_QoSNudging_0.2.0" -H "accept: application/json" -H "Content-Type: application/json" --data-binary @policy_instance_2_STD_QoSNudging_0.2.0.json
22
23# SET status for pi1 and pi2
24curl -X PUT "http://localhost:8085/pi1/NOT_ENFORCED/300"
25curl -X PUT "http://localhost:8085/pi2/ENFORCED"
26
27# GET policies
28curl -v "http://localhost:8085/A1-P/v1/policies"
29
30# DELETE policy instance pi2
31curl -X DELETE -v "http://localhost:8085/A1-P/v1/policies/pi2"
32
33# PUT a different policy instance pi1 (i.e. update it)
34curl -X PUT -v "http://localhost:8085/A1-P/v1/policies/pi1?policyTypeId=STD_QoSNudging_0.2.0" -H "accept: application/json" -H "Content-Type: application/json" --data-binary @policy_instance_1_bis_STD_QoSNudging_0.2.0.json
35
36# GET policy instance pi1
37curl -v "http://localhost:8085/A1-P/v1/policies/pi1"
38
39# GET policy status for pi1
40curl -v "http://localhost:8085/A1-P/v1/policystatus/pi1"