curl --request POST \
--url https://api.eddy.engineer/v1/storage.instances \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"backend": {
"bucket": "<string>",
"dir": "<string>"
},
"region": "<string>",
"restore_from": "<string>"
}
'import requests
url = "https://api.eddy.engineer/v1/storage.instances"
payload = {
"name": "<string>",
"backend": {
"bucket": "<string>",
"dir": "<string>"
},
"region": "<string>",
"restore_from": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
backend: {bucket: '<string>', dir: '<string>'},
region: '<string>',
restore_from: '<string>'
})
};
fetch('https://api.eddy.engineer/v1/storage.instances', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.eddy.engineer/v1/storage.instances",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'backend' => [
'bucket' => '<string>',
'dir' => '<string>'
],
'region' => '<string>',
'restore_from' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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 := "https://api.eddy.engineer/v1/storage.instances"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"backend\": {\n \"bucket\": \"<string>\",\n \"dir\": \"<string>\"\n },\n \"region\": \"<string>\",\n \"restore_from\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.post("https://api.eddy.engineer/v1/storage.instances")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"backend\": {\n \"bucket\": \"<string>\",\n \"dir\": \"<string>\"\n },\n \"region\": \"<string>\",\n \"restore_from\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/storage.instances")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"backend\": {\n \"bucket\": \"<string>\",\n \"dir\": \"<string>\"\n },\n \"region\": \"<string>\",\n \"restore_from\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}Create a storage instance (an org admin)
kind: paramdb creates a new store directory under the engine’s instance root and mounts it now; it lives on the engine’s volume, so its region is the engine’s (400 REGION_UNAVAILABLE for another) and it takes no backend. kind: blobs registers a bucket a person has already made (backend.bucket; the engine creates none): the engine writes, reads and deletes a probe object there before it answers, and refuses 502 STORAGE_UNREACHABLE when that fails. On an engine that keeps its blobs on disk a blob instance may be a local directory (the engine’s choice under its instance root, or backend.dir from the deployment admin). Answers the instance as GET /v1/storage.instances/{id} does. SI6: kind: vector (with vector: {dims, metric?}), timeseries and sql make a data store with the engine: a vector store is a collection on the engine’s vector server, or an exact store on its instance volume when it has none; a time-series store and a SQL database are a database file on the instance volume. Like a ParamDB instance they take the engine’s region and no backend. They are used through their own routes (/sql, /series.*, /vectors.*) and deleted with DELETE /v1/storage.instances/{id}. SI7: kind: kv makes a key-value store and kind: analytics a columnar analytics database, both on the instance volume (analytics is 503 STORAGE_KIND_UNAVAILABLE on an engine built without it). SI8: restore_from makes a data store from a backup the caller may read: the artifact a store’s backup action answers, or for sql, timeseries, kv and vector any SQLite file with that kind’s tables (any SQLite file for sql). The file is checked whole and of its kind before the store is kept (400 STORAGE_RESTORE otherwise); a backup of one kind restores as that kind, and any SQLite-kind backup also as sql; an analytics store restores only from a backup this engine made. A vector backup carries its shape, so vector may be left out. The answer adds restored: {from, found} (points, keys, rows or tables). 403 ORG_FORBIDDEN for anyone but an admin of the org.
curl --request POST \
--url https://api.eddy.engineer/v1/storage.instances \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"backend": {
"bucket": "<string>",
"dir": "<string>"
},
"region": "<string>",
"restore_from": "<string>"
}
'import requests
url = "https://api.eddy.engineer/v1/storage.instances"
payload = {
"name": "<string>",
"backend": {
"bucket": "<string>",
"dir": "<string>"
},
"region": "<string>",
"restore_from": "<string>"
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
backend: {bucket: '<string>', dir: '<string>'},
region: '<string>',
restore_from: '<string>'
})
};
fetch('https://api.eddy.engineer/v1/storage.instances', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.eddy.engineer/v1/storage.instances",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>',
'backend' => [
'bucket' => '<string>',
'dir' => '<string>'
],
'region' => '<string>',
'restore_from' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$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 := "https://api.eddy.engineer/v1/storage.instances"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"backend\": {\n \"bucket\": \"<string>\",\n \"dir\": \"<string>\"\n },\n \"region\": \"<string>\",\n \"restore_from\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
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.post("https://api.eddy.engineer/v1/storage.instances")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"backend\": {\n \"bucket\": \"<string>\",\n \"dir\": \"<string>\"\n },\n \"region\": \"<string>\",\n \"restore_from\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/storage.instances")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"backend\": {\n \"bucket\": \"<string>\",\n \"dir\": \"<string>\"\n },\n \"region\": \"<string>\",\n \"restore_from\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}Body
Response
OK
The response is of type object.