更新采集配置
PUT
https://api.flashcat.cloud/api/n9e-plus/collect/{id}
最后修改时间:2024-07-24 09:41:49
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request PUT 'https://api.flashcat.cloud/api/n9e-plus/collect/1' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "n9e-test2",
"group_id": 1,
"enable_time":[
{
"enable_stime":"00:00",
"enable_etime":"01:00",
"enable_days_of_week":[1]
}
],
"queries": [
{
"key": "all_hosts",
"op": "",
"values": null
},
{
"key": "group_ids",
"op": "==",
"values": [
1
]
}
],
"component": "HTTP_Response",
"cate": "http_response",
"content": "## collect interval\n# interval = 15\n\n\n[[instances]]\ntargets = [\n \"https://www.baidu.com\"\n]\n\n## append some labels for series\n# labels = { region=\"cloud\", product=\"n9e\" }\n\n## interval = global.interval * interval_times\n# interval_times = 1\n\n## Set http_proxy (categraf uses the system wide proxy settings if it'\''s is not set)\n# http_proxy = \"http://localhost:8888\"\n\n## Interface to use when dialing an address\n# interface = \"eth0\"\n\n## HTTP Request Method\n# method = \"GET\"\n\n## Set response_timeout (default 5 seconds)\n# response_timeout = \"5s\"\n\n## Whether to follow redirects from the server (defaults to false)\n# follow_redirects = false\n\n## Optional HTTP Basic Auth Credentials\n# username = \"username\"\n# password = \"pa$$word\"\n\n## Optional headers\n# headers = [\"Header-Key-1\", \"Header-Value-1\", \"Header-Key-2\", \"Header-Value-2\"]\n\n## Optional HTTP Request Body\n# body = '\'''\'''\''\n# {'\''fake'\'':'\''data'\''}\n# '\'''\'''\''\n\n## Optional substring or regular expression match in body of the response(substring case sensitive).\n## When both of the following parameters are enabled, one of them can be satisfied.\n# expect_response_substring = \"ok\"\n# expect_response_regular_expression = \"green|yellow\"\n\n## Optional expected response status codes.\n## \"expect_response_status_codes\" Supports adding multiple codes by delimiter(\"|\" or \",\").\n## When both of the following parameters are enabled, one of them can be satisfied.\n# expect_response_status_code = 0\n# expect_response_status_codes = \"200|301\"\n\n## Optional TLS Config\n# use_tls = false\n# tls_ca = \"/etc/categraf/ca.pem\"\n# tls_cert = \"/etc/categraf/cert.pem\"\n# tls_key = \"/etc/categraf/key.pem\"\n## Use TLS but skip chain & host verification\n# insecure_skip_verify = false\n",
"disabled": 1,
"id": 49
}'
响应示例响应示例
{
"err": ""
}
请求参数
Path 参数
id
string
必需
示例值:
1
Body 参数application/json