scenario:
  id: abcf522f5754a26096985d8962f63abc
  context:
    auth:
      type: digest
    base_path: /v1beta1
    host: null
  description: "Auto-generated scenario for Azure import"
  name: import_azure
steps:
  - case_id: c37f522f5754a26096985d8962f63afe
    operation_id: ClusterService_CreateCluster
    generation_id: 09198df8-3eef-4d82-a5a4-31eb9b0db7de
    order: 1
    case_type: typical_positive
    request_type: http
    request: |-
      {
        "auth": {
          "auth_type": "digest",
          "content": {"private_key": "placeholder","public_key": "placeholder"}
        },
        "method": "POST",
        "path": "/clusters",
        "path_params": {},
        "query_params": {},
        "headers": {},
        "body": {
          "displayName": "sce-singleimport",
          "labels": {
            "tidb.cloud/project": "{projectId}"
          },
          "port": 4000,
          "regionId": "{regionId}",
          "rootPassword": "31415926",
          "tidbNodeSetting": {
            "nodeSpecKey": "2C8G",
            "tidbNodeGroups": [
              {
                "nodeCount": 1
              }
            ]
          },
          "tikvNodeSetting": {
            "nodeCount": 3,
            "nodeSpecKey": "2C8G",
            "storageSizeGi": 200,
            "storageType": "Basic"
          }
        },
        "body_params": {
          "regionId": "region_id",
          "projectId": "project_id"
        }
      }
    expect: |-
      {
        "status_code": 200,
        "cel": "body.state == \"CREATING\""
      }
    description:
      Create a 1 TiDB 3 TiKV dedicated cluster to fulfill the dependency
      for scaling out TiDB nodes.
    max_retries: 0
    delay_after: 0
    step_type: defined
    name: create_cluster
    continue_on_unexpected: false
    save: |-
      {
        "placeholder": [
          {"key": "cluster_1", "eval": "body.clusterId"}
        ]
      }
    stage: execute
    meta: "{}"
  - case_id: c37f522f5754a26096985d8962f63aab
    operation_id: ClusterService_GetCluster
    case_type: supplimental_positive
    request_type: http
    request: |-
      {
        "auth": {
          "auth_type": "digest",
          "content": {"private_key": "placeholder","public_key": "placeholder"}
        },
        "method": "GET",
        "path": "/clusters/{clusterId}",
        "path_params": {
          "clusterId": "cluster_1"
        },
        "query_params": {},
        "headers": {},
        "body": {}
      }
    expect: |-
      {
        "status_code": 200,
        "cel": "body.state == \"ACTIVE\""
      }
    description: Poll the cluster state until it becomes ACTIVE.
    max_retries: 60
    delay_after: 60
    step_type: defined
    name: wait_for_cluster_active
    save: |-
      {
        "placeholder": [
          {"key": "tidbnodegroup_1", "eval": "body.tidbNodeSetting.tidbNodeGroups[0].tidbNodeGroupId"}
        ]
      }
    continue_on_unexpected: false
    stage: execute
    meta: "{}"
    generation_id: 09198df8-3eef-4d82-a5a4-31eb9b0db7de
    order: 1.5
  - case_id: wait_for_tidb_nodegroup_active
    operation_id: TidbNodeGroupService_GetTidbNodeGroup
    case_type: http
    request_type: http
    request: |-
      {
        "auth": {
          "auth_type": "digest",
          "content": {"private_key": "placeholder","public_key": "placeholder"}
        },
        "method": "GET",
        "path": "/clusters/{clusterId}/tidbNodeGroups/{tidbNodeGroupId}",
        "path_params": {
          "clusterId": "cluster_1",
          "tidbNodeGroupId": "tidbnodegroup_1"
        },
        "query_params": {},
        "headers": {},
        "body": {}
      }
    expect: |-
      {
        "status_code": 200,
        "cel": "body.state == \"ACTIVE\" && size(body.endpoints.filter(e, e.connectionType == 'PUBLIC')) > 0 && body.endpoints.filter(e, e.connectionType == 'PUBLIC')[0].host != \"\""
      }
    description: Poll the TiDB Node Group until it becomes ACTIVE.
    max_retries: 120
    delay_after: 30
    step_type: generated
    name: wait_for_tidb_node_group_active
    save: |-
      {
        "placeholder": [
          {"key": "public_endpoint", "eval": "body.endpoints.filter(e, e.connectionType == 'PUBLIC')[0].host"},
          {"key": "port", "eval": "body.endpoints.filter(e, e.connectionType == 'PUBLIC')[0].port"}
        ]
      }
    continue_on_unexpected: false
    stage: execute
    meta: "{}"
    generation_id: 09198df8-3eef-4d82-a5a4-31eb9b0db7de
    order: 2
  - case_id: set_public_endpoint
    operation_id: TidbNodeGroupService_UpdatePublicEndpointSetting
    generation_id: 09198df8-3eef-4d82-a5a4-31eb9b0db7de
    order: 3
    case_type: typical_positive
    request_type: http
    request: |-
      {
        "auth": {
          "auth_type": "digest",
          "content": {"private_key": "placeholder","public_key": "placeholder"}
        },
        "method": "PATCH",
        "path": "/clusters/{clusterId}/tidbNodeGroups/{tidbNodeGroupId}/publicEndpointSetting",
        "path_params": {
          "clusterId": "cluster_1",
          "tidbNodeGroupId": "tidbnodegroup_1"
        },
        "query_params": {},
        "headers": {},
        "body": {
          "enabled": true,
          "ipAccessList": [
            {
              "cidrNotation": "0.0.0.0/0",
              "description": "all"
            }
          ]
        }
      }
    expect: |-
      {
        "status_code": 200,
        "cel": "body.enabled == true"
      }
    description: Update the cluster to set the public endpoint.
    max_retries: 0
    delay_after: 0
    step_type: defined
    name: set_public_endpoint
    save: null
    continue_on_unexpected: false
    stage: execute
    meta: "{}"
  - case_id: force_wait_dns
    operation_id: ClusterService_GetCluster
    generation_id: 09198df8-3eef-4d82-a5a4-31eb9b0db7de
    order: 4
    case_type: supplimental_positive
    request_type: http
    request: |-
      {
        "auth": {
          "auth_type": "digest",
          "content": {"private_key": "placeholder","public_key": "placeholder"}
        },
        "method": "GET",
        "path": "/clusters/{clusterId}",
        "path_params": {
          "clusterId": "cluster_1"
        },
        "query_params": {},
        "headers": {},
        "body": {}
      }
    expect: |-
      {
        "status_code": 200,
        "cel": "body.state == \"ABC\""
      }
    description: Poll the cluster state until it becomes ACTIVE.
    max_retries: 30
    delay_after: 10
    step_type: defined
    name: force_wait_dns
    save: null
    continue_on_unexpected: true
    stage: prepare
    meta: "{}"
  - case_id: connect_to_create_table
    operation_id: Mysqlsh_connection
    case_type: typical_positive
    request_type: cmd_mysqlsh
    request: |-
      {
        "name": "mysqlsh",
        "args": [
          "--sql",
          "mysql://root:31415926@{public_endpoint}:{port}/test",
          "--result-format=json",
          "-e",
          "CREATE TABLE `students` (`id` int(11) NOT NULL AUTO_INCREMENT,`name` varchar(255) DEFAULT NULL,`age` int(11) DEFAULT NULL, PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=30001;",
          "--quiet-start=2"
        ],
        "args_params": {
          "public_endpoint": "public_endpoint",
          "port": "port"
        }
      }
    expect: |-
      {
        "exit_code": 0,
        "cel": ""
      }
    description: Check the connection status of the cluster.
    max_retries: 0
    delay_after: 0
    step_type: defined
    name: create_table
    save: null
    continue_on_unexpected: false
    stage: execute
    meta: "{}"
    generation_id: 09198df8-3eef-4d82-a5a4-31eb9b0db7de
    order: 5
  - case_id: list_imports
    operation_id: ImportService_ListImports
    case_type: typical_positive
    request_type: http
    request: |-
      {
        "auth": {
          "auth_type": "digest",
          "content": {"private_key": "placeholder","public_key": "placeholder"}
        },
        "method": "GET",
        "path": "/clusters/{clusterId}/imports",
        "path_params": {
          "clusterId": "cluster_1"
        },
        "query_params": {},
        "headers": {},
        "body": {}
      }
    expect: |-
      {
        "status_code": 200,
        "cel": "body.imports.size() == 0"
      }
    description: List imports.
    max_retries: 0
    delay_after: 0
    step_type: generated
    name: List imports
    save: null
    continue_on_unexpected: false
    stage: execute
    meta: "{}"
    generation_id: 09198df8-3eef-4d82-a5a4-31eb9b0db7de
    order: 6
  - case_id: import_csv
    operation_id: ImportService_CreateImport
    case_type: typical_positive
    request_type: http
    request: |-
      {
        "auth": {
          "auth_type": "digest",
          "content": {"private_key": "placeholder","public_key": "placeholder"}
        },
        "method": "POST",
        "path": "/clusters/{clusterId}/imports",
        "path_params": {
          "clusterId": "cluster_1"
        },
        "query_params": {},
        "headers": {},
        "body": {
          "creation_details": {
            "import_options": {
              "file_type": "CSV",
              "csv_format": {
                "separator": ",",
                "delimiter": "\"",
                "header": true,
                "not_null": false,
                "null_value": "\"\\N\"",
                "backslash_escape": true,
                "trim_last_separator": false
              },
              "duplication_handling": "ERROR",
              "need_drop_tables": false,
              "validate_only": false
            },
            "source": {
              "type": "AZURE_BLOB",
              "azure_blob": {
                "auth_type": "SAS_TOKEN",
                "uri": "https://fangcloudtest.blob.core.windows.net/testimportdata/testdata/",
                "sas_token": "{azure_account_sas_token}"
              }
            },
            "target_table_infos": [
              {
                "target_table": {
                  "schema": "test",
                  "table": "students"
                },
                "custom_file": "",
                "matched_uri": "https://fangcloudtest.blob.core.windows.net/testimportdata/testdata/"
              }
            ],
            "check_items": [
              "IMPORT_PRECHECK",
              "ESTIMATE_SIZE"
            ]
          }
        },
        "body_params": {
          "azure_account_sas_token": "azure_account_sas_token"
        }
      }
    expect: |-
      {
        "status_code": 200,
        "cel": ""
      }
    description: Import CSV.
    max_retries: 0
    delay_after: 0
    step_type: generated
    name: Import CSV
    save: |-
      {
        "placeholder": [
          { "key": "import_0", "eval": "body.importId" }
        ]
      }
    continue_on_unexpected: false
    stage: execute
    meta: "{}"
    generation_id: 09198df8-3eef-4d82-a5a4-31eb9b0db7de
    order: 7
  - case_id: cancel_import
    operation_id: ImportService_CancelImport
    case_type: typical_positive
    request_type: http
    request: |-
      {
        "auth": {
          "auth_type": "digest",
          "content": {"private_key": "placeholder","public_key": "placeholder"}
        },
        "method": "POST",
        "path": "/clusters/{clusterId}/imports/{importId}:cancel",
        "path_params": {
          "clusterId": "cluster_1",
          "importId": "import_0"
        },
        "query_params": {},
        "headers": {},
        "body": {}
      }
    expect: |-
      {
        "status_code": 200,
        "cel": ""
      }
    description: Cancel import.
    max_retries: 0
    delay_after: 0
    step_type: generated
    name: Cancel import
    save: null
    continue_on_unexpected: false
    stage: execute
    meta: "{}"
    generation_id: 09198df8-3eef-4d82-a5a4-31eb9b0db7de
    order: 8
  - case_id: wait_for_import_0
    operation_id: ImportService_GetImport
    case_type: typical_positive
    request_type: http
    request: |-
      {
        "auth": {
          "auth_type": "digest",
          "content": {"private_key": "placeholder","public_key": "placeholder"}
        },
        "method": "GET",
        "path": "/clusters/{clusterId}/imports/{importId}",
        "path_params": {
          "clusterId": "cluster_1",
          "importId": "import_0"
        },
        "query_params": {},
        "headers": {},
        "body": {}
      }
    expect: |-
      {
        "status_code": 200,
        "cel": "body.state == \"CANCELED\""
      }
    description: Wait for import to complete.
    max_retries: 120
    delay_after: 30
    step_type: generated
    name: wait_for_import_0
    save: null
    continue_on_unexpected: false
    stage: execute
    meta: "{}"
    generation_id: 09198df8-3eef-4d82-a5a4-31eb9b0db7de
    order: 8.5
  - case_id: import_csv_1
    operation_id: ImportService_CreateImport
    case_type: typical_positive
    request_type: http
    request: |-
      {
        "auth": {
          "auth_type": "digest",
          "content": {"private_key": "placeholder","public_key": "placeholder"}
        },
        "method": "POST",
        "path": "/clusters/{clusterId}/imports",
        "path_params": {
          "clusterId": "cluster_1"
        },
        "query_params": {},
        "headers": {},
        "body": {
          "creation_details": {
            "import_options": {
              "file_type": "CSV",
              "csv_format": {
                "separator": ",",
                "delimiter": "\"",
                "header": true,
                "not_null": false,
                "null_value": "\"\\N\"",
                "backslash_escape": true,
                "trim_last_separator": false
              },
              "duplication_handling": "ERROR",
              "need_drop_tables": false,
              "validate_only": false
            },
            "source": {
              "type": "AZURE_BLOB",
              "azure_blob": {
                "auth_type": "SAS_TOKEN",
                "uri": "https://fangcloudtest.blob.core.windows.net/testimportdata/testdata/",
                "sas_token": "{azure_account_sas_token}"
              }
            },
            "target_table_infos": [
              {
                "target_table": {
                  "schema": "test",
                  "table": "students"
                },
                "custom_file": "",
                "matched_uri": "https://fangcloudtest.blob.core.windows.net/testimportdata/testdata/"
              }
            ],
            "check_items": [
              "IMPORT_PRECHECK",
              "ESTIMATE_SIZE"
            ]
          }
        },
        "body_params": {
          "azure_account_sas_token": "azure_account_sas_token"
        }
      }
    expect: |-
      {
        "status_code": 200,
        "cel": ""
      }
    description: Import CSV.
    max_retries: 0
    delay_after: 0
    step_type: generated
    name: Import CSV
    save: |-
      {
        "placeholder": [
          { "key": "import_1", "eval": "body.importId" }
        ]
      }
    continue_on_unexpected: false
    stage: execute
    meta: "{}"
    generation_id: 09198df8-3eef-4d82-a5a4-31eb9b0db7de
    order: 9
  - case_id: wait_for_import_1
    operation_id: ImportService_GetImport
    case_type: typical_positive
    request_type: http
    request: |-
      {
        "auth": {
          "auth_type": "digest",
          "content": {"private_key": "placeholder","public_key": "placeholder"}
        },
        "method": "GET",
        "path": "/clusters/{clusterId}/imports/{importId}",
        "path_params": {
          "clusterId": "cluster_1",
          "importId": "import_1"
        },
        "query_params": {},
        "headers": {},
        "body": {}
      }
    expect: |-
      {
        "status_code": 200,
        "cel": "body.state == \"COMPLETED\""
      }
    description: Wait for import to complete.
    max_retries: 60
    delay_after: 60
    step_type: generated
    name: wait_for_import_1
    save: null
    continue_on_unexpected: false
    stage: execute
    meta: "{}"
    generation_id: 09198df8-3eef-4d82-a5a4-31eb9b0db7de
    order: 10
  - case_id: connect_to_check_table_1
    operation_id: Mysqlsh_connection
    case_type: typical_positive
    request_type: cmd_mysqlsh
    request: |-
      {
        "name": "mysqlsh",
        "args": [
          "--sql",
          "mysql://root:31415926@{public_endpoint}:{port}/test",
          "--result-format=json",
          "-e",
          "SELECT EXISTS (SELECT 1 FROM students WHERE name = 'li4') AS result;",
          "--quiet-start=2"
        ],
        "args_params": {
          "public_endpoint": "public_endpoint",
          "port": "port"
        }
      }
    expect: |-
      {
        "exit_code": 0,
        "cel": "output.result == 1"
      }
    description: Check data1
    max_retries: 0
    delay_after: 0
    step_type: defined
    name: check_data1
    save: null
    continue_on_unexpected: false
    stage: execute
    meta: "{}"
    generation_id: 09198df8-3eef-4d82-a5a4-31eb9b0db7de
    order: 11
  - case_id: drop_table_1
    operation_id: Mysqlsh_connection
    case_type: typical_positive
    request_type: cmd_mysqlsh
    request: |-
      {
        "name": "mysqlsh",
        "args": [
          "--sql",
          "mysql://root:31415926@{public_endpoint}:{port}/test",
          "--result-format=json",
          "-e",
          "DROP TABLE `students`;",
          "--quiet-start=2"
        ],
        "args_params": {
          "public_endpoint": "public_endpoint",
          "port": "port"
        }
      }
    expect: |-
      {
        "exit_code": 0,
        "cel": ""
      }
    description: drop table 1.
    max_retries: 0
    delay_after: 0
    step_type: defined
    name: drop_table_1
    save: null
    continue_on_unexpected: false
    stage: execute
    meta: "{}"
    generation_id: 09198df8-3eef-4d82-a5a4-31eb9b0db7de
    order: 12
  - case_id: create_table_2
    operation_id: Mysqlsh_connection
    case_type: typical_positive
    request_type: cmd_mysqlsh
    request: |-
      {
        "name": "mysqlsh",
        "args": [
          "--sql",
          "mysql://root:31415926@{public_endpoint}:{port}/test",
          "--result-format=json",
          "-e",
          "CREATE TABLE `students` (`id` int(11) NOT NULL AUTO_INCREMENT,`name` varchar(255) DEFAULT NULL,`age` int(11) DEFAULT NULL, PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=30001;",
          "--quiet-start=2"
        ],
        "args_params": {
          "public_endpoint": "public_endpoint",
          "port": "port"
        }
      }
    expect: |-
      {
        "exit_code": 0,
        "cel": ""
      }
    description: Create table 2.
    max_retries: 0
    delay_after: 0
    step_type: defined
    name: create_table_2
    save: null
    continue_on_unexpected: false
    stage: execute
    meta: "{}"
    generation_id: 09198df8-3eef-4d82-a5a4-31eb9b0db7de
    order: 13
  - case_id: import_sql
    operation_id: ImportService_CreateImport
    case_type: typical_positive
    request_type: http
    request: |-
      {
        "auth": {
          "auth_type": "digest",
          "content": {"private_key": "placeholder","public_key": "placeholder"}
        },
        "method": "POST",
        "path": "/clusters/{clusterId}/imports",
        "path_params": {
          "clusterId": "cluster_1"
        },
        "query_params": {},
        "headers": {},
        "body": {
          "creation_details": {
            "import_options": {
              "file_type": "SQL",
              "duplication_handling": "REPLACE",
              "need_drop_tables": false,
              "validate_only": false
            },
            "source": {
              "type": "AZURE_BLOB",
              "azure_blob": {
                "auth_type": "SAS_TOKEN",
                "uri": "https://fangcloudtest.blob.core.windows.net/testimportdata/testdata/",
                "sas_token": "{azure_account_sas_token}"
              }
            },
            "target_table_infos": [
              {
                "target_table": {
                  "schema": "test",
                  "table": "students"
                },
                "custom_file": "",
                "matched_uri": "https://fangcloudtest.blob.core.windows.net/testimportdata/testdata/"
              }
            ],
            "check_items": [
              "IMPORT_PRECHECK",
              "ESTIMATE_SIZE"
            ]
          }
        },
        "body_params": {
          "azure_account_sas_token": "azure_account_sas_token"
        }
      }
    expect: |-
      {
        "status_code": 200,
        "cel": ""
      }
    description: Import SQL.
    max_retries: 0
    delay_after: 0
    step_type: generated
    name: Import_SQL
    save: |-
      {
        "placeholder": [
          { "key": "import_2", "eval": "body.importId" }
        ]
      }
    continue_on_unexpected: false
    stage: execute
    meta: "{}"
    generation_id: 09198df8-3eef-4d82-a5a4-31eb9b0db7de
    order: 14
  - case_id: wait_for_import_2
    operation_id: ImportService_GetImport
    case_type: typical_positive
    request_type: http
    request: |-
      {
        "auth": {
          "auth_type": "digest",
          "content": {"private_key": "placeholder","public_key": "placeholder"}
        },
        "method": "GET",
        "path": "/clusters/{clusterId}/imports/{importId}",
        "path_params": {
          "clusterId": "cluster_1",
          "importId": "import_2"
        },
        "query_params": {},
        "headers": {},
        "body": {}
      }
    expect: |-
      {
        "status_code": 200,
        "cel": "body.state == \"COMPLETED\""
      }
    description: Wait for import to complete.
    max_retries: 60
    delay_after: 60
    step_type: generated
    name: wait_for_import_2
    save: null
    continue_on_unexpected: false
    stage: execute
    meta: "{}"
    generation_id: 09198df8-3eef-4d82-a5a4-31eb9b0db7de
    order: 15
  - case_id: connect_to_check_table_2
    operation_id: Mysqlsh_connection
    case_type: typical_positive
    request_type: cmd_mysqlsh
    request: |-
      {
        "name": "mysqlsh",
        "args": [
          "--sql",
          "mysql://root:31415926@{public_endpoint}:{port}/test",
          "--result-format=json",
          "-e",
          "SELECT EXISTS (SELECT 1 FROM students WHERE name = 'SQL_format_data1') AS result;",
          "--quiet-start=2"
        ],
        "args_params": {
          "public_endpoint": "public_endpoint",
          "port": "port"
        }
      }
    expect: |-
      {
        "exit_code": 0,
        "cel": "output.result == 1"
      }
    description: check data2
    max_retries: 0
    delay_after: 0
    step_type: defined
    name: check_data2
    save: null
    continue_on_unexpected: false
    stage: execute
    meta: "{}"
    generation_id: 09198df8-3eef-4d82-a5a4-31eb9b0db7de
    order: 16
  - case_id: drop_table_2
    operation_id: Mysqlsh_connection
    case_type: typical_positive
    request_type: cmd_mysqlsh
    request: |-
      {
        "name": "mysqlsh",
        "args": [
          "--sql",
          "mysql://root:31415926@{public_endpoint}:{port}/test",
          "--result-format=json",
          "-e",
          "DROP TABLE `students`;",
          "--quiet-start=2"
        ],
        "args_params": {
          "public_endpoint": "public_endpoint",
          "port": "port"
        }
      }
    expect: |-
      {
        "exit_code": 0,
        "cel": ""
      }
    description: Drop table 2
    max_retries: 0
    delay_after: 0
    step_type: defined
    name: drop_table_2
    save: null
    continue_on_unexpected: false
    stage: execute
    meta: "{}"
    generation_id: 09198df8-3eef-4d82-a5a4-31eb9b0db7de
    order: 17
  - case_id: create_table_3
    operation_id: Mysqlsh_connection
    case_type: typical_positive
    request_type: cmd_mysqlsh
    request: |-
      {
        "name": "mysqlsh",
        "args": [
          "--sql",
          "mysql://root:31415926@{public_endpoint}:{port}/test",
          "--result-format=json",
          "-e",
          "CREATE TABLE `students` (`id` int(11) NOT NULL AUTO_INCREMENT,`name` varchar(255) DEFAULT NULL,`age` int(11) DEFAULT NULL, PRIMARY KEY (`id`) /*T![clustered_index] CLUSTERED */) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=30001;",
          "--quiet-start=2"
        ],
        "args_params": {
          "public_endpoint": "public_endpoint",
          "port": "port"
        }
      }
    expect: |-
      {
        "exit_code": 0,
        "cel": ""
      }
    description: create table 3.
    max_retries: 0
    delay_after: 0
    step_type: defined
    name: create_table_3
    save: null
    continue_on_unexpected: false
    stage: execute
    meta: "{}"
    generation_id: 09198df8-3eef-4d82-a5a4-31eb9b0db7de
    order: 18
  - case_id: import_parquet
    operation_id: ImportService_CreateImport
    case_type: typical_positive
    request_type: http
    request: |-
      {
        "auth": {
          "auth_type": "digest",
          "content": {"private_key": "placeholder","public_key": "placeholder"}
        },
        "method": "POST",
        "path": "/clusters/{clusterId}/imports",
        "path_params": {
          "clusterId": "cluster_1"
        },
        "query_params": {},
        "headers": {},
        "body": {
          "creation_details": {
            "import_options": {
              "file_type": "PARQUET",
              "duplication_handling": "REPLACE",
              "need_drop_tables": false,
              "validate_only": false
            },
            "source": {
              "type": "AZURE_BLOB",
              "azure_blob": {
                "auth_type": "SAS_TOKEN",
                "uri": "https://fangcloudtest.blob.core.windows.net/testimportdata/testdata/",
                "sas_token": "{azure_account_sas_token}"
              }
            },
            "target_table_infos": [
              {
                "target_table": {
                  "schema": "test",
                  "table": "students"
                },
                "custom_file": "",
                "matched_uri": "https://fangcloudtest.blob.core.windows.net/testimportdata/testdata/"
              }
            ],
            "check_items": [
              "IMPORT_PRECHECK",
              "ESTIMATE_SIZE"
            ]
          }
        },
        "body_params": {
          "azure_account_sas_token": "azure_account_sas_token"
        }
      }
    expect: |-
      {
        "status_code": 200,
        "cel": ""
      }
    description: Import parquet.
    max_retries: 0
    delay_after: 0
    step_type: generated
    name: Import_parquet
    save: |-
      {
        "placeholder": [
          { "key": "import_3", "eval": "body.importId" }
        ]
      }
    continue_on_unexpected: false
    stage: execute
    meta: "{}"
    generation_id: 09198df8-3eef-4d82-a5a4-31eb9b0db7de
    order: 19
  - case_id: wait_for_import_3
    operation_id: ImportService_GetImport
    case_type: typical_positive
    request_type: http
    request: |-
      {
        "auth": {
          "auth_type": "digest",
          "content": {"private_key": "placeholder","public_key": "placeholder"}
        },
        "method": "GET",
        "path": "/clusters/{clusterId}/imports/{importId}",
        "path_params": {
          "clusterId": "cluster_1",
          "importId": "import_3"
        },
        "query_params": {},
        "headers": {},
        "body": {}
      }
    expect: |-
      {
        "status_code": 200,
        "cel": "body.state == \"COMPLETED\""
      }
    description: Wait for import to complete.
    max_retries: 60
    delay_after: 60
    step_type: generated
    name: wait_for_import_3
    save: null
    continue_on_unexpected: false
    stage: execute
    meta: "{}"
    generation_id: 09198df8-3eef-4d82-a5a4-31eb9b0db7de
    order: 20
  - case_id: connect_to_check_table_3
    operation_id: Mysqlsh_connection
    case_type: typical_positive
    request_type: cmd_mysqlsh
    request: |-
      {
        "name": "mysqlsh",
        "args": [
          "--sql",
          "mysql://root:31415926@{public_endpoint}:{port}/test",
          "--result-format=json",
          "-e",
          "SELECT EXISTS (SELECT 1 FROM students WHERE name = 'Charlie') AS result;",
          "--quiet-start=2"
        ],
        "args_params": {
          "public_endpoint": "public_endpoint",
          "port": "port"
        }
      }
    expect: |-
      {
        "exit_code": 0,
        "cel": "output.result == 1"
      }
    description: Check the connection status of the cluster.
    max_retries: 0
    delay_after: 0
    step_type: defined
    name: check_data
    save: null
    continue_on_unexpected: false
    stage: execute
    meta: "{}"
    generation_id: 09198df8-3eef-4d82-a5a4-31eb9b0db7de
    order: 21
  - case_id: cleanup_cluster_1
    operation_id: ClusterService_DeleteCluster
    generation_id: 09198df8-3eef-4d82-a5a4-31eb9b0db7de
    order: 22
    case_type: typical_positive
    request_type: http
    request: |-
      {
        "auth": {
          "auth_type": "digest",
          "content": {"private_key": "placeholder","public_key": "placeholder"}
        },
        "method": "DELETE",
        "path": "/clusters/{clusterId}",
        "path_params": {
          "clusterId": "cluster_1"
        },
        "query_params": {},
        "headers": {},
        "body": {}
      }
    expect: |-
      {
        "status_code": 200,
        "cel": ""
      }
    description: Cleanup step for TiDB Cloud cluster with no parent dependency.
    max_retries: 0
    delay_after: 0
    step_type: generated
    name: Delete TiDB Cloud Cluster
    save: null
    continue_on_unexpected: false
    stage: execute
    meta: "{}"
