创建监控
curl --request POST \
--url https://api.olostep.com/v1/monitors \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"source_policy": {
"include_urls": [
"<string>"
],
"exclude_urls": [
"<string>"
],
"include_domains": [
"<string>"
],
"exclude_domains": [
"<string>"
]
},
"frequency": "every hour",
"notification": {
"events": [],
"channels": [
{
"target": "<string>",
"events": []
}
]
},
"metadata": {},
"output_schema": {}
}
'import requests
url = "https://api.olostep.com/v1/monitors"
payload = {
"query": "<string>",
"source_policy": {
"include_urls": ["<string>"],
"exclude_urls": ["<string>"],
"include_domains": ["<string>"],
"exclude_domains": ["<string>"]
},
"frequency": "every hour",
"notification": {
"events": [],
"channels": [
{
"target": "<string>",
"events": []
}
]
},
"metadata": {},
"output_schema": {}
}
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({
query: '<string>',
source_policy: {
include_urls: ['<string>'],
exclude_urls: ['<string>'],
include_domains: ['<string>'],
exclude_domains: ['<string>']
},
frequency: 'every hour',
notification: {events: [], channels: [{target: '<string>', events: []}]},
metadata: {},
output_schema: {}
})
};
fetch('https://api.olostep.com/v1/monitors', 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",
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([
'query' => '<string>',
'source_policy' => [
'include_urls' => [
'<string>'
],
'exclude_urls' => [
'<string>'
],
'include_domains' => [
'<string>'
],
'exclude_domains' => [
'<string>'
]
],
'frequency' => 'every hour',
'notification' => [
'events' => [
],
'channels' => [
[
'target' => '<string>',
'events' => [
]
]
]
],
'metadata' => [
],
'output_schema' => [
]
]),
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"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"source_policy\": {\n \"include_urls\": [\n \"<string>\"\n ],\n \"exclude_urls\": [\n \"<string>\"\n ],\n \"include_domains\": [\n \"<string>\"\n ],\n \"exclude_domains\": [\n \"<string>\"\n ]\n },\n \"frequency\": \"every hour\",\n \"notification\": {\n \"events\": [],\n \"channels\": [\n {\n \"target\": \"<string>\",\n \"events\": []\n }\n ]\n },\n \"metadata\": {},\n \"output_schema\": {}\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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"source_policy\": {\n \"include_urls\": [\n \"<string>\"\n ],\n \"exclude_urls\": [\n \"<string>\"\n ],\n \"include_domains\": [\n \"<string>\"\n ],\n \"exclude_domains\": [\n \"<string>\"\n ]\n },\n \"frequency\": \"every hour\",\n \"notification\": {\n \"events\": [],\n \"channels\": [\n {\n \"target\": \"<string>\",\n \"events\": []\n }\n ]\n },\n \"metadata\": {},\n \"output_schema\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.olostep.com/v1/monitors")
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 \"query\": \"<string>\",\n \"source_policy\": {\n \"include_urls\": [\n \"<string>\"\n ],\n \"exclude_urls\": [\n \"<string>\"\n ],\n \"include_domains\": [\n \"<string>\"\n ],\n \"exclude_domains\": [\n \"<string>\"\n ]\n },\n \"frequency\": \"every hour\",\n \"notification\": {\n \"events\": [],\n \"channels\": [\n {\n \"target\": \"<string>\",\n \"events\": []\n }\n ]\n },\n \"metadata\": {},\n \"output_schema\": {}\n}"
response = http.request(request)
puts response.read_body"<string>"{
"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>"
}显示器
创建监控器
从自然语言查询创建一个监控器。配置一个影子代理,生成工作流规范,排队DAG规划,并安排定期运行。通过notification.channels和/或webhook配置交付。返回202状态为provisioning,或使用?stream=1流式传输进度。
POST
/
v1
/
monitors
创建监控
curl --request POST \
--url https://api.olostep.com/v1/monitors \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"source_policy": {
"include_urls": [
"<string>"
],
"exclude_urls": [
"<string>"
],
"include_domains": [
"<string>"
],
"exclude_domains": [
"<string>"
]
},
"frequency": "every hour",
"notification": {
"events": [],
"channels": [
{
"target": "<string>",
"events": []
}
]
},
"metadata": {},
"output_schema": {}
}
'import requests
url = "https://api.olostep.com/v1/monitors"
payload = {
"query": "<string>",
"source_policy": {
"include_urls": ["<string>"],
"exclude_urls": ["<string>"],
"include_domains": ["<string>"],
"exclude_domains": ["<string>"]
},
"frequency": "every hour",
"notification": {
"events": [],
"channels": [
{
"target": "<string>",
"events": []
}
]
},
"metadata": {},
"output_schema": {}
}
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({
query: '<string>',
source_policy: {
include_urls: ['<string>'],
exclude_urls: ['<string>'],
include_domains: ['<string>'],
exclude_domains: ['<string>']
},
frequency: 'every hour',
notification: {events: [], channels: [{target: '<string>', events: []}]},
metadata: {},
output_schema: {}
})
};
fetch('https://api.olostep.com/v1/monitors', 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",
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([
'query' => '<string>',
'source_policy' => [
'include_urls' => [
'<string>'
],
'exclude_urls' => [
'<string>'
],
'include_domains' => [
'<string>'
],
'exclude_domains' => [
'<string>'
]
],
'frequency' => 'every hour',
'notification' => [
'events' => [
],
'channels' => [
[
'target' => '<string>',
'events' => [
]
]
]
],
'metadata' => [
],
'output_schema' => [
]
]),
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"
payload := strings.NewReader("{\n \"query\": \"<string>\",\n \"source_policy\": {\n \"include_urls\": [\n \"<string>\"\n ],\n \"exclude_urls\": [\n \"<string>\"\n ],\n \"include_domains\": [\n \"<string>\"\n ],\n \"exclude_domains\": [\n \"<string>\"\n ]\n },\n \"frequency\": \"every hour\",\n \"notification\": {\n \"events\": [],\n \"channels\": [\n {\n \"target\": \"<string>\",\n \"events\": []\n }\n ]\n },\n \"metadata\": {},\n \"output_schema\": {}\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")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"query\": \"<string>\",\n \"source_policy\": {\n \"include_urls\": [\n \"<string>\"\n ],\n \"exclude_urls\": [\n \"<string>\"\n ],\n \"include_domains\": [\n \"<string>\"\n ],\n \"exclude_domains\": [\n \"<string>\"\n ]\n },\n \"frequency\": \"every hour\",\n \"notification\": {\n \"events\": [],\n \"channels\": [\n {\n \"target\": \"<string>\",\n \"events\": []\n }\n ]\n },\n \"metadata\": {},\n \"output_schema\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.olostep.com/v1/monitors")
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 \"query\": \"<string>\",\n \"source_policy\": {\n \"include_urls\": [\n \"<string>\"\n ],\n \"exclude_urls\": [\n \"<string>\"\n ],\n \"include_domains\": [\n \"<string>\"\n ],\n \"exclude_domains\": [\n \"<string>\"\n ]\n },\n \"frequency\": \"every hour\",\n \"notification\": {\n \"events\": [],\n \"channels\": [\n {\n \"target\": \"<string>\",\n \"events\": []\n }\n ]\n },\n \"metadata\": {},\n \"output_schema\": {}\n}"
response = http.request(request)
puts response.read_body"<string>"{
"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>"
}授权
Bearer认证头格式为Bearer ,其中是你的认证令牌。
查询参数
设置时,响应为text/event-stream,包含phase,reasoning_token,complete和error事件。
可用选项:
1, true 请求体
application/json
用自然语言描述要监控的内容。
在规划和执行期间应用的可选 URL/域名允许和拒绝列表。
Show child attributes
Show child attributes
自然语言计划(例如every day at 9am)。最小间隔为每10分钟。计划使用UTC。
Maximum string length:
50Show child attributes
Show child attributes
Show child attributes
Show child attributes
用于结构化提取输出的JSON Schema。
响应
配置流(text/event-stream),当stream=1时。以包含监控对象的complete事件结束。
The response is of type string.
此页面对您有帮助吗?
⌘I