From: thuva4 Date: Sun, 29 Apr 2018 12:10:00 +0000 (+0530) Subject: Add project model in testapiclient X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=f10eff1ad885457a004f4a2d4b8dab3d6c0841c2;p=releng-testresults.git Add project model in testapiclient Change-Id: If238e2d22f3c895264c90579c7c4d0b442f6c82a Signed-off-by: thuva4 --- diff --git a/testapi/testapi-client/testapiclient/cli/projects.py b/testapi/testapi-client/testapiclient/cli/projects.py index 510acc8..2fa5b5b 100644 --- a/testapi/testapi-client/testapiclient/cli/projects.py +++ b/testapi/testapi-client/testapiclient/cli/projects.py @@ -2,6 +2,7 @@ import json from testapiclient.utils import command from testapiclient.utils import urlparse +from testapiclient.models import project def projects_url(): @@ -51,9 +52,10 @@ class ProjectCreate(command.ShowOne): parser = super(ProjectCreate, self).get_parser(prog_name) parser.add_argument('project', type=json.loads, - help='Project create request format :{' - ' "name": (required)"", ' - '"description": (optional)""}') + help='Project create request format :\n' + '\'{}\''.format(json.dumps( + project.ProjectCreateRequest().__dict__ + ))) return parser def take_action(self, parsed_args): @@ -83,9 +85,10 @@ class ProjectPut(command.ShowOne): help='Update project by name') parser.add_argument('project', type=json.loads, - help='Project Update request format :{' - '"name": (required)"", ' - '"description": (optional)""}') + help='Project Update request format :\n' + '\'{}\''.format(json.dumps( + project.ProjectCreateRequest().__dict__ + ))) return parser def take_action(self, parsed_args): diff --git a/testapi/testapi-client/testapiclient/models/project.py b/testapi/testapi-client/testapiclient/models/project.py new file mode 100644 index 0000000..fc85588 --- /dev/null +++ b/testapi/testapi-client/testapiclient/models/project.py @@ -0,0 +1,4 @@ +class ProjectCreateRequest(): + def __init__(self, name='', description=''): + self.description = description + self.name = name