Sha256: 1e80c92f32423cb6193385ac96dea8b0a71af22e536c1a2af52cf29929d5b4a4

Contents?: true

Size: 948 Bytes

Versions: 1

Compression:

Stored size: 948 Bytes

Contents

class Apitool::Client::Backup < Apitool::Client::ApitoolClient

  def path_to_b64_path(path)
    Base64.strict_encode64(path)
  end

  def index
    get('/backups') do |response, request, result|
      if response.code == 200
        parse(response)
      else
        nil
      end
    end
  end

  def show(uuid)
    get("/backups/#{uuid}") do |response|
      if response.code == 200
        parse(response)
      else
        nil
      end
    end
  end

  # {
  #   uuid: "some unique identifier",
  #   b64_path: "some_path_encrypted_in_b64"
  # }
  def create(options = {})
    parameters = {
      backup: options
    }
    post("/backups", parameters) do |response|
      if response.code == 200
        parse(response)
      else
        nil
      end
    end
  end

  def destroy(uuid)
    delete("/backups/#{uuid}") do |response|
      if response.code == 200
        parse(response)
      else
        nil
      end
    end
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
apitool-client-2.0.0 lib/apitool/client/backup.rb