bseltz-cohesity / scripts

Cohesity REST API examples in PowerShell and Python
Apache License 2.0
104 stars 41 forks source link

backupNow extendederrorcodes #95

Closed nwageler closed 1 year ago

nwageler commented 1 year ago

Should the output of backupNow change when adding the -extendedErrorCodes parameter?

We are getting same output whether it is specified or not:

PS > ./backupNow.ps1 -vip myCluster -jobName 'testPG' -keepLocalFor 14 -noArchive -wait -extendedErrorCodes
Connected!
Running testPG...
New Job Run ID: 16215972:1680192151306122
Job finished with status: Succeeded

PS > ./backupNow.ps1 -vip myCluster -jobName 'testPG' -keepLocalFor 14 -noArchive -wait
Connected!
Running testPG...
New Job Run ID: 16215972:1680192442366047
Job finished with status: Succeeded
bseltz-cohesity commented 1 year ago

The text output does not change (it's already descriptive). What changes is the exit codes returned to the OS or calling process. The standard exit code are 0 (success) or 1 (failed, which may mean several things, including that the job ran but failed, or the job didn't run, etc). Extended error codes include a variety of failure modes:

# 1: Unsuccessful
# 2: connection/authentication error
# 3: Syntax Error
# 4: Timed out waiting for existing run to finish
# 5: Timed out waiting for status update
# 6: Timed out waiting for new run to appear
# 7: Timed out getting protection jobs