Browse Source

netbox better output format fix

master
Julian Noble 4 days ago
parent
commit
29faa9a234
  1. 27
      src/modules/punk/netbox-999999.0a1.0.tm
  2. 9
      src/modules/punk/ns-999999.0a1.0.tm
  3. 9
      src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/ns-0.1.0.tm
  4. 9
      src/project_layouts/custom/_project/punk.shell-0.1/src/bootsupport/modules/punk/ns-0.1.0.tm
  5. 27
      src/vfs/_vfscommon.vfs/modules/punk/netbox-0.1.0.tm
  6. 9
      src/vfs/_vfscommon.vfs/modules/punk/ns-0.1.0.tm

27
src/modules/punk/netbox-999999.0a1.0.tm

@ -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

9
src/modules/punk/ns-999999.0a1.0.tm

@ -5077,9 +5077,12 @@ y" {return quirkykeyscript}
lpop queryargs_untested 0
lappend eparams $q
puts stderr "---> cmd_traverse ensembleparam $q ($lname)"
puts stderr "arginfo: $arginfo"
puts stderr "---> eparams: $eparams"
puts stderr "---> existing args: $args"
#puts stderr "arginfo: $arginfo"
#puts stderr "---> eparams: $eparams"
#puts stderr "---> existing args: $args"
#ledit queryargs_untested 0 0
#review - add tests

9
src/project_layouts/custom/_project/punk.project-0.1/src/bootsupport/modules/punk/ns-0.1.0.tm

@ -5077,9 +5077,12 @@ y" {return quirkykeyscript}
lpop queryargs_untested 0
lappend eparams $q
puts stderr "---> cmd_traverse ensembleparam $q ($lname)"
puts stderr "arginfo: $arginfo"
puts stderr "---> eparams: $eparams"
puts stderr "---> existing args: $args"
#puts stderr "arginfo: $arginfo"
#puts stderr "---> eparams: $eparams"
#puts stderr "---> existing args: $args"
#ledit queryargs_untested 0 0
#review - add tests

9
src/project_layouts/custom/_project/punk.shell-0.1/src/bootsupport/modules/punk/ns-0.1.0.tm

@ -5077,9 +5077,12 @@ y" {return quirkykeyscript}
lpop queryargs_untested 0
lappend eparams $q
puts stderr "---> cmd_traverse ensembleparam $q ($lname)"
puts stderr "arginfo: $arginfo"
puts stderr "---> eparams: $eparams"
puts stderr "---> existing args: $args"
#puts stderr "arginfo: $arginfo"
#puts stderr "---> eparams: $eparams"
#puts stderr "---> existing args: $args"
#ledit queryargs_untested 0 0
#review - add tests

27
src/vfs/_vfscommon.vfs/modules/punk/netbox-0.1.0.tm

@ -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

9
src/vfs/_vfscommon.vfs/modules/punk/ns-0.1.0.tm

@ -5077,9 +5077,12 @@ y" {return quirkykeyscript}
lpop queryargs_untested 0
lappend eparams $q
puts stderr "---> cmd_traverse ensembleparam $q ($lname)"
puts stderr "arginfo: $arginfo"
puts stderr "---> eparams: $eparams"
puts stderr "---> existing args: $args"
#puts stderr "arginfo: $arginfo"
#puts stderr "---> eparams: $eparams"
#puts stderr "---> existing args: $args"
#ledit queryargs_untested 0 0
#review - add tests

Loading…
Cancel
Save