Write Workspace Files
curl --request PUT \
--url http://127.0.0.1:9321/api/workspaces/{name}/files \
--header 'Content-Type: application/json' \
--data '
{
"files": {},
"delete": [
"<string>"
]
}
'import requests
url = "http://127.0.0.1:9321/api/workspaces/{name}/files"
payload = {
"files": {},
"delete": ["<string>"]
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({files: {}, delete: ['<string>']})
};
fetch('http://127.0.0.1:9321/api/workspaces/{name}/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "9321",
CURLOPT_URL => "http://127.0.0.1:9321/api/workspaces/{name}/files",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'files' => [
],
'delete' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://127.0.0.1:9321/api/workspaces/{name}/files"
payload := strings.NewReader("{\n \"files\": {},\n \"delete\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("http://127.0.0.1:9321/api/workspaces/{name}/files")
.header("Content-Type", "application/json")
.body("{\n \"files\": {},\n \"delete\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://127.0.0.1:9321/api/workspaces/{name}/files")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"files\": {},\n \"delete\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"written": 123,
"deleted": 123,
"file_count": 123,
"total_bytes": 123,
"files": [
{
"path": "<string>",
"size": 123,
"sha256": "<string>",
"mtime": "<string>"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Workspaces
Write Workspace Files
Reference for merged 0.6.0 source. The latest verified binary release is 0.5.5; use your Engine’s /api/openapi.json for its installed contract.
Write Workspace Files
curl --request PUT \
--url http://127.0.0.1:9321/api/workspaces/{name}/files \
--header 'Content-Type: application/json' \
--data '
{
"files": {},
"delete": [
"<string>"
]
}
'import requests
url = "http://127.0.0.1:9321/api/workspaces/{name}/files"
payload = {
"files": {},
"delete": ["<string>"]
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({files: {}, delete: ['<string>']})
};
fetch('http://127.0.0.1:9321/api/workspaces/{name}/files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "9321",
CURLOPT_URL => "http://127.0.0.1:9321/api/workspaces/{name}/files",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'files' => [
],
'delete' => [
'<string>'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "http://127.0.0.1:9321/api/workspaces/{name}/files"
payload := strings.NewReader("{\n \"files\": {},\n \"delete\": [\n \"<string>\"\n ]\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("http://127.0.0.1:9321/api/workspaces/{name}/files")
.header("Content-Type", "application/json")
.body("{\n \"files\": {},\n \"delete\": [\n \"<string>\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://127.0.0.1:9321/api/workspaces/{name}/files")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"files\": {},\n \"delete\": [\n \"<string>\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"written": 123,
"deleted": 123,
"file_count": 123,
"total_bytes": 123,
"files": [
{
"path": "<string>",
"size": 123,
"sha256": "<string>",
"mtime": "<string>"
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}