Add search option for list query

Change-Id: I3a2f021f5d9e104539fc1550713553f6c86df553
This commit is contained in:
gengchc2 2018-11-28 22:36:16 -08:00
parent 1cc79e1567
commit cdd34ec059
24 changed files with 221 additions and 11 deletions

View File

@ -30,6 +30,7 @@ Query Parameters
- limit: limit
- offset: marker
- search: search_option
Response Parameters
-------------------
@ -39,6 +40,12 @@ Response Parameters
- actions: actions
Request Example
---------------
.. literalinclude:: samples/actions-list-request.json
:language: javascript
Response Example
----------------

View File

@ -28,6 +28,7 @@ Query Parameters
- limit: limit
- offset: marker
- search: search_option
Response Parameters
-------------------
@ -37,6 +38,12 @@ Response Parameters
- backups: backups
Request Example
---------------
.. literalinclude:: samples/backup-list-request.json
:language: javascript
Response Example
----------------

View File

@ -29,6 +29,7 @@ Query Parameters
- limit: limit
- offset: marker
- search: search_option
Response Parameters
-------------------
@ -38,6 +39,12 @@ Response Parameters
- clients: clients
Request Example
---------------
.. literalinclude:: samples/clients-list-request.json
:language: javascript
Response Example
----------------

View File

@ -29,6 +29,7 @@ Query Parameters
- limit: limit
- offset: marker
- search: search_option
Response Parameters
-------------------
@ -38,6 +39,12 @@ Response Parameters
- jobs: jobs
Request Example
---------------
.. literalinclude:: samples/jobs-list-request.json
:language: javascript
Response Example
----------------

View File

@ -174,6 +174,15 @@ result:
description: |
A string represents if the operation was successful ``success`` or failed.
search_option:
type: dict
in: body
required: false
description: |
The query option of list. It is a JSON structure. It contains the keywords
``match``, ``match_not``, or one of the two. The values about keys
``match`` and ``match_not`` are a list of {key, value}.
session_description:
type: string
in: body

View File

@ -0,0 +1,12 @@
{
"match_not": [
{
"max_retries": 20
}
],
"match": [
{
"backup_name": "test0001_backup"
}
]
}

View File

@ -0,0 +1,12 @@
{
"match_not": [
{
"storage": "ftps"
}
],
"match": [
{
"backup_name": "freezer_mysql_backup"
}
]
}

View File

@ -0,0 +1,12 @@
{
"match_not": [
{
"client_id": "tecs_node1"
}
],
"match": [
{
"user_id":"0cd44caf6db5486b94a04b33256a5ff4"
}
]
}

View File

@ -0,0 +1,12 @@
{
"match_not": [
{
"schedule_interval": "10 days"
}
],
"match": [
{
"client_id": "752d8bd43d654e7a840bbfda77ce41af_szaher"
}
]
}

View File

@ -0,0 +1,12 @@
{
"match_not": [
{
"schedule_interval": "10 days"
}
],
"match": [
{
"hold_off": 50
}
]
}

View File

@ -37,6 +37,7 @@ Query Parameters
- limit: limit
- offset: marker
- search: search_option
Response Parameters
-------------------
@ -46,6 +47,12 @@ Response Parameters
- sessions: sessions
Request Example
---------------
.. literalinclude:: samples/sessions-list-request.json
:language: javascript
Response Example
----------------

View File

@ -38,6 +38,7 @@ Request Parameters
- limit: limit
- offset: marker
- search: search_option
Response Parameters
-------------------
@ -47,6 +48,12 @@ Response Parameters
- actions: actions
Request Example
---------------
.. literalinclude:: samples/actions-list-request.json
:language: javascript
Response Example
----------------

View File

@ -38,6 +38,7 @@ Request Parameters
- limit: limit
- marker: marker
- search: search_option
Response Parameters
-------------------
@ -47,6 +48,12 @@ Response Parameters
- backups: backups
Request Example
---------------
.. literalinclude:: samples/backup-list-request.json
:language: javascript
Response Example
----------------

View File

@ -37,6 +37,7 @@ Request Parameters
- limit: limit
- offset: marker
- search: search_option
Response Parameters
-------------------
@ -46,6 +47,12 @@ Response Parameters
- clients: clients
Request Example
---------------
.. literalinclude:: samples/clients-list-request.json
:language: javascript
Response Example
----------------

View File

@ -37,6 +37,8 @@ Request Parameters
- limit: limit
- offset: marker
- search: search_option
Response Parameters
-------------------
@ -46,6 +48,13 @@ Response Parameters
- jobs: jobs
Request Example
---------------
.. literalinclude:: samples/jobs-list-request.json
:language: javascript
Response Example
----------------

View File

@ -190,6 +190,15 @@ result:
description: |
A string represents if the operation was successful ``success`` or failed.
search_option:
type: dict
in: body
required: false
description: |
The query option of list. It is a JSON structure. It contains the keywords
``match``, ``match_not``, or one of the two. The values about keys
``match`` and ``match_not`` are a list of {key, value}.
session_description:
type: string
in: body

View File

@ -0,0 +1,12 @@
{
"match_not": [
{
"max_retries": 20
}
],
"match": [
{
"backup_name": "test0001_backup"
}
]
}

View File

@ -0,0 +1,12 @@
{
"match_not": [
{
"storage": "ftps"
}
],
"match": [
{
"backup_name": "freezer_mysql_backup"
}
]
}

View File

@ -0,0 +1,12 @@
{
"match_not": [
{
"client_id": "tecs_node1"
}
],
"match": [
{
"user_id":"0cd44caf6db5486b94a04b33256a5ff4"
}
]
}

View File

@ -0,0 +1,12 @@
{
"match_not": [
{
"schedule_interval": "10 days"
}
],
"match": [
{
"client_id": "752d8bd43d654e7a840bbfda77ce41af_szaher"
}
]
}

View File

@ -0,0 +1,12 @@
{
"match_not": [
{
"schedule_interval": "10 days"
}
],
"match": [
{
"hold_off": 50
}
]
}

View File

@ -43,6 +43,7 @@ Request Parameters
- limit: limit
- offset: marker
- search: search_option
Response Parameters
-------------------
@ -52,6 +53,12 @@ Response Parameters
- sessions: sessions
Request Example
---------------
.. literalinclude:: samples/sessions-list-request.json
:language: javascript
Response Example
----------------

View File

@ -141,12 +141,12 @@ html_theme = 'default'
#html_last_updated_fmt = '%b %d, %Y'
git_cmd = ["git", "log", "--pretty=format:%ad, commit %h", "--date=local",
"-n1"]
try:
html_last_updated_fmt = subprocess.check_output(git_cmd).decode('utf-8')
except Exception:
warnings.warn('Cannot get last updated time from git repository. '
'Not setting "html_last_updated_fmt".')
#try:
# html_last_updated_fmt = subprocess.check_output(git_cmd).decode('utf-8')
#except Exception:
# warnings.warn('Cannot get last updated time from git repository. '
# 'Not setting "html_last_updated_fmt".')
html_last_updated_fmt = '%Y-%m-%d %H:%M'
# If true, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True

View File

@ -11,8 +11,7 @@ Contents:
.. toctree::
:maxdepth: 2
cli/index
cli/index
Indices and tables
==================
@ -20,3 +19,4 @@ Indices and tables
* :ref:`genindex`
* :ref:`search`