From d7b3e7b890fa21a018900e459c8b85e7a8f68332 Mon Sep 17 00:00:00 2001 From: thuva4 <tharma.thuva@gmail.com> Date: Thu, 26 Apr 2018 13:15:03 +0530 Subject: 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> --- .../developer/devguide/testapi-client-import.rst | 65 ++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 testapi/docs/developer/devguide/testapi-client-import.rst (limited to 'testapi/docs/developer/devguide') 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':''} + -- cgit