---
setup:
- skip:
    known_issues:
    - cluster_feature: "gte_v8.7.0"
      fixed_by: "gte_v8.10.0"
    reason: "Synthetic source shows up in the mapping in 8.10 and on, may trigger\
      \ assert failures in mixed cluster tests"
    features:
    - "headers"
    - "allowed_warnings_regex"
---
enable:
- requires:
    cluster_features:
    - "gte_v8.1.0"
    reason: "introduced in 8.1.0"
- do:
    indices.create:
      index: "test_index"
      body:
        settings:
          index:
            mode: "time_series"
            routing_path:
            - "metricset"
            - "k8s.pod.uid"
            time_series:
              start_time: "2021-04-28T00:00:00Z"
              end_time: "2021-04-29T00:00:00Z"
            number_of_replicas: 0
            number_of_shards: 2
        mappings:
          properties:
            '@timestamp':
              type: "date"
            metricset:
              type: "keyword"
              time_series_dimension: true
            k8s:
              properties:
                pod:
                  properties:
                    uid:
                      type: "keyword"
                      time_series_dimension: true
                    name:
                      type: "keyword"
                    ip:
                      type: "ip"
                    network:
                      properties:
                        tx:
                          type: "long"
                        rx:
                          type: "long"
    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"
---
no sort field:
- requires:
    cluster_features:
    - "gte_v8.1.0"
    reason: "introduced in 8.1.0"
- do:
    catch: "/\\[index.mode=time_series\\] is incompatible with \\[index.sort.field\\\
      ]/"
    indices.create:
      index: "test_index"
      body:
        settings:
          index:
            mode: "time_series"
            routing_path: "foo"
            time_series:
              start_time: "2021-04-28T00:00:00Z"
              end_time: "2021-04-29T00:00:00Z"
            sort.field:
            - "a"
    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"
---
no sort order:
- requires:
    cluster_features:
    - "gte_v8.1.0"
    reason: "introduced in 8.1.0"
- do:
    catch: "/\\[index.mode=time_series\\] is incompatible with \\[index.sort.order\\\
      ]/"
    indices.create:
      index: "test_index"
      body:
        settings:
          index:
            mode: "time_series"
            routing_path: "foo"
            time_series:
              start_time: "2021-04-28T00:00:00Z"
              end_time: "2021-04-29T00:00:00Z"
            sort.order:
            - "DESC"
    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"
---
no sort mode:
- requires:
    cluster_features:
    - "gte_v8.1.0"
    reason: "introduced in 8.1.0"
- do:
    catch: "/\\[index.mode=time_series\\] is incompatible with \\[index.sort.mode\\\
      ]/"
    indices.create:
      index: "test_index"
      body:
        settings:
          index:
            mode: "time_series"
            routing_path: "foo"
            time_series:
              start_time: "2021-04-28T00:00:00Z"
              end_time: "2021-04-29T00:00:00Z"
            sort.mode:
            - "MIN"
    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"
---
no sort missing:
- requires:
    cluster_features:
    - "gte_v8.1.0"
    reason: "introduced in 8.1.0"
- do:
    catch: "/\\[index.mode=time_series\\] is incompatible with \\[index.sort.missing\\\
      ]/"
    indices.create:
      index: "test_index"
      body:
        settings:
          index:
            mode: "time_series"
            routing_path: "foo"
            time_series:
              start_time: "2021-04-28T00:00:00Z"
              end_time: "2021-04-29T00:00:00Z"
            sort.missing:
            - "_last"
    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"
---
no partitioning:
- requires:
    cluster_features:
    - "gte_v8.1.0"
    reason: "introduced in 8.1.0"
- do:
    catch: "/\\[index.mode=time_series\\] is incompatible with \\[index.routing_partition_size\\\
      ]/"
    indices.create:
      index: "test_index"
      body:
        settings:
          index:
            mode: "time_series"
            routing_path: "foo"
            time_series:
              start_time: "2021-04-28T00:00:00Z"
              end_time: "2021-04-29T00:00:00Z"
            routing_partition_size: 2
            number_of_shards: 4
    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"
---
routing_path required:
- requires:
    cluster_features:
    - "gte_v8.2.0"
    reason: "the message was changed in 8.2.0"
- do:
    catch: "/\\[index.mode=time_series\\] requires a non-empty \\[index.routing_path\\\
      ]/"
    indices.create:
      index: "test_index"
      body:
        settings:
          index:
            mode: "time_series"
            time_series:
              start_time: "2021-04-28T00:00:00Z"
              end_time: "2021-04-29T00:00:00Z"
            number_of_shards: 5
    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"
---
routing_path is not allowed in standard mode:
- requires:
    cluster_features:
    - "gte_v8.1.0"
    reason: "introduced in 8.1.0"
- do:
    catch: "/\\[index.routing_path\\] requires \\[index.mode=time_series\\]/"
    indices.create:
      index: "test_index"
      body:
        settings:
          index:
            routing_path: "foo"
    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"
---
routing required:
- requires:
    cluster_features:
    - "gte_v8.1.0"
    reason: "introduced in 8.1.0"
- do:
    catch: "/routing is forbidden on CRUD operations that target indices in \\[index.mode=time_series\\\
      ]/"
    indices.create:
      index: "test_index"
      body:
        settings:
          index:
            mode: "time_series"
            routing_path: "foo"
            time_series:
              start_time: "2021-04-28T00:00:00Z"
              end_time: "2021-04-29T00:00:00Z"
        mappings:
          _routing:
            required: true
    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"
---
empty routing_path:
- requires:
    cluster_features:
    - "gte_v8.2.0"
    reason: "the message was changed in 8.2.0"
- do:
    catch: "/\\[index.mode=time_series\\] requires a non-empty \\[index.routing_path\\\
      ]/"
    indices.create:
      index: "test_index"
      body:
        settings:
          index:
            mode: "time_series"
            routing_path: []
            time_series:
              start_time: "2021-04-28T00:00:00Z"
              end_time: "2021-04-29T00:00:00Z"
            number_of_shards: 5
    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"
---
empty start end times:
- requires:
    cluster_features:
    - "gte_v8.1.0"
    reason: "introduced in 8.1.0"
- do:
    catch: "/cannot parse empty date(time)?/"
    indices.create:
      index: "test_index"
      body:
        settings:
          index:
            mode: "time_series"
            routing_path: []
            time_series:
              start_time: ""
              end_time: ""
            number_of_shards: 5
    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"
---
set start_time and end_time:
- requires:
    cluster_features:
    - "gte_v8.2.0"
    reason: "tsdb indexing changed in 8.2.0"
- do:
    indices.create:
      index: "test_index"
      body:
        settings:
          index:
            mode: "time_series"
            routing_path:
            - "metricset"
            time_series:
              start_time: 1632625782000
              end_time: 1632625792000
        mappings:
          properties:
            '@timestamp':
              type: "date"
            metricset:
              type: "keyword"
              time_series_dimension: true
    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:
    indices.put_settings:
      index: "test_index"
      body:
        index:
          time_series:
            end_time: 1632625793000
    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:
    catch: "/index.time_series.end_time must be larger than current value \\[1632625793000\\\
      ]/"
    indices.put_settings:
      index: "test_index"
      body:
        index:
          time_series:
            end_time: 1632625792000
    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:
      refresh: true
      index: "test_index"
      body:
        '@timestamp': 1632625792000
        metricset: "pod"
    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:
    search:
      index: "test_index"
      body:
        docvalue_fields:
        - "@timestamp"
    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:
    hits.total.value: 1
- match:
    hits.hits.0.fields.@timestamp:
    - "2021-09-26T03:09:52.000Z"
- do:
    indices.delete:
      index: "test_index"
    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"
---
set start_time and end_time without timeseries mode:
- skip:
    awaits_fix: "we don't validate for index_mode=tsdb when setting start_date/end_date\
      \ anymore"
- requires:
    cluster_features:
    - "gte_v8.2.0"
    reason: "tsdb indexing changed in 8.2.0"
- do:
    catch: "/\\[index.time_series.start_time\\] requires \\[index.mode=time_series\\\
      ]/"
    indices.create:
      index: "test_index"
      body:
        settings:
          index:
            time_series:
              start_time: 1632625782000
    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:
    catch: "/\\[index.time_series.end_time\\] requires \\[index.mode=time_series\\\
      ]/"
    indices.create:
      index: "test_index"
      body:
        settings:
          index:
            time_series:
              end_time: 1632625782000
    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"
---
set start_time, end_time and routing_path via put settings api without time_series mode:
- skip:
    awaits_fix: "we don't validate for index_mode=tsdb when setting start_date/end_date\
      \ anymore"
- requires:
    cluster_features:
    - "gte_v8.15.0"
    reason: "bug fixed in 8.15.0"
- do:
    indices.create:
      index: "test-index"
    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:
    acknowledged: true
- do:
    catch: "/\\[index.time_series.end_time\\] requires \\[index.mode=time_series\\\
      ]/"
    indices.put_settings:
      index: "test-index"
      body:
        index.time_series.end_time: 1632625782000
    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:
    catch: "/Can't update non dynamic settings \\[\\[index.time_series.start_time\\\
      ]\\] for open indices/"
    indices.put_settings:
      index: "test-index"
      body:
        index.time_series.start_time: 1632625782000
    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:
    catch: "/Can't update non dynamic settings \\[\\[index.routing_path\\]\\] for\
      \ open indices/"
    indices.put_settings:
      index: "test-index"
      body:
        settings:
          index:
            routing_path: "foo"
    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:
    indices.close:
      index: "test-index"
    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:
    catch: "/\\[index.time_series.end_time\\] requires \\[index.mode=time_series\\\
      ]/"
    indices.put_settings:
      index: "test-index"
      body:
        index.time_series.end_time: 1632625782000
    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:
    catch: "/final test-index setting \\[index.time_series.start_time\\], not updateable/"
    indices.put_settings:
      index: "test-index"
      body:
        index.time_series.start_time: 1632625782000
    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:
    catch: "/final test-index setting \\[index.routing_path\\], not updateable/"
    indices.put_settings:
      index: "test-index"
      body:
        settings:
          index:
            routing_path: "foo"
    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"
---
set bad start_time and end_time:
- requires:
    cluster_features:
    - "gte_v8.2.0"
    reason: "tsdb indexing changed in 8.2.0"
- do:
    indices.create:
      index: "test_index"
      body:
        settings:
          index:
            mode: "time_series"
            routing_path:
            - "metricset"
            time_series:
              start_time: 1632625782000
              end_time: 1632625792000
        mappings:
          properties:
            metricset:
              type: "keyword"
              time_series_dimension: true
    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:
    catch: "/time series index @timestamp value \\[2021-09-26T03:09:41Z\\] must be\
      \ larger than 2021-09-26T03:09:42Z/"
    index:
      index: "test_index"
      body:
        '@timestamp': 1632625781000
        metricset: "pod"
    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:
    catch: "/time series index @timestamp value \\[2021-09-26T03:09:53Z\\] must be\
      \ smaller than 2021-09-26T03:09:52Z/"
    index:
      index: "test_index"
      body:
        '@timestamp': 1632625793000
        metricset: "pod"
    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"
---
check start_time and end_time with data_nano:
- requires:
    cluster_features:
    - "gte_v8.2.0"
    reason: "tsdb indexing changed in 8.2.0"
- do:
    indices.create:
      index: "test_index"
      body:
        settings:
          index:
            mode: "time_series"
            routing_path:
            - "metricset"
            time_series:
              start_time: "2021-09-26T03:09:42Z"
              end_time: "2021-09-26T03:09:52Z"
        mappings:
          properties:
            '@timestamp':
              type: "date_nanos"
            metricset:
              type: "keyword"
              time_series_dimension: true
    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:
      refresh: true
      index: "test_index"
      body:
        '@timestamp': "2021-09-26T03:09:51.123456789Z"
        metricset: "pod"
    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:
    search:
      index: "test_index"
      body:
        docvalue_fields:
        - "@timestamp"
    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:
    hits.total.value: 1
- match:
    hits.hits.0.fields.@timestamp:
    - "2021-09-26T03:09:51.123456789Z"
- do:
    catch: "/time series index @timestamp value \\[2010-09-26T03:09:52.123456789Z\\\
      ] must be larger than 2021-09-26T03:09:42Z/"
    index:
      index: "test_index"
      body:
        '@timestamp': "2010-09-26T03:09:52.123456789Z"
        metricset: "pod"
    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:
    catch: "/time series index @timestamp value \\[2031-09-26T03:09:52.123456789Z\\\
      ] must be smaller than 2021-09-26T03:09:52Z/"
    index:
      index: "test_index"
      body:
        '@timestamp': "2031-09-26T03:09:52.123456789Z"
        metricset: "pod"
    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"
---
check start_time boundary with data_nano:
- requires:
    cluster_features:
    - "gte_v8.2.0"
    reason: "tsdb indexing changed in 8.2.0"
- do:
    indices.create:
      index: "test_index"
      body:
        settings:
          index:
            mode: "time_series"
            routing_path:
            - "metricset"
            time_series:
              start_time: "2021-09-26T03:09:42Z"
              end_time: "2021-09-26T03:09:52Z"
        mappings:
          properties:
            '@timestamp':
              type: "date_nanos"
            metricset:
              type: "keyword"
              time_series_dimension: true
    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:
      refresh: true
      index: "test_index"
      body:
        '@timestamp': "2021-09-26T03:09:42.123456789Z"
        metricset: "pod"
    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:
    search:
      index: "test_index"
      body:
        docvalue_fields:
        - "@timestamp"
    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:
    hits.total.value: 1
- match:
    hits.hits.0.fields.@timestamp:
    - "2021-09-26T03:09:42.123456789Z"
- do:
    catch: "/time series index @timestamp value \\[2021-09-26T03:09:41.123456789Z\\\
      ] must be larger than 2021-09-26T03:09:42Z/"
    index:
      index: "test_index"
      body:
        '@timestamp': "2021-09-26T03:09:41.123456789Z"
        metricset: "pod"
    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"
---
check end_time boundary with data_nano:
- requires:
    cluster_features:
    - "gte_v8.2.0"
    reason: "tsdb indexing changed in 8.2.0"
- do:
    indices.create:
      index: "test_index"
      body:
        settings:
          index:
            mode: "time_series"
            routing_path:
            - "metricset"
            time_series:
              start_time: "2021-09-26T03:09:42Z"
              end_time: "2021-09-26T03:09:52Z"
        mappings:
          properties:
            '@timestamp':
              type: "date_nanos"
            metricset:
              type: "keyword"
              time_series_dimension: true
    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:
      refresh: true
      index: "test_index"
      body:
        '@timestamp': "2021-09-26T03:09:51.123456789Z"
        metricset: "pod"
    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:
    search:
      index: "test_index"
      body:
        docvalue_fields:
        - "@timestamp"
    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:
    hits.total.value: 1
- match:
    hits.hits.0.fields.@timestamp:
    - "2021-09-26T03:09:51.123456789Z"
- do:
    catch: "/time series index @timestamp value \\[2021-09-26T03:09:52.123456789Z\\\
      ] must be smaller than 2021-09-26T03:09:52Z/"
    index:
      index: "test_index"
      body:
        '@timestamp': "2021-09-26T03:09:52.123456789Z"
        metricset: "pod"
    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"
---
check time_series default time bound value:
- requires:
    cluster_features:
    - "gte_v8.2.0"
    reason: "tsdb indexing changed in 8.2.0"
- do:
    indices.create:
      index: "test_index"
      body:
        settings:
          index:
            mode: "time_series"
            routing_path:
            - "metricset"
            time_series:
              start_time: "-9999-01-01T00:00:00Z"
              end_time: "9999-12-31T23:59:59.999Z"
        mappings:
          properties:
            '@timestamp':
              type: "date_nanos"
            metricset:
              type: "keyword"
              time_series_dimension: true
    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: "test_index"
      body:
        '@timestamp': "2021-09-26T03:09:52.123456789Z"
        metricset: "pod"
    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"
---
check time_series empty time bound value:
- requires:
    cluster_features:
    - "gte_v8.2.0"
    reason: "tsdb indexing changed in 8.2.0"
- do:
    indices.create:
      index: "test_index"
      body:
        settings:
          index:
            mode: "time_series"
            routing_path:
            - "metricset"
        mappings:
          properties:
            '@timestamp':
              type: "date_nanos"
            metricset:
              type: "keyword"
              time_series_dimension: true
    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: "test_index"
      body:
        '@timestamp': "2021-09-26T03:09:52.123456789Z"
        metricset: "pod"
    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"
