Vast.ai API
Instances
copy
1min
code examples curl location request put 'https //console vast ai/api/v0/commands/copy direct/' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{ "src path" "", "dst path" "" }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "src path" "", "dst path" "" }); var requestoptions = { method 'put', headers myheaders, body raw, redirect 'follow' }; fetch("https //console vast ai/api/v0/commands/copy direct/", 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/commands/copy direct/") https = net http new(url host, url port) https use ssl = true request = net http put new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request body = json dump({ "src path" "", "dst path" "" }) response = https request(request) puts response read body import requests import json url = "https //console vast ai/api/v0/commands/copy direct/" payload = json dumps({ "src path" "", "dst path" "" }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("put", url, headers=headers, data=payload) print(response text) responses // remote copy initiated successfully { "success" true, "msg" "remote to remote copy initiated check instance status bar for progress updates ( 30 seconds delayed) " }// invalid arguments provided { "success" false, "error" "invalid args", "msg" "invalid src path " }// source or destination id not found or access denied { "success" false, "error" "no such user", "msg" "no such user " }