scenario:
  id: 10e5fb01-2d4a-4d16-a624-801d28324e53
  context:
    auth:
      type: digest
    base_path: /v1beta2
    host: null
  description: ng_private_endpoint
  name: ng_private_endpoint
steps:
- operation_id: TidbService_CreateTidb
  request_type: http
  request: |-
    {
      "method": "POST",
      "path": "/tidbs",
      "headers": {},
      "query_params": {},
      "body": {
        "displayName": "sce-ng-private-endpoint",
        "regionId": "{regionId}",
        "minRcu": "5000",
        "maxRcu": "6000",
        "servicePlan": "Premium",
        "cloudProvider": "{cloud_provider}"
      },
      "body_params": {
        "regionId": "region_id",
        "cloud_provider": "cloud_provider"
      },
      "auth": {
        "auth_type": "digest",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": ""
    }
  save: |-
    {
      "placeholder": [
        {
          "key": "cluster_1",
          "eval": "body.tidbId"
        }
      ]
    }
  description: ""
  max_retries: 0
  delay_after: 0
  name: ""
  continue_on_unexpected: false
  stage: ""
  meta: "{}"
  generation_id: ""
  order: 0
- operation_id: TidbService_GetTidb
  request_type: http
  request: |-
    {
      "method": "GET",
      "path": "/tidbs/{tidbId}",
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "digest",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      },
      "path_params": {
        "tidbId": "cluster_1"
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.state == 'ACTIVE'"
    }
  save: null
  description: ''
  max_retries: 120
  delay_after: 30
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 1
- operation_id: PrivateEndpointConnectionService_GetPrivateLinkService
  request_type: http
  request: |-
    {
      "method": "GET",
      "path": "/tidbs/{tidbId}/privateLinkService",
      "headers": {},
      "query_params": {},
      "body": {},
      "path_params": {
        "tidbId": "cluster_1"
      },
      "auth": {
        "auth_type": "digest",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.state == 'ACTIVE'"
    }
  save: |-
    {
      "placeholder": [
        {
          "key": "private_link_service_1",
          "eval": "body.serviceName"
        }
      ]
    }
  description: ''
  max_retries: 120
  delay_after: 30
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 0
- operation_id: ec2 describe-vpcs
  request_type: cmd_aws
  request: |-
    {
      "args": [
        "ec2",
        "describe-vpcs",
        "--region",
        "{region}",
        "--filters", 
        "Name=isDefault,Values=true",
        "--output",
        "json"
      ],
      "args_params": {
        "region":"region"
      },
      "name": "aws"
    }
  expect: |-
    {
      "status_code": 0,
      "cel": ""
    }
  save: |-
    {
      "placeholder": [
        {
          "key": "vpc_id_1",
          "eval": "output.Vpcs[0].VpcId"
        }
      ]
    }
  description: ''
  max_retries: 0
  delay_after: 0
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 1.5
- operation_id: ec2 create-vpc-endpoint
  request_type: cmd_aws
  request: |-
    {
      "args": [
        "ec2",
        "create-vpc-endpoint",
        "--vpc-id",
        "{vpc_id_1}",
        "--service-name",
        "{private_link_service_1}",
        "--vpc-endpoint-type",
        "Interface",
        "--region",
        "{region}"
      ],
      "args_params": {
        "vpc_id_1": "vpc_id_1",
        "private_link_service_1": "private_link_service_1",
        "region":"region"
      },
      "name": "aws"
    }
  expect: |-
    {
      "status_code": 0,
      "cel": ""
    }
  save: |-
    {
      "placeholder": [
        {
          "key": "private_endpoint_1",
          "eval": "output.VpcEndpoint.VpcEndpointId"
        },
        {
          "key": "vpc_1",
          "eval": "output.VpcEndpoint.VpcId"
        }
      ]
    }
  description: ''
  max_retries: 0
  delay_after: 0
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 2
- operation_id: PrivateEndpointConnectionService_CreatePrivateEndpointConnection
  request_type: http
  request: |-
    {
      "method": "POST",
      "path": "/tidbs/{tidbId}/privateEndpointConnections",
      "headers": {},
      "query_params": {},
      "body": {
        "regionId": "{regionId}",
        "endpointId": "{private_endpoint_1}"
      },
      "auth": {
        "auth_type": "digest",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      },
      "path_params": {
        "tidbId": "cluster_1"
      },
      "body_params": {
        "regionId": "region_id",
        "private_endpoint_1": "private_endpoint_1"
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": ""
    }
  save: |-
    {
      "placeholder": [
        {
          "key": "private_endpoint_connection_1",
          "eval": "body.privateEndpointConnectionId"
        }
      ]
    }
  description: ''
  max_retries: 0
  delay_after: 0
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 3
- operation_id: PrivateEndpointConnectionService_GetPrivateEndpointConnection
  request_type: http
  request: |-
    {
      "method": "GET",
      "path": "/tidbs/{tidbId}/privateEndpointConnections/{privateEndpointConnectionId}",
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "digest",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      },
      "path_params": {
        "tidbId": "cluster_1",
        "privateEndpointConnectionId": "private_endpoint_connection_1"
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.endpointState == 'ACTIVE'"
    }
  save: null
  description: ''
  max_retries: 120
  delay_after: 30
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 4
- operation_id: PrivateEndpointConnectionService_ListPrivateEndpointConnections
  request_type: http
  request: |-
    {
      "method": "GET",
      "path": "/tidbs/{tidbId}/privateEndpointConnections",
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "digest",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      },
      "path_params": {
        "tidbId": "cluster_1"
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.totalSize > 0"
    }
  save: null
  description: ''
  max_retries: 120
  delay_after: 30
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 5
- operation_id: PrivateEndpointConnectionService_GetPrivateEndpointConnection
  request_type: http
  request: |-
    {
      "method": "GET",
      "path": "/tidbs/{tidbId}/privateEndpointConnections/{privateEndpointConnectionId}",
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "digest",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      },
      "path_params": {
        "tidbId": "cluster_1",
        "privateEndpointConnectionId": "private_endpoint_connection_1"
      }
    }
  expect: |-
    {
      "status_code": 200,
      "cel": "body.endpointState == 'ACTIVE'"
    }
  save: null
  description: ''
  max_retries: 120
  delay_after: 30
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 6
- operation_id: PrivateEndpointConnectionService_DeletePrivateEndpointConnection
  request_type: http
  request: |-
    {
      "method": "DELETE",
      "path": "/tidbs/{tidbId}/privateEndpointConnections/{privateEndpointConnectionId}",
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "digest",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      },
      "path_params": {
        "tidbId": "cluster_1",
        "privateEndpointConnectionId": "private_endpoint_connection_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: 7
- operation_id: ec2 delete-vpc-endpoint
  request_type: cmd_aws
  request: |-
    {
      "args": [
        "ec2",
        "delete-vpc-endpoints",
        "--vpc-endpoint-ids",
        "{private_endpoint_1}"
      ],
      "args_params": {
        "private_endpoint_1": "private_endpoint_1"
      },
      "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: 8
- operation_id: TidbService_DeleteTidb
  request_type: http
  request: |-
    {
      "method": "DELETE",
      "path": "/tidbs/{tidbId}",
      "headers": {},
      "query_params": {},
      "body": {},
      "auth": {
        "auth_type": "digest",
        "content": {
          "private_key": "placeholder",
          "public_key": "placeholder"
        }
      },
      "path_params": {
        "tidbId": "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: 9
