Alex Klein | b7cdbe6 | 2019-02-22 11:41:32 -0700 | [diff] [blame] | 1 | # -*- coding: utf-8 -*- |
| 2 | # Copyright 2019 The Chromium OS Authors. All rights reserved. |
| 3 | # Use of this source code is governed by a BSD-style license that can be |
| 4 | # found in the LICENSE file. |
| 5 | |
Mike Frysinger | a9b30c7 | 2020-04-18 03:36:03 -0400 | [diff] [blame] | 6 | from __future__ import print_function |
| 7 | |
| 8 | import sys |
| 9 | |
| 10 | |
| 11 | assert sys.version_info >= (3, 6), 'This module requires Python 3.6+' |
| 12 | |
| 13 | |
Alex Klein | b7cdbe6 | 2019-02-22 11:41:32 -0700 | [diff] [blame] | 14 | IMPORT_PATTERN = 'chromite.api.controller.%s' |
Alex Klein | 8cb365a | 2019-05-15 16:24:53 -0600 | [diff] [blame] | 15 | |
| 16 | # Endpoint ran successfully. |
| 17 | RETURN_CODE_SUCCESS = 0 |
| 18 | # Unrecoverable error. This includes things from missing required inputs to |
| 19 | # unhandled exceptions. |
| 20 | RETURN_CODE_UNRECOVERABLE = 1 |
| 21 | # The endpoint did not complete successfully, but did complete via a well |
| 22 | # handled path and produced actionable information relevant to the failure in |
| 23 | # the response. |
| 24 | RETURN_CODE_UNSUCCESSFUL_RESPONSE_AVAILABLE = 2 |
| 25 | # Notes the endpoint completed via a well handled path, but the result was not |
| 26 | # a successful execution of the endpoint. |
| 27 | RETURN_CODE_COMPLETED_UNSUCCESSFULLY = 3 |
Alex Klein | 231d2da | 2019-07-22 16:44:45 -0600 | [diff] [blame] | 28 | |
| 29 | |
| 30 | # Validate only request successfully validated. |
| 31 | RETURN_CODE_VALID_INPUT = 0 |
| 32 | # Validate only request did not pass validation. |
| 33 | RETURN_CODE_INVALID_INPUT = 1 |