# Deterministic API path -> Oncall Team routing.
#
# Source: request paths currently present in ../../scenario_testcases/*.yaml.
# Matching uses the URL path only; query strings and hosts are intentionally
# ignored. The most specific matching pattern wins. Keep ambiguous paths out of
# this file so they continue through AI-based routing.
version = 1

# Account, organization, project, and API-key management.
[[routes]]
path_pattern = "/api/v1/orgs/*/api_keys/*"
team = "account"

[[routes]]
path_pattern = "/api/v1/orgs/*/console-apikey*"
team = "account"

[[routes]]
path_pattern = "/v1beta1/apikeys/*/roles"
team = "account"

# Cloud backup, restore, import, export, DM, and Changefeed APIs.
[[routes]]
path_pattern = "/api/v1beta/projects/*/clusters/*/backups*"
team = "tidb_x_tools"

[[routes]]
path_pattern = "/api/v1beta/projects/*/restores*"
team = "tidb_x_tools"

[[routes]]
path_pattern = "/api/v1/orgs/*/projects/*/clusters/*/backups*"
team = "tidb_x_tools"

[[routes]]
path_pattern = "/api/v2/orgs/*/projects/*/clusters/*/backups*"
team = "tidb_x_tools"

[[routes]]
path_pattern = "/v1beta2/backups*"
team = "tidb_x_tools"

[[routes]]
path_pattern = "/v1beta2/tidbs/*/backup*"
team = "tidb_x_tools"

[[routes]]
path_pattern = "/v1beta2/tidbs/*:restoreStatus"
team = "tidb_x_tools"

[[routes]]
path_pattern = "/v1beta2/tidbs:restore"
team = "tidb_x_tools"

[[routes]]
path_pattern = "/v1beta2/tidbs:validateClassicBackup"
team = "tidb_x_tools"

[[routes]]
path_pattern = "/v1beta2/tidbs/*/imports*"
team = "tidb_x_tools"

[[routes]]
path_pattern = "/v1beta2/tidbs/*/exports*"
team = "tidb_x_tools"

[[routes]]
path_pattern = "/v1beta1/clusters/*/imports*"
team = "tidb_x_tools"

[[routes]]
path_pattern = "/v1beta1/clusters/*/exports*"
team = "tidb_x_tools"

[[routes]]
path_pattern = "/api/v2025/cloud/v1beta2/tidbs/*/premiumMigration*"
team = "tidb_x_tools"

[[routes]]
path_pattern = "/api/v1beta2/tidbs/*/changefeed*"
team = "tidb_x_tools"

# Security configuration exposed by the Premium and Dedicated control APIs.
[[routes]]
path_pattern = "/v1beta2/cmeks*"
team = "security"

[[routes]]
path_pattern = "/v1beta2/tidbs/*/dualLayerDataEncryption"
team = "security"

[[routes]]
path_pattern = "/v1beta2/tidbs/*/auditLog*"
team = "security"

[[routes]]
path_pattern = "/v1beta2/tidbs/*/logRedactionPolicy"
team = "security"

[[routes]]
path_pattern = "/v1beta1/clusters/*/auditLog*"
team = "security"

[[routes]]
path_pattern = "/v1beta1/clusters/*/logRedactionPolicy"
team = "security"

# Observability alert APIs.
[[routes]]
path_pattern = "/api/v1/external/*/orgs/*/projects/*/clusters/*/alerts"
team = "o11y"

# Premium / Essential cluster control APIs. More specific integration and
# security rules above take precedence.
[[routes]]
path_pattern = "/api/v2025/cloud/v1beta2/tidbs*"
team = "premium"

[[routes]]
path_pattern = "/v1beta2/tidbs*"
team = "premium"

[[routes]]
path_pattern = "/v1beta2/regions*"
team = "premium"

[[routes]]
path_pattern = "/api/premium/api/v1beta/*"
team = "premium"

# Dedicated and regional control-plane APIs. More specific import/export and
# security rules above take precedence.
[[routes]]
path_pattern = "/api/v2023/dedicated/v1beta1/clusters*"
team = "global_control"

[[routes]]
path_pattern = "/api/v2023/clusterManagement/v1beta1/clusters*"
team = "global_control"

[[routes]]
path_pattern = "/api/v1beta/projects/*/clusters*"
team = "global_control"

[[routes]]
path_pattern = "/api/v1/orgs/*/projects/*/clusters*"
team = "global_control"

[[routes]]
path_pattern = "/v1beta1/clusters*"
team = "global_control"

[[routes]]
path_pattern = "/v1beta1/networkContainers*"
team = "global_control"

[[routes]]
path_pattern = "/v1beta1/vpcPeerings*"
team = "global_control"

[[routes]]
path_pattern = "/v1beta1/maintenance*"
team = "global_control"

[[routes]]
path_pattern = "/v1beta1/regions*"
team = "global_control"
