Addition to the first commit
[sim/a1-interface.git] / near-rt-ric-simulator / scripts / commands.sh
1 #!/bin/bash
2 #  ============LICENSE_START===============================================
3 #  Copyright (C) 2020 Nordix Foundation. All rights reserved.
4 #  ========================================================================
5 #  Licensed under the Apache License, Version 2.0 (the "License");
6 #  you may not use this file except in compliance with the License.
7 #  You may obtain a copy of the License at
8 #
9 #       http://www.apache.org/licenses/LICENSE-2.0
10 #
11 #  Unless required by applicable law or agreed to in writing, software
12 #  distributed under the License is distributed on an "AS IS" BASIS,
13 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 #  See the License for the specific language governing permissions and
15 #  limitations under the License.
16 #  ============LICENSE_END=================================================
17 #
18
19 # Different commands for the simulator.
20 # By running this, nothing should return an error.
21
22 # Make a test
23 curl -v "http://localhost:8085/"
24
25 # PUT a policy type STD_QoSNudging_0.2.0
26 curl -X PUT -v "http://localhost:8085/policytypes/STD_QoSNudging_0.2.0" -H "accept: application/json" -H "Content-Type: application/json" --data-binary @example_files/policy_type_STD_QoSNudging_0.2.0.json
27
28 # GET policy types
29 curl -v "http://localhost:8085/A1-P/v1/policytypes"
30
31 # GET policy type STD_QoSNudging_0.2.0
32 curl -v "http://localhost:8085/A1-P/v1/policytypes/STD_QoSNudging_0.2.0"
33
34 # PUT a policy instance pi1
35 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 @example_files/policy_instance_1_STD_QoSNudging_0.2.0.json
36
37 # PUT a policy instance pi2
38 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 @example_files/policy_instance_2_STD_QoSNudging_0.2.0.json
39
40 # SET status for pi1 and pi2
41 curl -X PUT "http://localhost:8085/pi1/NOT_ENFORCED/300"
42 curl -X PUT "http://localhost:8085/pi2/ENFORCED"
43
44 # GET policies
45 curl -v "http://localhost:8085/A1-P/v1/policies"
46
47 # DELETE policy instance pi2
48 curl -X DELETE -v "http://localhost:8085/A1-P/v1/policies/pi2"
49
50 # PUT a different policy instance pi1 (i.e. update it)
51 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 @example_files/policy_instance_1_bis_STD_QoSNudging_0.2.0.json
52
53 # GET policy instance pi1
54 curl -v "http://localhost:8085/A1-P/v1/policies/pi1"
55
56 # GET policy status for pi1
57 curl -v "http://localhost:8085/A1-P/v1/policystatus/pi1"