blob: 4e873dbaf9e5a98ddf3f8f9cce6a31765f9092be [file] [log] [blame]
maximesson98f822c2019-12-11 16:53:33 +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
maximesson0aeab562020-01-27 18:05:04 +01008# 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
maximesson98f822c2019-12-11 16:53:33 +010010
11# GET policy types
12curl -v "http://localhost:8085/A1-P/v1/policytypes"
13
maximesson0aeab562020-01-27 18:05:04 +010014# GET policy type STD_QoSNudging_0.2.0
15curl -v "http://localhost:8085/A1-P/v1/policytypes/STD_QoSNudging_0.2.0"
maximesson98f822c2019-12-11 16:53:33 +010016
17# PUT a policy instance pi1
maximesson0aeab562020-01-27 18:05:04 +010018curl -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
maximesson98f822c2019-12-11 16:53:33 +010019
20# PUT a policy instance pi2
maximesson0aeab562020-01-27 18:05:04 +010021curl -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
maximesson98f822c2019-12-11 16:53:33 +010022
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
maximesson98f822c2019-12-11 16:53:33 +010027# GET policies
28curl -v "http://localhost:8085/A1-P/v1/policies"
29
maximesson98f822c2019-12-11 16:53:33 +010030# 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)
maximesson0aeab562020-01-27 18:05:04 +010034curl -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
maximesson98f822c2019-12-11 16:53:33 +010035
36# GET policy instance pi1
37curl -v "http://localhost:8085/A1-P/v1/policies/pi1"
38
39# GET policy status for pi1
maximesson0aeab562020-01-27 18:05:04 +010040curl -v "http://localhost:8085/A1-P/v1/policystatus/pi1"