refactor(SNM config): Move rest config top level

This commit is contained in:
Emil Ivanichkov 2024-03-11 16:51:59 +02:00 committed by Emil Ivanichkov
parent ab80677ff5
commit f54600b17e
1 changed files with 35 additions and 33 deletions

View File

@ -17,44 +17,46 @@ type
type
StatusNodeManagerConfig* = object
restEnabled* {.
desc: "Enable the REST server"
defaultValue: true
name: "rest" .}: bool
restPort* {.
desc: "Port for the REST server"
defaultValue: defaultSNMRestPort
defaultValueDesc: $defaultSNMRestPortDesc
name: "rest-port" .}: Port
restAddress* {.
desc: "Listening address of the REST server"
defaultValue: defaultAdminListenAddress
defaultValueDesc: $defaultAdminListenAddressDesc
name: "rest-address" .}: IpAddress
restRequestTimeout* {.
defaultValue: 0
defaultValueDesc: "infinite"
desc: "The number of seconds to wait until complete REST request " &
"will be received"
name: "rest-request-timeout" .}: Natural
restMaxRequestBodySize* {.
defaultValue: 16_384
desc: "Maximum size of REST request body (kilobytes)"
name: "rest-max-body-size" .}: Natural
restMaxRequestHeadersSize* {.
defaultValue: 128
desc: "Maximum size of REST request headers (kilobytes)"
name: "rest-max-headers-size" .}: Natural
case cmd* {.
command
defaultValue: SNMStartUpCmd.noCommand .}: SNMStartUpCmd
of SNMStartUpCmd.noCommand:
restEnabled* {.
desc: "Enable the REST server"
defaultValue: true
name: "rest" .}: bool
restPort* {.
desc: "Port for the REST server"
defaultValue: defaultSNMRestPort
defaultValueDesc: $defaultSNMRestPortDesc
name: "rest-port" .}: Port
restAddress* {.
desc: "Listening address of the REST server"
defaultValue: defaultAdminListenAddress
defaultValueDesc: $defaultAdminListenAddressDesc
name: "rest-address" .}: IpAddress
restRequestTimeout* {.
defaultValue: 0
defaultValueDesc: "infinite"
desc: "The number of seconds to wait until complete REST request " &
"will be received"
name: "rest-request-timeout" .}: Natural
restMaxRequestBodySize* {.
defaultValue: 16_384
desc: "Maximum size of REST request body (kilobytes)"
name: "rest-max-body-size" .}: Natural
restMaxRequestHeadersSize* {.
defaultValue: 128
desc: "Maximum size of REST request headers (kilobytes)"
name: "rest-max-headers-size" .}: Natural
discard
of SNMStartUpCmd.pair:
qr* {.