| 1 |
--- |
| 2 |
fixes: |
| 3 |
- | |
| 4 |
Some API responses are changed to use more appropriate status codes. The |
| 5 |
following requests will receive different response status codes: |
| 6 |
|
| 7 |
- Requesting instance reservation with ``affinity = True``: 500 to 400 |
| 8 |
|
| 9 |
* Instance reservation only accepts affinity = False until the plugin |
| 10 |
implements the `Support no affinity rule`_ blueprint. |
| 11 |
The Create Lease API and the Update Lease API now return 400 Bad |
| 12 |
Request instead of 500 Internal Server Error when affinity = True |
| 13 |
is specified. |
| 14 |
|
| 15 |
- Requesting end_date earlier than start_date in the Create Lease API: |
| 16 |
202 to 400 |
| 17 |
|
| 18 |
* The end_date parameter must be later than the start_date parameter. |
| 19 |
However, the Create Lease API was accepting requests where end_date is |
| 20 |
earlier than start_date, which was causing lease errors because of |
| 21 |
invalid status change. From the Rocky release, the API checks the |
| 22 |
ordering of the two events and returns an appropriate response status |
| 23 |
code. |
| 24 |
|
| 25 |
- Requesting invalid start_date or end_date in the Create Lease API and the |
| 26 |
Update Lease API: 403 to 400 |
| 27 |
|
| 28 |
* 403 response code means an API request is Not Authorized. When the |
| 29 |
ordering of the two is invalid, the response status code is now 400 Bad |
| 30 |
Request, since the request is authorized but has an invalid request |
| 31 |
body. |
| 32 |
|
| 33 |
- Requesting an extra capability key longer than 64 characters: 500 to 400 |
| 34 |
|
| 35 |
* The length of a host's extra capability key is limited to a maximum of |
| 36 |
64 characters. When a request body includes an extra capability longer |
| 37 |
than 64 characters, the response status code of the Create Host API and |
| 38 |
the Update Host API is now 400 Bad Request instead of 500 |
| 39 |
Internal Server Error. |
| 40 |
|
| 41 |
- Creating a new host/lease: 202 to 201 |
| 42 |
|
| 43 |
* The Create Host API and the Create Lease API now return 201 Created |
| 44 |
instead of 202 Accepted, since Blazar ensures that a new host/lease is |
| 45 |
created before responding. |
| 46 |
|
| 47 |
- Updating a host/lease: 202 to 200 |
| 48 |
|
| 49 |
* The Update Host API and the Update Lease API now return 200 OK instead |
| 50 |
of 202 Accepted, since Blazar ensures that a host/lease is updated |
| 51 |
before responding. |
| 52 |
|
| 53 |
- Requesting invalid date in the Create Lease API and the Update Lease API: |
| 54 |
500 to 400 |
| 55 |
|
| 56 |
* The start_date, end_date and before_end_date should be the format of |
| 57 |
"CCYY-MM-DD hh:mm" such as "2020-07-01 10:00", otherwise |
| 58 |
it raises 400 Bad Request instead of 500 Internal Server Error. |
| 59 |
|
| 60 |
.. _`Support no affinity rule`: https://blueprints.launchpad.net/blazar/+spec/no-affinity-instance-reservation |