def http_uploadnetmap_datacenter_id(tenant_id, datacenter_id): result, content = nfvo.datacenter_new_netmap(mydb, tenant_id, datacenter_id, None) if result < 0: print "http_postnetmap_datacenter_id error %d %s" % (result, content) bottle.abort(-result, content) convert_datetime2str(content) af.convert_str2boolean(content, ('shared', 'multipoint') ) print content data={'netmaps' : content} return format_out(data)
def http_uploadnetmap_datacenter_id(tenant_id, datacenter_id): result, content = nfvo.datacenter_new_netmap(mydb, tenant_id, datacenter_id, None) if result < 0: print "http_postnetmap_datacenter_id error %d %s" % (result, content) bottle.abort(-result, content) convert_datetime2str(content) utils.convert_str2boolean(content, ('shared', 'multipoint') ) print content data={'netmaps' : content} return format_out(data)
def http_postnetmap_datacenter_id(tenant_id, datacenter_id): '''creates a new netmap''' #parse input data http_content,_ = format_in( netmap_new_schema ) r = af.remove_extra_items(http_content, netmap_new_schema) if r is not None: print "http_action_datacenter_id: Warning: remove extra items ", r #obtain data, check that only one exist result, content = nfvo.datacenter_new_netmap(mydb, tenant_id, datacenter_id, http_content) if result < 0: print "http_postnetmap_datacenter_id error %d %s" % (result, content) bottle.abort(-result, content) convert_datetime2str(content) af.convert_str2boolean(content, ('shared', 'multipoint') ) print content data={'netmaps' : content} return format_out(data)
def http_postnetmap_datacenter_id(tenant_id, datacenter_id): '''creates a new netmap''' #parse input data http_content,_ = format_in( netmap_new_schema ) r = utils.remove_extra_items(http_content, netmap_new_schema) if r is not None: print "http_action_datacenter_id: Warning: remove extra items ", r #obtain data, check that only one exist result, content = nfvo.datacenter_new_netmap(mydb, tenant_id, datacenter_id, http_content) if result < 0: print "http_postnetmap_datacenter_id error %d %s" % (result, content) bottle.abort(-result, content) convert_datetime2str(content) utils.convert_str2boolean(content, ('shared', 'multipoint') ) print content data={'netmaps' : content} return format_out(data)