curl --request PUT \
--url https://api.example.com/api/state-templates/{name} \
--header 'x-api-key: <api-key>'import requests
url = "https://api.example.com/api/state-templates/{name}"
headers = {"x-api-key": "<api-key>"}
response = requests.put(url, headers=headers)
print(response.text)const options = {method: 'PUT', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.example.com/api/state-templates/{name}', 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.example.com/api/state-templates/{name}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/state-templates/{name}"
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.example.com/api/state-templates/{name}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/state-templates/{name}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"name": "<string>",
"declarations": {
"schema": {},
"check": {
"content": "<string>",
"id": "<string>",
"kwargs": {}
}
},
"description": "",
"kind": "state-template",
"parameters": {},
"reconcile": {
"close": {
"content": "<string>",
"id": "<string>",
"kwargs": {}
},
"orphans": {
"content": "<string>",
"id": "<string>",
"kwargs": {}
},
"resolutions": {
"content": "<string>",
"id": "<string>",
"kwargs": {}
}
},
"regimes": [
{}
],
"schema": {
"content": "<string>",
"id": "<string>",
"kwargs": {}
},
"template_jq": {},
"trace": {}
}
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Create or replace a state template
Upload a state-template document; the name is taken from the path. An existing name
without replace is refused so an overwrite is deliberate.
curl --request PUT \
--url https://api.example.com/api/state-templates/{name} \
--header 'x-api-key: <api-key>'import requests
url = "https://api.example.com/api/state-templates/{name}"
headers = {"x-api-key": "<api-key>"}
response = requests.put(url, headers=headers)
print(response.text)const options = {method: 'PUT', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.example.com/api/state-templates/{name}', 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.example.com/api/state-templates/{name}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_HTTPHEADER => [
"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"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/state-templates/{name}"
req, _ := http.NewRequest("PUT", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://api.example.com/api/state-templates/{name}")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/state-templates/{name}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": {
"name": "<string>",
"declarations": {
"schema": {},
"check": {
"content": "<string>",
"id": "<string>",
"kwargs": {}
}
},
"description": "",
"kind": "state-template",
"parameters": {},
"reconcile": {
"close": {
"content": "<string>",
"id": "<string>",
"kwargs": {}
},
"orphans": {
"content": "<string>",
"id": "<string>",
"kwargs": {}
},
"resolutions": {
"content": "<string>",
"id": "<string>",
"kwargs": {}
}
},
"regimes": [
{}
],
"schema": {
"content": "<string>",
"id": "<string>",
"kwargs": {}
},
"template_jq": {},
"trace": {}
}
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}Authorizations
Path Parameters
Response
Success.
A state-template document: the reusable schema fragment plus the parameters, write
regimes, attach-time declarations and trace switch the platform owns, plus
template_jq (named jq programs — input-purpose reads and update-purpose
record operations) and reconcile (how a declarations edit settles open records)
that give the record its meaning. A template is data end to end: the states API serves
an input-purpose result for a subject and applies an update-purpose program to a subject
generically, so a template is usable through the API with no other engine.
extra="forbid" refuses any key outside these.
The wire key schema is the attribute schema_ (alias). The declarations,
template_jq and reconcile sections carry their served sub-shapes
(:class:StateTemplateDeclarations, :class:StateTemplateJq,
:class:StateTemplateReconcile); the skeleton store does the semantic validation (jq
compilation, regime/record path resolution against the fragment) these models do not.
Show child attributes
Show child attributes

