Vast.ai API
Instances

show logs

1min
code examples curl location globoff request put 'https //console vast ai/api/v0/instances/request logs/{id}' \\ \ header 'accept application/json' \\ \ header 'content type application/json'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var requestoptions = { method 'put', headers myheaders, redirect 'follow' }; fetch("https //console vast ai/api/v0/instances/request logs/{id}", 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/instances/request logs/{id}") 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" response = https request(request) puts response read body import requests import json url = "https //console vast ai/api/v0/instances/request logs/{id}" payload = {} headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("put", url, headers=headers, data=payload) print(response text) responses // success response with s3 url for log retrieval { "success" true, "result url" "https //s3 amazonaws com/vast ai/instance logs/{hash} log", "msg" "" }// not authorized { "error" "not authorized", "msg" "not authorized to view logs for this instance" }// instance not found { "error" "invalid id", "msg" "invalid instance id " }