---
setup:
- skip:
    features:
    - "headers"
    - "allowed_warnings_regex"
- requires:
    cluster_features:
    - "gte_v8.9.0"
    reason: "/_info/_all only available from v8.9"
---
Cluster Info _all:
- do:
    cluster.info:
      target:
      - "_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"
- is_true: "cluster_name"
- is_true: "http"
- is_true: "ingest"
- is_true: "thread_pool"
- is_true: "script"
---
Cluster Info fails when mixing _all with other targets:
- do:
    catch: "bad_request"
    cluster.info:
      target:
      - "_all"
      - "ingest"
    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:
    status: 400
- match:
    error.type: "illegal_argument_exception"
- match:
    error.reason: "request [/_info/_all,ingest] contains _all and individual target\
      \ [_all,ingest]"
---
Cluster Info fails with an invalid target:
- do:
    catch: "bad_request"
    cluster.info:
      target:
      - "ingest"
      - "invalid_target"
    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:
    status: 400
- match:
    error.type: "illegal_argument_exception"
- match:
    error.reason: "request [/_info/ingest,invalid_target] contains unrecognized target:\
      \ [invalid_target]"
