Mercurial > core / lisp/lib/pod/api.lisp
1 ;;; lib/pod/api.lisp --- Podman API model 7 curl --unix-socket /run/podman/podman.sock http://d/v4.0.0/libpod/info 9 'podman pull quay.io/containers/podman' 11 curl -XPOST --unix-socket /run/podman/podman.sock -v 'http://d/v4.0.0/images/create?fromImage=quay.io%2Fcontainers%2Fpodman' 15 curl --unix-socket /run/podman/podman.sock -v 'http://d/v4.0.0/libpod/images/json' | jq 21 (defvar *libpod-params* (make-hash-table :test #'equal)) 22 (defvar *libpod-paths* (make-hash-table :test #'equal)) 23 (defun register-libpod-param (name prototype) 24 (setf (gethash name *libpod-params*) prototype)) 25 (defun register-libpod-path (name prototype) 26 (setf (gethash name *libpod-params*) prototype))) 28 (defmacro register-libpod-params (&rest forms) 30 (register-libpod-param (car f) (cdr f)))) 32 (defmacro register-libpod-paths (&rest forms) 34 (register-libpod-path (car f) (cdr f)))) 36 ;; we should really group these better 37 (register-libpod-params ("caCertFile" string) 51 ("ignoreRootFS" boolean) 52 ("ignoreVolumes" boolean) 54 ("leaveRunning" boolean) 55 ("preCheckpoint" boolean) 56 ("printStats" boolean) 57 ("tcpEstablished" boolean) 58 ("withPrevious" boolean) 60 ("changes" (vector string)) 78 ("names" (vector string)) 80 ("podmanOnly" boolean) 84 ("additionalEnvVariables" (vector string))) 86 (register-libpod-paths 88 ("libpod/info" (:get)) 89 ("libpod/_ping" (:get)) 90 ("libpod/system/df" (:get)) 92 ("libpod/containers/json" (:get (all filters limit namespace pod size sync))) 94 ("libpod/images/json" (:get (all filters))) 96 ("libpod/pods/json" (:get (filters))) 98 ("libpod/volumes/json" (:get (filters))) 100 ("libpod/secrets/json" (:get (filters))) 102 ("libpod networks/json" (:get (filters)))) 104 (defstruct libpod-param 105 (name "" :type string) 108 (defstruct (libpod-request (:conc-name "REQUEST-")) 109 (path "" :type string) 110 (method :get :type keyword) 111 (params (make-array 0 :element-type 'libpod-param :fill-pointer 0 :adjustable t) :type (vector libpod-param)) 114 (defmethod push-param ((param libpod-param) (request libpod-request)) 115 (vector-push param (request-params request))) 117 (defmethod build-request ((self libpod-request)) 118 "Return a function that calls DEX:REQUEST with args filled in from 119 SELF. Holes are left open and exposed as arguments to the returned 120 function as in the below lambda-list: 122 (SOCKET ENDPOINT &OPTIONAL CALLBACK)." 124 (lambda (socket endpoint &optional callback) 125 (declare (ignorable socket endpoint callback))))) 127 (defstruct libpod-response 130 (body nil :type (or null vector))) 132 ;; (defmacro define-libpod-request (path)) 133 ;; (defmacro define-libpod-response (name))