github.com/rootless-containers/rootlesskit/v2@v2.3.4/docs/api.md (about) 1 # REST API 2 3 RootlessKit listens REST API on `${ROOTLESSKIT_STATE_DIR}/api.sock`. 4 5 ```console 6 (host)$ rootlesskit --net=slirp4netns --port-driver=builtin bash 7 (rootlesskit)# curl -s --unix-socket "${ROOTLESSKIT_STATE_DIR}/api.sock" http://rootlesskit/v1/info | jq . 8 { 9 "apiVersion": "1.1.0", 10 "version": "0.14.0-beta.0", 11 "stateDir": "/tmp/rootlesskit957151185", 12 "childPID": 157684, 13 "networkDriver": { 14 "driver": "slirp4netns", 15 "dns": [ 16 "10.0.2.3" 17 ] 18 }, 19 "portDriver": { 20 "driver": "builtin", 21 "protos": [ 22 "tcp", 23 "udp" 24 ] 25 } 26 } 27 ``` 28 29 ## openapi.yaml 30 31 See [`../pkg/api/openapi.yaml`](../pkg/api/openapi.yaml) 32 33 ## rootlessctl CLI 34 35 `rootlessctl` is the CLI for the API. 36 37 ```console 38 $ rootlessctl --help 39 NAME: 40 rootlessctl - RootlessKit API client 41 42 USAGE: 43 rootlessctl [global options] command [command options] [arguments...] 44 45 VERSION: 46 0.14.0-beta.0 47 48 COMMANDS: 49 list-ports List ports 50 add-ports Add ports 51 remove-ports Remove ports 52 info Show info 53 help, h Shows a list of commands or help for one command 54 55 GLOBAL OPTIONS: 56 --debug debug mode (default: false) 57 --socket value Path to api.sock (under the "rootlesskit --state-dir" directory), defaults to $ROOTLESSKIT_STATE_DIR/api.sock 58 --help, -h show help (default: false) 59 --version, -v print the version (default: false) 60 ``` 61 62 e.g., `rootlessctl --socket /foo/bar/sock info --json`