blob: 801c60ba082f705a75ce30668c9d8bd8e7e3704b [file] [log] [blame]
peusterm58310762016-01-12 17:09:20 +01001#!/usr/bin/python
peusterm72f09882018-05-15 17:10:27 +02002# Copyright (c) 2015 SONATA-NFV and Paderborn University
3# 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#
17# Neither the name of the SONATA-NFV, Paderborn University
18# nor the names of its contributors may be used to endorse or promote
19# products derived from this software without specific prior written
20# permission.
21#
22# This work has been performed in the framework of the SONATA project,
23# funded by the European Commission under Grant number 671517 through
24# the Horizon 2020 and 5G-PPP programmes. The authors would like to
25# acknowledge the contributions of their colleagues of the SONATA
26# partner consortium (www.sonata-nfv.eu).
peusterm58310762016-01-12 17:09:20 +010027import sys
hadik3r558504a2016-06-27 17:59:04 +020028from emuvim.cli.rest import compute as restcom
29from emuvim.cli.rest import datacenter as restdc
stevenvanrossem73efd192016-06-29 01:44:07 +020030from emuvim.cli.rest import monitor as restmon
31from emuvim.cli.rest import network as restnetw
hadik3r558504a2016-06-27 17:59:04 +020032
peusterm72f09882018-05-15 17:10:27 +020033
peusterm68aaedb2017-06-15 14:27:46 +020034def help():
35 print("Missing arguments.\n")
36 print("Usage: son-emu-cli compute|datacenter|network|monitor <arguments>\n")
37 print("Get more help:")
38 print("\tson-emu-cli compute --help")
39 print("\tson-emu-cli datacenter --help")
40 print("\tson-emu-cli network --help")
41 print("\tson-emu-cli monitor --help")
42 exit(0)
peusterm58310762016-01-12 17:09:20 +010043
peusterm72f09882018-05-15 17:10:27 +020044
peusterm58310762016-01-12 17:09:20 +010045def main():
46 if len(sys.argv) < 2:
peusterm68aaedb2017-06-15 14:27:46 +020047 help()
stevenvanrossem73efd192016-06-29 01:44:07 +020048 elif sys.argv[1] == "monitor":
49 restmon.main(sys.argv[2:])
50 elif sys.argv[1] == "network":
51 restnetw.main(sys.argv[2:])
hadik3r558504a2016-06-27 17:59:04 +020052 elif sys.argv[1] == "compute":
53 restcom.main(sys.argv[2:])
54 elif sys.argv[1] == "datacenter":
55 restdc.main(sys.argv[2:])
peusterm68aaedb2017-06-15 14:27:46 +020056 else:
57 help()
hadik3r558504a2016-06-27 17:59:04 +020058
peusterm58310762016-01-12 17:09:20 +010059
60if __name__ == '__main__':
61 main()