There were urls and handlers for vmware in the nailgun, that were
removed completely in
review.openstack.org/#/c/428402/15/nailgun/nailgun/api/v1/urls.py
The better approach is remain the urls and make special stub-handlers
instead of real ones.
Change-Id: I50bf740ec726c9cc57ff63d49aff718e812e6feb
Closes-Bug: #1668258
Allow limiting the number of objects returned via GET
by providing "limit"
Example: api/notifications?limit=5
Allow offseting (skipping N first records) via "offset"
Example: api/notifications?offset=100
Allow ordering of objects by providing "order_by"
Example: api/notifications?order_by=-id
Add helper functions/classes to:
- get HTTP parameters (limit, offset, order_by)
- get scoped collection query by applying 4 operations
filter, order, offset, limit
- set Conent-Range header if scope limits are present
Make default NailgunCollection's GET utilize scoped query
This makes default (parent) GET of child handlers support paging
and ordering (overriden GET methods will not get this functionality
automatically)
NailgunCollection.GET is also an example of how to implement
this new functionality.
Helper functions/classes can be utilized in child handler methods
to implement filters / ordering / paging
Related-Bug: 1657348
Change-Id: I7760465f70b3f69791e7a0c558a26e8ba55c934a
Developers should use assertIn(A, B) instead of assertTrue(A in B ).
Developers should use assertNotIn(A, B) instead of assertFalse(A in B ).
TrivialFix
Change-Id: Ibfb5bda501015383ac170544129c280f99f4f5ed
Decorator content does too many different actions, so
let's split it into 3 decorators: @handle_errors,
@validate and @serialize. We can skip calling @serialize
in many places, because those methods just raise some
http error.
Also I've changed return value of all handlers from
serialized json (string) to python's structures, lists
and dicts. So It's become possible to implement different
serializers and I've added support for YAML output.
Change-Id: Ia3da3bd809bcca923d53666eca54def78c995f65
Closes-Bug: #1606211
It's a common task to get list of something from URL,
so let's add this get_param_as_set function and use
it where possible.
Change-Id: I4ae28553117f5ae4de35350270a40e3ac6beaf41
Partial-Bug: #1593751
Add new handler SnapshotDownload which returns empty response
with X-Accel-Redirect header. Nginx reads this header and
serves actuall snapshot file.
Also changed 'reverse' function location, let it be more
available for other modules.
Change-Id: Id46b533e8d2a8021d1fbb2e5d4284508e1181704
Implements: blueprint snapshot-download-with-auth
- errors are now returned as tracebacks, not HTML
- added schema checking based on the handler type and validator
- content_json decorator rewritten completely
- common JSON types
- creation of nodes with non-number ID is now forbidden according to scheme
Implements: blueprint nailgun-api-requests-responses-validation
Change-Id: Icf49bb534ccb19872402b66532ef44418bd66a53
The `BaseHandler.http` method behaves similar to pecan's abort function,
and allows end users to raise http response with custom status code,
custom message and custom headers.
Related to blueprint reduce-dependence-on-webpy
Closes-Bug: #1277174
Change-Id: I8759ada1451446602c107b26a4d7e7fabd99c568
If we receive from PUT smth like:
{"editable": {"storage": {"osd_pool_size": {"value": 3},
"volumes_ceph": {"value": true}}}}
attributes.editable will contain only received data and no default one
Changing paste.TestApp for webtest.TestApp cause TestApp does not have
PATCH method available
Change-Id: I259ee806c9464cb82b391e9c3b633e5e7f5f11d3
Closes-Bug: #1283135