创建日志导出任务 | 大装置帮助中心
跳到主要内容

创建日志导出任务

接口描述

POST

/monitor/ts/data/v1/subscriptions/:subscription_name/resourceGroups/:resource_group_name/zones/:zone/telemetryStations/:telemetry_station_name/exportLog/products/:product_name/exportJob

创建日志导出任务

请求头(Request Header)

参考认证(authentication)

请求参数(Request Parameters)

名称类型必须位置默认值取值范围描述
subscription_namestringpath--订阅
resource_group_namestringpath--资源组
zonestringpath--可用区
telemetry_station_namestringpath--监控空间
product_namestringquery--子产品键

请求体(Request Body)

名称类型描述
resource_id[]string开始时间
filterint结束时间
startint指标间隔步长,秒(如60=1min,300=5min)。当获取的panel为即时值时,该参数无用;需满足(end-start)/step<11000
endint时间校准对齐,根据step,调整校准start,end time取整,默认false
custom_filter[]CustomFilter自定义筛选器,例如按任务名称或容器名称筛选
log_oss_config_idstring日志 OSS 配置的 ID
log_file_typestringlog_file_type
sort_orderstring日志的排序顺序,可以是升序或降序
oss_uristring存储桶的 OSS URI
access_key_idstringAccessKey ID
access_key_secretstringAccessKey Secret
security_tokenstring安全令牌
severity_textstring日志的严重级别:INFO、DEBUG、WARN、ERROR、FATAL
only_bodystring是否仅导出内容

其中CustomFilter如下:

名称类型描述
keystring自定义查询的键
valuestring自定义查询的值,可以是中文或自定义值

请求示例(Request Example)

curl -XPOST 'https://monitor.sensecoreapi.tech/monitor/ts/data/v1/subscriptions/224bae0c-a98f-41f5-b5d3-9f54aa98455f/resourceGroups/default/zones/cn-sh-01z/telemetryStations/ts-user-a95a77a3-961f-43fa-9577-d5c8a2cb0149/exportLog/products/product.lepton-acp-new/exportJob' \
-H 'Content-Type: application/json' \
-d '{
"resource_id":
[
"bdbe3cf3-eb3f-11ee-aa82-fa4cc5eb8e29"
],
"start": "1712057953",
"end": "1712662753",
"oss_uri": "https://test1138.aoss.cn-sh-01.sensecoreapi-oss.tech",
"access_key_id": "1EC2B934FC52480FA172C7D1F88BB9A8",
"access_key_secret": "*********",
"only_body": false,
"log_file_type": "json",
"log_oss_config_id": "RXwpLov2OYg2GXr5atGOkGGAQW1VmylB",
"product_name": "product.lepton-acp-new",
"severity_text":
[
"TRACE",
"DEBUG",
"INFO",
"WARN",
"ERROR",
"FATAL"
],
"filter": "",
"custom_filter":
[
{
"key": "Attributes.k8s.job.name",
"value": "app-byqesyjp"
},
{
"key": "Attributes.k8s.job.name",
"value": "app-61fx81fy"
},
{
"key": "Attributes.k8s.job.name",
"value": "app-36k49xzn"
}
]
}'

响应(Response)

名称类型描述
export_job_idstring导出任务id

响应示例(Response Example)

{
"export_job_id": "XgWbZqrwpAl60oRQgfZPK2DMQP1O0j3n"
}