aboutsummaryrefslogtreecommitdiffstats
path: root/arthur/apis/kubernetes/pods.py
diff options
context:
space:
mode:
Diffstat (limited to 'arthur/apis/kubernetes/pods.py')
-rw-r--r--arthur/apis/kubernetes/pods.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/arthur/apis/kubernetes/pods.py b/arthur/apis/kubernetes/pods.py
new file mode 100644
index 0000000..dfdc80c
--- /dev/null
+++ b/arthur/apis/kubernetes/pods.py
@@ -0,0 +1,12 @@
+"""APIs for working with Kubernetes pods."""
+
+from kubernetes_asyncio import client
+from kubernetes_asyncio.client.api_client import ApiClient
+from kubernetes_asyncio.client.models import V1PodList
+
+
+async def list_pods(namespace: str) -> V1PodList:
+ """Query the Kubernetes API for a list of pods in the provided namespace."""
+ async with ApiClient() as api_client:
+ api = client.CoreV1Api(api_client)
+ return await api.list_namespaced_pod(namespace=namespace)