Skip to main content

A helper client for FairCom JSON Action API

Project description

JsonActionClient

A wrapper for the FairCom JSON Action API.

Installation

pip install faircom-json-action-client

Usage

Example credential usage:

client = JsonActionClient( "http://127.0.0.1:8080/api" )
client.login( "admin", "ADMIN" )

with client:
    list_databases_json = {
        "api":       "db",
        "action":    "listDatabases",
        "params":    { },
        "authToken": client.auth_token
    }
    response = client.post_json( list_databases_json )
    print( f"Response: {json.dumps( response, indent = 3 )}" )

Example client certificate usage:

client = JsonActionClient( "https://127.0.0.1:8444/api", ca_cert = "/FairCom/ca.crt", client_cert = "/FairCom/client.pem" )
client.login()

with client:
    list_databases_json = {
        "api":       "db",
        "action":    "listDatabases",
        "params":    { },
        "authToken": client.auth_token
    }
    response = client.post_json( list_databases_json )
    print( f"Response: {json.dumps( response, indent = 3 )}" )

Location

https://github.com/AdamJHowell/JsonActionClient

Project details


Download files

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

Source Distribution

faircom_json_action_client-0.0.1.tar.gz (19.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

faircom_json_action_client-0.0.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file faircom_json_action_client-0.0.1.tar.gz.

File metadata

File hashes

Hashes for faircom_json_action_client-0.0.1.tar.gz
Algorithm Hash digest
SHA256 cccfe233f6e7751c4906c1f14f3e6f85ced5e692330612d6e62d35e20d4ac701
MD5 c111aa20daa57bca77a0a5b4f75c4161
BLAKE2b-256 cb994e09db845374a8d9017fa891060ed6110a416ce13878a5e38b6fd4876aec

See more details on using hashes here.

File details

Details for the file faircom_json_action_client-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for faircom_json_action_client-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3a5428d995dfaad3ba8f23b69c7d7d410b940c593d6cfa9e58904d116174153e
MD5 644f732e56f714a38cdfe03b2ce2a43a
BLAKE2b-256 cbefbc63b2fb9236d5c2267dc5c7f76141f5e8b17f7c32b17d6e15c5737a03e8

See more details on using hashes here.

Supported by

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