Skip to content

Commit cc8a35f

Browse files
authored
Merge pull request #144 from alioso/CT-1077
CT-1077 Reformat introduction shell snippets
2 parents e481b3d + 236421d commit cc8a35f

File tree

1 file changed

+53
-7
lines changed

1 file changed

+53
-7
lines changed

openapi.yaml

Lines changed: 53 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,10 @@ info:
182182

183183
```Shell
184184
curl "https://api.linode.com/v4/linode/types" \
185-
-H 'X-Filter: { "class": "standard" }'
185+
-H '
186+
X-Filter: {
187+
"class": "standard"
188+
}'
186189
```
187190

188191
The filter object's keys are the keys of the object you're filtering,
@@ -191,17 +194,27 @@ info:
191194
Types that offer one vcpu:
192195

193196
```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+
}'
196203
```
197204

198205
In the above example, both filters are combined with an "and" operation.
199206
However, if you wanted either Types with one vcpu or Types in our "standard"
200207
class, you can add an operator:
201208

202-
```Shell
209+
```Shell
203210
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+
}'
205218
```
206219

207220
Each filter in the `+or` array is its own filter object, and all conditions
@@ -229,7 +242,12 @@ info:
229242

230243
```Shell
231244
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+
}'
233251
```
234252

235253
You can combine and nest operators to construct arbitrarily-complex queries.
@@ -239,7 +257,35 @@ info:
239257

240258
```Shell
241259
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+
}'
243289
```
244290

245291
# CLI (Command Line Interface)

0 commit comments

Comments
 (0)