|
|
|
|
@ -473,16 +473,6 @@ tcl::namespace::eval punk::netbox::system {
|
|
|
|
|
|
|
|
|
|
set config [dict create format json result json] |
|
|
|
|
|
|
|
|
|
#The 'result' key seems to tell ::rest what post-processor to use to translate it *from* that to a tcl dict (or in xml case a nested list) |
|
|
|
|
#sort of.. |
|
|
|
|
#xml - takes xml produces a list |
|
|
|
|
#json - takes json produces a dict |
|
|
|
|
#discard - 'return -code ok' |
|
|
|
|
#auto - *basic* detect xml or json and do as above |
|
|
|
|
#tdom - takes xml - produces a tdom documentElement |
|
|
|
|
#raw - just returns the data |
|
|
|
|
dict set config result raw |
|
|
|
|
|
|
|
|
|
dict set config headers [list Authorization [list Token [dict get $contexts $apicontextid token value]]] |
|
|
|
|
set bodycontrol %bodycontrol% |
|
|
|
|
switch -- $bodycontrol { |
|
|
|
|
@ -505,10 +495,6 @@ tcl::namespace::eval punk::netbox::system {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if {$returntype in "json jsondump"} { |
|
|
|
|
#if we set result json - we get a dict instead of json :/ |
|
|
|
|
dict set config result raw |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
set url [dict get $contexts $apicontextid url value] |
|
|
|
|
set endpoint "%endpoint%" |
|
|
|
|
@ -1086,6 +1072,19 @@ tcl::namespace::eval punk::netbox {
|
|
|
|
|
set resultlist $call_data($asynctoken,result) |
|
|
|
|
set returntype $call_data($asynctoken,returntype) |
|
|
|
|
set config $call_data($asynctoken,config) |
|
|
|
|
if {$returntype in "json jsondump"} { |
|
|
|
|
#if we leave 'result' = json - we get a dict instead of json :/ |
|
|
|
|
#The 'result' key seems to tell ::rest what post-processor to use to translate it *from* that to a tcl dict (or in xml case a nested list) |
|
|
|
|
#sort of.. |
|
|
|
|
#xml - takes xml produces a list |
|
|
|
|
#json - takes json produces a dict |
|
|
|
|
#discard - 'return -code ok' |
|
|
|
|
#auto - *basic* detect xml or json and do as above |
|
|
|
|
#tdom - takes xml - produces a tdom documentElement |
|
|
|
|
#raw - just returns the data |
|
|
|
|
dict set config result raw |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#status is #OK|ERROR |
|
|
|
|
lassign $resultlist status resulttext |
|
|
|
|
|