TensorFlow Serving C++ API Documentation
response_code_enum.h
1 /* Copyright 2018 Google Inc. All Rights Reserved.
2 
3 Licensed under the Apache License, Version 2.0 (the "License");
4 you may not use this file except in compliance with the License.
5 You may obtain a copy of the License at
6 
7  http://www.apache.org/licenses/LICENSE-2.0
8 
9 Unless required by applicable law or agreed to in writing, software
10 distributed under the License is distributed on an "AS IS" BASIS,
11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 See the License for the specific language governing permissions and
13 limitations under the License.
14 ==============================================================================*/
15 
16 #ifndef TENSORFLOW_SERVING_UTIL_NET_HTTP_PUBLIC_RESPONSE_CODE_ENUM_H_
17 #define TENSORFLOW_SERVING_UTIL_NET_HTTP_PUBLIC_RESPONSE_CODE_ENUM_H_
18 
19 namespace tensorflow {
20 namespace serving {
21 namespace net_http {
22 
23 enum class HTTPStatusCode {
24  // These are the status codes we can give back to the client.
25  // http://www.iana.org/assignments/http-status-codes/http-status-codes.xhtml#http-status-codes-1
26  UNDEFINED = 0, // Illegal value for initialization
27  FIRST_CODE = 100,
28 
29  // Informational
30  CONTINUE = 100, // Continue
31  SWITCHING = 101, // Switching Protocols
32  PROCESSING = 102, // Processing (RFC 2518, sec 10.1)
33 
34  // Success
35  OK = 200, // OK
36  CREATED = 201, // Created
37  ACCEPTED = 202, // Accepted
38  PROVISIONAL = 203, // Non-Authoritative Information
39  NO_CONTENT = 204, // No Content
40  RESET_CONTENT = 205, // Reset Content
41  PART_CONTENT = 206, // Partial Content
42  MULTI_STATUS = 207, // Multi-Status (RFC 2518, sec 10.2)
43  ALREADY_REPORTED = 208, // Already Reported (RFC 5842)
44  IM_USED = 226, // IM Used (RFC 3229)
45 
46  // Redirect
47  MULTIPLE = 300, // Multiple Choices
48  MOVED_PERM = 301, // Moved Permanently
49  MOVED_TEMP = 302, // Found. For historical reasons,
50  // a user agent MAY change the method
51  // from POST to GET for the subsequent
52  // request (RFC 7231, sec 6.4.3).
53  SEE_OTHER = 303, // See Other
54  NOT_MODIFIED = 304, // Not Modified
55  USE_PROXY = 305, // Use Proxy
56  TEMP_REDIRECT = 307, // Similar to 302, except that user
57  // agents MUST NOT change the request
58  // method (RFC 7231, sec 6.4.7)
59  RESUME_INCOMPLETE = 308, // Resume Incomplete
60 
61  // Client Error
62  BAD_REQUEST = 400, // Bad Request
63  UNAUTHORIZED = 401, // Unauthorized
64  PAYMENT = 402, // Payment Required
65  FORBIDDEN = 403, // Forbidden
66  NOT_FOUND = 404, // Not Found
67  METHOD_NA = 405, // Method Not Allowed
68  NONE_ACC = 406, // Not Acceptable
69  PROXY = 407, // Proxy Authentication Required
70  REQUEST_TO = 408, // Request Time-out
71  CONFLICT = 409, // Conflict
72  GONE = 410, // Gone
73  LEN_REQUIRED = 411, // Length Required
74  PRECOND_FAILED = 412, // Precondition Failed
75  ENTITY_TOO_BIG = 413, // Request Entity Too Large
76  URI_TOO_BIG = 414, // Request-URI Too Large
77  UNKNOWN_MEDIA = 415, // Unsupported Media Type
78  BAD_RANGE = 416, // Requested range not satisfiable
79  BAD_EXPECTATION = 417, // Expectation Failed
80  IM_A_TEAPOT = 418, // I'm a Teapot (RFC 2324, 7168)
81  MISDIRECTED_REQUEST = 421, // Misdirected Request (RFC 7540)
82  UNPROC_ENTITY = 422, // Unprocessable Entity (RFC 2518, sec 10.3)
83  LOCKED = 423, // Locked (RFC 2518, sec 10.4)
84  FAILED_DEP = 424, // Failed Dependency (RFC 2518, sec 10.5)
85  UPGRADE_REQUIRED = 426, // Upgrade Required (RFC 7231, sec 6.5.14)
86  PRECOND_REQUIRED = 428, // Precondition Required (RFC 6585, sec 3)
87  TOO_MANY_REQUESTS = 429, // Too Many Requests (RFC 6585, sec 4)
88  HEADER_TOO_LARGE = 431, // Request Header Fields Too Large
89  // (RFC 6585, sec 5)
90  UNAVAILABLE_LEGAL = 451, // Unavailable For Legal Reasons (RFC 7725)
91  CLIENT_CLOSED_REQUEST = 499, // Client Closed Request (Nginx)
92 
93  // Server Error
94  ERROR = 500, // Internal Server Error
95  NOT_IMP = 501, // Not Implemented
96  BAD_GATEWAY = 502, // Bad Gateway
97  SERVICE_UNAV = 503, // Service Unavailable
98  GATEWAY_TO = 504, // Gateway Time-out
99  BAD_VERSION = 505, // HTTP Version not supported
100  VARIANT_NEGOTIATES = 506, // Variant Also Negotiates (RFC 2295)
101  INSUF_STORAGE = 507, // Insufficient Storage (RFC 2518, sec 10.6)
102  LOOP_DETECTED = 508, // Loop Detected (RFC 5842)
103  NOT_EXTENDED = 510, // Not Extended (RFC 2774)
104  NETAUTH_REQUIRED = 511, // Network Authentication Required
105  // (RFC 6585, sec 6)
106  LAST_CODE = 599,
107 };
108 
109 } // namespace net_http
110 } // namespace serving
111 } // namespace tensorflow
112 
113 #endif // TENSORFLOW_SERVING_UTIL_NET_HTTP_PUBLIC_RESPONSE_CODE_ENUM_H_