---
setup:
- skip:
    features:
    - "headers"
    - "allowed_warnings_regex"
---
Test cat indices output for hidden index:
- requires:
    cluster_features:
    - "gte_v8.11.0"
    reason: "dataset size was added in 8.11.0"
- do:
    indices.create:
      index: "index1"
      body:
        settings:
          number_of_shards: "1"
          number_of_replicas: "0"
          index:
            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.indices:
      index: "i*"
    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"
- do:
    cat.indices:
      index: "i*"
      expand_wildcards:
      - "all"
    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: "/^(green  \\s+\n   open   \\s+\n   index1 \\s+\n   ([a-zA-Z0-9=/_+]|[\\\
      \\\\-]){22} \\s+\n   1      \\s+\n   0      \\s+\n   0      \\s+\n   0     \
      \ \\s+\n   (\\d+|\\d+[.]\\d+)(kb|b) \\s+\n   (\\d+|\\d+[.]\\d+)(kb|b) \\s+\n\
      \   (\\d+|\\d+[.]\\d+)(kb|b) \\s*\n )\n $/\n"
---
Test cat indices output for dot-hidden index and dot-prefixed pattern:
- requires:
    cluster_features:
    - "gte_v8.11.0"
    reason: "dataset size was added in 8.11.0"
    test_runner_features:
    - "headers"
- do:
    headers:
      X-elastic-product-origin: "elastic"
      Content-Type: "application/vnd.elasticsearch+json;compatible-with=8"
      Accept: "application/vnd.elasticsearch+json;compatible-with=8"
    indices.create:
      index: ".index1"
      body:
        settings:
          number_of_shards: "1"
          number_of_replicas: "0"
          index:
            hidden: true
    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.indices: {}
    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"
- do:
    cat.indices:
      index: ".i*"
    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: "/^(green  \\s+\n   open   \\s+\n   \\.index1 \\s+\n   ([a-zA-Z0-9=/_+]|[\\\
      \\\\-]){22} \\s+\n   1      \\s+\n   0      \\s+\n   0      \\s+\n   0     \
      \ \\s+\n   (\\d+|\\d+[.]\\d+)(kb|b) \\s+\n   (\\d+|\\d+[.]\\d+)(kb|b) \\s+\n\
      \   (\\d+|\\d+[.]\\d+)(kb|b) \\s*\n )\n $/\n"
---
Test cat indices output with a hidden index with a visible alias:
- requires:
    cluster_features:
    - "gte_v8.11.0"
    reason: "dataset size was added in 8.11.0"
- do:
    indices.create:
      index: "index1"
      body:
        settings:
          number_of_shards: "1"
          number_of_replicas: "0"
          index:
            hidden: true
        aliases:
          alias1: {}
    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.indices:
      index: "i*"
    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"
- do:
    cat.indices:
      index: "i*"
      expand_wildcards:
      - "open"
      - "hidden"
    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: "/^(green  \\s+\n   open   \\s+\n   index1 \\s+\n   ([a-zA-Z0-9=/_+]|[\\\
      \\\\-]){22} \\s+\n   1      \\s+\n   0      \\s+\n   0      \\s+\n   0     \
      \ \\s+\n   (\\d+|\\d+[.]\\d+)(kb|b) \\s+\n   (\\d+|\\d+[.]\\d+)(kb|b) \\s+\n\
      \   (\\d+|\\d+[.]\\d+)(kb|b) \\s*\n )\n $/\n"
- do:
    cat.indices:
      index: "alias1"
    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: "/^(green  \\s+\n   open   \\s+\n   index1 \\s+\n   ([a-zA-Z0-9=/_+]|[\\\
      \\\\-]){22} \\s+\n   1      \\s+\n   0      \\s+\n   0      \\s+\n   0     \
      \ \\s+\n   (\\d+|\\d+[.]\\d+)(kb|b) \\s+\n   (\\d+|\\d+[.]\\d+)(kb|b) \\s+\n\
      \   (\\d+|\\d+[.]\\d+)(kb|b) \\s*\n )\n $/\n"
---
Test cat indices output with a hidden index with a hidden alias:
- requires:
    cluster_features:
    - "gte_v8.11.0"
    reason: "dataset size was added in 8.11.0"
- do:
    indices.create:
      index: "index1"
      body:
        settings:
          number_of_shards: "1"
          number_of_replicas: "0"
          index:
            hidden: true
        aliases:
          alias1:
            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.indices:
      index: "i*"
    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"
- do:
    cat.indices:
      index: "i*"
      expand_wildcards:
      - "all"
    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: "/^(green  \\s+\n   open   \\s+\n   index1 \\s+\n   ([a-zA-Z0-9=/_+]|[\\\
      \\\\-]){22} \\s+\n   1      \\s+\n   0      \\s+\n   0      \\s+\n   0     \
      \ \\s+\n   (\\d+|\\d+[.]\\d+)(kb|b) \\s+\n   (\\d+|\\d+[.]\\d+)(kb|b) \\s+\n\
      \   (\\d+|\\d+[.]\\d+)(kb|b) \\s*\n )\n $/\n"
- do:
    cat.indices:
      index: "alias1"
    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: "/^(green  \\s+\n   open   \\s+\n   index1 \\s+\n   ([a-zA-Z0-9=/_+]|[\\\
      \\\\-]){22} \\s+\n   1      \\s+\n   0      \\s+\n   0      \\s+\n   0     \
      \ \\s+\n   (\\d+|\\d+[.]\\d+)(kb|b) \\s+\n   (\\d+|\\d+[.]\\d+)(kb|b) \\s+\n\
      \   (\\d+|\\d+[.]\\d+)(kb|b) \\s*\n )\n $/\n"
---
Test cat indices output with a hidden index, dot-hidden alias and dot pattern:
- requires:
    cluster_features:
    - "gte_v8.11.0"
    reason: "dataset size was added in 8.11.0"
- do:
    indices.create:
      index: "index1"
      body:
        settings:
          number_of_shards: "1"
          number_of_replicas: "0"
          index:
            hidden: true
        aliases:
          ".alias1":
            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.indices: {}
    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"
- do:
    cat.indices:
      index: ".*"
    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: "/^(.*           # Accounts for system indices that get automatically generated\n\
      \   green  \\s+\n   open   \\s+\n   index1 \\s+\n   ([a-zA-Z0-9=/_+]|[\\\\\\\
      -]){22} \\s+\n   1      \\s+\n   0      \\s+\n   0      \\s+\n   0      \\s+\n\
      \   (\\d+|\\d+[.]\\d+)(kb|b) \\s+\n   (\\d+|\\d+[.]\\d+)(kb|b) \\s+\n   (\\\
      d+|\\d+[.]\\d+)(kb|b) \\s*\n   .*           # Accounts for system indices that\
      \ get automatically generated\n )\n $/\n"
