Skip to content

CT-1077 Reformat introduction shell snippets #144

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 15, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 53 additions & 7 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,10 @@ info:

```Shell
curl "https://api.linode.com/v4/linode/types" \
-H 'X-Filter: { "class": "standard" }'
-H '
X-Filter: {
"class": "standard"
}'
```

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

```Shell
curl "https://api.linode.com/v4/linode/types" \
-H 'X-Filter: { "class": "standard", "vcpus": 1 }'
curl "https://api.linode.com/v4/linode/types" \
-H '
X-Filter: {
"class": "standard",
"vcpus": 1
}'
```

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

```Shell
```Shell
curl "https://api.linode.com/v4/linode/types" \
-H 'X-Filter: { "+or": [ { "vcpus": 1 }, { "class": "standard" } ] }'
-H '
X-Filter: {
"+or": [
{ "vcpus": 1 },
{ "class": "standard" }
]
}'
```

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

```Shell
curl "https://api.linode.com/v4/linode/types" \
-H 'X-Filter: { "memory": { "+gte": 61440 } }'
-H '
X-Filter: {
"memory": {
"+gte": 61440
}
}'
```

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

```Shell
curl "https://api.linode.com/v4/linode/types" \
-H 'X-Filter: { "+or": [ { "+or": [ { "class": "standard" }, { "class": "highmem" } ] }, { "+and": [ { "vcpus": { "+gte": 12 } }, { "vcpus": { "+lte": 20 } } ] } ] }'
-H '
X-Filter: {
"+or": [
{
"+or": [
{
"class": "standard"
},
{
"class": "highmem"
}
]
},
{
"+and": [
{
"vcpus": {
"+gte": 12
}
},
{
"vcpus": {
"+lte": 20
}
}
]
}
]
}'
```

# CLI (Command Line Interface)
Expand Down