Confluent Cloud SDK
SDK to interact with Confluent Cloud API
Installation
pip install confluent-cloud-sdk
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",
)
Example with secret in AWS And list all assets
import json
from os import environ
from boto3.session import Session
from confluent_cloud_sdk.client_factory import ConfluentClient
from confluent_cloud_sdk.confluent_iam_v2 import ServiceAccount
from confluent_cloud_sdk.confluent_org_v2 import ConfluentEnvironment
from confluent_cloud_sdk.confluent_cluster_v2 import KafkaClusterV2
from compose_x_common.aws import get_session
def get_confluent_admin_secret(
secret_arn: str,
session: Session = None,
key_id: str = "ApiKey",
secret_id: str = "ApiSecret",
) -> ConfluentClient:
session = get_session(session)
client = session.client("secretsmanager")
value = json.loads(client.get_secret_value(SecretId=secret_arn)["SecretString"])
return ConfluentClient(value[key_id], value[secret_id])
cclient = get_confluent_admin_secret(environ.get("SECRET_ARN"))
envs = cclient.list_all(ConfluentEnvironment)
for env in envs:
print(env.obj_id)
clusters = cclient.list_all(KafkaClusterV2, url_args=f"?environment={env.obj_id}")
for cluster in clusters:
print(cluster.obj_id)
svc_accounts = cclient.list_all(ServiceAccount)
for svc_account in svc_accounts:
print(svc_account.obj_id)
svc_account.import_api_keys()
print([key.obj_id for key in svc_account.api_keys.values()])
Usage examples
For more details, see docs/usage.rst
Metadata
Release files for confluent-cloud-sdk 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| confluent_cloud_sdk-0.2.3.tar.gz | 14.6 kB | Without provenance | Details for confluent_cloud_sdk-0.2.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| confluent_cloud_sdk-0.2.3-py3-none-any.whl | Python 3 | none | any | Details for confluent_cloud_sdk-0.2.3-py3-none-any.whl |
Total release size: 33.0 kB
Release files / confluent_cloud_sdk-0.2.3.tar.gz
| Download URL | confluent_cloud_sdk-0.2.3.tar.gz |
|---|---|
| Size | 14.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a8280ae04019c73a6769bf7170096b722b82a7875b8a33c049db01f1ba6abc6e
|
|
BLAKE2b-256 checksum How to use checksums |
8fed22b6876833271b46fc999cfe91b86e28808292b253a0bc4a83d55b8093c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.11.5 Linux/6.4.12-100.fc37.x86_64
|
Release files / confluent_cloud_sdk-0.2.3-py3-none-any.whl
| Download URL | confluent_cloud_sdk-0.2.3-py3-none-any.whl |
|---|---|
| Size | 18.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c11e10d28e956742c1b4138e9220befdd47d1e5a34e8c3be56155f95ebe95ece
|
|
BLAKE2b-256 checksum How to use checksums |
7bfad1b7254d13426936be4e763eed6c2a5dc0f8aa678f765de9bbac0dedb920
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.11.5 Linux/6.4.12-100.fc37.x86_64
|
Security for confluent-cloud-sdk 0.2.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.