Conduktor Proxy API Client
Project description
cdk-proxy-api-client
API Client library to interact with Conduktor Proxy
Current version: v1beta1
Getting started
First, create a Proxy Client
from cdk_proxy_api_client.proxy_api import ApiClient, ProxyClient
api = ApiClient("localhost", port=8888, username="superUser", password="superUser")
proxy_client = ProxyClient(api)
Features
Note: we assume you are re-using the proxy_client
as shown above.
- Create new Token for a tenant
from cdk_proxy_api_client.admin_auth import AdminAuth
admin = AdminAuth(proxy_client)
admin.create_tenant_credentials("a_tenant_name")
- List all topic mappings for a tenant
from cdk_proxy_api_client.proxy_api import Multitenancy
tenants_mgmt = Multitenancy(proxy_client)
tenants = tenants_mgmt.list_tenants(as_list=True)
- Create a new mapping for a tenant
- Delete a tenant - topic mapping
- Delete all topic mappings for a tenant
from cdk_proxy_api_client.tenant_mappings import TenantMappings
tenant_mappings_mgmt = TenantMappings(proxy_client)
tenant_mappings_mgmt.create_tenant_topic_mapping(
"tenant_name", "logical_name", "real_name"
)
tenant_mappings_mgmt.delete_tenant_topic_mapping("tenant_name", "logical_name")
Testing
The testing is for now very manual. See e2e_testing.py
Pytest will be added later on
Tools & CLI
To simplify the usage of the client, you can use some CLI tools
cdk-cli-import-tenant-mappings
usage: Create tenant mappings from configuration file [-h] -f MAPPINGS_FILE --username USERNAME --password PASSWORD --url URL [--to-yaml]
optional arguments:
-h, --help show this help message and exit
-f MAPPINGS_FILE, --mappings-file MAPPINGS_FILE
Path to the tenants mappings config file
--username USERNAME
--password PASSWORD
--url URL
--to-yaml Output the mappings in YAML
example file:
---
# example.config.yaml
tenant_name: application-01
ignore_duplicates_conflict: true
mappings:
- logicalTopicName: data.stock
physicalTopicName: data.stock
readOnly: true
cdk-cli-import-tenant-mappings -f example.config.yaml \
--username ${PROXY_USERNAME} \
--password ${PROXY_PASSWORD} \
--url ${PROXY_URL}
cdk-cli-create-tenant-token
Create a new user tenant token
cdk-cli-create-tenant-token \
--username ${PROXY_USERNAME} \
--password ${PROXY_PASSWORD} \
--url ${PROXY_URL} \
--lifetime-in-seconds 3600 \
--tenant-name js-fin-panther-stg
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cdk_proxy_api_client-0.1.2.tar.gz
(13.9 kB
view hashes)
Built Distribution
Close
Hashes for cdk_proxy_api_client-0.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | edfb93d7da35d819f5317b42fc35fa1afc2ba1e6de0aa4ba92f110dab827593a |
|
MD5 | 31912158e0713469ef6804a3e88e7fe8 |
|
BLAKE2b-256 | daebe661e0bf69682679c4a2eaf25dd095bf712b4bf41c38c9d51f760cfd2570 |
Close
Hashes for cdk_proxy_api_client-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc7681982d4a1a8991850308d1a47f14c81e7c9921ca0d768d23e833fd90adf9 |
|
MD5 | a4ba60925383e1a80c967b00899e5e77 |
|
BLAKE2b-256 | 8171be4165e85151668e83cfdfa5f62d53da08783c5da77a56d609fc51968147 |