Browse Source

punk::netbox quiet some msgs, bump version

master
Julian Noble 2 weeks ago
parent
commit
8a7c2fb0fe
  1. 28
      src/modules/punk/netbox-999999.0a1.0.tm
  2. 2
      src/modules/punk/netbox-buildversion.txt

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

@ -681,6 +681,13 @@ tcl::namespace::eval punk::netbox {
variable contexts [dict create] variable contexts [dict create]
variable context_id 0 variable context_id 0
namespace eval argdoc {
variable PUNKARGS
set DYN_CONTEXTNAMES {${[punk::netbox::api_context_names]}}
}
proc api_context_names {} { proc api_context_names {} {
variable contexts variable contexts
return [dict keys $contexts] return [dict keys $contexts]
@ -845,7 +852,7 @@ tcl::namespace::eval punk::netbox {
set nowarnings [dict exists $received -nowarnings] set nowarnings [dict exists $received -nowarnings]
if {$filepath eq ""} { if {$filepath eq ""} {
set filepath [_datafile] set filepath [_datafile -quiet]
} }
if {![file exists $filepath]} { if {![file exists $filepath]} {
error "No existing datafile at '$filepath'\nUse api_context_create/api_context_save to configure and save contexts" error "No existing datafile at '$filepath'\nUse api_context_create/api_context_save to configure and save contexts"
@ -900,12 +907,16 @@ tcl::namespace::eval punk::netbox {
set received [dict get $argd received] set received [dict get $argd received]
set be_quiet [dict exists $received -quiet] set be_quiet [dict exists $received -quiet]
set nowarnings [dict exists $received -nowarnings] set nowarnings [dict exists $received -nowarnings]
if {!$bequiet} {
set filepath [_datafile] set filepath [_datafile]
} else {
set filepath [_datafile -quiet]
}
if {![file exists $filepath]} { if {![file exists $filepath]} {
error "No existing datafile at '$filepath'\nCall api_context_load with a path to a .toml file with context records\nor use api_context_create/api_context_save." error "No existing datafile at '$filepath'\nCall api_context_load with a path to a .toml file with context records\nor use api_context_create/api_context_save."
} }
if {!$be_quiet} { if {!$be_quiet} {
puts stdout "Loading API token contexts from [_datafile]" puts stdout "Loading API token contexts from $filepath"
} }
if {$nowarnings} { if {$nowarnings} {
api_context_load -nowarnings api_context_load -nowarnings
@ -992,6 +1003,7 @@ tcl::namespace::eval punk::netbox {
} }
namespace eval argdoc { namespace eval argdoc {
lappend PUNKARGS [list { lappend PUNKARGS [list {
@dynamic
@id -id ::punk::netbox::api_context_get @id -id ::punk::netbox::api_context_get
@cmd -name punk::netbox::api_context_get -help\ @cmd -name punk::netbox::api_context_get -help\
"Get api context fields for a single context. "Get api context fields for a single context.
@ -1003,7 +1015,7 @@ tcl::namespace::eval punk::netbox {
Contextids can be created in-memory using Contextids can be created in-memory using
api_context_create, or loaded from a .toml api_context_create, or loaded from a .toml
file using api_context_load."\ file using api_context_load."\
-choices {${[punk::netbox::api_context_names]}} -choices {${$DYN_CONTEXTNAMES}}
@values -min 0 -max -1 @values -min 0 -max -1
field -type string -multiple 1 -optional 1 -help\ field -type string -multiple 1 -optional 1 -help\
"If no field arguments are supplied, all will "If no field arguments are supplied, all will
@ -1646,8 +1658,10 @@ tcl::namespace::eval punk::netbox {
append _number_filter_help [textblock::list_as_table -columns 3 -show_hseps 1 $_filter_number] append _number_filter_help [textblock::list_as_table -columns 3 -show_hseps 1 $_filter_number]
} }
namespace eval argdoc {
punk::args::define {*}[list\ punk::args::define {*}[list\
{ {
@dynamic
@id -id ::punk::netbox::status @id -id ::punk::netbox::status
@cmd -name punk::netbox::status -help\ @cmd -name punk::netbox::status -help\
"status_list "status_list
@ -1661,7 +1675,7 @@ tcl::namespace::eval punk::netbox {
A contextid can be created in-memory using A contextid can be created in-memory using
api_context_create, or loaded from a .toml api_context_create, or loaded from a .toml
file using api_context_load."\ file using api_context_load."\
-choices {${[punk::netbox::api_context_names]}} -choices {${$DYN_CONTEXTNAMES}}
@opts @opts
}\ }\
[set ::punk::netbox::argdoc::_RETURN_STATUS]\ [set ::punk::netbox::argdoc::_RETURN_STATUS]\
@ -1669,6 +1683,7 @@ tcl::namespace::eval punk::netbox {
-ASYNC -type none -ASYNC -type none
@values -min 0 -max 0 @values -min 0 -max 0
}] }]
}
::punk::netbox::system::make_rest_func_async ::punk::netbox::status api/status/ -verb get -body none ::punk::netbox::system::make_rest_func_async ::punk::netbox::status api/status/ -verb get -body none
#test - to see what the create_interface procs look like with a callback #test - to see what the create_interface procs look like with a callback
@ -1779,6 +1794,8 @@ tcl::namespace::eval punk::netbox {
tcl::namespace::eval punk::netbox::dcim { tcl::namespace::eval punk::netbox::dcim {
namespace export {[a-z]*} namespace export {[a-z]*}
namespace eval argdoc {
set DYN_CONTEXTNAMES {${[punk::netbox::api_context_names]}}
lappend PUNKARGS [list\ lappend PUNKARGS [list\
{ {
@dynamic @dynamic
@ -1792,7 +1809,7 @@ tcl::namespace::eval punk::netbox::dcim {
A contextid can be created in-memory using A contextid can be created in-memory using
api_context_create, or loaded from a .toml api_context_create, or loaded from a .toml
file using api_context_load."\ file using api_context_load."\
-choices {${[punk::netbox::api_context_names]}} -choices {${$DYN_CONTEXTNAMES}}
@opts @opts
-id -type integer -id -type integer
-ID_FILTER -type list -minsize 2 -maxsize 2 -multiple 1 -unindentedfields {-help} -help\ -ID_FILTER -type list -minsize 2 -maxsize 2 -multiple 1 -unindentedfields {-help} -help\
@ -1866,6 +1883,7 @@ tcl::namespace::eval punk::netbox::dcim {
{ {
@values -min 0 -max 0 @values -min 0 -max 0
}] }]
}
::punk::netbox::system::make_rest_func_async ::punk::netbox::dcim::devices_list api/dcim/devices/ -verb get -body none ::punk::netbox::system::make_rest_func_async ::punk::netbox::dcim::devices_list api/dcim/devices/ -verb get -body none
} }

2
src/modules/punk/netbox-buildversion.txt

@ -1,3 +1,3 @@
0.1.0 0.1.1
#First line must be a semantic version number #First line must be a semantic version number
#all other lines are ignored. #all other lines are ignored.

Loading…
Cancel
Save