Confluent Cloud API SDK
Project description
SDK to interact with Confluent Cloud API
Installation
pip install confluent-cloud-sdk
Usage examples
For more details, see docs/usage.rst
Imports
To use Confluent Admin API SDK in a project
from confluent_cloud_sdk.client_factory import ConfluentClient
from confluent_cloud_sdk.confluent_iam_v2 import ApiKey
from confluent_cloud_sdk.confluent_iam_v2 import ServiceAccount
Initialize connection
client = ConfluentClient(
"cloud_key_key",
"cloud_key_secret",
)
List all service accounts
accounts_request = ServiceAccount(client, None).list()
for account in accounts_request.json()["data"]
print(account)
Create a new service account
new_service_account = ServiceAccount(
client, display_name="test_client", description="A simple service account"
)
try:
new_service_account.create() # we try to create the user. If already exists, there will be conflict.
except GenericConflict:
new_service_account.set_from_read()
print("SVC ACCOUNT ID IS", new_service_account.obj_id)
List all API Keys of the service account
new_service_account.import_api_keys()
for key in new_service._api_keys:
print(key.id)
Create a new API Key for the service account for a given resource
new_api_key = ApiKey(client, display_name="new-test-key")
new_api_key.create(
owner_id=new_service_account.obj_id,
resource_id="cluster_id",
)
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
confluent_cloud_sdk-0.1.0.tar.gz
(14.0 kB
view hashes)
Built Distribution
Close
Hashes for confluent_cloud_sdk-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1e67560fbfb4d80fa5fcb9121c302cc74645450a6e6ca472c8c01ddd228ff06 |
|
MD5 | 78195cf3293a34a3bda187641ad6a5c2 |
|
BLAKE2b-256 | 862bb61d070bfc0439cdddd90928df18c122fec477e5b86b81acdcdb6f55c0b6 |
Close
Hashes for confluent_cloud_sdk-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e4b50e32294b5b594b6ca7fa5d6cc74bc6909dd721019279dcd4415b6dcc559 |
|
MD5 | dd891d0e2b4cc4e203e2597a2ffd7ba0 |
|
BLAKE2b-256 | 6e5d306a91d906d3f2c6c0e52bdd6946b496385dd8bcfdc7f515a0538f6e69cc |