nekomata / docker /inspect.lisp
SNAPKITTYWEST's picture
push from SNAPKITTYWEST/nekomata
3b70664 verified
Raw History Blame Contribute Delete
573 Bytes
(in-package #:nekod.docker)
(defun inspect-container (sock id)
"Inspect a container — returns full state as string (JSON)."
(multiple-value-bind (status body)
(docker-get sock (format nil "/containers/~a/json" id))
(if (= status 200) body
(error 'nekod:docker-api-error :message body :status-code status
:endpoint (format nil "/containers/~a/json" id)))))
(defun container-stats (sock id)
"Get container resource stats (CPU, memory, network)."
(docker-get sock (format nil "/containers/~a/stats?stream=false" id)))