X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=openmano;h=59fd7e8d8bde076a849d1ac245b993c9ce2b8584;hb=59f45266ae0e573d0d4e6dcfec04f4a715faeaf2;hp=818e7173ee9138ac4d9c256bd89e92fcbaa7f514;hpb=5c7c4736c4abd81a1a43abada5c36b5fb79ced2a;p=osm%2FRO.git diff --git a/openmano b/openmano index 818e7173..59fd7e8d 100755 --- a/openmano +++ b/openmano @@ -28,8 +28,8 @@ openmano client used to interact with openmano-server (openmanod) ''' __author__="Alfonso Tierno, Gerardo Garcia" __date__ ="$09-oct-2014 09:09:48$" -__version__="0.4.6-r500" -version_date="Sep 2016" +__version__="0.4.8-r512" +version_date="Oct 2016" from argcomplete.completers import FilesCompleter import os @@ -251,7 +251,7 @@ def vnf_create(args): tenant = _get_tenant() myvnf = _load_file_or_yaml(args.file) - if args.name or args.description or args.image_path: + if args.name or args.description or args.image_path or args.image_name or args.image_checksum: #print args.name try: if args.name: @@ -264,6 +264,16 @@ def vnf_create(args): #print "image-path", image_path_ myvnf['vnf']['VNFC'][index]['VNFC image']=image_path_ index=index+1 + if args.image_name: + index=0 + for image_name_ in args.image_name.split(","): + myvnf['vnf']['VNFC'][index]['image name']=image_name_ + index=index+1 + if args.image_checksum: + index=0 + for image_checksum_ in args.image_checksum.split(","): + myvnf['vnf']['VNFC'][index]['image checksum']=image_checksum_ + index=index+1 except (KeyError, TypeError), e: if str(e)=='vnf': error_pos= "missing field 'vnf'" elif str(e)=='name': error_pos= "missing field 'vnf':'name'" @@ -271,6 +281,8 @@ def vnf_create(args): elif str(e)=='VNFC': error_pos= "missing field 'vnf':'VNFC'" elif str(e)==str(index): error_pos= "field 'vnf':'VNFC' must be an array" elif str(e)=='VNFC image': error_pos= "missing field 'vnf':'VNFC'['VNFC image']" + elif str(e)=='image name': error_pos= "missing field 'vnf':'VNFC'['image name']" + elif str(e)=='image checksum': error_pos= "missing field 'vnf':'VNFC'['image checksum']" else: error_pos="wrong format" print "Wrong VNF descriptor: " + error_pos return -1 @@ -579,7 +591,7 @@ def instance_create(args): if args.scenario != None: scenario = args.scenario if not scenario: - print "you must provide an scenario in the file descriptor or with --scenario" + print "you must provide a scenario in the file descriptor or with --scenario" return -1 myInstance["instance"]["scenario"] = _get_item_uuid("scenarios", scenario, tenant) if args.netmap_use: @@ -889,6 +901,8 @@ def datacenter_attach(args): datacenter_dict['vim_username'] = args.user if args.password != None: datacenter_dict['vim_password'] = args.password + if args.config!=None: + datacenter_dict["config"] = _load_file_or_yaml(args.config) payload_req = json.dumps( {"datacenter": datacenter_dict }) #print payload_req @@ -1205,6 +1219,8 @@ if __name__=="__main__": vnf_create_parser.add_argument("--name", action="store", help="name of the VNF (if it exists in the VNF descriptor, it is overwritten)") vnf_create_parser.add_argument("--description", action="store", help="description of the VNF (if it exists in the VNF descriptor, it is overwritten)") vnf_create_parser.add_argument("--image-path", action="store", help="change image path locations (overwritten)") + vnf_create_parser.add_argument("--image-name", action="store", help="change image name (overwritten)") + vnf_create_parser.add_argument("--image-checksum", action="store", help="change image checksum (overwritten)") vnf_create_parser.set_defaults(func=vnf_create) vnf_list_parser = subparsers.add_parser('vnf-list', parents=[parent_parser], help="lists information about a vnf") @@ -1335,6 +1351,7 @@ if __name__=="__main__": datacenter_attach_parser.add_argument('--vim-tenant-name', action='store', help="specify a datacenter tenant name.") datacenter_attach_parser.add_argument("--user", action="store", help="user credentials for the datacenter") datacenter_attach_parser.add_argument("--password", action="store", help="password credentials for the datacenter") + datacenter_attach_parser.add_argument("--config", action="store", help="aditional configuration in json/yaml format") datacenter_attach_parser.set_defaults(func=datacenter_attach) datacenter_detach_parser = subparsers.add_parser('datacenter-detach', parents=[parent_parser], help="removes the association between a datacenter and the operating tenant")