在使用Vault API 時,回傳的HTTP status code跟一般常見的意思有一點點的差異,例如: 429
一般是 Too Many Requests
, 但在Vault表示Default return code for health status of standby nodes.
HTTP status codes 在Vault有哪些差異呢?可以在官網文件找到說明:
https://www.vaultproject.io/api-docs/index#http-status-codes
.200
- Success with data.
.204
- Success, no data returned.
.400
- Invalid request, missing or invalid data.
.403
- Forbidden, your authentication details are either incorrect, you don't have access to this feature, or - if CORS is enabled - you made a cross-origin request from an origin that is not allowed to make such requests.
.404
- Invalid path. This can both mean that the path truly doesn't exist or that you don't have permission to view a specific path. We use 404 in some cases to avoid state leakage.
.405
- Unsupported operation. You tried to use a method inappropriate to the request path, e.g. a POST on an endpoint that only accepts GETs.
.412
- Precondition failed. Returned on Enterprise when a request can't be processed yet due to some missing eventually consistent data. Should be retried, perhaps with a little backoff. See Vault Eventual Consistency.
.429
- Default return code for health status of standby nodes. This will likely change in the future.
.473
- Default return code for health status of performance standby nodes.
500 - Internal server error. An internal error has occurred, try again later. If the error persists, report a bug.
.502
- A request to Vault required Vault making a request to a third party; the third party responded with an error of some kind.
.503
- Vault is down for maintenance or is currently sealed. Try again later.