curl --request POST \
--url https://api.eddy.engineer/v1/power.import \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"blob": "<string>",
"entry": "<string>",
"files": {},
"include_document": true,
"name": "<string>",
"text": "<string>"
}
'import requests
url = "https://api.eddy.engineer/v1/power.import"
payload = {
"blob": "<string>",
"entry": "<string>",
"files": {},
"include_document": True,
"name": "<string>",
"text": "<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({
blob: '<string>',
entry: '<string>',
files: {},
include_document: true,
name: '<string>',
text: '<string>'
})
};
fetch('https://api.eddy.engineer/v1/power.import', 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.import",
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([
'blob' => '<string>',
'entry' => '<string>',
'files' => [
],
'include_document' => true,
'name' => '<string>',
'text' => '<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.import"
payload := strings.NewReader("{\n \"blob\": \"<string>\",\n \"entry\": \"<string>\",\n \"files\": {},\n \"include_document\": true,\n \"name\": \"<string>\",\n \"text\": \"<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.import")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"blob\": \"<string>\",\n \"entry\": \"<string>\",\n \"files\": {},\n \"include_document\": true,\n \"name\": \"<string>\",\n \"text\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/power.import")
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 \"blob\": \"<string>\",\n \"entry\": \"<string>\",\n \"files\": {},\n \"include_document\": true,\n \"name\": \"<string>\",\n \"text\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}Import a MATPOWER case, a pandapower JSON network or OpenDSS scripts as a power network document
format: matpower reads a .m case file’s text, matpower_planning the same with TP2’s planning fields (gencost as costs, rate A, B and C as ratings by duty, angle limits, areas and zones, dcline and MatACDC HVDC links, ne_branch candidates: the network the OPF, transfer and security studies take), pandapower a network saved as JSON (pandapower.to_json), opendss a .dss script: one script as text, or several as files (path to contents, paths as the scripts name each other with redirect and compile) with entry naming the one to start from. The network is stored and validated as power_network does, with its origin (format, file name, the file’s BLAKE3). import_findings lists everything the importer read and did not carry, every value it had to assume and every element it does not support, by code: nothing is dropped without one. Refused: POWER_IMPORT_INVALID (400: the file cannot be read at all, with why), POWER_CAP (413), POWER_REQUEST (400). TL3c: blob (a blob id) instead of text: the file is read from the blob as the caller and imported exactly as if sent inline; giving both is 400 FILE_GIVEN_TWICE, a blob that is not UTF-8 text 400 BLOB_NOT_TEXT.
curl --request POST \
--url https://api.eddy.engineer/v1/power.import \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"blob": "<string>",
"entry": "<string>",
"files": {},
"include_document": true,
"name": "<string>",
"text": "<string>"
}
'import requests
url = "https://api.eddy.engineer/v1/power.import"
payload = {
"blob": "<string>",
"entry": "<string>",
"files": {},
"include_document": True,
"name": "<string>",
"text": "<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({
blob: '<string>',
entry: '<string>',
files: {},
include_document: true,
name: '<string>',
text: '<string>'
})
};
fetch('https://api.eddy.engineer/v1/power.import', 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.import",
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([
'blob' => '<string>',
'entry' => '<string>',
'files' => [
],
'include_document' => true,
'name' => '<string>',
'text' => '<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.import"
payload := strings.NewReader("{\n \"blob\": \"<string>\",\n \"entry\": \"<string>\",\n \"files\": {},\n \"include_document\": true,\n \"name\": \"<string>\",\n \"text\": \"<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.import")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"blob\": \"<string>\",\n \"entry\": \"<string>\",\n \"files\": {},\n \"include_document\": true,\n \"name\": \"<string>\",\n \"text\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.eddy.engineer/v1/power.import")
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 \"blob\": \"<string>\",\n \"entry\": \"<string>\",\n \"files\": {},\n \"include_document\": true,\n \"name\": \"<string>\",\n \"text\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}{
"error": {
"code": "INVALID_GEOMETRY",
"message": "<string>"
}
}Body
TL3c: a blob id (b3:<64 hex>: an upload's blob_id, an attachment's blob) holding the file, instead of text: read as the caller under the read gate (a blob the caller may not read answers 404 BLOB_NOT_FOUND, as an absent one) and imported exactly as if its contents were sent inline. Give one of the two (both: 400 FILE_GIVEN_TWICE).
The file's contents (one file)
Response
key, format, origin, counts, cases, validation, import_findings, import_findings_count, profiles (the profile documents an OpenDSS import makes from its load shapes, each stored under its key, which the network's profiles bindings name: key, name, kind, unit, time, step, count, range), document
The response is of type object.