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
Copy file name to clipboardExpand all lines: openapi.yaml
+54-24Lines changed: 54 additions & 24 deletions
Original file line number
Diff line number
Diff line change
@@ -39,16 +39,17 @@ info:
39
39
<a target="_top" href="https://cloud.linode.com/profile/tokens">Linode Cloud Manager</a> or
40
40
the [Create Personal Access Token](/docs/api/profile/#personal-access-token-create) endpoint.
41
41
42
-
All scopes for the OAuth security model ([defined below](/docs/api/profile/#oauth)) apply to this
42
+
All scopes for the OAuth security model ([defined below](/docs/api/#oauth)) apply to this
43
43
security model as well.
44
44
45
-
#### Authentication
45
+
### Authentication
46
46
47
47
| Security Scheme Type: | HTTP |
48
48
|-----------------------|------|
49
49
| **HTTP Authorization Scheme** | bearer |
50
50
51
-
### OAuth
51
+
## OAuth
52
+
52
53
If you only need to access the Linode API for personal use,
53
54
we recommend that you create a [personal access token](/docs/api/#personal-access-token).
54
55
If you're designing an application that can authenticate with an arbitrary Linode user, then
@@ -65,7 +66,7 @@ info:
65
66
- A public client is used with applications where the client secret is not guaranteed to be secure. For example, a native app running on a user's computer may not be able to keep the client secret safe, as a user could potentially inspect the source of the application. So, native apps or apps that run in a user's browser should use a public client.
66
67
- Public and private clients follow different workflows, as described below.
67
68
68
-
#### OAuth Workflow
69
+
### OAuth Workflow
69
70
70
71
The OAuth workflow is a series of exchanges between your third-party app and Linode. The workflow is used
71
72
to authenticate a user before an application can start making API calls on the user's behalf.
@@ -137,30 +138,34 @@ info:
137
138
138
139
You'll get another response with an updated `access_token` and `refresh_token`, which can then be used to refresh access again.
| **Scopes** | <ul><li>`account:read_only` - Allows access to GET information about your Account.</li><li>`account:read_write` - Allows access to all endpoints related to your Account.</li><li>`databases:read_only` - Allows access to GET Managed Databases on your Account.</li><li>`databases:read_write` - Allows access to all endpoints related to your Managed Databases.</li><li>`domains:read_only` - Allows access to GET Domains on your Account.</li><li>`domains:read_write` - Allows access to all Domain endpoints.</li><li>`events:read_only` - Allows access to GET your Events.</li><li>`events:read_write` - Allows access to all endpoints related to your Events.</li><li>`firewall:read_only` - Allows access to GET information about your Firewalls.</li><li>`firewall:read_write` - Allows access to all Firewall endpoints.</li><li>`images:read_only` - Allows access to GET your Images.</li><li>`images:read_write` - Allows access to all endpoints related to your Images.</li><li>`ips:read_only` - Allows access to GET your ips.</li><li>`ips:read_write` - Allows access to all endpoints related to your ips.</li><li>`linodes:read_only` - Allows access to GET Linodes on your Account.</li><li>`linodes:read_write` - Allow access to all endpoints related to your Linodes.</li><li>`lke:read_only` - Allows access to GET LKE Clusters on your Account.</li><li>`lke:read_write` - Allows access to all endpoints related to LKE Clusters on your Account.</li><li>`longview:read_only` - Allows access to GET your Longview Clients.</li><li>`longview:read_write` - Allows access to all endpoints related to your Longview Clients.</li><li>`nodebalancers:read_only` - Allows access to GET NodeBalancers on your Account.</li><li>`nodebalancers:read_write` - Allows access to all NodeBalancer endpoints.</li><li>`object_storage:read_only` - Allows access to GET information related to your Object Storage.</li><li>`object_storage:read_write` - Allows access to all Object Storage endpoints.</li><li>`stackscripts:read_only` - Allows access to GET your StackScripts.</li><li>`stackscripts:read_write` - Allows access to all endpoints related to your StackScripts.</li><li>`volumes:read_only` - Allows access to GET your Volumes.</li><li>`volumes:read_write` - Allows access to all endpoints related to your Volumes.</li></ul><br/>|
147
148
148
149
## Requests
149
150
150
-
Requests must be made over HTTPS to ensure transactions are encrypted. The
151
-
following Request methods are supported:
151
+
Requests must be made over HTTPS to ensure transactions are encrypted. Data included in requests must be supplied in json format unless otherwise specified in the command description.
152
152
153
-
| METHOD | USAGE |
154
-
|--------|-------|
155
-
| GET | Retrieves data about collections and individual resources. |
156
-
| POST | For collections, creates a new resource of that type. Also used to perform actions on action endpoints. |
157
-
| PUT | Updates an existing resource. |
158
-
| DELETE | Deletes a resource. This is a destructive action. |
153
+
The following request methods are supported:
159
154
155
+
| METHOD | USAGE |
156
+
|---------|-------|
157
+
| GET | Retrieves data about collections and individual resources. |
158
+
| POST | For collections, creates a new resource of that type. Also used to perform actions on action endpoints. |
159
+
| PUT | Updates an existing resource. |
160
+
| DELETE | Deletes a resource. This is a destructive action. |
161
+
| HEAD | Returns only the response header information of a GET request |
162
+
| OPTIONS | Provides permitted communication options for a command |
160
163
161
164
## Responses
162
165
163
-
Actions will return one following HTTP response status codes:
166
+
### Response Status Codes
167
+
168
+
Actions will return one of the following HTTP response status codes:
164
169
165
170
| STATUS | DESCRIPTION |
166
171
|---------|-------------|
@@ -175,6 +180,38 @@ info:
175
180
| 429 Too Many Requests | You've hit a rate limit. |
176
181
| 500 Internal Server Error | Please [open a Support Ticket](/docs/api/support/#support-ticket-open). |
177
182
183
+
### Response Headers
184
+
185
+
There are many ways to access response header information for individual command URLs, depending on how you are accessing the Linode API. For example, to view HTTP response headers for the `/regions` endpoint when making requests with `curl`, use the `-I` or `--head` option as follows:
186
+
187
+
```Shell
188
+
curl -I https://api.linode.com/v4/regions
189
+
```
190
+
191
+
Responses may include the following headers:
192
+
193
+
| HEADER | DESCRIPTION | EXAMPLE |
194
+
|--------|-------------|---------|
195
+
| Access-Control-Allow-Credentials | Responses to credentialed requests are exposed to frontend JavaScript code. | true |
196
+
| Access-Control-Allow-Headers | All permissible request headers for this endpoint. | Authorization, Origin, X-Requested-With, Content-Type, Accept, X-Filter |
197
+
| Access-Control-Allow-Methods | Permissible HTTP methods for this endpoint | HEAD, GET, OPTIONS, POST, PUT, DELETE |
198
+
| Access-Control-Allow-Origin | Indicates origin access permissions. The wildcard character `*` means any origin can access the resource. | * |
199
+
| Access-Control-Expose-Headers | Available headers to include in response to cross-origin requests. | X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Status |
200
+
| Cache-Control | Controls caching in browsers and shared caches such as CDNs. | private, max-age=60, s-maxage=60 |
201
+
| Content-Security-Policy | Controls which resources are allowed to load. By default, resources do not load. | default-src 'none' |
202
+
| Content-Type | All responses are in json format. | application/json |
203
+
| Content-Warning | A message containing instructions for successful requests that were not able to be completed. | Please contact support for assistance. |
204
+
| Retry-After | The remaining time in seconds until the current [rate limit](#rate-limiting) window resets. | 60 |
205
+
| Strict-Transport-Security | Enforces HTTPS-only access until the returned time in seconds. | max-age=31536000 |
206
+
| Vary | Optional request headers that affected the response content. | Authorization, X-Filter |
207
+
| X-Accepted-OAuth-Scopes | Required [scopes](#oauth-reference) for accessing the requested command. | linodes:read_only |
208
+
| X-Customer-UUID | A unique identifier for the account owning the the [personal access token](#personal-access-token) that was used for the request. | ABCDEF01-3456-789A-BCDEF0123456789A |
209
+
| X-OAuth-Scopes | Allowed [scopes](#oauth-reference) associated with the [personal access token](#personal-access-token) that was used for the request. A value of `*` indicates read/write access for all scope categories. | images:read_write linodes:read_only |
210
+
| X-RateLimit-Limit | The maximum number of permitted requests during the [rate limit](#rate-limiting) window for this endpoint. | 800 |
211
+
| X-RateLimit-Remaining | The remaining number of permitted requests in the current [rate limit](#rate-limiting) window. | 798 |
212
+
| X-RateLimit-Reset | The time when the current [rate limit](#rate-limiting) window rests in UTC epoch seconds. | 1674747739 |
213
+
| X-Spec-Version | The current API version that handled the request. | 4.150.0 |
214
+
178
215
## Errors
179
216
180
217
Success is indicated via <a href="https://en.wikipedia.org/wiki/List_of_HTTP_status_codes" target="_top">Standard HTTP status codes</a>.
@@ -193,7 +230,6 @@ info:
193
230
new errors coming back once we are able to get further along in the process
194
231
of handling your request.
195
232
196
-
197
233
Within each error object, the `field` parameter will be included if the error
198
234
pertains to a specific field in the JSON you've submitted. This will be
199
235
omitted if there is no relevant field. The `reason` is a human-readable
@@ -363,19 +399,13 @@ info:
363
399
364
400
### Rate Limit HTTP Response Headers
365
401
366
-
The Linode API includes the following HTTP response headers which are designed to help you avoid hitting rate limits that might disrupt your applications:
402
+
The Linode API includes the following HTTP response headers which are designed to help you avoid hitting rate limits which might disrupt your applications:
367
403
368
404
* **X-RateLimit-Limit**: The maximum number of permitted requests during the rate limit window for this endpoint.
369
405
* **X-RateLimit-Remaining**: The remaining number of permitted requests in the current rate limit window.
370
406
* **X-RateLimit-Reset**: The time when the current rate limit window rests in UTC epoch seconds.
371
407
* **Retry-After**: The remaining time in seconds until the current rate limit window resets.
372
408
373
-
There are many ways to access header information for your requests, depending on how you are accessing the Linode API. For example, to view HTTP response headers when making requests with `curl`, use the `-i` or `--include` option as follows:
374
-
375
-
```Shell
376
-
curl -i https://api.linode.com/v4/regions
377
-
```
378
-
379
409
## CLI (Command Line Interface)
380
410
381
411
The <a href="https://github.com/linode/linode-cli" target="_top">Linode CLI</a> allows you to easily
0 commit comments