Vast.ai API
Volumes
unlist volume
1 min
code examples curl location 'https //console vast ai/api/v0/volumes/unlist' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{ "id" 2029 }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "id" 2029 }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("https //console vast ai/api/v0/volumes/unlist", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("https //console vast ai/api/v0/volumes/unlist") https = net http new(url host, url port) https use ssl = true request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request body = json dump({ "id" 2029 }) response = https request(request) puts response read body import requests import json url = "https //console vast ai/api/v0/volumes/unlist" payload = json dumps({ "id" 2029 }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // success response { "success" true, "msg" "unlisted volume 2029 " }// bad request { "success" false, "msg" "" }// too many requests { "detail" "api requests too frequent endpoint threshold=5 0" }