scenario:
  id: 10e5fb01-2d4a-4d16-a624-801d28324e53
  context:
    auth:
      type: digest
    base_path: /v1beta2
    host: null
  description: ng_private_endpoint_azure
  name: ng_private_endpoint_azure
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: CloudCLI_CreatePrivateEndpoint
  request_type: cmd_azure
  request: |-
    {
      "name": "az",
      "args": [
        "network",
        "private-endpoint",
        "create",
        "--location",
        "eastus2",
        "--name",
        "e2e-scenario-pe-{clusterId}",
        "--resource-group",
        "e2e-fuzzy-openapi-eastus2",
        "--subnet",
        "/subscriptions/85b598b9-a080-4476-bc96-ba89e64f92d1/resourceGroups/e2e-fuzzy-openapi-eastus2/providers/Microsoft.Network/virtualNetworks/e2e-fuzzy-openapi-eastus2/subnets/default",
        "--private-connection-resource-id",
        "{private_link_service_1}",
        "--connection-name",
        "e2e-scenario-pe-{clusterId}",
        "--manual-request",
        "true",
        "--nic-name",
        "e2e-scenario-pe-{clusterId}-nic",
        "--subscription",
        "85b598b9-a080-4476-bc96-ba89e64f92d1",
        "--output",
        "json"
      ],
      "args_params": {
        "clusterId": "cluster_1",
        "private_link_service_1": "private_link_service_1"
      }
    }
  expect: |-
    {
      "exit_code": 0,
      "cel": ""
    }
  save: |-
    {
      "placeholder": [
        {
          "key": "private_endpoint_1",
          "eval": "output.id"
        },
        {
          "key": "nic_id_1",
          "eval": "output.networkInterfaces[0].id"
        }
      ]
    }
  description: ''
  max_retries: 0
  delay_after: 0
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 2
- operation_id: CloudCLI_GetPrivateIP
  request_type: cmd_azure
  request: |-
    {
      "name": "az",
      "args": [
        "network",
        "nic",
        "show",
        "--ids",
        "{nic_id_1}",
        "--subscription",
        "85b598b9-a080-4476-bc96-ba89e64f92d1",
        "--query",
        "{privateIpAddress:ipConfigurations[0].privateIPAddress}",
        "--output",
        "json"
      ],
      "args_params": {
        "nic_id_1": "nic_id_1"
      }
    }
  expect: |-
    {
      "exit_code": 0,
      "cel": ""
    }
  save: |-
    {
      "placeholder": [
        {
          "key": "private_ip_1",
          "eval": "output.privateIpAddress"
        }
      ]
    }
  description: ''
  max_retries: 0
  delay_after: 0
  name: ''
  continue_on_unexpected: false
  stage: ''
  meta: '{}'
  generation_id: ''
  order: 2.5
- operation_id: PrivateEndpointConnectionService_CreatePrivateEndpointConnection
  request_type: http
  request: |-
    {
      "method": "POST",
      "path": "/tidbs/{tidbId}/privateEndpointConnections",
      "headers": {},
      "query_params": {},
      "body": {
        "regionId": "{regionId}",
        "endpointId": "{private_endpoint_1}",
        "privateIpAddress": "{private_ip_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",
        "private_ip_1": "private_ip_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: CloudCLI_DeletePrivateEndpoint
  request_type: cmd_azure
  request: |-
    {
      "name": "az",
      "args": [
        "network",
        "private-endpoint",
        "delete",
        "--ids",
        "{private_endpoint_1}",
        "--subscription",
        "85b598b9-a080-4476-bc96-ba89e64f92d1",
        "--output",
        "json"
      ],
      "args_params": {
        "private_endpoint_1": "private_endpoint_1"
      }
    }
  expect: |-
    {
      "exit_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
