raise NfvoException("Invalid net id or name '{}' at instance:vnfs:networks".format(net_id), httperrors.Bad_Request)
if net_instance_desc.get("vim-network-name"):
scenario_net["vim-network-name"] = net_instance_desc["vim-network-name"]
+ if net_instance_desc.get("vim-network-id"):
+ scenario_net["vim-network-id"] = net_instance_desc["vim-network-id"]
if net_instance_desc.get("name"):
scenario_net["name"] = net_instance_desc["name"]
if 'ip-profile' in net_instance_desc:
}
db_instance_nets.append(db_net)
+ lookfor_filter = {}
if net.get("vim-network-name"):
- lookfor_filter = {"name": net["vim-network-name"]}
+ lookfor_filter["name"] = net["vim-network-name"]
+ if net.get("vim-network-id"):
+ lookfor_filter["id"] = net["vim-network-id"]
+ if lookfor_filter:
task_action = "FIND"
task_extra = {"params": (lookfor_filter,)}
else:
"type": "object",
"properties": {
"vim-network-name": name_schema,
+ "vim-network-id": name_schema,
"ip-profile": ip_profile_schema,
"name": name_schema,
}
"properties":{
"ip_address": ip_schema,
"datacenter": name_schema,
- "vim-network-name": name_schema
+ "vim-network-name": name_schema,
+ "vim-network-id": name_schema
},
"patternProperties":{
".": {"type": "string"}
#In oder words, it is the same as 'try to map to the VIM network (netmap-use) if exist, and if not create the network (netmap-create)
"netmap-use": name_schema, #
"vim-network-name": name_schema, #override network name
+ "vim-network-id": name_schema,
#"ip-profile": ip_profile_schema,
"datacenter": name_schema,
}