summaryrefslogtreecommitdiffstats
path: root/testapi/testapi-client/testapiclient/client/pods.py
diff options
context:
space:
mode:
authorSerenaFeng <feng.xiaowei@zte.com.cn>2018-04-20 17:41:19 +0800
committerSerenaFeng <feng.xiaowei@zte.com.cn>2018-04-23 09:46:29 +0800
commit5a6e75ea55a2f9d6ef0ae655139b9b8b0e7e2780 (patch)
treef788831162000ed25f6a9f0dc1c45d7710fcadb6 /testapi/testapi-client/testapiclient/client/pods.py
parent979f52bde489317e114f493d4b16838dfb28be1f (diff)
impl import-testapiclient framework
the usage: from testapiclient.client import pods pod_client = pods.PodsClient(user='test', password='pass') pod_client.create({'name': 'test-api', 'mode':'metal', 'role':'community_ci', 'details':''} from testapiclient.client import pods from testapiclient.models import pods as pm pod_client = pods.PodsClient(user='test', password='pass') pod = pm.Pods(name='test') pod_client.create(pod.__dict__) Change-Id: I6a7770d0b54f5570552a6ebbf1c42a638723997c Signed-off-by: SerenaFeng <feng.xiaowei@zte.com.cn>
Diffstat (limited to 'testapi/testapi-client/testapiclient/client/pods.py')
-rw-r--r--testapi/testapi-client/testapiclient/client/pods.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/testapi/testapi-client/testapiclient/client/pods.py b/testapi/testapi-client/testapiclient/client/pods.py
new file mode 100644
index 0000000..4254da7
--- /dev/null
+++ b/testapi/testapi-client/testapiclient/client/pods.py
@@ -0,0 +1,11 @@
+from testapiclient.client import base
+
+
+class PodsClient(base.Client):
+ resource = 'pods'
+
+ def __init__(self, **kwargs):
+ super(PodsClient, self).__init__(**kwargs)
+
+ def create(self, pod_req):
+ return self.clientmanager.post(self.url, pod_req)