diff --git a/ROADMAP.md b/ROADMAP.md index 648d4c5..bb4d938 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -20,7 +20,7 @@ reference](https://docs.docker.com/engine/api/v1.41/). - [ ] Start a container - [ ] Stop a container - [ ] Restart a container - - [ ] Kill a container + - [x] Kill a container - [ ] Update a container - [ ] Rename a container - [ ] Pause a container diff --git a/containers.v b/containers.v index c119f9e..ce9c81b 100644 --- a/containers.v +++ b/containers.v @@ -89,6 +89,12 @@ pub fn (mut d DockerConn) container_remove(id string) ! { d.read_response()! } +pub fn (mut d DockerConn) container_kill(id string) ! { + d.request(.post, '/containers/${id}/kill') + d.send()! + d.read_response()! +} + pub fn (mut d DockerConn) container_get_logs(id string) !&StreamFormatReader { d.request(.get, '/containers/${id}/logs') d.params({ diff --git a/images.v b/images.v index fd7f0d4..8641430 100644 --- a/images.v +++ b/images.v @@ -40,7 +40,7 @@ pub fn (mut d DockerConn) image_from_container(id string, repo string, tag strin 'repo': repo 'tag': tag }) - d.body('application/json', '{}') + d.body('application/json', '{}') d.send()! return d.read_json_response[Image]()!