scenario:
  id: 5d6f93c1-8d4f-496e-8cd0-3a727b73e224
  context:
    auth:
      type: customized
    base_path: /api/premium/api/v1beta
    host: null
  description: ng_regional_clusters
  name: ng_regional_clusters
steps:
- operation_id: SharedPoolService_CreateSharedPool
  request_type: http
  # 9999999999999999982
  request: |-
    {
      "method": "POST",
      "path": "/sharedPools",
      "headers": {},
      "query_params": {},
      "body": {
        "tenantId": "{tenant_id}",
        "sharedPool": {
          "id": "{sharedpool_id}"
        },
        "requestUnit": {
          "min": 5000,
          "max": 10000
        },
        "initSharedPoolConfig": {
          "tikvDataStorage": {
            "type": "cloud-auto",
            "sizeGi": 1500,
            "iops": 0,
            "throughputMbps": 0
          },
          "tikvRaftlogStorage": {
            "type": "cloud-auto",
            "sizeGi": 40,
            "iops": 0,
            "throughputMbps": 0
          },
          "tiflashCnStorage": {
            "type": "cloud-auto",
            "sizeGi": 500,
            "iops": 0,
            "throughputMbps": 0
          },
          "tiflashWnStorage": {
            "type": "cloud-auto",
            "sizeGi": 500,
            "iops": 0,
            "throughputMbps": 0
          },
          "networkCidr": "10.0.0.0/16"
        }
      },
      "body_params": {
        "sharedpool_id": "sharedpool_id",
        "tenant_id": "tenant_id"
      },
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.phase == 'CREATING'"
    }
  save: |-
    {
      "placeholder": [
        {
          "key": "sharedpool_1",
          "eval": "body.id"
        }
      ]
    }
  description: ''
  max_retries: 0
  delay_after: 0
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 0
- operation_id: TiDBClusterService_CreateTiDBCluster
  request_type: http
  # 9999999999999999989
  request: |-
    {
      "method": "POST",
      "path": "/clusters",
      "headers": {},
      "query_params": {},
      "body": {
        "id": "{cluster_id}",
        "tenantId": "{tenant_id}",
        "sharedPoolId": "{sharedpool_id}",
        "requestUnit": {
          "min": 5000,
          "max": 10000
        }
      },
      "body_params": {
        "tenant_id": "tenant_id",
        "cluster_id": "cluster_id",
        "sharedpool_id": "sharedpool_id"
      },
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.phase == 'CREATING'"
    }
  save: |-
    {
      "placeholder": [
        {
          "key": "cluster_1",
          "eval": "body.id"
        }
      ]
    }
  description: ''
  max_retries: 0
  delay_after: 0
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 0.1
- operation_id: TiDBClusterService_ListTiDBClusters
  request_type: http
  request: |-
    {
      "method": "GET",
      "path": "/clusters",
      "headers": {},
      "query_params": {
        "tenantId": "org_id",
        "sharedPoolId": "sharedpool_1"
      },
      "body": {},
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.totalCount > 0"
    }
  save: null
  # save: |-
  #   {
  #     "placeholder": [
  #       {
  #         "key": "cluster_1",
  #         "eval": "body.clusters.filter(cluster, cluster.id == '9999999999999999989')[0].id"
  #       }
  #     ]
  #   }
  description: ''
  max_retries: 10
  delay_after: 30
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 1
- operation_id: TiDBClusterService_GetTiDBCluster
  request_type: http
  request: |-
    {
      "method": "GET",
      "path": "/clusters/{clusterId}",
      "path_params": {
        "clusterId": "cluster_1"
      },
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.phase == 'AVAILABLE'"
    }
  save: |-
    {
      "placeholder": [
        {
          "key": "sharedpool_1",
          "eval": "body.sharedPoolId"
        }
      ]
    }
  description: ''
  max_retries: 120
  delay_after: 30
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 2
- operation_id: RuConfigService_GetRuConfig
  request_type: http
  request: |-
    {
      "method": "GET",
      "path": "/ruConfigs/{ruConfigId}",
      "path_params": {
        "ruConfigId": "org_id"
      },
      "headers": {},
      "query_params": {
        "scope": "TENANT"
      },
      "body": {},
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": ""
    }
  save: null
  description: ''
  max_retries: 0
  delay_after: 0
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 3
- operation_id: RuConfigService_SetRuConfig
  request_type: http
  request: |-
    {
      "method": "PUT",
      "path": "/ruConfigs/{ruConfigId}",
      "path_params": {
        "ruConfigId": "org_id"
      },
      "headers": {},
      "query_params": {},
      "body": {
        "scope": "TENANT",
        "ruConfig": {
          "featureFlags": {
            "enableScaleSharedPoolByRu": false,
            "enableScaleTidbGroupByRu": false
          },
          "components": {
            "coprocessor_worker": {
              "maxNodeCount": 20,
              "nodeSpecRuRange": {
                "16c32g": {
                  "min": 120000,
                  "max": 480000
                },
                "32c64g": {
                  "min": 480000,
                  "max": 4294967295
                },
                "8c16g": {
                  "min": 0,
                  "max": 120000
                }
              }
            },
            "pd": {
              "maxNodeCount": 3,
              "nodeSpecRuRange": {
                "16c32g": {
                  "min": 540000,
                  "max": 4294967295
                },
                "4c8g": {
                  "min": 0,
                  "max": 210000
                },
                "8c16g": {
                  "min": 210000,
                  "max": 540000
                }
              }
            },
            "pd_scheduling": {
              "maxNodeCount": 5,
              "nodeSpecRuRange": {
                "16c32g": {
                  "min": 540000,
                  "max": 1200000
                },
                "2c8g": {
                  "min": 0,
                  "max": 90000
                },
                "32c64g": {
                  "min": 1200000,
                  "max": 4294967295
                },
                "4c8g": {
                  "min": 90000,
                  "max": 210000
                },
                "8c16g": {
                  "min": 210000,
                  "max": 540000
                }
              }
            },
            "pd_tso": {
              "maxNodeCount": 5,
              "nodeSpecRuRange": {
                "16c32g": {
                  "min": 540000,
                  "max": 4294967295
                },
                "2c8g": {
                  "min": 0,
                  "max": 90000
                },
                "4c8g": {
                  "min": 90000,
                  "max": 210000
                },
                "8c16g": {
                  "min": 210000,
                  "max": 540000
                }
              }
            },
            "tidb": {
              "maxNodeCount": 60,
              "nodeSpecRuRange": {
                "16c32g": {
                  "min": 120000,
                  "max": 540000
                },
                "32c64g": {
                  "min": 540000,
                  "max": 1200000
                },
                "64c128g": {
                  "min": 1200000,
                  "max": 4294967295
                },
                "8c16g": {
                  "min": 0,
                  "max": 120000
                }
              }
            },
            "tidb_worker": {
              "maxNodeCount": 200,
              "nodeSpecRuRange": {
                "16c32g": {
                  "min": 120000,
                  "max": 480000
                },
                "32c64g": {
                  "min": 480000,
                  "max": 960000
                },
                "64c128g": {
                  "min": 960000,
                  "max": 4294967295
                },
                "8c16g": {
                  "min": 0,
                  "max": 120000
                }
              }
            },
            "tiflash_compute": {
              "maxNodeCount": 20,
              "nodeSpecRuRange": {
                "16c64g": {
                  "min": 240000,
                  "max": 640000
                },
                "32c128g": {
                  "min": 640000,
                  "max": 1200000
                },
                "64c256g": {
                  "min": 1200000,
                  "max": 4294967295
                },
                "8c16g": {
                  "min": 0,
                  "max": 240000
                }
              }
            },
            "tiflash_write": {
              "maxNodeCount": 20,
              "nodeSpecRuRange": {
                "16c64g": {
                  "min": 240000,
                  "max": 640000
                },
                "32c128g": {
                  "min": 640000,
                  "max": 1200000
                },
                "64c256g": {
                  "min": 1200000,
                  "max": 4294967295
                },
                "8c16g": {
                  "min": 0,
                  "max": 240000
                }
              }
            },
            "tikv": {
              "maxNodeCount": 60,
              "nodeSpecRuRange": {
                "16c32g": {
                  "min": 120000,
                  "max": 480000
                },
                "32c64g": {
                  "min": 480000,
                  "max": 4294967295
                },
                "8c16g": {
                  "min": 0,
                  "max": 120000
                }
              }
            },
            "tikv_worker": {
              "maxNodeCount": 200,
              "nodeSpecRuRange": {
                "16c32g": {
                  "min": 120000,
                  "max": 480000
                },
                "32c64g": {
                  "min": 480000,
                  "max": 4294967295
                },
                "8c16g": {
                  "min": 0,
                  "max": 120000
                }
              }
            },
            "tiproxy": {
              "maxNodeCount": 30,
              "nodeSpecRuRange": {
                "2c8g": {
                  "min": 0,
                  "max": 360000
                },
                "8c16g": {
                  "min": 360000,
                  "max": 4294967295
                }
              }
            },
            "resource_manager":{
              "maxNodeCount":2,
              "nodeSpecRuRange": {
                "2c4g": {
                  "min":0
                }
              }
            }
          }
        }
      },
      "body_params": {
        "componentType": "component_type_1"
      },
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": ""
    }
  save: null
  description: ''
  max_retries: 0
  delay_after: 0
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 4
- operation_id: TiDBClusterService_GetTiDBCluster
  request_type: http
  request: |-
    {
      "method": "GET",
      "path": "/clusters/{clusterId}",
      "path_params": {
        "clusterId": "cluster_1"
      },
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.phase == 'AVAILABLE'"
    }
  save: null
  description: ''
  max_retries: 120
  delay_after: 30
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 4.5
- operation_id: TiDBClusterService_UpdateTiDBCluster
  request_type: http
  request: |-
    {
      "method": "PUT",
      "path": "/clusters/{clusterId}",
      "path_params": {
        "clusterId": "cluster_1"
      },
      "headers": {},
      "query_params": {},
      "body": {
        "requestUnit": {
          "min": 6000,
          "max": 8000
        },
        "force": true
      },
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.phase == 'AVAILABLE'"
    }
  save: null
  description: ''
  max_retries: 0
  delay_after: 0
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 5
- operation_id: TiDBClusterService_GetTiDBCluster
  request_type: http
  request: |-
    {
      "method": "GET",
      "path": "/clusters/{clusterId}",
      "path_params": {
        "clusterId": "cluster_1"
      },
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.phase == 'AVAILABLE'"
    }
  save: null
  description: ''
  max_retries: 120
  delay_after: 30
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 5.5
- operation_id: TiDBClusterService_GetTiDBClusterTiProxyNodeQuota
  request_type: http
  request: |-
    {
      "method": "GET",
      "path": "/clusters/{clusterId}/tiProxyNodeQuota",
      "path_params": {
        "clusterId": "cluster_1"
      },
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.nodeCount == 2 && body.maxNodeCount == 30 && body.minNodeCount == 2"
    }
  save: null
  description: ''
  max_retries: 0
  delay_after: 0
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 6
- operation_id: TiDBClusterService_GetProviderRole
  request_type: http
  request: |-
    {
      "method": "GET",
      "path": "/clusters/{clusterId}/providerRole",
      "path_params": {
        "clusterId": "cluster_1"
      },
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "type(body.nodeRole) == string && body.nodeRole != ''"
    }
  save: null
  description: ''
  max_retries: 0
  delay_after: 0
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 7
- operation_id: TiDBClusterService_CreateTiDBGroup
  request_type: http
  request: |-
    {
      "method": "POST",
      "path": "/clusters/{clusterId}/tidbGroups",
      "path_params": {
        "clusterId": "cluster_1"
      },
      "headers": {},
      "query_params": {},
      "body": {
        "id": "{clusterId}",
        "tenantId": "{tenantId}"
      },
      "body_params": {
        "tenantId": "org_id",
        "clusterId": "cluster_1"
      },
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.phase == 'CREATING'"
    }
  save: |-
    {
      "placeholder": [
        {
          "key": "tidbgroup_1",
          "eval": "body.id"
        }
      ]
    }
  description: ''
  max_retries: 0
  delay_after: 0
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 8
- operation_id: TiDBClusterService_ListTiDBGroups
  request_type: http
  request: |-
    {
      "method": "GET",
      "path": "/clusters/{clusterId}/tidbGroups",
      "path_params": {
        "clusterId": "cluster_1"
      },
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.totalCount >= 0"
    }
  save: null
  # save: |-
  #   {
  #     "placeholder": [
  #       {
  #         "key": "tidbgroup_1",
  #         "eval": "body.tidbGroups[0].id"
  #       }
  #     ]
  #   }
  description: ''
  max_retries: 0
  delay_after: 0
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 9
- operation_id: TiDBClusterService_GetTiDBGroup
  request_type: http
  request: |-
    {
      "method": "GET",
      "path": "/clusters/{clusterId}/tidbGroups/{tidbGroupId}",
      "path_params": {
        "clusterId": "cluster_1",
        "tidbGroupId": "tidbgroup_1"
      },
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.phase == 'AVAILABLE'"
    }
  save: null
  description: ''
  max_retries: 120
  delay_after: 30
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 10
- operation_id: SharedPoolService_SetHPAScaleBehavior
  request_type: http
  request: |-
    {
      "method": "POST",
      "path": "/sharedPools/{sharedPoolId}:setHPAScaleBehavior",
      "path_params": {
        "sharedPoolId": "sharedpool_1"
      },
      "headers": {},
      "query_params": {},
      "body": {
        "groupId": "{tidbGroupId}",
        "componentType": "TIDB",
        "scaleUpEnabled": false
      },
      "body_params": {
        "tidbGroupId": "tidbgroup_1"
      },
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": ""
    }
  save: null
  description: ''
  max_retries: 0
  delay_after: 0
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 10.5
- operation_id: SharedPoolService_ScaleSharedPool
  request_type: http
  request: |-
    {
      "method": "POST",
      "path": "/sharedPools/{sharedPoolId}:scale",
      "path_params": {
        "sharedPoolId": "sharedpool_1"
      },
      "headers": {},
      "query_params": {},
      "body": {
        "component": {
          "id": "{clusterId}",
          "componentType": "TIPROXY",
          "nodeQuota": {
            "nodeSpec": {
              "cpu": 8,
              "memoryGi": 16,
              "withLocalDisk": false,
              "localDiskSizeGi": 0
            },
            "nodeCount": 3
          }
        },
        "force": true
      },
      "body_params": {
        "clusterId": "cluster_1"
      },
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.phase == 'MODIFYING'"
    }
  save: null
  description: ''
  max_retries: 0
  delay_after: 0
  name: 'scale_tiproxy'
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 10.1
- operation_id: SharedPoolService_GetSharedPool
  request_type: http
  request: |-
    {
      "method": "GET",
      "path": "/sharedPools/{sharedPoolId}",
      "path_params": {
        "sharedPoolId": "sharedpool_1"
      },
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.phase == 'AVAILABLE' && body.componentGroups.exists(cg, cg.componentType == 'TIPROXY' && cg.nodeQuota.nodeCount == 3 && cg.nodeQuota.nodeSpec.cpu == 8 && cg.nodeQuota.nodeSpec.memoryGi == 16)"
    }
  save: null
  description: ''
  max_retries: 120
  delay_after: 30
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 10.2
- operation_id: TiDBClusterService_SetAuditLogSetting
  request_type: http
  request: |-
    {
      "method": "POST",
      "path": "/clusters/{clusterId}:setAuditLogSetting",
      "path_params": {
        "clusterId": "cluster_1"
      },
      "headers": {},
      "query_params": {},
      "body": {
        "auditLogSetting": {
          "bucketUrl": "oss://db-auditlog-test-bucket/auditlog_v1/",
          "region": "us-west-2",
          "providerIdentity": {
            "cloudRoleIdentity": "acs:ram::5841052134823325:role/Auditlog_Testing",
            "externalId": "{clusterId}"
          }
        }
      },
      "body_params": {
        "clusterId": "cluster_1"
      },
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.bucketUrl == 'oss://db-auditlog-test-bucket/auditlog_v1/'"
    }
  save: null
  description: ''
  max_retries: 0
  delay_after: 0
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 10.8
- operation_id: TiDBClusterService_GetTiDBCluster
  request_type: http
  request: |-
    {
      "method": "GET",
      "path": "/clusters/{clusterId}",
      "path_params": {
        "clusterId": "cluster_1"
      },
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.phase == 'AVAILABLE'"
    }
  save: null
  description: ''
  max_retries: 120
  delay_after: 30
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 10.9
- operation_id: TiDBClusterService_GetTiDBGroup
  request_type: http
  request: |-
    {
      "method": "GET",
      "path": "/clusters/{clusterId}/tidbGroups/{tidbGroupId}",
      "path_params": {
        "clusterId": "cluster_1",
        "tidbGroupId": "tidbgroup_1"
      },
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.phase == 'AVAILABLE'"
    }
  save: null
  description: ''
  max_retries: 0
  delay_after: 0
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 10.10
- operation_id: TiDBClusterService_UpdateTiDBGroup
  request_type: http
  request: |-
    {
      "method": "PUT",
      "path": "/clusters/{clusterId}/tidbGroups/{tidbGroupId}",
      "path_params": {
        "clusterId": "cluster_1",
        "tidbGroupId": "tidbgroup_1"
      },
      "headers": {},
      "query_params": {},
      "body": {
        "sqlEndpoint": {
          "publicLb": {
            "enabled": true,
            "port": 4000,
            "ipAllowList": [
              {
                "cidrBlock": "0.0.0.0/0"
              }
            ]
          },
          "privateLb": {
            "enabled": true,
            "port": 4000
          }
        }
      },
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.phase == 'MODIFYING'"
    }
  save: null
  description: ''
  max_retries: 0
  delay_after: 0
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 11
- operation_id: TiDBClusterService_GetTiDBGroup
  request_type: http
  request: |-
    {
      "method": "GET",
      "path": "/clusters/{clusterId}/tidbGroups/{tidbGroupId}",
      "path_params": {
        "clusterId": "cluster_1",
        "tidbGroupId": "tidbgroup_1"
      },
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.phase == 'AVAILABLE' && body.sqlEndpoint.publicLb.enabled == true && body.sqlEndpoint.publicLb.port == 4000 && body.sqlEndpoint.publicLb.ipAllowList.exists(ip, ip.cidrBlock == '0.0.0.0/0')"
    }
  save: |-
    {
      "placeholder": [
        {
          "key": "public_endpoint",
          "eval": "body.sqlEndpoint.publicLb.host"
        },
        {
          "key": "port",
          "eval": "body.sqlEndpoint.publicLb.port"
        }
      ]
    }
  description: ''
  max_retries: 120
  delay_after: 30
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 11.2
- operation_id: TiDBClusterService_ScaleTiDBGroup
  request_type: http
  request: |-
    {
      "method": "POST",
      "path": "/clusters/{clusterId}/tidbGroups/{tidbGroupId}:scale",
      "path_params": {
        "clusterId": "cluster_1",
        "tidbGroupId": "tidbgroup_1"
      },
      "headers": {},
      "query_params": {},
      "body": {
        "componentType": "TIDB",
        "nodeQuota": {
          "nodeSpec": {
            "cpu": 16,
            "memoryGi": 32
          },
          "nodeCount": 2
        },
        "force": true
      },
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.phase == 'MODIFYING'"
    }
  save: null
  description: ''
  max_retries: 0
  delay_after: 0
  name: 'scale_tidb'
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 12
- operation_id: TiDBClusterService_GetTiDBGroup
  request_type: http
  request: |-
    {
      "method": "GET",
      "path": "/clusters/{clusterId}/tidbGroups/{tidbGroupId}",
      "path_params": {
        "clusterId": "cluster_1",
        "tidbGroupId": "tidbgroup_1"
      },
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.phase == 'AVAILABLE' && body.nodeQuota.nodeCount == 2 && body.nodeQuota.nodeSpec.cpu == 16 && body.nodeQuota.nodeSpec.memoryGi == 32"
    }
  save: null
  description: ''
  max_retries: 120
  delay_after: 30
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 12.2
- operation_id: SharedPoolService_ListLightweightBackups
  request_type: http
  request: |-
    {
      "method": "GET",
      "path": "/sharedPools/{sharedPoolId}/lightweightBackups",
      "path_params": {
        "sharedPoolId": "sharedpool_1"
      },
      "headers": {},
      "query_params": {
        "fromPrefix": "20250606/08"
      },
      "body": {},
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.backups.size() >= 0"
    }
  save: null
  description: ''
  max_retries: 0
  delay_after: 0
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 12.3
- operation_id: Mysqlsh_Connection
  request_type: cmd_mysqlsh
  request: |-
    {
      "name": "mysqlsh",
      "args": [
        "--sql",
        "mysql://root@{public_endpoint}:{port}/mysql",
        "--result-format=json",
        "-e",
        "select count(*) as count from mysql.user",
        "--quiet-start=2",
        "--no-password"
      ],
      "args_params": {
        "public_endpoint": "public_endpoint",
        "port": "port"
      }
    }
  expect: |-
    {
      "exit_code": 0,
      "cel": "output.count >= 1"
    }
  save: null
  description: Check the connection status of the cluster.
  max_retries: 10
  delay_after: 30
  name: check_password
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 12.5
- operation_id: TiDBClusterService_ApplyTiDBGroup
  request_type: http
  request: |-
    {
      "method": "POST",
      "path": "/clusters/{clusterId}/tidbGroups/{tidbGroupId}:apply",
      "path_params": {
        "clusterId": "cluster_1",
        "tidbGroupId": "tidbgroup_1"
      },
      "headers": {},
      "query_params": {},
      "body": {
        "force": true
      },
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": ""
    }
  save: null
  description: ''
  max_retries: 0
  delay_after: 0
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 13
- operation_id: TiDBClusterService_CreatePrivateLinkService
  request_type: http
  request: |-
    {
      "method": "POST",
      "path": "/clusters/{clusterId}/tidbGroups/{tidbGroupId}/privateLinkServices",
      "path_params": {
        "clusterId": "cluster_1",
        "tidbGroupId": "tidbgroup_1"
      },
      "headers": {},
      "query_params": {},
      "body": {
        "id": "{groupId}",
        "sharedPoolId": "{sharedPoolId}"
      },
      "body_params": {
        "groupId": "tidbgroup_1",
        "sharedPoolId": "sharedpool_1"
      },
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": ""
    }
  save: |-
    {
      "placeholder": [
        {
          "key": "privateLinkService_1",
          "eval": "body.id"
        }
      ]
    }
  description: ''
  max_retries: 0
  delay_after: 0
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 14
- operation_id: TiDBClusterService_GetPrivateLinkService
  request_type: http
  request: |-
    {
      "method": "GET",
      "path": "/clusters/{clusterId}/tidbGroups/{tidbGroupId}/privateLinkServices/{privateLinkServiceId}",
      "path_params": {
        "clusterId": "cluster_1",
        "tidbGroupId": "tidbgroup_1",
        "privateLinkServiceId": "privateLinkService_1"
      },
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
      }
    }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.status == 'ACTIVE'"
    }
  save: |-
    {
      "placeholder": [
        {
          "key": "service_name_1",
          "eval": "body.aliCloud.serviceName"
        }
      ]
    }
  description: ''
  max_retries: 120
  delay_after: 30
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 15
# - operation_id: CloudCLI_CreateVPCEndpoint
#   request_type: cmd_aws
#   request: |-
#     {
#       "service": "ec2",
#       "name": "aws",
#       "args": [
#         "ec2",
#         "create-vpc-endpoint",
#         "--vpc-id",
#         "vpc-0ce23fd5a8e541d6c",
#         "--vpc-endpoint-type",
#         "Interface",
#         "--service-name",
#         "{service_name_1}",
#         "--region",
#         "us-west-2"
#       ],
#       "args_params": {
#         "service_name_1": "service_name_1"
#       }
#     }
#   expect: |-
#     {
#       "exit_code": 0
#     }
#   save: |-
#     {
#       "placeholder": [
#         {
#           "key": "vpce_id_1",
#           "eval": "output.VpcEndpoint.VpcEndpointId"
#         }
#       ]
#     }
#   description: ''
#   max_retries: 0
#   delay_after: 0
#   name: ''
#   continue_on_unexpected: false
#   stage: ''
#   meta: '{}'
#   generation_id: ''
#   order: 16
# - operation_id: TiDBClusterService_UpdatePrivateLinkService
#   request_type: http
#   request: |-
#     {
#       "method": "PUT",
#       "path": "/clusters/{clusterId}/tidbGroups/{tidbGroupId}/privateLinkServices/{privateLinkServiceId}",
#       "path_params": {
#         "clusterId": "cluster_1",
#         "tidbGroupId": "tidbgroup_1",
#         "privateLinkServiceId": "privateLinkService_1"
#       },
#       "headers": {},
#       "query_params": {},
#       "body": {
#         "privateLinkConnections": [
#           {
#             "aliCloud": {
#               "vpcEndpointId": "{vpce_id_1}"
#             }
#           }
#         ]
#       },
#       "body_params": {
#         "vpce_id_1": "vpce_id_1"
#       },
#       "auth": {
#         "auth_type": "customized",
#         "content": {
#           "private_key": "placeholder",
#           "public_key": "placeholder"
#         }
#       }
#     }
#   expect: |-
#     {
#       "status_code": 200
#     }
#   save: null
#   description: ''
#   max_retries: 0
#   delay_after: 0
#   name: ''
#   continue_on_unexpected: false
#   stage: ''
#   meta: '{}'
#   generation_id: ''
#   order: 17
- operation_id: TiDBClusterService_DeletePrivateLinkService
  request_type: http
  request: |-
    {
      "method": "DELETE",
      "path": "/clusters/{clusterId}/tidbGroups/{tidbGroupId}/privateLinkServices/{privateLinkServiceId}",
      "path_params": {
        "clusterId": "cluster_1",
        "tidbGroupId": "tidbgroup_1",
        "privateLinkServiceId": "privateLinkService_1"
      },
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200
    }
  save: null
  description: ''
  max_retries: 0
  delay_after: 0
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 18
# - operation_id: CloudCLI_DeleteVPCEndpoint
#   request_type: cmd_aws
#   request: |-
#     {
#       "service": "ec2",
#       "name": "aws",
#       "args": [
#         "ec2",
#         "delete-vpc-endpoints",
#         "--vpc-endpoint-id",
#         "{vpce_id_1}",
#         "--region",
#         "us-west-2"
#       ],
#       "args_params": {
#         "vpce_id_1": "vpce_id_1"
#       }
#     }
#   expect: |-
#     {
#       "exit_code": 0
#     }
#   save: null
#   description: ''
#   max_retries: 0
#   delay_after: 0
#   name: ''
#   continue_on_unexpected: false
#   stage: ''
#   meta: '{}'
#   generation_id: ''
#   order: 19
- operation_id: TiDBClusterService_GetTiDBGroup
  request_type: http
  request: |-
    {
      "method": "GET",
      "path": "/clusters/{clusterId}/tidbGroups/{tidbGroupId}",
      "path_params": {
        "clusterId": "cluster_1",
        "tidbGroupId": "tidbgroup_1"
      },
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.phase == 'AVAILABLE'"
    }
  save: null
  description: ''
  max_retries: 120
  delay_after: 30
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 19.0
- operation_id: TiDBClusterService_ScaleTiDBGroup
  request_type: http
  request: |-
    {
      "method": "POST",
      "path": "/clusters/{clusterId}/tidbGroups/{tidbGroupId}:scale",
      "path_params": {
        "clusterId": "cluster_1",
        "tidbGroupId": "tidbgroup_1"
      },
      "headers": {},
      "query_params": {},
      "body": {
        "componentType": "TIDB",
        "nodeQuota": {
          "nodeSpec": {
            "cpu": 8,
            "memoryGi": 16
          },
          "nodeCount": 1
        },
        "force": true
      },
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.phase == 'MODIFYING'"
    }
  save: null
  description: ''
  max_retries: 0
  delay_after: 0
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 19.1
- operation_id: TiDBClusterService_GetTiDBGroup
  request_type: http
  request: |-
    {
      "method": "GET",
      "path": "/clusters/{clusterId}/tidbGroups/{tidbGroupId}",
      "path_params": {
        "clusterId": "cluster_1",
        "tidbGroupId": "tidbgroup_1"
      },
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.phase == 'AVAILABLE' && body.nodeQuota.nodeCount == 1 && body.nodeQuota.nodeSpec.cpu == 8 && body.nodeQuota.nodeSpec.memoryGi == 16"
    }
  save: null
  description: ''
  max_retries: 120
  delay_after: 30
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 19.2
- operation_id: SharedPoolService_ScaleSharedPool
  request_type: http
  request: |-
    {
      "method": "POST",
      "path": "/sharedPools/{sharedPoolId}:scale",
      "path_params": {
        "sharedPoolId": "sharedpool_1"
      },
      "headers": {},
      "query_params": {},
      "body": {
        "component": {
          "id": "{clusterId}",
          "componentType": "TIPROXY",
          "nodeQuota": {
            "nodeSpec": {
              "cpu": 2,
              "memoryGi": 8,
              "withLocalDisk": false,
              "localDiskSizeGi": 0
            },
            "nodeCount": 2
          }
        },
        "force": true
      },
      "body_params": {
        "clusterId": "cluster_1"
      },
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.phase == 'MODIFYING'"
    }
  save: null
  description: ''
  max_retries: 0
  delay_after: 0
  name: 'scale_coprocessor_worker'
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 19.7
- operation_id: SharedPoolService_GetSharedPool
  request_type: http
  request: |-
    {
      "method": "GET",
      "path": "/sharedPools/{sharedPoolId}",
      "path_params": {
        "sharedPoolId": "sharedpool_1"
      },
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.phase == 'AVAILABLE' && body.componentGroups.exists(cg, cg.componentType == 'TIPROXY' && cg.nodeQuota.nodeCount == 2 && cg.nodeQuota.nodeSpec.cpu == 2 && cg.nodeQuota.nodeSpec.memoryGi == 8)"
    }
  save: null
  description: ''
  max_retries: 120
  delay_after: 30
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 19.8
- operation_id: Mysqlsh_Connection
  request_type: cmd_mysqlsh
  request: |-
    {
      "name": "mysqlsh",
      "args": [
        "--sql",
        "mysql://root@{public_endpoint}:{port}/mysql",
        "--result-format=json",
        "-e",
        "select count(*) as count from mysql.user",
        "--quiet-start=2",
        "--no-password"
      ],
      "args_params": {
        "public_endpoint": "public_endpoint",
        "port": "port"
      }
    }
  expect: |-
    {
      "exit_code": 0,
      "cel": "output.count >= 1"
    }
  save: null
  description: Check the connection status of the cluster.
  max_retries: 10
  delay_after: 30
  name: check_password
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 19.9
- operation_id: TiDBClusterService_DeleteTiDBGroup
  request_type: http
  request: |-
    {
      "method": "DELETE",
      "path": "/clusters/{clusterId}/tidbGroups/{tidbGroupId}",
      "path_params": {
        "clusterId": "cluster_1",
        "tidbGroupId": "tidbgroup_1"
      },
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200
    }
  save: null
  description: ''
  max_retries: 0
  delay_after: 0
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 20
- operation_id: TiDBClusterService_GetTiDBCluster
  request_type: http
  request: |-
    {
      "method": "GET",
      "path": "/clusters/{clusterId}",
      "path_params": {
        "clusterId": "cluster_1"
      },
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.phase == 'AVAILABLE'"
    }
  save: null
  description: ''
  max_retries: 120
  delay_after: 30
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 21
- operation_id: TiDBClusterService_DeleteTiDBCluster
  request_type: http
  request: |-
    {
      "method": "DELETE",
      "path": "/clusters/{clusterId}",
      "path_params": {
        "clusterId": "cluster_1"
      },
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200
    }
  save: null
  description: ''
  max_retries: 0
  delay_after: 0
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 22
- operation_id: SharedPoolService_DeleteSharedPool
  request_type: http
  request: |-
    {
      "method": "DELETE",
      "path": "/sharedPools/{sharedPoolId}",
      "path_params": {
        "sharedPoolId": "sharedpool_1"
      },
      "headers": {},
      "query_params": {"pruneDataplane": true},
      "body": {},
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.phase == 'DELETING'"
    }
  save: null
  description: ''
  max_retries: 60
  delay_after: 30
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 23
- operation_id: SharedPoolService_WaitSharedPoolDeleted
  request_type: http
  request: |-
    {
      "method": "GET",
      "path": "/sharedPools/{sharedPoolId}",
      "path_params": {
        "sharedPoolId": "sharedpool_1"
      },
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "customized",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 404
    }
  save: null
  description: 'Wait until the shared pool is fully deleted.'
  max_retries: 60
  delay_after: 30
  name: 'wait_shared_pool_deleted'
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 24
