curl --request POST \
--url https://api.example.com/v0/admin/subscriptions/evaluator-migrations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"plugin_id": "<string>",
"from_version": "<string>",
"dry_run": true,
"limit": 100,
"after": "<string>"
}
'import requests
url = "https://api.example.com/v0/admin/subscriptions/evaluator-migrations"
payload = {
"plugin_id": "<string>",
"from_version": "<string>",
"dry_run": True,
"limit": 100,
"after": "<string>"
}
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({
plugin_id: '<string>',
from_version: '<string>',
dry_run: true,
limit: 100,
after: '<string>'
})
};
fetch('https://api.example.com/v0/admin/subscriptions/evaluator-migrations', 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/v0/admin/subscriptions/evaluator-migrations",
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([
'plugin_id' => '<string>',
'from_version' => '<string>',
'dry_run' => true,
'limit' => 100,
'after' => '<string>'
]),
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.example.com/v0/admin/subscriptions/evaluator-migrations"
payload := strings.NewReader("{\n \"plugin_id\": \"<string>\",\n \"from_version\": \"<string>\",\n \"dry_run\": true,\n \"limit\": 100,\n \"after\": \"<string>\"\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.example.com/v0/admin/subscriptions/evaluator-migrations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"plugin_id\": \"<string>\",\n \"from_version\": \"<string>\",\n \"dry_run\": true,\n \"limit\": 100,\n \"after\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v0/admin/subscriptions/evaluator-migrations")
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 \"plugin_id\": \"<string>\",\n \"from_version\": \"<string>\",\n \"dry_run\": true,\n \"limit\": 100,\n \"after\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"plugin_id": "<string>",
"from_version": "<string>",
"to_version": "<string>",
"dry_run": true,
"moved": [
{
"subscription_id": "<string>",
"from_version_id": "<string>",
"version_id": "<string>"
}
],
"refused": [
{
"subscription_id": "<string>",
"version_id": "<string>",
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
],
"next_after": "<string>"
}{
"code": "<string>",
"message": "<string>",
"retryable": true,
"field": "<string>",
"resync_url": "<string>"
}Migrate subscription evaluators
Move the key’s Organization’s Subscriptions from one version of an alert-rule plugin to the version the active Pipeline Plan serves, after that plugin’s upgrade or rollback. It looks at the Subscriptions that are not deleted, enabled or disabled, whose current Version pins plugin_id at from_version, in Subscription id order, at most limit of them, after after. Each one’s Saved Query expression and evaluator configuration must validate against the served version’s schemas first; one that does not is listed in refused with the first issue and keeps its version. A moved Subscription gets a new current Version that keeps its Saved Query Version, configuration and destination and pins the served version. Like an edit, it judges only changes committed after it, nothing is re-evaluated, Matches keep the Version that produced them, and subscription.updated is announced in each of its Corpora. dry_run true validates and lists what would move without moving anything. A call moves each Subscription at most once; calling again with next_after continues, and repeating a call converges. Subscriptions whose Corpora the key does not all grant are left out. 422 unsupported_evaluator when no version of plugin_id serves new Subscriptions, invalid_migration when from_version is that version. Requires plugins:admin.
curl --request POST \
--url https://api.example.com/v0/admin/subscriptions/evaluator-migrations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"plugin_id": "<string>",
"from_version": "<string>",
"dry_run": true,
"limit": 100,
"after": "<string>"
}
'import requests
url = "https://api.example.com/v0/admin/subscriptions/evaluator-migrations"
payload = {
"plugin_id": "<string>",
"from_version": "<string>",
"dry_run": True,
"limit": 100,
"after": "<string>"
}
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({
plugin_id: '<string>',
from_version: '<string>',
dry_run: true,
limit: 100,
after: '<string>'
})
};
fetch('https://api.example.com/v0/admin/subscriptions/evaluator-migrations', 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/v0/admin/subscriptions/evaluator-migrations",
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([
'plugin_id' => '<string>',
'from_version' => '<string>',
'dry_run' => true,
'limit' => 100,
'after' => '<string>'
]),
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.example.com/v0/admin/subscriptions/evaluator-migrations"
payload := strings.NewReader("{\n \"plugin_id\": \"<string>\",\n \"from_version\": \"<string>\",\n \"dry_run\": true,\n \"limit\": 100,\n \"after\": \"<string>\"\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.example.com/v0/admin/subscriptions/evaluator-migrations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"plugin_id\": \"<string>\",\n \"from_version\": \"<string>\",\n \"dry_run\": true,\n \"limit\": 100,\n \"after\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v0/admin/subscriptions/evaluator-migrations")
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 \"plugin_id\": \"<string>\",\n \"from_version\": \"<string>\",\n \"dry_run\": true,\n \"limit\": 100,\n \"after\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"plugin_id": "<string>",
"from_version": "<string>",
"to_version": "<string>",
"dry_run": true,
"moved": [
{
"subscription_id": "<string>",
"from_version_id": "<string>",
"version_id": "<string>"
}
],
"refused": [
{
"subscription_id": "<string>",
"version_id": "<string>",
"code": "<string>",
"field": "<string>",
"message": "<string>"
}
],
"next_after": "<string>"
}{
"code": "<string>",
"message": "<string>",
"retryable": true,
"field": "<string>",
"resync_url": "<string>"
}Authorizations
API key, not necessarily a JWT. Server derives Organization, permitted actions and Corpus scope; every resource access is authorized.
Body
The alert-rule plugin, such as alerts.
1 - 256The version the Subscriptions to move pin now.
1 - 256true validates and lists what would move, without moving anything.
The most Subscriptions this call looks at.
1 <= x <= 500Continue after this Subscription id, the next_after of the previous call.
1Response
Successful response
The version the active plan serves, which moved Subscriptions pin.
The Subscriptions moved, or that would move in a dry run.
Show child attributes
Show child attributes
The Subscriptions left on from_version. code is invalid_expression or invalid_subscription_configuration when the served version's schemas refuse them (field and message name the first issue), or subscription_changed when the Subscription got another Version during the call.
Show child attributes
Show child attributes
Present when more Subscriptions may pin from_version; pass it as after.