Report usage of StopAutoUpdate policy in borgmon charts
Omaha already has an event result for reporting UpdateDeferred (9)
which shows up in the borgman charts. In order to use that we should
perform a normal updatecheck without the updatedisabled set to true and
then discard the response with event type UpdateComplete (3) but with
event result UpdateDeferred (9).
BUG=28645: Report StopAutoUpdate enforcement in Borgmon charts for Omaha
TEST=Tested success, error and deferred cases on my zgb.
Change-Id: I27cb4465ea9876b39edaff3b747ada44a4f875d4
Reviewed-on: https://gerrit.chromium.org/gerrit/19112
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Commit-Ready: Jay Srinivasan <jaysri@chromium.org>
Tested-by: Jay Srinivasan <jaysri@chromium.org>
diff --git a/action_processor.h b/action_processor.h
index c45c3c8..256648d 100644
--- a/action_processor.h
+++ b/action_processor.h
@@ -23,6 +23,7 @@
// Action exit codes.
enum ActionExitCode {
+ // use the 0xx and 1xx ranges for client errors.
kActionCodeSuccess = 0,
kActionCodeError = 1,
kActionCodeOmahaRequestError = 2,
@@ -43,14 +44,23 @@
kActionCodeSignedDeltaPayloadExpectedError = 17,
kActionCodeDownloadPayloadPubKeyVerificationError = 18,
kActionCodePostinstallBootedFromFirmwareB = 19,
- kActionCodeOmahaUpdateIgnoredPerPolicy = 20,
+
+ // use the 2xx range for errors in Omaha response.
kActionCodeOmahaRequestEmptyResponseError = 200,
kActionCodeOmahaRequestXMLParseError = 201,
kActionCodeOmahaRequestNoUpdateCheckNode = 202,
kActionCodeOmahaRequestNoUpdateCheckStatus = 203,
kActionCodeOmahaRequestBadUpdateCheckStatus = 204,
+
+ // use the 2xxx range to encode HTTP errors.
kActionCodeOmahaRequestHTTPResponseBase = 2000, // + HTTP response code
+ // use the 5xxx range for return codes that are not really errors,
+ // but deferred updates. these have to be logged with a different
+ // result in Omaha so that they don't show up as errors in borgmon charts.
+ kActionCodeOmahaUpdateIgnoredPerPolicy = 5000,
+ kActionCodeOmahaUpdateDeferredPerPolicy = 5001,
+
// Bit flags.
kActionCodeResumedFlag = 1 << 30, // Set if resuming an interruped update.
kActionCodeBootModeFlag = 1 << 31, // Set if boot mode not normal.