Add ticket-list command
Add ticket-list command for evoque Change-Id: I9fa7fe677cdf85e61f6bd4b9a123456495519144
This commit is contained in:
parent
c5f2830186
commit
dc39bad499
@ -15,9 +15,11 @@ from evoqueclient.common import utils
|
|||||||
|
|
||||||
def do_ticket_list(ec, args={}):
|
def do_ticket_list(ec, args={}):
|
||||||
"""List all available tickets."""
|
"""List all available tickets."""
|
||||||
tickets = ec.ticket.list()
|
tickets = ec.tickets.list()
|
||||||
field_labels = ["ID", "Name"]
|
field_labels = ["ID", "Name", "Status", "Domain", "User_ID", "Domain_id",
|
||||||
fields = ["id", "name"]
|
"Project", "User", "Type"]
|
||||||
|
fields = ["id", "name", "status", "domain", "user_id", "domain_id",
|
||||||
|
"project", "user", "type"]
|
||||||
utils.print_list(tickets, fields, field_labels)
|
utils.print_list(tickets, fields, field_labels)
|
||||||
|
|
||||||
|
|
||||||
|
@ -24,5 +24,11 @@ class Ticket(base.Resource):
|
|||||||
class TicketManager(base.Manager):
|
class TicketManager(base.Manager):
|
||||||
resource_class = Ticket
|
resource_class = Ticket
|
||||||
|
|
||||||
|
def list(self, **kwargs):
|
||||||
|
"""Get tickets list with pagination support."""
|
||||||
|
|
||||||
|
url = '/v1/ticket'
|
||||||
|
return self._list(url, response_key='tickets')
|
||||||
|
|
||||||
def add(self, data):
|
def add(self, data):
|
||||||
return self._create('/v1/ticket', data)
|
return self._create('/v1/ticket', data)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user