X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=doc%2FPLCAPI.xml.in;h=02ed26248f83561fb75e57084a29ef2ec259a63e;hb=e70e20fdbececafef842ec7b330fd48db42e614e;hp=af48f91785876f02ece5da4c54eaea913af58ef2;hpb=ae247e567468efe3fd5e54488a6fdd32da11fa96;p=plcapi.git diff --git a/doc/PLCAPI.xml.in b/doc/PLCAPI.xml.in index af48f91..02ed262 100644 --- a/doc/PLCAPI.xml.in +++ b/doc/PLCAPI.xml.in @@ -360,8 +360,8 @@ tagname=arch category=node/slice/config/ui/header=A/rank=x - The current limitation about tags as opposed to native - fields is that, for performance, tags won't get returned + The current limitations about tags, as opposed to native + fields, is that for performance, tags won't get returned when using the implicit set of columns. So for instance: # get all details for 'pl1.foo.com' @@ -369,6 +369,20 @@ tagname=arch category=node/slice/config/ui/header=A/rank=x # this did not return the 'arch' tag >>> 'arch' in node False + + + + + For a similar reason, any tag used in the filter argument will have to be mentioned in the list of returned columns as well. For example: + +# if 'hrn' is not part of the result, this does not work +>>> ns=GetNodes({'hrn':'ple.*'},['hostname']) +Database error b59e068c-589a-4ad5-9dd8-63cc38f2a2eb: +column "hrn" does not exist +LINE 1: ...M view_nodes WHERE deleted IS False AND (True AND hrn ILIKE ... +... abridged ... +# this can be worked around by just returning 'hrn' as well +>>> ns=GetNodes({'hrn':'ple.*'},['hrn','hostname']) @@ -545,9 +559,9 @@ node_ids = plc_api.GetSlices(auth,slice_name,['node_ids'])[0]['node_ids'] slice_nodes = plc_api.GetNodes(auth,node_ids,['hostname']) # store in a file -f=open('mynodes.txt','w') -for node in slice_nodes: - print >>f,node['hostname'] +with ('mynodes.txt','a') as f: + for node in slice_nodes: + f.write(node['hostname'] + "\n") f.close()