diff options
author | Serena Feng <feng.xiaowei@zte.com.cn> | 2018-05-07 14:13:36 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-05-07 14:13:36 +0000 |
commit | ba70e3d75f1be0f1b57203cabe31bceedb1856df (patch) | |
tree | 36f4f8fe9537d1c166eb15b498d2a8e5798e840f | |
parent | 3d9d1d89639e15227232649f250f9431c9563de7 (diff) | |
parent | f10eff1ad885457a004f4a2d4b8dab3d6c0841c2 (diff) |
Merge "Add project model in testapiclient"
-rw-r--r-- | testapi/testapi-client/testapiclient/cli/projects.py | 15 | ||||
-rw-r--r-- | testapi/testapi-client/testapiclient/models/project.py | 4 |
2 files changed, 13 insertions, 6 deletions
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 |