turbot / steampipe

Zero-ETL, infinite possibilities. Live query APIs, code & more with SQL. No DB required.
https://steampipe.io
GNU Affero General Public License v3.0
6.92k stars 274 forks source link

Defined exit codes for steampipe commands #2935

Closed binaek closed 1 year ago

binaek commented 1 year ago

Exit codes for steampipe commands:

Service commands

steampipe service start

steampipe service stop

steampipe service restart

Query commands

steampipe query

steampipe query _

Check commands

steampipe check

0: no runtime errors, no control alarms or errors
1: no runtime errors, 1 or more control alarms, no control errors
2: no runtime errors, 1 or more control errors
3+: runtime error

Refer to community slack thread: https://steampipe.slack.com/archives/C01UECB59A7/p1668613929383289

Plugin commands

steampipe plugin install _

steampipe plugin list

steampipe plugin uninstall _

steampipe plugin update _

Mod commands

steampipe mod init

steampipe mod install _

steampipe mod list

steampipe mod uninstall _

steampipe mod update _

Dashboard commands

steampipe dashboard

Variable command

steampipe variable list

pskrbasu commented 1 year ago

OLD vs NEW exit codes:

OLD

ExitCodeSuccessful                   = 0
ExitCodeUnknownErrorPanic            = 1
ExitCodeInsufficientOrWrongArguments = 2
ExitCodeLoadingError                 = 3
ExitCodePluginListFailure            = 4
ExitCodeNoModFile                    = 15
ExitCodeBindPortUnavailable          = 31

NEW

    ExitCodeSuccessful                 = 0
    ExitCodeControlsAlarm              = 1   // check - no runtime errors, 1 or more control alarms, no control errors
    ExitCodeControlsError              = 2   // check - no runtime errors, 1 or more control errors
    ExitCodePluginLoadingError         = 11  // plugin - loading error
    ExitCodePluginListFailure          = 12  // plugin - listing failed
    ExitCodePluginNotFound             = 13  // plugin - not found
    ExitCodeSnapshotCreationFailed     = 21  // snapshot - creation failed
    ExitCodeSnapshotUploadFailed       = 22  // snapshot - upload failed
    ExitCodeServiceSetupFailure        = 31  // service - setup failed
    ExitCodeServiceStartupFailure      = 32  // service - start failed
    ExitCodeServiceStopFailure         = 33  // service - stop failed
    ExitCodeQueryExecutionFailed       = 41  // query - 1 or more queries failed - change in behavior(previously the exitCode used to be the number of queries that failed)
    ExitCodeLoginCloudConnectionFailed = 51  // login - connecting to cloud failed
    ExitCodeInitializationFailed       = 250 // common - initialization failed
    ExitCodeBindPortUnavailable        = 251 // common(service/dashboard) - port binding failed
    ExitCodeNoModFile                  = 252 // common - no mod file
    ExitCodeFileSystemAccessFailure    = 253 // common - file system access failed
    ExitCodeInsufficientOrWrongInputs  = 254 // common - runtime error(insufficient or wrong input)
    ExitCodeUnknownErrorPanic          = 255 // common - runtime error(unknown panic)