---
setup:
- skip:
    features:
    - "headers"
    - "allowed_warnings_regex"
---
Repository throttling stats (no repository exists):
- requires:
    cluster_features:
    - "gte_v8.9.0"
    reason: "repository throttling stats was added in 8.9.0"
    test_runner_features:
    - "arbitrary_key"
- do:
    nodes.info: {}
    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:
    nodes._arbitrary_key_: "node_id"
- do:
    nodes.stats:
      metric:
      - "repositories"
    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: "nodes.$node_id.repositories"
- match:
    nodes.$node_id.repositories: {}
---
Repository throttling stats (some repositories exist):
- requires:
    cluster_features:
    - "gte_v8.9.0"
    reason: "repository throttling stats was added in 8.9.0"
    test_runner_features:
    - "arbitrary_key"
- do:
    nodes.info: {}
    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:
    nodes._arbitrary_key_: "node_id"
- do:
    snapshot.create_repository:
      repository: "test_repo_uuid_1"
      body:
        type: "fs"
        settings:
          location: "test_repo_uuid_1_loc"
    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:
    snapshot.create_repository:
      repository: "test_repo_uuid_2"
      body:
        type: "fs"
        settings:
          location: "test_repo_uuid_2_loc"
    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:
    nodes.stats:
      metric:
      - "repositories"
    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: "nodes.$node_id.repositories"
- is_true: "nodes.$node_id.repositories.test_repo_uuid_1"
- gte:
    nodes.$node_id.repositories.test_repo_uuid_1.total_read_throttled_time_nanos: 0
- gte:
    nodes.$node_id.repositories.test_repo_uuid_1.total_write_throttled_time_nanos: 0
- is_true: "nodes.$node_id.repositories.test_repo_uuid_2"
- gte:
    nodes.$node_id.repositories.test_repo_uuid_2.total_read_throttled_time_nanos: 0
- gte:
    nodes.$node_id.repositories.test_repo_uuid_2.total_write_throttled_time_nanos: 0
