maximesson | 98f822c | 2019-12-11 16:53:33 +0100 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | # Different commands for the simulator. |
| 3 | # By running this, nothing should return an error. |
| 4 | |
| 5 | # Make a test |
| 6 | curl -v "http://localhost:8085/" |
| 7 | |
maximesson | 0aeab56 | 2020-01-27 18:05:04 +0100 | [diff] [blame] | 8 | # PUT a policy type STD_QoSNudging_0.2.0 |
| 9 | curl -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 |
maximesson | 98f822c | 2019-12-11 16:53:33 +0100 | [diff] [blame] | 10 | |
| 11 | # GET policy types |
| 12 | curl -v "http://localhost:8085/A1-P/v1/policytypes" |
| 13 | |
maximesson | 0aeab56 | 2020-01-27 18:05:04 +0100 | [diff] [blame] | 14 | # GET policy type STD_QoSNudging_0.2.0 |
| 15 | curl -v "http://localhost:8085/A1-P/v1/policytypes/STD_QoSNudging_0.2.0" |
maximesson | 98f822c | 2019-12-11 16:53:33 +0100 | [diff] [blame] | 16 | |
| 17 | # PUT a policy instance pi1 |
maximesson | 0aeab56 | 2020-01-27 18:05:04 +0100 | [diff] [blame] | 18 | curl -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 |
maximesson | 98f822c | 2019-12-11 16:53:33 +0100 | [diff] [blame] | 19 | |
| 20 | # PUT a policy instance pi2 |
maximesson | 0aeab56 | 2020-01-27 18:05:04 +0100 | [diff] [blame] | 21 | curl -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 |
maximesson | 98f822c | 2019-12-11 16:53:33 +0100 | [diff] [blame] | 22 | |
| 23 | # SET status for pi1 and pi2 |
| 24 | curl -X PUT "http://localhost:8085/pi1/NOT_ENFORCED/300" |
| 25 | curl -X PUT "http://localhost:8085/pi2/ENFORCED" |
| 26 | |
maximesson | 98f822c | 2019-12-11 16:53:33 +0100 | [diff] [blame] | 27 | # GET policies |
| 28 | curl -v "http://localhost:8085/A1-P/v1/policies" |
| 29 | |
maximesson | 98f822c | 2019-12-11 16:53:33 +0100 | [diff] [blame] | 30 | # DELETE policy instance pi2 |
| 31 | curl -X DELETE -v "http://localhost:8085/A1-P/v1/policies/pi2" |
| 32 | |
| 33 | # PUT a different policy instance pi1 (i.e. update it) |
maximesson | 0aeab56 | 2020-01-27 18:05:04 +0100 | [diff] [blame] | 34 | curl -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 |
maximesson | 98f822c | 2019-12-11 16:53:33 +0100 | [diff] [blame] | 35 | |
| 36 | # GET policy instance pi1 |
| 37 | curl -v "http://localhost:8085/A1-P/v1/policies/pi1" |
| 38 | |
| 39 | # GET policy status for pi1 |
maximesson | 0aeab56 | 2020-01-27 18:05:04 +0100 | [diff] [blame] | 40 | curl -v "http://localhost:8085/A1-P/v1/policystatus/pi1" |