Class: Docker::API::Volume
Overview
This class represents the Docker API endpoints regarding volumes.
Instance Method Summary collapse
-
#create(body = {}) ⇒ Object
Create a volume.
-
#details(name) ⇒ Object
Inspect a volume.
-
#list(params = {}) ⇒ Object
List volumes.
-
#prune(params = {}) ⇒ Object
Delete unused volumes.
-
#remove(name, params = {}) ⇒ Object
Remove a volume.
Methods inherited from Base
Constructor Details
This class inherits a constructor from Docker::API::Base
Instance Method Details
#create(body = {}) ⇒ Object
Create a volume.
Docker API: POST /volumes/create
35 36 37 |
# File 'lib/docker/api/volume.rb', line 35 def create body = {} @connection.request(method: :post, path: "/volumes/create", headers: {"Content-Type": "application/json"}, body: body.to_json) end |
#details(name) ⇒ Object
Inspect a volume.
Docker API: GET /volumes/name
24 25 26 |
# File 'lib/docker/api/volume.rb', line 24 def details name @connection.get("/volumes/#{name}") end |
#list(params = {}) ⇒ Object
List volumes.
Docker API: GET
13 14 15 |
# File 'lib/docker/api/volume.rb', line 13 def list params = {} @connection.get(build_path("/volumes", params)) end |
#prune(params = {}) ⇒ Object
Delete unused volumes.
Docker API: POST /volumes/prune
58 59 60 |
# File 'lib/docker/api/volume.rb', line 58 def prune params = {} @connection.post(build_path("/volumes/prune", params)) end |
#remove(name, params = {}) ⇒ Object
Remove a volume.
Docker API: DELETE /volumes/name
47 48 49 |
# File 'lib/docker/api/volume.rb', line 47 def remove name, params = {} @connection.delete(build_path("/volumes/#{name}",params)) end |