|
| 1 | +--- |
| 2 | +setup: |
| 3 | + |
| 4 | + - do: |
| 5 | + indices.create: |
| 6 | + index: test_index |
| 7 | + body: |
| 8 | + aliases: |
| 9 | + test_alias: {} |
| 10 | + test_blias: {} |
| 11 | + mappings: |
| 12 | + type_1: {} |
| 13 | + warmers: |
| 14 | + test_warmer: |
| 15 | + source: |
| 16 | + query: |
| 17 | + match_all: {} |
| 18 | + settings: |
| 19 | + number_of_shards: 1 |
| 20 | + number_of_replicas: 1 |
| 21 | + |
| 22 | + - do: |
| 23 | + indices.create: |
| 24 | + index: test_index_2 |
| 25 | + body: |
| 26 | + settings: |
| 27 | + number_of_shards: 1 |
| 28 | + number_of_replicas: 2 |
| 29 | + aliases: |
| 30 | + test_alias: {} |
| 31 | + test_blias: {} |
| 32 | + |
| 33 | + - do: |
| 34 | + indices.create: |
| 35 | + index: test_index_3 |
| 36 | + body: |
| 37 | + aliases: |
| 38 | + test_alias: {} |
| 39 | + test_blias: {} |
| 40 | + |
| 41 | + - do: |
| 42 | + cluster.health: |
| 43 | + wait_for_status: yellow |
| 44 | + |
| 45 | + - do: |
| 46 | + indices.close: |
| 47 | + index: test_index_3 |
| 48 | + |
| 49 | + - do: |
| 50 | + cluster.health: |
| 51 | + wait_for_status: yellow |
| 52 | + |
| 53 | +--- |
| 54 | +"Get index infos": |
| 55 | + |
| 56 | + - do: |
| 57 | + indices.get: |
| 58 | + index: test_index |
| 59 | + |
| 60 | + - is_true: test_index.aliases |
| 61 | + - is_true: test_index.settings |
| 62 | + - is_true: test_index.warmers |
| 63 | + - is_true: test_index.mappings |
| 64 | + |
| 65 | +--- |
| 66 | +"Get index infos for mappings only": |
| 67 | + |
| 68 | + - do: |
| 69 | + indices.get: |
| 70 | + index: test_index |
| 71 | + feature: _mapping |
| 72 | + |
| 73 | + - is_true: test_index.mappings |
| 74 | + - is_false: test_index.aliases |
| 75 | + - is_false: test_index.settings |
| 76 | + - is_false: test_index.warmers |
| 77 | + |
| 78 | +--- |
| 79 | +"Get index infos for mappings and warmers only": |
| 80 | + |
| 81 | + - do: |
| 82 | + indices.get: |
| 83 | + index: test_index |
| 84 | + feature: _mapping,_warmer |
| 85 | + |
| 86 | + - is_true: test_index.mappings |
| 87 | + - is_true: test_index.warmers |
| 88 | + - is_false: test_index.aliases |
| 89 | + - is_false: test_index.settings |
| 90 | + |
| 91 | +--- |
| 92 | +"Get index infos should work on aliases": |
| 93 | + |
| 94 | + - do: |
| 95 | + indices.get: |
| 96 | + index: test_blias |
| 97 | + feature: _mapping,_warmer |
| 98 | + |
| 99 | + - is_true: test_index.mappings |
| 100 | + - is_true: test_index.warmers |
| 101 | + - is_false: test_index.aliases |
| 102 | + - is_false: test_index.settings |
| 103 | + |
| 104 | +--- |
| 105 | +"Get index infos should work for wildcards": |
| 106 | + |
| 107 | + - do: |
| 108 | + indices.get: |
| 109 | + index: test_* |
| 110 | + feature: _mapping,_settings |
| 111 | + |
| 112 | + - is_true: test_index.mappings |
| 113 | + - is_true: test_index.settings |
| 114 | + - is_true: test_index_2.settings |
| 115 | + - is_false: test_index.aliases |
| 116 | + - is_false: test_index.warmers |
| 117 | + |
| 118 | +--- |
| 119 | +"Missing index should throw an Error": |
| 120 | + |
| 121 | + - do: |
| 122 | + catch: missing |
| 123 | + indices.get: |
| 124 | + index: test_not_found |
| 125 | + |
| 126 | +--- |
| 127 | +"Missing index should return empty object if ignore_unavailable": |
| 128 | + |
| 129 | + - do: |
| 130 | + indices.get: |
| 131 | + index: test_not_found |
| 132 | + ignore_unavailable: true |
| 133 | + |
| 134 | + - match: { $body: "{}" } |
| 135 | + |
| 136 | +--- |
| 137 | +"Should return empty object if allow_no_indices": |
| 138 | + |
| 139 | + - do: |
| 140 | + indices.get: |
| 141 | + index: test_not* |
| 142 | + |
| 143 | + - match: { $body: "{}" } |
| 144 | + |
| 145 | +--- |
| 146 | +"Should throw error if allow_no_indices=false": |
| 147 | + |
| 148 | + - do: |
| 149 | + catch: missing |
| 150 | + indices.get: |
| 151 | + index: test_not* |
| 152 | + allow_no_indices: false |
| 153 | + |
| 154 | +--- |
| 155 | +"Should return test_index_2 if expand_wildcards=open": |
| 156 | + |
| 157 | + - do: |
| 158 | + indices.get: |
| 159 | + index: test_index_* |
| 160 | + expand_wildcards: open |
| 161 | + |
| 162 | + - is_true: test_index_2.settings |
| 163 | + - is_false: test_index_3.settings |
| 164 | + |
| 165 | +--- |
| 166 | +"Should return test_index_3 if expand_wildcards=closed": |
| 167 | + |
| 168 | + - skip: |
| 169 | + version: "0 - 2.0.0" |
| 170 | + reason: Requires fix for issue 7258 |
| 171 | + |
| 172 | + - do: |
| 173 | + indices.get: |
| 174 | + index: test_index_* |
| 175 | + feature: _settings |
| 176 | + expand_wildcards: closed |
| 177 | + |
| 178 | + - is_false: test_index_2.settings |
| 179 | + - is_true: test_index_3.settings |
| 180 | + |
| 181 | +--- |
| 182 | +"Should return test_index_2 and test_index_3 if expand_wildcards=open,closed": |
| 183 | + |
| 184 | + - do: |
| 185 | + indices.get: |
| 186 | + index: test_index_* |
| 187 | + feature: _settings |
| 188 | + expand_wildcards: open,closed |
| 189 | + |
| 190 | + - is_true: test_index_2.settings |
| 191 | + - is_true: test_index_3.settings |
| 192 | + |
0 commit comments