Add ticket list api

Change-Id: If37a4aedf75c2fdaa1902de1e2d892c279c19aa0
This commit is contained in:
lawrancejing 2015-12-14 07:38:11 +00:00
parent d1b59d4ba6
commit dad8cf3ac3
1 changed files with 10 additions and 0 deletions

View File

@ -25,6 +25,10 @@ class Workflow(base.APIResourceWrapper):
_attrs = ['id', 'name', 'created_at', 'updated_at']
class Ticket(base.APIResourceWrapper):
_attrs = ['id', 'name', 'created_at', 'updated_at']
def _get_endpoint(request):
endpoint = getattr(
settings, 'EVOQUE_API_URL', "http://127.0.0.1:8808")
@ -45,3 +49,9 @@ def workflow_list(request):
"""Returns all workflows."""
workflows = evoqueclient(request).workflows.list()
return [Workflow(c) for c in workflows]
def ticket_list(request):
"""Returns all tickets."""
tickets = evoqueclient(request).tickets.list()
return [Ticket(c) for c in tickets]