Skip to main content

Kitica Devicepool.

Project description

Kitica API

Introduction

Kitica's REST API was built to support parallel device automation testing, It serves device's information through HTTP protocol.

Setup

Kitica's API service was designed to be hosted behind nginx web server, but could also be run locally for development.

Development Server Setup

Step 1
Before anything else, it is recommended that you run the service in a virtual environment.
So, first, install python'3 virtualenv.

pip install virtualenv

After installing, create a virtualenv inside the api folder(repository_root/api). Run:

virtualenv venv

Where venv is the name of the virtualenv instance.

Output

Using base prefix '/usr'
New python executable in /home/yourusername/sample/venv/bin/python3
Also creating executable in /home/yourusername/sample/venv/bin/python
Installing setuptools, pip, wheel...
done.

Next, activate the virtualenv:

source venv/bin/activate

Now that virtualenv is active, install the dependencies for the api service.

pip install -r requirements.txt

After that, all dependencies should be installed.

Step 2 To start the API service, run:

python kiticaApi.py

Output

 * Serving Flask app "kiticaAPI" (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: on
 * Running on http://0.0.0.0:5000/ (Press CTRL+C to quit)
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: xxx-xxx-xxx

Service should be running now.
To Verify, Create a get request in postman.

url: http://localhost:5000/devices
method: GET
Response should be something like this:

[
    {
        "deviceId": 3,
        "deviceName": "Pixel 2",
        "platformName": "Android",
        "server": "xxx.xxx.xxx.xxx",
        "port": "4723/wd/hub",
        "udid": "emulator-5554",
        "platformVersion": "9",
        "status": "FREE",
        "teamName": "TEAM",
        "version": 1,
        "borrowerIp": null,
        "borrowerHostname": null,
        "lastBorrowed": "2020-02-12 15:29:29",
        "deviceType": "Emulator"
    }
]

That's it, local development server is now running.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

kitica-1.4a9-py3-none-any.whl (22.0 kB view details)

Uploaded Python 3

File details

Details for the file kitica-1.4a9-py3-none-any.whl.

File metadata

  • Download URL: kitica-1.4a9-py3-none-any.whl
  • Upload date:
  • Size: 22.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for kitica-1.4a9-py3-none-any.whl
Algorithm Hash digest
SHA256 2f1d0850f5fba7509d85c06c01cb0899950579615f158c60e9cd864d370697aa
MD5 6713b17651b9b127429914f9d58841a5
BLAKE2b-256 5cb185e80e6704807721d9a439622e1d2a73710b2d065c20dc6b315ff1ae25cf

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page