diff options
author | Serena Feng <feng.xiaowei@zte.com.cn> | 2018-05-07 14:03:22 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-05-07 14:03:22 +0000 |
commit | 22307af0125dc525e8946c0951c1f7fcff39e9d7 (patch) | |
tree | 14c26df3b0366a6cc68c7f760e703540de177e62 /testapi/docs/developer/devguide/testapi-client-import.rst | |
parent | 3dee5b5a444e9a18987786b7016e8c0bb9d27434 (diff) | |
parent | d7b3e7b890fa21a018900e459c8b85e7a8f68332 (diff) |
Merge "Add get functionality for the import module"
Diffstat (limited to 'testapi/docs/developer/devguide/testapi-client-import.rst')
-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':''} + |