scenario:
  id: 38713bee-c52a-4532-b9af-de94af9e90c7
  context:
    auth:
      type: digest
    base_path: /v1beta1
    host: null
  description: ''
  name: test
steps:
- operation_id: ClusterService_CreateCluster
  request_type: http
  request: |-
    {
      "method": "POST",
      "path": "/clusters",
      "headers": {},
      "query_params": {},
      "body": {
        "displayName": "e2e-essential-export",
        "region": {
          "name": "{regionId}"
        },
        "rootPassword": "pi31415926536",
        "autoScaling": {
          "minRcu": 2000,
          "maxRcu": 4000
        },
        "endpoints": {
          "public": {
            "authorizedNetworks": [
              {
                "startIpAddress": "0.0.0.0",
                "endIpAddress": "255.255.255.255",
                "displayName": "AllowAll"
              }
            ]
          }
        },
        "labels": {
          "tidb.cloud/project": "{projectId}"
        }
      },
      "body_params": {
        "projectId": "project_id",
        "regionId": "region_id"
      },
      "auth": {
        "auth_type": "digest",
        "content": {
          "public_key": "placeholder",
          "private_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": ""
    }
  save: |-
    {
      "placeholder": [
        {
          "key": "cluster_1",
          "eval": "body.clusterId"
        }
      ]
    }
  description: ''
  max_retries: 0
  delay_after: 0
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 0
- operation_id: ClusterService_GetCluster
  request_type: http
  request: |-
    {
      "method": "GET",
      "path": "/clusters/{clusterId}?view=FULL",
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "digest",
        "content": {
          "public_key": "placeholder",
          "private_key": "placeholder"
        }
      },
      "path_params": {
        "clusterId": "cluster_1"
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.state == 'ACTIVE' && body.endpoints.public.host != '' && body.userPrefix != ''"
    }
  save: |-
    {
      "placeholder": [
        {
          "key": "user_prefix",
          "eval": "body.userPrefix"
        },
        {
          "key": "public_endpoint",
          "eval": "body.endpoints.public.host"
        },
        {
          "key": "public_endpoint_port",
          "eval": "body.endpoints.public.port"
        }
      ]
    }
  description: ''
  max_retries: 10
  delay_after: 30
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 1
- operation_id: ExecuteSQL
  request_type: cmd_mysqlsh
  request: |-
    {
      "args": [
        "mysql://{user_prefix}.root:pi31415926536@{public_endpoint}:{public_endpoint_port}/test",
        "--sql",
        "-e",
        "CREATE TABLE IF NOT EXISTS tt (id INT AUTO_INCREMENT PRIMARY KEY, name VARCHAR(100), value INT); INSERT INTO tt (name, value) VALUES ('test1', 100), ('test2', 200);",
        "--result-format=json",
        "--quiet-start=2"
      ],
      "args_params": {
        "user_prefix": "user_prefix",
        "public_endpoint": "public_endpoint",
        "public_endpoint_port": "public_endpoint_port"
      },
      "name": "mysqlsh"
    }
  expect: |-
    {
      "status_code": 0,
      "cel": ""
    }
  save: null
  description: ''
  max_retries: 0
  delay_after: 0
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 2
- operation_id: ClusterService_PartialUpdateCluster
  request_type: http
  request: |-
    {
      "method": "PATCH",
      "path": "/clusters/{clusterId}",
      "headers": {},
      "query_params": {},
      "body": {
        "updateMask": "autoScaling",
        "cluster": {
          "autoScaling": {
            "minRcu": 2000,
            "maxRcu": 6000
          }
        }
      },
      "auth": {
        "auth_type": "digest",
        "content": {
          "public_key": "placeholder",
          "private_key": "placeholder"
        }
      },
      "path_params": {
        "clusterId": "cluster_1"
      }
    }
  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: ClusterService_GetCluster
  request_type: http
  request: |-
    {
      "method": "GET",
      "path": "/clusters/{clusterId}?view=FULL",
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "digest",
        "content": {
          "public_key": "placeholder",
          "private_key": "placeholder"
        }
      },
      "path_params": {
        "clusterId": "cluster_1"
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.state == 'ACTIVE' && body.autoScaling.maxRcu == 6000"
    }
  save: null
  description: ''
  max_retries: 10
  delay_after: 30
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 4
- operation_id: ExecuteSQL
  request_type: cmd_mysqlsh
  request: |-
    {
      "args": [
        "mysql://{user_prefix}.root:pi31415926536@{public_endpoint}:{public_endpoint_port}/test",
        "--sql",
        "-e",
        "SELECT value FROM tt WHERE name = 'test1';",
        "--result-format=json",
        "--quiet-start=2"
      ],
      "args_params": {
        "user_prefix": "user_prefix",
        "public_endpoint": "public_endpoint",
        "public_endpoint_port": "public_endpoint_port"
      },
      "name": "mysqlsh"
    }
  expect: |-
    {
      "status_code": 0,
      "cel": "output.value == 100"
    }
  save: null
  description: ''
  max_retries: 0
  delay_after: 0
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 5
- operation_id: ExportService_ListExports
  request_type: http
  request: |-
    {
      "method": "GET",
      "path": "/clusters/{clusterId}/exports",
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "digest",
        "content": {
          "public_key": "placeholder",
          "private_key": "placeholder"
        }
      },
      "path_params": {
        "clusterId": "cluster_1"
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.totalSize == 0"
    }
  save: null
  description: ''
  max_retries: 0
  delay_after: 0
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 6
- operation_id: ExportService_CreateExport
  request_type: http
  request: |-
    {
      "method": "POST",
      "path": "/clusters/{clusterId}/exports",
      "headers": {},
      "query_params": {},
      "body": {
        "exportOptions": {
          "fileType": "SQL",
          "compression": "ZSTD",
          "filter": {
            "table": {
              "patterns": [
                "test.tt"
              ]
            }
          }
        },
        "target": {
          "type": "S3",
          "s3": {
            "uri": "s3://llm-operated/temp/",
            "authType": "ROLE_ARN",
            "roleArn": "arn:aws:iam::024848481520:role/autonomous-llm-e2e"
          }
        }
      },
      "auth": {
        "auth_type": "digest",
        "content": {
          "public_key": "placeholder",
          "private_key": "placeholder"
        }
      },
      "path_params": {
        "clusterId": "cluster_1"
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": ""
    }
  save: |-
    {
      "placeholder": [
        {
          "key": "export_1",
          "eval": "body.exportId"
        }
      ]
    }
  description: ''
  max_retries: 0
  delay_after: 0
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 7
- operation_id: ExportService_CancelExport
  request_type: http
  request: |-
    {
      "method": "POST",
      "path": "/clusters/{clusterId}/exports/{exportId}:cancel",
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "digest",
        "content": {
          "public_key": "placeholder",
          "private_key": "placeholder"
        }
      },
      "path_params": {
        "clusterId": "cluster_1",
        "exportId": "export_1"
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": ""
    }
  save: null
  description: ''
  max_retries: 0
  delay_after: 0
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 8
- operation_id: ExportService_GetExport
  request_type: http
  request: |-
    {
      "method": "GET",
      "path": "/clusters/{clusterId}/exports/{exportId}",
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "digest",
        "content": {
          "public_key": "placeholder",
          "private_key": "placeholder"
        }
      },
      "path_params": {
        "clusterId": "cluster_1",
        "exportId": "export_1"
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.state == 'CANCELED'"
    }
  save: null
  description: ''
  max_retries: 10
  delay_after: 30
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 9
- operation_id: ExportService_CreateExport
  request_type: http
  request: |-
    {
      "method": "POST",
      "path": "/clusters/{clusterId}/exports",
      "headers": {},
      "query_params": {},
      "body": {
        "exportOptions": {
          "fileType": "SQL",
          "compression": "ZSTD",
          "filter": {
            "table": {
              "patterns": [
                "test.tt"
              ]
            }
          }
        },
        "target": {
          "type": "S3",
          "s3": {
            "uri": "s3://llm-operated/temp/",
            "authType": "ROLE_ARN",
            "roleArn": "arn:aws:iam::024848481520:role/autonomous-llm-e2e"
          }
        }
      },
      "auth": {
        "auth_type": "digest",
        "content": {
          "public_key": "placeholder",
          "private_key": "placeholder"
        }
      },
      "path_params": {
        "clusterId": "cluster_1"
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": ""
    }
  save: |-
    {
      "placeholder": [
        {
          "key": "export_2",
          "eval": "body.exportId"
        }
      ]
    }
  description: ''
  max_retries: 0
  delay_after: 0
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 10
- operation_id: ExportService_GetExport
  request_type: http
  request: |-
    {
      "method": "GET",
      "path": "/clusters/{clusterId}/exports/{exportId}",
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "digest",
        "content": {
          "public_key": "placeholder",
          "private_key": "placeholder"
        }
      },
      "path_params": {
        "clusterId": "cluster_1",
        "exportId": "export_2"
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.state == 'SUCCEEDED'"
    }
  save: null
  description: ''
  max_retries: 10
  delay_after: 30
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 11
- operation_id: ExportService_DeleteExport
  request_type: http
  request: |-
    {
      "method": "DELETE",
      "path": "/clusters/{clusterId}/exports/{exportId}",
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "digest",
        "content": {
          "public_key": "placeholder",
          "private_key": "placeholder"
        }
      },
      "path_params": {
        "clusterId": "cluster_1",
        "exportId": "export_2"
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": ""
    }
  save: null
  description: ''
  max_retries: 0
  delay_after: 0
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 12
- operation_id: ClusterService_DeleteCluster
  request_type: http
  request: |-
    {
      "method": "DELETE",
      "path": "/clusters/{clusterId}",
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "digest",
        "content": {
          "public_key": "placeholder",
          "private_key": "placeholder"
        }
      },
      "path_params": {
        "clusterId": "cluster_1"
      }
    }
  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: AWS_S3_DeleteObject
  request_type: cmd_aws
  request: |-
    {
      "args": [
        "s3",
        "rm",
        "s3://llm-operated/temp/",
        "--recursive"
      ],
      "args_params": {},
      "name": "aws"
    }
  expect: |-
    {
      "status_code": 0,
      "cel": ""
    }
  save: null
  description: ''
  max_retries: 0
  delay_after: 0
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 14
