@@ -182,7 +182,10 @@ info:
182
182
183
183
```Shell
184
184
curl "https://api.linode.com/v4/linode/types" \
185
- -H 'X-Filter: { "class": "standard" }'
185
+ -H '
186
+ X-Filter: {
187
+ "class": "standard"
188
+ }'
186
189
```
187
190
188
191
The filter object's keys are the keys of the object you're filtering,
@@ -191,17 +194,27 @@ info:
191
194
Types that offer one vcpu:
192
195
193
196
```Shell
194
- curl "https://api.linode.com/v4/linode/types" \
195
- -H 'X-Filter: { "class": "standard", "vcpus": 1 }'
197
+ curl "https://api.linode.com/v4/linode/types" \
198
+ -H '
199
+ X-Filter: {
200
+ "class": "standard",
201
+ "vcpus": 1
202
+ }'
196
203
```
197
204
198
205
In the above example, both filters are combined with an "and" operation.
199
206
However, if you wanted either Types with one vcpu or Types in our "standard"
200
207
class, you can add an operator:
201
208
202
- ```Shell
209
+ ```Shell
203
210
curl "https://api.linode.com/v4/linode/types" \
204
- -H 'X-Filter: { "+or": [ { "vcpus": 1 }, { "class": "standard" } ] }'
211
+ -H '
212
+ X-Filter: {
213
+ "+or": [
214
+ { "vcpus": 1 },
215
+ { "class": "standard" }
216
+ ]
217
+ }'
205
218
```
206
219
207
220
Each filter in the `+or` array is its own filter object, and all conditions
@@ -229,7 +242,12 @@ info:
229
242
230
243
```Shell
231
244
curl "https://api.linode.com/v4/linode/types" \
232
- -H 'X-Filter: { "memory": { "+gte": 61440 } }'
245
+ -H '
246
+ X-Filter: {
247
+ "memory": {
248
+ "+gte": 61440
249
+ }
250
+ }'
233
251
```
234
252
235
253
You can combine and nest operators to construct arbitrarily-complex queries.
@@ -239,7 +257,35 @@ info:
239
257
240
258
```Shell
241
259
curl "https://api.linode.com/v4/linode/types" \
242
- -H 'X-Filter: { "+or": [ { "+or": [ { "class": "standard" }, { "class": "highmem" } ] }, { "+and": [ { "vcpus": { "+gte": 12 } }, { "vcpus": { "+lte": 20 } } ] } ] }'
260
+ -H '
261
+ X-Filter: {
262
+ "+or": [
263
+ {
264
+ "+or": [
265
+ {
266
+ "class": "standard"
267
+ },
268
+ {
269
+ "class": "highmem"
270
+ }
271
+ ]
272
+ },
273
+ {
274
+ "+and": [
275
+ {
276
+ "vcpus": {
277
+ "+gte": 12
278
+ }
279
+ },
280
+ {
281
+ "vcpus": {
282
+ "+lte": 20
283
+ }
284
+ }
285
+ ]
286
+ }
287
+ ]
288
+ }'
243
289
```
244
290
245
291
# CLI (Command Line Interface)
0 commit comments