content = myvim.get_network_list(filter_dict=filter_dict)
elif item=="tenants":
content = myvim.get_tenant_list(filter_dict=filter_dict)
+ elif item == "images":
+ content = myvim.get_image_list(filter_dict=filter_dict)
else:
raise NfvoException(item + "?", HTTP_Method_Not_Allowed)
logger.debug("vim_action response %s", content) #update nets Change from VIM format to NFVO format
content = myvim.delete_network(item_id)
elif item=="tenants":
content = myvim.delete_tenant(item_id)
+ elif item == "images":
+ content = myvim.delete_image(item_id)
else:
raise NfvoException(item + "?", HTTP_Method_Not_Allowed)
except vimconn.vimconnException as e:
'''
__author__="Alfonso Tierno, Gerardo Garcia"
__date__ ="$09-oct-2014 09:09:48$"
-__version__="0.4.9-r515"
+__version__="0.4.10-r516"
version_date="Jan 2017"
from argcomplete.completers import FilesCompleter
datacenter_action_parser.add_argument("-f","--force", action="store_true", help="do not prompt for confirmation")
datacenter_action_parser.set_defaults(func=datacenter_netmap_action, action=item)
- for item in ("network", "tenant"):
+ for item in ("network", "tenant", "image"):
if item=="network":
commnad_name = 'vim-net'
else:
vim_item_del_parser.add_argument("--datacenter", action="store", help="specifies the datacenter")
vim_item_del_parser.set_defaults(func=vim_action, item=item, action="delete")
- vim_item_create_parser = subparsers.add_parser(commnad_name + '-create', parents=[parent_parser], help="create a "+item+" at vim")
- vim_item_create_parser.add_argument("file", nargs='?', help="descriptor of the %s. Must be a file or yaml/json text" % item).completer = FilesCompleter
- vim_item_create_parser.add_argument("--name", action="store", help="name of the %s" % item )
- vim_item_create_parser.add_argument("--datacenter", action="store", help="specifies the datacenter")
- if item=="network":
- vim_item_create_parser.add_argument("--type", action="store", help="type of network, data, ptp, bridge")
- vim_item_create_parser.add_argument("--shared", action="store_true", help="Private or shared")
- vim_item_create_parser.add_argument("--bind-net", action="store", help="For openvim datacenter type, net to be bind to, for vlan type, use sufix ':<vlan_tag>'")
- else:
- vim_item_create_parser.add_argument("--description", action="store", help="description of the %s" % item)
- vim_item_create_parser.set_defaults(func=vim_action, item=item, action="create")
+ if item == "network" or item == "tenant":
+ vim_item_create_parser = subparsers.add_parser(commnad_name + '-create', parents=[parent_parser], help="create a "+item+" at vim")
+ vim_item_create_parser.add_argument("file", nargs='?', help="descriptor of the %s. Must be a file or yaml/json text" % item).completer = FilesCompleter
+ vim_item_create_parser.add_argument("--name", action="store", help="name of the %s" % item )
+ vim_item_create_parser.add_argument("--datacenter", action="store", help="specifies the datacenter")
+ if item=="network":
+ vim_item_create_parser.add_argument("--type", action="store", help="type of network, data, ptp, bridge")
+ vim_item_create_parser.add_argument("--shared", action="store_true", help="Private or shared")
+ vim_item_create_parser.add_argument("--bind-net", action="store", help="For openvim datacenter type, net to be bind to, for vlan type, use sufix ':<vlan_tag>'")
+ else:
+ vim_item_create_parser.add_argument("--description", action="store", help="description of the %s" % item)
+ vim_item_create_parser.set_defaults(func=vim_action, item=item, action="create")
argcomplete.autocomplete(main_parser)