---
setup:
- skip:
    features:
    - "headers"
    - "allowed_warnings_regex"
---
Test cat aliases output with a hidden index with a hidden alias:
- requires:
    cluster_features:
    - "gte_v7.7.0"
    reason: "hidden indices and aliases were added in 7.7.0"
- do:
    indices.create:
      index: "test"
      body:
        settings:
          number_of_shards: "1"
          number_of_replicas: "0"
          index:
            hidden: true
        aliases:
          test_alias:
            is_hidden: 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:
    cat.aliases: {}
    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:
    $body: "/^\n    test_alias          \\s+\n    test                \\s+\n    -\
      \                   \\s+\n    -                   \\s+\n    -              \
      \     \\s+\n    -                   \\s+\n$/\n"
- do:
    cat.aliases:
      name: "test_alias"
    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:
    $body: "/^\n    test_alias          \\s+\n    test                \\s+\n    -\
      \                   \\s+\n    -                   \\s+\n    -              \
      \     \\s+\n    -                   \\s+\n$/\n"
- do:
    cat.aliases:
      expand_wildcards:
      - "open"
      - "closed"
    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:
    $body: "/^\n$/\n"
---
Test cat aliases output with a hidden index with a visible alias:
- requires:
    cluster_features:
    - "gte_v7.7.0"
    reason: "hidden indices and aliases were added in 7.7.0"
- do:
    indices.create:
      index: "test"
      body:
        settings:
          number_of_shards: "1"
          number_of_replicas: "0"
          index:
            hidden: true
        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:
    cat.aliases:
      name: "test*"
    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:
    $body: "/^\n    test_alias          \\s+\n    test                \\s+\n    -\
      \                   \\s+\n    -                   \\s+\n    -              \
      \     \\s+\n    -                   \\s+\n$/\n"
- do:
    cat.aliases:
      name: "test_alias"
    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:
    $body: "/^\n    test_alias          \\s+\n    test                \\s+\n    -\
      \                   \\s+\n    -                   \\s+\n    -              \
      \     \\s+\n    -                   \\s+\n$/\n"
---
Test cat aliases output with a visible index with a hidden alias:
- requires:
    cluster_features:
    - "gte_v7.7.0"
    reason: "hidden indices and aliases were added in 7.7.0"
- do:
    indices.create:
      index: "test"
      body:
        settings:
          number_of_shards: "1"
          number_of_replicas: "0"
        aliases:
          test_alias:
            is_hidden: 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:
    cat.aliases: {}
    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:
    $body: "/^\n    test_alias          \\s+\n    test                \\s+\n    -\
      \                   \\s+\n    -                   \\s+\n    -              \
      \     \\s+\n    -                   \\s+\n$/\n"
- do:
    cat.aliases:
      name: "test_alias"
    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:
    $body: "/^\n    test_alias          \\s+\n    test                \\s+\n    -\
      \                   \\s+\n    -                   \\s+\n    -              \
      \     \\s+\n    -                   \\s+\n$/\n"
