Resource retrieving: add changes-before filter

This adds the changes-before filter to the servers,
os-instance-actions and os-migrations APIs for
filtering resources which were last updated before
or equal to the given time. The changes-before filter,
like the changes-since filter, will return deleted
server resources.

Part of bp support-to-query-nova-resources-filter-by-changes-before
Change-Id: If91c179e3823c8b0da744a9363906b0f7b05c326
This commit is contained in:
zhangbailin
2018-09-03 10:55:05 +08:00
committed by Matt Riedemann
parent 82270cc261
commit 28c1075b59
61 changed files with 2426 additions and 54 deletions
+41 -9
View File
@@ -132,9 +132,9 @@ For different user roles, the user has different query options set:
- For general user, there is limited set of attributes of the servers can be
used as query option. ``reservation_id``, ``name``, ``status``, ``image``,
``flavor``, ``ip``, ``changes-since``, ``ip6``, ``tags``, ``tags-any``,
``not-tags``, ``not-tags-any`` are supported options to be used. Other
options will be ignored by nova silently.
``flavor``, ``ip``, ``changes-since``, ``changes-before``, ``ip6``,
``tags``, ``tags-any``, ``not-tags``, ``not-tags-any`` are supported options
to be used. Other options will be ignored by nova silently.
- For administrator, most of the server attributes can be used as query
options. Before the Ocata release, the fields in the database schema of
@@ -197,11 +197,14 @@ For different user roles, the user has different query options set:
]
}
There are also some speical query options:
There are also some special query options:
- ``changes-since`` returns the servers updated after the given time.
Please see: :doc:`polling_changes-since_parameter`
- ``changes-before`` returns the servers updated before the given time.
Please see: :doc:`polling_changes-since_parameter`
- ``deleted`` returns (or excludes) deleted servers
- ``soft_deleted`` modifies behavior of 'deleted' to either include or exclude
@@ -212,7 +215,7 @@ There are also some speical query options:
.. code::
**Example: User query server with special keys changes-since**
**Example: User query server with special keys changes-since or changes-before**
Precondition:
GET /servers/detail
@@ -221,13 +224,13 @@ There are also some speical query options:
{
"servers": [
{
"name": "t1"
"updated": "2015-12-15T15:55:52Z"
"name": "t1",
"updated": "2015-12-15T15:55:52Z",
...
},
{
"name": "t2",
"updated": "2015-12-17T15:55:52Z"
"updated": "2015-12-17T15:55:52Z",
...
}
]
@@ -239,11 +242,40 @@ There are also some speical query options:
{
{
"name": "t2",
"updated": "2015-12-17T15:55:52Z"
"updated": "2015-12-17T15:55:52Z",
...
}
}
GET /servers/detail?changes-before='2015-12-16T15:55:52Z'
Response:
{
{
"name": "t1",
"updated": "2015-12-15T15:55:52Z",
...
}
}
GET /servers/detail?changes-since='2015-12-10T15:55:52Z'&changes-before='2015-12-28T15:55:52Z'
Response:
{
"servers": [
{
"name": "t1",
"updated": "2015-12-15T15:55:52Z",
...
},
{
"name": "t2",
"updated": "2015-12-17T15:55:52Z",
...
}
]
}
There are two kinds of matching in query options: Exact matching and
regex matching.