diff options
author | 2018-04-26 13:15:03 +0530 | |
---|---|---|
committer | 2018-05-07 11:43:54 +0530 | |
commit | d7b3e7b890fa21a018900e459c8b85e7a8f68332 (patch) | |
tree | c059fedee7bb50345f3a2e5a93c401b97245f3ae /testapi/docs/developer/devguide | |
parent | 71c429c25f30660d436fef7b064553c266d4655a (diff) |
Add get functionality for the import module
Tested
Module will deserialize the json objects from the server to Pod
instance.
Change-Id: I3e2cb9386f8949d544624be687ee227ae4529d72
Signed-off-by: thuva4 <tharma.thuva@gmail.com>
Diffstat (limited to 'testapi/docs/developer/devguide')
-rw-r--r-- | testapi/docs/developer/devguide/testapi-client-import.rst | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/testapi/docs/developer/devguide/testapi-client-import.rst b/testapi/docs/developer/devguide/testapi-client-import.rst new file mode 100644 index 0000000..69cb6ad --- /dev/null +++ b/testapi/docs/developer/devguide/testapi-client-import.rst @@ -0,0 +1,65 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. (c) 2017 ZTE Corp. + +===================== +TestAPI client import +===================== + +**Python module to communicate with the TestAPI Server** + +This project aims to provide a python module which can +communicate with the TestAPI Server. The user can use this client +to fetch/post/modify the resources on the TestAPI Server. + +Usage +----- + +Pod +^^^ + +GET +""" + +User will get the json Pod objects with the get request. + +.. code-block:: shell + + from testapiclient.client import pods + + pod_client = pods.PodsClient() + pod_client.get() + +User can use search parameters to get pods + +.. code-block:: shell + + from testapiclient.client import pods + + pod_client = pods.PodsClient() + pod_client.get(name='pod1') + +GET ONE +""""""" + +User will get the json Pod objects with the get request. + +.. code-block:: shell + + from testapiclient.client import pods + + pod_client = pods.PodsClient() + pod_client.get_one('name') + +CREATE +"""""" +User has to authenticate before running the function. + +.. code-block:: shell + + 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':''} + |