elinuxhenrik | b033eaf | 2020-02-03 16:02:21 +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 | |
| 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 |
| 10 | |
| 11 | # GET policy types |
| 12 | curl -v "http://localhost:8085/A1-P/v1/policytypes" |
| 13 | |
| 14 | # GET policy type STD_QoSNudging_0.2.0 |
| 15 | curl -v "http://localhost:8085/A1-P/v1/policytypes/STD_QoSNudging_0.2.0" |
| 16 | |
| 17 | # PUT a policy instance pi1 |
| 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 |
| 19 | |
| 20 | # PUT a policy instance pi2 |
| 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 |
| 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 | |
| 27 | # GET policies |
| 28 | curl -v "http://localhost:8085/A1-P/v1/policies" |
| 29 | |
| 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) |
| 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 |
| 35 | |
| 36 | # GET policy instance pi1 |
| 37 | curl -v "http://localhost:8085/A1-P/v1/policies/pi1" |
| 38 | |
| 39 | # GET policy status for pi1 |
| 40 | curl -v "http://localhost:8085/A1-P/v1/policystatus/pi1" |