crystal-docker-api | src/docker/volumes.cr ∙ GitFOSS
.cr
Crystal
(text/x-crystal)
require "./api_client_wrapper"
require "./api/models/volume"

# Interact with a single container that exists on a docker client.
class Docker::Volumes
  include Docker::ApiClientWrapper

  def initialize(@client : Docker::Api::ApiClient)
  end

  # Method to get an archive from container
  def list(filters : Hash(String, Array(String)))
    # filters: { "name" => [vid] }
    @client.list_volume filters
  end

  # Method to send an archive to container
  def create(name : String)
    @client.create_volume name
  end
end