---
setup:
- skip:
    features:
    - "headers"
    - "allowed_warnings_regex"
---
basic tsdb delete:
- skip:
    awaits_fix: "ids have changed after introduction of synthetic id"
- requires:
    cluster_features:
    - "gte_v8.13.0"
    reason: "_tsid hashing introduced in 8.13"
- do:
    indices.create:
      index: "weather_sensors"
      body:
        settings:
          index:
            mode: "time_series"
            routing_path:
            - "sensor_id"
            - "location"
            time_series:
              start_time: "2000-01-01T00:00:00.000Z"
              end_time: "2099-12-31T23:59:59.999Z"
            number_of_replicas: 0
            number_of_shards: 1
        mappings:
          properties:
            '@timestamp':
              type: "date"
            humidity:
              type: "half_float"
              time_series_metric: "gauge"
            location:
              type: "keyword"
              time_series_dimension: true
            sensor_id:
              type: "keyword"
              time_series_dimension: true
            temperature:
              type: "half_float"
              time_series_metric: "gauge"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    index:
      index: "weather_sensors"
      body:
        '@timestamp': "2023-05-31T08:41:15.000Z"
        sensor_id: "SYKENET-000001"
        location: "swamp"
        temperature: 32.4
        humidity: 88.9
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    _id: "crxuhAep5Npwt_etAAABiHD35_g"
- match:
    result: "created"
- match:
    _version: 1
- do:
    delete:
      index: "weather_sensors"
      id: "crxuhAep5Npwt_etAAABiHD35_g"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    _id: "crxuhAep5Npwt_etAAABiHD35_g"
- match:
    result: "deleted"
- match:
    _version: 2
- do:
    indices.flush:
      index: "weather_sensors"
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- do:
    index:
      index: "weather_sensors"
      body:
        '@timestamp': "2023-05-31T08:41:15.000Z"
        sensor_id: "SYKENET-000001"
        location: "swamp"
        temperature: 32.4
        humidity: 88.9
    headers:
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    allowed_warnings_regex:
    - "Use of the \\[max_size\\] rollover condition has been deprecated in favour\
      \ of the \\[max_primary_shard_size\\] condition and will be removed in a later\
      \ version"
    - "Parameter \\[confidence_interval\\] in \\[index_options\\] for dense_vector\
      \ field \\[[^\\]]+\\] is deprecated and will be removed in a future version"
- match:
    _id: "crxuhAep5Npwt_etAAABiHD35_g"
- match:
    result: "created"
- match:
    _version: 3
