更新监控
curl --request POST \
--url https://api.olostep.com/v1/monitors/{monitor_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"frequency": "<string>",
"metadata": {},
"notification": {
"events": [],
"channels": [
{
"target": "<string>",
"events": []
}
]
},
"webhook": {
"url": "<string>"
}
}
'import requests
url = "https://api.olostep.com/v1/monitors/{monitor_id}"
payload = {
"frequency": "<string>",
"metadata": {},
"notification": {
"events": [],
"channels": [
{
"target": "<string>",
"events": []
}
]
},
"webhook": { "url": "<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({
frequency: '<string>',
metadata: {},
notification: {events: [], channels: [{target: '<string>', events: []}]},
webhook: {url: '<string>'}
})
};
fetch('https://api.olostep.com/v1/monitors/{monitor_id}', 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.olostep.com/v1/monitors/{monitor_id}",
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([
'frequency' => '<string>',
'metadata' => [
],
'notification' => [
'events' => [
],
'channels' => [
[
'target' => '<string>',
'events' => [
]
]
]
],
'webhook' => [
'url' => '<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.olostep.com/v1/monitors/{monitor_id}"
payload := strings.NewReader("{\n \"frequency\": \"<string>\",\n \"metadata\": {},\n \"notification\": {\n \"events\": [],\n \"channels\": [\n {\n \"target\": \"<string>\",\n \"events\": []\n }\n ]\n },\n \"webhook\": {\n \"url\": \"<string>\"\n }\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.olostep.com/v1/monitors/{monitor_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"frequency\": \"<string>\",\n \"metadata\": {},\n \"notification\": {\n \"events\": [],\n \"channels\": [\n {\n \"target\": \"<string>\",\n \"events\": []\n }\n ]\n },\n \"webhook\": {\n \"url\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.olostep.com/v1/monitors/{monitor_id}")
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 \"frequency\": \"<string>\",\n \"metadata\": {},\n \"notification\": {\n \"events\": [],\n \"channels\": [\n {\n \"target\": \"<string>\",\n \"events\": []\n }\n ]\n },\n \"webhook\": {\n \"url\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "monitor",
"query": "<string>",
"tracked": {
"type": "<string>",
"urls": [
"<string>"
],
"web_query": "<string>"
},
"source_policy": {
"include_urls": [
"<string>"
],
"exclude_urls": [
"<string>"
],
"include_domains": [
"<string>"
],
"exclude_domains": [
"<string>"
]
},
"schedule": {
"frequency": "<string>",
"cron": "<string>",
"timezone": "UTC",
"next_run_at": "2023-11-07T05:31:56Z"
},
"notification": {
"events": [],
"channels": [
{
"target": "<string>",
"events": []
}
]
},
"webhook": {
"url": "<string>"
},
"output_schema": {},
"error_message": "<string>",
"last_run": {
"id": "<string>",
"status": "completed",
"change_detected": true,
"ran_at": "2023-11-07T05:31:56Z"
},
"agent": {
"id": "<string>"
},
"metadata": {},
"created": 123,
"updated": 123,
"total_count": 123,
"mermaid_diagram": "<string>"
}{
"error": "<string>",
"monitor_id": "<string>"
}{
"error": "<string>",
"monitor_id": "<string>"
}显示器
更新监控器
更新频率、元数据、通知和/或 webhook。频率更改会重新创建计划。当状态为配置中时返回 409。
POST
/
v1
/
monitors
/
{monitor_id}
更新监控
curl --request POST \
--url https://api.olostep.com/v1/monitors/{monitor_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"frequency": "<string>",
"metadata": {},
"notification": {
"events": [],
"channels": [
{
"target": "<string>",
"events": []
}
]
},
"webhook": {
"url": "<string>"
}
}
'import requests
url = "https://api.olostep.com/v1/monitors/{monitor_id}"
payload = {
"frequency": "<string>",
"metadata": {},
"notification": {
"events": [],
"channels": [
{
"target": "<string>",
"events": []
}
]
},
"webhook": { "url": "<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({
frequency: '<string>',
metadata: {},
notification: {events: [], channels: [{target: '<string>', events: []}]},
webhook: {url: '<string>'}
})
};
fetch('https://api.olostep.com/v1/monitors/{monitor_id}', 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.olostep.com/v1/monitors/{monitor_id}",
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([
'frequency' => '<string>',
'metadata' => [
],
'notification' => [
'events' => [
],
'channels' => [
[
'target' => '<string>',
'events' => [
]
]
]
],
'webhook' => [
'url' => '<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.olostep.com/v1/monitors/{monitor_id}"
payload := strings.NewReader("{\n \"frequency\": \"<string>\",\n \"metadata\": {},\n \"notification\": {\n \"events\": [],\n \"channels\": [\n {\n \"target\": \"<string>\",\n \"events\": []\n }\n ]\n },\n \"webhook\": {\n \"url\": \"<string>\"\n }\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.olostep.com/v1/monitors/{monitor_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"frequency\": \"<string>\",\n \"metadata\": {},\n \"notification\": {\n \"events\": [],\n \"channels\": [\n {\n \"target\": \"<string>\",\n \"events\": []\n }\n ]\n },\n \"webhook\": {\n \"url\": \"<string>\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.olostep.com/v1/monitors/{monitor_id}")
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 \"frequency\": \"<string>\",\n \"metadata\": {},\n \"notification\": {\n \"events\": [],\n \"channels\": [\n {\n \"target\": \"<string>\",\n \"events\": []\n }\n ]\n },\n \"webhook\": {\n \"url\": \"<string>\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"object": "monitor",
"query": "<string>",
"tracked": {
"type": "<string>",
"urls": [
"<string>"
],
"web_query": "<string>"
},
"source_policy": {
"include_urls": [
"<string>"
],
"exclude_urls": [
"<string>"
],
"include_domains": [
"<string>"
],
"exclude_domains": [
"<string>"
]
},
"schedule": {
"frequency": "<string>",
"cron": "<string>",
"timezone": "UTC",
"next_run_at": "2023-11-07T05:31:56Z"
},
"notification": {
"events": [],
"channels": [
{
"target": "<string>",
"events": []
}
]
},
"webhook": {
"url": "<string>"
},
"output_schema": {},
"error_message": "<string>",
"last_run": {
"id": "<string>",
"status": "completed",
"change_detected": true,
"ran_at": "2023-11-07T05:31:56Z"
},
"agent": {
"id": "<string>"
},
"metadata": {},
"created": 123,
"updated": 123,
"total_count": 123,
"mermaid_diagram": "<string>"
}{
"error": "<string>",
"monitor_id": "<string>"
}{
"error": "<string>",
"monitor_id": "<string>"
}合并语义: 元数据更新遵循 Stripe 的方法——新键被添加,现有键被更新,设置为空字符串
"" 的键被删除。授权
Bearer认证头格式为Bearer ,其中是你的认证令牌。
路径参数
Pattern:
^monitor_请求体
application/json
响应
监控已更新。
唯一的监控器标识符 (monitor_…)。
示例:
"monitor"
自然语言中的监控意图。
规划完成后监控器跟踪的已解决目标。
Show child attributes
Show child attributes
在规划和执行期间应用的可选 URL/域名允许和拒绝列表。
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
可选的JSON Schema用于结构化提取输出。
监控生命周期状态。
可用选项:
provisioning, active, paused, failed, deleted 当status为failed时出现。
最新快照摘要。包含在GET /v1/monitors/{monitor_id}中。
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Unix时间戳(秒)。
Unix时间戳(秒)。
快照总数。除非include_total_count=false,否则包含在GET /v1/monitors/{monitor_id}中。
监控DAG的Mermaid流程图。当include-diagram=true时包含在获取中。
此页面对您有帮助吗?
⌘I