diff options
| author | 2021-07-18 04:08:04 +0100 | |
|---|---|---|
| committer | 2021-07-18 04:08:04 +0100 | |
| commit | 19a122a6281a4877d4c1db657fbe7fb3d8a1ac35 (patch) | |
| tree | a1a89696393d452eebcaf0746d642002703280d5 /arthur/apis/kubernetes/certificates.py | |
| parent | fix: add missing type annotation (diff) | |
refactor: move certificates to separate API module
Diffstat (limited to 'arthur/apis/kubernetes/certificates.py')
| -rw-r--r-- | arthur/apis/kubernetes/certificates.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arthur/apis/kubernetes/certificates.py b/arthur/apis/kubernetes/certificates.py new file mode 100644 index 0000000..45ce9ec --- /dev/null +++ b/arthur/apis/kubernetes/certificates.py @@ -0,0 +1,14 @@ +"""APIs for interacting with TLS certificates through cert-manager.io CRDs.""" +from typing import Any + +from kubernetes_asyncio import client +from kubernetes_asyncio.client.api_client import ApiClient + + +async def list_certificates(namespace: str) -> dict[str, Any]: + """List certificate objects created through cert-manager.""" + async with ApiClient() as api: + api = client.CustomObjectsApi(api) + return await api.list_namespaced_custom_object( + "cert-manager.io", "v1", namespace, "certificates" + ) |