Restore an instrumentation version
curl --request POST \
--url https://api.apsio.io/v1/projects/{projectId}/apps/{appId}/instrumentation/versions/{version}/restore \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"updated_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.apsio.io/v1/projects/{projectId}/apps/{appId}/instrumentation/versions/{version}/restore"
payload = { "updated_at": "2023-11-07T05:31:56Z" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({updated_at: '2023-11-07T05:31:56Z'})
};
fetch('https://api.apsio.io/v1/projects/{projectId}/apps/{appId}/instrumentation/versions/{version}/restore', 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.apsio.io/v1/projects/{projectId}/apps/{appId}/instrumentation/versions/{version}/restore",
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([
'updated_at' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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 := "https://api.apsio.io/v1/projects/{projectId}/apps/{appId}/instrumentation/versions/{version}/restore"
payload := strings.NewReader("{\n \"updated_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.apsio.io/v1/projects/{projectId}/apps/{appId}/instrumentation/versions/{version}/restore")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"updated_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apsio.io/v1/projects/{projectId}/apps/{appId}/instrumentation/versions/{version}/restore")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"updated_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"app_id": "<string>",
"families": {
"summary": {
"mode": "always",
"rate": 123,
"window_minutes": 123,
"set": true
},
"errors": {
"mode": "always",
"rate": 123,
"window_minutes": 123,
"set": true
},
"logs": {
"mode": "always",
"rate": 123,
"window_minutes": 123,
"set": true
},
"spans": {
"mode": "always",
"rate": 123,
"window_minutes": 123,
"set": true
},
"network": {
"mode": "always",
"rate": 123,
"window_minutes": 123,
"set": true
},
"metrics": {
"mode": "always",
"rate": 123,
"window_minutes": 123,
"set": true
},
"replay": {
"mode": "always",
"rate": 123,
"window_minutes": 123,
"set": true
},
"resources": {
"mode": "always",
"rate": 123,
"window_minutes": 123,
"set": true
}
},
"retention_hours": 123,
"kill_switch": {
"on": true,
"by_apsio": true,
"updated_by": "<string>",
"updated_at": "<string>"
},
"version": 123,
"updated_by": "<string>",
"updated_at": "<string>",
"untrusted": {
"kill_switch_reason": "<string>",
"rules": [
{
"id": "<string>",
"name": "<string>"
}
],
"triggers": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization",
"queries_per_minute": 123
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization",
"queries_per_minute": 123
}
}{
"error": {
"code": "grant_required",
"message": "<string>",
"grant_url": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization",
"queries_per_minute": 123
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization",
"queries_per_minute": 123
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization",
"queries_per_minute": 123
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization",
"queries_per_minute": 123
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization",
"queries_per_minute": 123
}
}API reference
Restore an instrumentation version
Makes one of the app’s versions the instrumentation again (D133): its families, retention, caps and rules, checked and published as the console’s editor would, as a new version that names the one it restored. The kill switch stays as it is. With updated_at as the caller read it, a change made since is 409 conflict. A version the app never had is 404. Devices take it at their next fetch. Owners and admins, from the console or through their agent with their instrumentation:write grant; never a project token (D117). Audited as instrumentation.update with restored_from, via, tool, oauth_client_id and grant_id. Send Content-Type: application/json.
POST
/
projects
/
{projectId}
/
apps
/
{appId}
/
instrumentation
/
versions
/
{version}
/
restore
Restore an instrumentation version
curl --request POST \
--url https://api.apsio.io/v1/projects/{projectId}/apps/{appId}/instrumentation/versions/{version}/restore \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"updated_at": "2023-11-07T05:31:56Z"
}
'import requests
url = "https://api.apsio.io/v1/projects/{projectId}/apps/{appId}/instrumentation/versions/{version}/restore"
payload = { "updated_at": "2023-11-07T05:31:56Z" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({updated_at: '2023-11-07T05:31:56Z'})
};
fetch('https://api.apsio.io/v1/projects/{projectId}/apps/{appId}/instrumentation/versions/{version}/restore', 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.apsio.io/v1/projects/{projectId}/apps/{appId}/instrumentation/versions/{version}/restore",
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([
'updated_at' => '2023-11-07T05:31:56Z'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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 := "https://api.apsio.io/v1/projects/{projectId}/apps/{appId}/instrumentation/versions/{version}/restore"
payload := strings.NewReader("{\n \"updated_at\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.apsio.io/v1/projects/{projectId}/apps/{appId}/instrumentation/versions/{version}/restore")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"updated_at\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.apsio.io/v1/projects/{projectId}/apps/{appId}/instrumentation/versions/{version}/restore")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"updated_at\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"app_id": "<string>",
"families": {
"summary": {
"mode": "always",
"rate": 123,
"window_minutes": 123,
"set": true
},
"errors": {
"mode": "always",
"rate": 123,
"window_minutes": 123,
"set": true
},
"logs": {
"mode": "always",
"rate": 123,
"window_minutes": 123,
"set": true
},
"spans": {
"mode": "always",
"rate": 123,
"window_minutes": 123,
"set": true
},
"network": {
"mode": "always",
"rate": 123,
"window_minutes": 123,
"set": true
},
"metrics": {
"mode": "always",
"rate": 123,
"window_minutes": 123,
"set": true
},
"replay": {
"mode": "always",
"rate": 123,
"window_minutes": 123,
"set": true
},
"resources": {
"mode": "always",
"rate": 123,
"window_minutes": 123,
"set": true
}
},
"retention_hours": 123,
"kill_switch": {
"on": true,
"by_apsio": true,
"updated_by": "<string>",
"updated_at": "<string>"
},
"version": 123,
"updated_by": "<string>",
"updated_at": "<string>",
"untrusted": {
"kill_switch_reason": "<string>",
"rules": [
{
"id": "<string>",
"name": "<string>"
}
],
"triggers": {}
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization",
"queries_per_minute": 123
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization",
"queries_per_minute": 123
}
}{
"error": {
"code": "grant_required",
"message": "<string>",
"grant_url": "<string>"
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization",
"queries_per_minute": 123
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization",
"queries_per_minute": 123
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization",
"queries_per_minute": 123
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization",
"queries_per_minute": 123
}
}{
"error": {
"code": "invalid_request",
"message": "<string>",
"subject": "organization",
"queries_per_minute": 123
}
}Authorizations
Path Parameters
Body
application/json
Response
The app's instrumentation, as published.