curl --request POST \
--url https://api.eddy.engineer/v1/power.network \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"network": {},
"network_key": "<string>",
"project": "<string>",
"variant": "<string>"
}
'import requests
url = "https://api.eddy.engineer/v1/power.network"
payload = {
"network": {},
"network_key": "<string>",
"project": "<string>",
"variant": "<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({network: {}, network_key: '<string>', project: '<string>', variant: '<string>'})
};
fetch('https://api.eddy.engineer/v1/power.network', 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/power.network",
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([
'network' => [
],
'network_key' => '<string>',
'project' => '<string>',
'variant' => '<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/power.network"
payload := strings.NewReader("{\n \"network\": {},\n \"network_key\": \"<string>\",\n \"project\": \"<string>\",\n \"variant\": \"<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/power.network")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"network\": {},\n \"network_key\": \"<string>\",\n \"project\": \"<string>\",\n \"variant\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/power.network")
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 \"network\": {},\n \"network_key\": \"<string>\",\n \"project\": \"<string>\",\n \"variant\": \"<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>"
}
}Store a power network document (`ss.power.network/1`) by content address and validate it
Start here with a network you hold: the document is put in canonical form (lists by id), stored under the BLAKE3 of its bytes and validated. Answers key (what every study takes as network_key), counts, cases (each study case’s id, study and value tables), extensions (the per-study data the document carries: short_circuit, protection, coordination, arc_flash, sizing, harmonics) and validation: every problem as a typed finding with its code, severity, element and message (islands, missing data, impossible values, dangling references). A document with findings is still stored; a study says what it could not do. With project the project’s document is stored as it stands. Refused: POWER_REQUEST (400: not exactly one of network, network_key, project), POWER_DOCUMENT_INVALID (400: not a network document, with where), POWER_CAP (413), POWER_NETWORK_NOT_FOUND (404), POWER_PROJECT_KIND (422: the project is not a power project).
curl --request POST \
--url https://api.eddy.engineer/v1/power.network \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"network": {},
"network_key": "<string>",
"project": "<string>",
"variant": "<string>"
}
'import requests
url = "https://api.eddy.engineer/v1/power.network"
payload = {
"network": {},
"network_key": "<string>",
"project": "<string>",
"variant": "<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({network: {}, network_key: '<string>', project: '<string>', variant: '<string>'})
};
fetch('https://api.eddy.engineer/v1/power.network', 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/power.network",
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([
'network' => [
],
'network_key' => '<string>',
'project' => '<string>',
'variant' => '<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/power.network"
payload := strings.NewReader("{\n \"network\": {},\n \"network_key\": \"<string>\",\n \"project\": \"<string>\",\n \"variant\": \"<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/power.network")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"network\": {},\n \"network_key\": \"<string>\",\n \"project\": \"<string>\",\n \"variant\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/power.network")
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 \"network\": {},\n \"network_key\": \"<string>\",\n \"project\": \"<string>\",\n \"variant\": \"<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>"
}
}Body
Response
schema, key, blob_uri, name, frequency_hz, base_va, counts, cases, extensions, validation {errors, warnings, info, findings, truncated}
The response is of type object.