跳转到主要内容
监控与采集相关接口/监控综合
POSTMonitoring起始版本 1.0同步需要认证

验证隔离查询

校验PROM QL查询符合租户隔离边界。

调试可用性

在线调试

使用当前认证信息和示例参数提交 Mock 请求。

请求参数

请求体字段

  • tenantIdString必填

    租户ID。

    示例: tenant-001-xyz

  • queryString必填

    查询语句。

    示例: cpu_usage_percent{job="node"}

响应状态

200 OK

该 API 成功时返回以下响应结构。

  • validBoolean

    是否有效。

    示例: true

  • originalQueryString

    原始提交查询字符串。

    示例: cpu_usage_percent{job="node"}

  • filteredQueryString

    查询租户过滤注入。

    示例: cpu_usage_percent{job="node",tenant_id="tenant-001"}

  • tenantIdString

    租户ID。

    示例: tenant-001-xyz

  • violationsList

    资源。

    示例: item1,item2

  • errorCodeString

    LDAP错误分类编码。

    示例: INVALID_CONFIG

  • messageString

    错误返回消息。

    示例: Query is compliant with tenant isolation policy

请求地址

POST/api/v1/monitoring/isolation/validate

/api/v1/monitoring/isolation/validate

操作 ID

ValidateIsolationQuery

永久链接

请求示例

curl -X POST '{host}/api/v1/monitoring/isolation/validate' -H 'Authorization: Bearer {token}' -H 'Content-Type: application/json' -d '{"tenantId":"tenant-001-xyz","query":"cpu_usage_percent{job=\"node\"}"}'

响应示例

200
{
  "valid": true,
  "originalQuery": "cpu_usage_percent{job=\"node\"}",
  "filteredQuery": "cpu_usage_percent{job=\"node\",tenant_id=\"tenant-001\"}",
  "tenantId": "tenant-001-xyz",
  "violations": [],
  "errorCode": "INVALID_CONFIG",
  "message": "Query is compliant with tenant isolation policy"
}

变更历史

此 API 暂无变更历史记录。

查看全部变更历史