You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
iStreamPlanet's APIs implement OpenAPI 3 descriptions which are publicly linked via [RFC 8631](https://tools.ietf.org/html/rfc8631)`service-desc` link relation headers and auto-discovery for [CLI configuration](https://rest.sh/#/openapi?id=autoconfiguration) via `x-cli-config` extension. This means you can use any client which understands these features to interact with our APIs.
11
-
12
-
Since the client is generated from API-provided descriptions rather than hard-coded, you will always have access to the latest API features.
11
+
iStreamPlanet's APIs implement OpenAPI 3 descriptions which are publicly linked via [RFC 8631](https://tools.ietf.org/html/rfc8631)`service-desc` link relation headers and provide auto-discovery for [CLI configuration](https://rest.sh/#/openapi?id=autoconfiguration) via the `x-cli-config` extension. This means you can use any client which understands these features to interact with our APIs.
13
12
14
13
## Installation
15
14
16
-
We recommend getting started with [Restish](https://rest.sh/), a simple cURL-like commandline client for REST-ish APIs. Getting started is easy:
15
+
We recommend getting started with [Restish](https://rest.sh/), a simple cURL-like commandline client for REST-ish APIs. Commands are generated at runtime based on our latest published OpenAPI, so you always have access to the latest API features automatically.
16
+
17
+
Getting started is easy:
17
18
18
19
<Tabs
19
-
defaultValue="mac"
20
+
defaultValue={function() {
21
+
if (ExecutionEnvironment.canUseDOM) {
22
+
// Try to guess the user's OS from their browser!
23
+
const platform =navigator.platform.toLowerCase();
24
+
if (platform.includes("linux")) {
25
+
return"linux";
26
+
} elseif (platform.includes("win")) {
27
+
return"win";
28
+
}
29
+
}
30
+
return"mac";
31
+
}()}
20
32
values={[
21
33
{ label: "macOS", value: "mac" },
22
34
{ label: "Windows", value: "win" },
@@ -25,29 +37,37 @@ We recommend getting started with [Restish](https://rest.sh/), a simple cURL-lik
25
37
>
26
38
<TabItemvalue="mac">
27
39
28
-
First, make sure you have [Homebrew](https://brew.sh/) installed. After that, installing Restish is a breeze:
40
+
First, make sure you have [Homebrew](https://brew.sh/) installed. After that, installing or upgrading Restish is a breeze:
29
41
30
42
```bash
43
+
# Install Restish
31
44
$ brew tap danielgtaylor/restish && brew install restish
45
+
46
+
# Upgrade Restish to latest release
47
+
$ brew upgrade restish
32
48
```
33
49
34
-
Prefer not to use Homebrew? Then [manually download a release](https://github.com/danielgtaylor/restish/releases).
50
+
Prefer not to use Homebrew? Then [manually download a release](https://github.com/danielgtaylor/restish/releases/latest).
35
51
36
52
</TabItem>
37
53
<TabItemvalue="win">
38
54
39
-
Head over and [manually download a release](https://github.com/danielgtaylor/restish/releases). Unzip the executable somewhere and you are good to go!
55
+
Head over and [manually download a release](https://github.com/danielgtaylor/restish/releases/latest). Unzip the executable somewhere and you are good to go!
40
56
41
57
</TabItem>
42
58
<TabItemvalue="linux">
43
59
44
-
First, make sure you have [Homebrew](https://brew.sh/)installed. After that, installing Restish is a breeze:
60
+
If you have [Homebrew](https://brew.sh/)then installing or upgrading Restish is a breeze:
45
61
46
62
```bash
63
+
# Install Restish
47
64
$ brew tap danielgtaylor/restish && brew install restish
65
+
66
+
# Upgrade Restish to latest release
67
+
$ brew upgrade restish
48
68
```
49
69
50
-
Prefer not to use Homebrew? Then [manually download a release](https://github.com/danielgtaylor/restish/releases) or use `go get` if you have the Go compiler installed:
70
+
Prefer not to use Homebrew? Then [manually download a release](https://github.com/danielgtaylor/restish/releases/latest) or use `go get` if you have the Go compiler installed:
51
71
52
72
```bash
53
73
// Download, build & install.
@@ -63,7 +83,7 @@ Once installed you need to configure Restish to talk to the iStreamPlanet API. W
63
83
64
84
```bash
65
85
# Configure Restish to talk to iStreamPlanet.
66
-
$ restish api config isp https://api.istreamplanet.com
86
+
$ restish api configure isp https://api.istreamplanet.com
67
87
68
88
? Organization ID [?for help] YOUR_VALUE_HERE
69
89
? Select option [Use arrows to move, type to filter]
@@ -73,6 +93,8 @@ $ restish api config isp https://api.istreamplanet.com
73
93
> Save and exit
74
94
```
75
95
96
+
Restish supports multiple profiles, which can be set up via the interactive configuration prompt above or by copying & editing in `~/.restish/apis.json`. Once configured, you can use `-p` to reference the profile, for example `restish isp -p PROFILE_NAME list-channels`.
97
+
76
98
## Example Usage
77
99
78
100
Commands and help are generated on the fly from the server-provided OpenAPI document. Help commands let you see what is available and how to use it.
@@ -81,8 +103,8 @@ Commands and help are generated on the fly from the server-provided OpenAPI docu
81
103
# Get a list of all available commands.
82
104
$ restish isp --help
83
105
84
-
# See help for creating a channel.
85
-
$ restish isp create-channel --help
106
+
# See help for creating/updating a channel.
107
+
$ restish isp put-channel --help
86
108
```
87
109
88
110
### Getting Information
@@ -97,23 +119,74 @@ $ restish isp list-sources
97
119
$ restish isp list-channels
98
120
```
99
121
122
+
Lists of items like sources and channels are generally paginated. By default, Restish will make as many requests as needed to get all pages of data before returning. This behavior can be disabled to get a single page, for example:
123
+
124
+
```bash
125
+
# Disable auto-pagination, and return up to 5 items from the first page.
Restish is smart about which URIs require authentication by matching them to pre-configured API base URIs, so you can also directly access links you find in responses. For example, you might see something like this returned when listing channels and want to get additional details:
Restish supports client-side [filtering & projection](https://rest.sh/#/output?id=filtering-amp-projection) of response data, making it easier to get just the information you need from the API. Filtering uses the `-f` shorthand function which accepts a JMESPath expression to run against an [object that looks like](https://rest.sh/#/output?id=response-structure):
139
+
140
+
```json
141
+
{
142
+
"proto": "HTTP/2.0",
143
+
"status": 200,
144
+
"headers": {
145
+
"Header-Name": "header value"
146
+
},
147
+
"links": {
148
+
"link-name": [
149
+
{
150
+
"rel": "link-name",
151
+
"uri": "https://link.url/..."
152
+
}
153
+
]
154
+
},
155
+
"body": {
156
+
// Body is here
157
+
}
158
+
}
159
+
```
160
+
161
+
Some examples:
162
+
163
+
```bash
164
+
# Get just the channel ID and name for all channels:
Note that enabling filtering will also enable JSON output mode.
178
+
107
179
### Writing Data
108
180
109
181
Write calls take input in one of two ways: JSON passed in via stdin or a custom [CLI shorthand syntax](https://rest.sh/#/shorthand) on the commandline.
110
182
111
183
```bash
112
184
# Pass JSON via stdin.
113
-
$ restish isp create-channel <input.json
185
+
$ echo'{"name": "My Test Channel", "ingest": {"source": {"id": "s-abc123"}}}'>input.json
$ restish isp create-channel name: My Test Channel, source: s-abc123, ...
189
+
$ restish isp put-channel my-channel-id name: My Test Channel, ingest.source.id: s-abc123, ...
117
190
```
118
191
119
192
Read the [Restish documentation](https://rest.sh/) for more in-depth CLI info and check out our [Guide](/docs/guide/) and API reference for examples that show you how to use the iStreamPlanet APIs.
0 commit comments