---
setup:
- skip:
    features:
    - "headers"
    - "allowed_warnings_regex"
- requires:
    cluster_features:
    - "gte_v7.9.0"
    reason: "resolve index introduced in 7.9"
    test_runner_features: "allowed_warnings"
- do:
    indices.create:
      index: "test_index1"
      body:
        aliases:
          test_alias: {}
          test_blias: {}
          test_clias: {}
    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.create:
      index: "test_index2"
      body:
        aliases:
          test_alias: {}
    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_index2"
    allowed_warnings:
    - "the default value for the ?wait_for_active_shards parameter will change from\
      \ '0' to 'index-setting' in version 8; specify '?wait_for_active_shards=index-setting'\
      \ to adopt the future default behaviour, or '?wait_for_active_shards=0' to preserve\
      \ today's behaviour"
    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.create:
      index: "test_index3"
      body:
        aliases:
          test_blias: {}
    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"
---
Resolve index with indices and aliases:
- requires:
    cluster_features:
    - "gte_v7.9.0"
    reason: "resolve index introduced in 7.9"
- do:
    indices.resolve_index:
      name: "*"
    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:
    indices.0.name: "test_index1"
- match:
    indices.0.aliases.0: "test_alias"
- match:
    indices.0.aliases.1: "test_blias"
- match:
    indices.0.aliases.2: "test_clias"
- match:
    indices.0.attributes.0: "open"
- match:
    indices.1.name: "test_index3"
- match:
    indices.1.aliases.0: "test_blias"
- match:
    indices.1.attributes.0: "open"
- match:
    aliases.0.name: "test_alias"
- match:
    aliases.0.indices.0: "test_index1"
- match:
    aliases.0.indices.1: "test_index2"
- match:
    aliases.1.name: "test_blias"
- match:
    aliases.1.indices.0: "test_index1"
- match:
    aliases.1.indices.1: "test_index3"
- match:
    aliases.2.name: "test_clias"
- match:
    aliases.2.indices.0: "test_index1"
- length:
    data_streams: 0
---
Resolve index with hidden and closed indices:
- requires:
    cluster_features:
    - "gte_v7.9.0"
    reason: "resolve index introduced in 7.9"
- do:
    indices.resolve_index:
      name: "*,-.security*"
      expand_wildcards:
      - "all"
    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:
    indices.0.name: "test_index1"
- match:
    indices.0.aliases.0: "test_alias"
- match:
    indices.0.aliases.1: "test_blias"
- match:
    indices.0.aliases.2: "test_clias"
- match:
    indices.0.attributes.0: "open"
- match:
    indices.1.name: "test_index2"
- match:
    indices.1.aliases.0: "test_alias"
- match:
    indices.1.attributes.0: "closed"
- match:
    indices.2.name: "test_index3"
- match:
    indices.2.aliases.0: "test_blias"
- match:
    indices.2.attributes.0: "open"
- match:
    aliases.0.name: "test_alias"
- match:
    aliases.0.indices.0: "test_index1"
- match:
    aliases.0.indices.1: "test_index2"
- match:
    aliases.1.name: "test_blias"
- match:
    aliases.1.indices.0: "test_index1"
- match:
    aliases.1.indices.1: "test_index3"
- match:
    aliases.2.name: "test_clias"
- match:
    aliases.2.indices.0: "test_index1"
- length:
    data_streams: 0
