生成用于签名日志实时流请求的令牌
接口描述
POST
/monitor/ts/data/v1/subscriptions/:subscription_name/resourceGroups/:resource_group_name/zones/:zone/telemetryStations/:telemetry_station_name/logLivestream/token
生成用于签名日志实时流请求的令牌
请求头(Request Header)
请求参数(Request Parameters)
名称 | 类型 | 必须 | 位置 | 默认值 | 取值范围 | 描述 |
---|---|---|---|---|---|---|
subscription_name | string | 是 | path | - | - | 订阅 |
resource_group_name | string | 是 | path | - | - | 资源组 |
zone | string | 是 | path | - | - | 可用区 |
telemetry_station_name | string | 是 | path | - | - | 监控空间 |
请求体(Request Body)
名称 | 类型 | 描述 |
---|---|---|
resource_type | string | 资源类型 |
resource_id | string | 资源ID |
filters | []Filter | 过滤器 |
其中,Filter
如下:
名称 | 类型 | 描述 |
---|---|---|
key | string | 筛选键,例如gpu |
values | []string | 筛选值,例如[0,1,2] |
请求示例(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-code1030-224bae0c/logLivestream/token' \
-H 'Content-Type: application/json' \
-d '{
"resource_type": "resource_type.compute.workspace.v1.instance",
"resource_id": "a831a4aa-6811-11ee-bc1e-e612694d9db2",
"filters":
[
{
"key": "acp.lepton.sensetime.com/job-name",
"val": "pt-wm0dduu9"
},
{
"key": "pod",
"val": "pt-wm0dduu9-worker-0"
}
]
}'
响应(Response)
名称 | 类型 | 描述 |
---|---|---|
token | string | 令牌 |
endpoint | string | 端点 |
expire_time | string | 过期时间 |
响应示例(Response Example)
{
"token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzZW5zZWNvcmUudGVsZW1ldHJ5LmxvZ3N0cmVhbS5hdXRoIiwic3ViIjoic2Vuc2Vjb3JlLnRlbGVtZXRyeS5sb2dzdHJlYW0uYXV0aCIsImF1ZCI6WyJzZW5zZWNvcmUudGVsZW1ldHJ5LmxvZ3N0cmVhbS5wcm94eSJdLCJleHAiOjE3MTI3MzU1MDQsIm5iZiI6MTcxMjcyMDIwNCwiaWF0IjoxNzEyNzIxMTA0LCJqdGkiOiIwZWVmMzQ0ZC02Y2Q4LTRjZTEtYWM2Yi0xMjBlMTYwZWQ2NTEiLCJSZXNvdXJjZVR5cGUiOiJyZXNvdXJjZV90eXBlLmNvbXB1dGUud29ya3NwYWNlLnYxLmluc3RhbmNlIiwiUmVzb3VyY2VJRCI6ImE4MzFhNGFhLTY4MTEtMTFlZS1iYzFlLWU2MTI2OTRkOWRiMiIsIkVuZHBvaW50IjoibW9uaXRvci1kYXRhLmNuLXNoLTAxYy5zZW5zZWNvcmVhcGkudGVjaCIsIlpvbmUiOiJtb25pdG9yLWRhdGEuY24tc2gtMDFjLnNlbnNlY29yZWFwaS50ZWNoIiwiTmFtZXNwYWNlIjoibnMtY29kZTEwMzAtOTk4ZjhmN2QiLCJQb2QiOiJwdC13bTBkZHV1OS13b3JrZXItMCIsIkNvbnRhaW5lciI6InB5dG9yY2giLCJGaWx0ZXJzIjp7ImFjcC5sZXB0b24uc2Vuc2V0aW1lLmNvbS9qb2ItbmFtZSI6InB0LXdtMGRkdXU5IiwicG9kIjoicHQtd20wZGR1dTktd29ya2VyLTAifX0.ozWEPNjsBJmPE-KALLosiqeB6r3lnurHoF0vuBNjs9u_jPbswh9UlsYW4ywdrpFIWTKYnlXMnokhTagPA4-4wg",
"endpoint": "monitor-data.cn-sh-01c.sensecoreapi.tech",
"expire_time": "2024-04-10T07:51:44.227382964Z"
}