{
  "id": "dedicated-create",
  "name": "Create a Dedicated cluster",
  "risk": "mutating",
  "completionMutation": {
    "guardId": "dedicated-create",
    "recoveryPath": "/tidbs/{{dedicatedClusterId}}/overview"
  },
  "start": { "path": "/tidbs" },
  "initialization": ["If {{clusterName}} already exists, open it and do not create a duplicate."],
  "goal": [
    "On Create Resource, select For All Users if the plan section shows Only For Partners. Select the Dedicated plan card and verify Summary says Plan Dedicated before filling any fields. Premium Reserved is a different product, even if the instance name contains dedicated.",
    "Create exactly one Dedicated cluster named {{clusterName}} using AWS Oregon (us-west-2) and the form defaults.",
    "Before clicking Create, verify Summary shows Plan Dedicated, the exact cluster name {{clusterName}}, AWS, and Oregon (us-west-2). If any value differs, correct the form first; do not submit another plan or region.",
    "Submit once and wait until the cluster is Active."
  ],
  "success": {
    "evidence": [
      { "kind": "url", "matches": "/(?:tidbs|clusters)/[^/]+/overview(?:[/?]|$)" },
      { "kind": "visibleText", "text": "Active", "timeoutMs": 3900000 },
      { "kind": "visibleText", "text": "{{clusterName}}" }
    ]
  },
  "recovery": ["Provisioning can take 65 minutes; after one accepted create request only observe the named cluster."],
  "limits": { "maxDurationMs": 3900000, "maxActions": 28 },
  "safety": {
    "deny": ["Do not create another name, change the default sizing, or submit twice."],
    "networkGuards": [
      {
        "id": "dedicated-create",
        "method": "POST",
        "path": "/api/v2023/dedicated/v1beta1/clusters",
        "bodyEquals": { "displayName": "{{clusterName}}", "cloudProvider": "aws", "regionId": "aws-us-west-2" },
        "maxRequests": 1,
        "deduplicateBy": ["displayName"],
        "required": true,
        "captureResponse": { "variable": "dedicatedClusterId", "paths": ["clusterId", "id"] }
      }
    ]
  }
}
