-
Notifications
You must be signed in to change notification settings - Fork 2
/
openapi.yaml
15160 lines (14964 loc) · 497 KB
/
openapi.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.1
info:
version: 4.0.19
title: Linode API
x-logo: {
url: '/api/v4/linode-logo.svg',
backgroundColor: '#fafafa'
}
description: |
# Introduction
The Linode API provides the ability to programmatically manage the full
range of Linode products and services.
This reference is designed to assist application developers and system
administrators. Each endpoint includes descriptions, request syntax, and
examples using standard HTTP requests. Response data is returned in JSON
format.
This document was generated from our OpenAPI Specification. See the
<a target="_top" href="https://www.openapis.org">OpenAPI website</a> for more information.
<a target="_top" href="https://developers.linode.com/api/docs/v4/openapi.yaml">Download the Linode OpenAPI Specification</a>.
# Changelog
<a target="_top" href="https://developers.linode.com/changelog">View our Changelog</a> to see release
notes on all changes made to our API.
# Access and Authentication
Some endpoints are publicly accessible without requiring authentication.
All endpoints affecting your Account, however, require either a Personal
Access Token or OAuth authentication (when using third-party
applications).
## Personal Access Token
The easiest way to access the API is with a Personal Access Token (PAT)
generated from the
<a target="_top" href="https://cloud.linode.com/profile/tokens">Linode Cloud Manager</a>.
All scopes for the OAuth security model (defined below) apply to this
security model as well.
### Authentication
| Security Scheme Type: | HTTP |
|-----------------------|------|
| **HTTP Authorization Scheme** | bearer |
## OAuth
The OAuth workflow is a three-step process to authenticate a User before an
application can start making API calls on the User's behalf. If all you need
is a Personal Access Token, feel free to skip ahead to the next section.
First, the User visits the application's website and is directed to log with
Linode. The User is then redirected to Linode's authentication server and
presented the scope levels the application is requesting. Once the User
accepts the request for access, we redirect them back to the application's
specified redirect URI with an access code.
Once the User has logged in to Linode and you have received an exchange code,
you will need to exchange that access code for an Authorization token. You
do this by making an HTTP POST request to the following address:
```
https://login.linode.com/oauth/token
```
Make this request as `application/x-www-form-urlencoded` or as
`multipart/form-data` and include the following parameters in the POST body:
| PARAMETER | DESCRIPTION |
|-----------|-------------|
| client_id | Your app's client ID |
| client_secret | Your app's client secret |
| code | The code you just received from the redirect |
You'll get a reponse like this:
```json
{
"scope": "linodes:read_write",
"access_token": "03d084436a6c91fbafd5c4b20c82e5056a2e9ce1635920c30dc8d81dc7a6665c"
"token_type": "bearer",
"expires_in": 7200,
}
```
Included in the reponse is `access_token`. With this token, you can proceed to make
authenticated HTTP requests to the API by adding this header to each request:
```
Authorization: Bearer 03d084436a6c91fbafd5c4b20c82e5056a2e9ce1635920c30dc8d81dc7a6665c
```
### Authentication
| Security Scheme Type: | Oauth2 |
|-----------------------|--------|
| **AuthorizationCode Oauth Flow** | **Authorization URL:** https://login.linode.com/oauth/authorize<br />**Token URL:** https://login.linode.com/oauth/token<br />**Scopes:**<br /><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>`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>`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>`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>`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 />|
# Requests
Requests must be made over HTTPS to ensure transactions are encrypted. The
following Request methods are supported:
| METHOD | USAGE |
|--------|-------|
| GET | Retrieves data about collections and individual resources. |
| POST | For collections, creates a new resource of that type. Also used to perform actions on action endpoints. |
| PUT | Updates an existing resource. |
| DELETE | Deletes a resource. This is a destructive action. |
# Responses
Actions will return one following HTTP response status codes:
| STATUS | DESCRIPTION |
|---------|-------------|
| 200 OK | The request was successful. |
| 204 No Content | The server successfully fulfilled the request and there is no additional content to send. |
| 400 Bad Request | You submitted an invalid request (missing parameters, etc.). |
| 401 Unauthorized | You failed to authenticate for this resource. |
| 403 Forbidden | You are authenticated, but don't have permission to do this. |
| 404 Not Found | The resource you're requesting does not exist. |
| 429 Too Many Requests | You've hit a rate limit. |
| 500 Internal Server Error | Please [open a Support Ticket](#operation/createTicket). |
# Errors
Success is indicated via <a href="https://en.wikipedia.org/wiki/List_of_HTTP_status_codes" target="_top">Standard HTTP status codes</a>.
`2xx` codes indicate success, `4xx` codes indicate a request error, and
`5xx` errors indicate a server error. A
request error might be an invalid input, a required parameter being omitted,
or a malformed request. A server error means something went wrong processing
your request. If this occurs, please
[open a Support Ticket](#operation/createTicket)
and let us know. Though errors are logged and we work quickly to resolve issues,
opening a ticket and providing us with reproducable steps and data is always helpful.
The `errors` field is an array of the things that went wrong with your request.
We will try to include as many of the problems in the response as possible,
but it's conceivable that fixing these errors and resubmitting may result in
new errors coming back once we are able to get further along in the process
of handling your request.
Within each error object, the `field` parameter will be included if the error
pertains to a specific field in the JSON you've submitted. This will be
omitted if there is no relevant field. The `reason` is a human-readable
explanation of the error, and will always be included.
# Pagination
Resource lists are always paginated. The response will look similar to this:
```json
{
"data": [ ... ],
"page": 1,
"pages": 3,
"results": 300
}
```
Pages start at 1. You may retrieve a specific page of results by adding
`?page=x` to your URL (for example, `?page=4`). Page sizes default to 100,
and can be set to return between 25 and 100. Page size can be set using
`?page_size=x`.
# Filtering and Sorting
Collections are searchable by fields they include, marked in the spec as
`x-linode-filterable: true`. Filters are passed
in the `X-Filter` header and are formatted as JSON objects. Here is a request
call for Linode Types in our "standard" class:
```Shell
curl "https://api.linode.com/v4/linode/types" \
-H 'X-Filter: { \
"class": "standard"
}'
```
The filter object's keys are the keys of the object you're filtering,
and the values are accepted values. You can add multiple filters by
including more than one key. For example, filtering for "standard" Linode
Types that offer one vcpu:
```Shell
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
curl "https://api.linode.com/v4/linode/types" \
-H 'X-Filter: {
"+or": [
{ "vcpus": 1 },
{ "class": "standard" }
]
}'
```
Each filter in the `+or` array is its own filter object, and all conditions
in it are combined with an "and" operation as they were in the previous example.
Other operators are also available. Operators are keys of a Filter JSON
object. Their value must be of the appropriate type, and they are evaluated
as described below:
| OPERATOR | TYPE | DESCRIPTION |
|----------|--------|-----------------------------------|
| +and | array | All conditions must be true. |
| +or | array | One condition must be true. |
| +gt | number | Value must be greater than number. |
| +gte | number | Value must be greater than or equal to number. |
| +lt | number | Value must be less than number. |
| +lte | number | Value must be less than or equal to number. |
| +contains | string | Given string must be in the value. |
| +neq | string | Does not equal the value. |
| +order_by | string | Attribute to order the results by - must be filterable. |
| +order | string | Either "asc" or "desc". Defaults to "asc". Requires `+order_by`. |
For example, filtering for [Linode Types](#operation/getLinodeTypes)
that offer memory equal to or higher than 61440:
```Shell
curl "https://api.linode.com/v4/linode/types" \
-H 'X-Filter: {
"memory": {
"+gte": 61440
}
}'
```
You can combine and nest operators to construct arbitrarily-complex queries.
For example, give me all [Linode Types](#operation/getLinodeTypes)
which are either `standard` or `highmem` class, or
have between 12 and 20 vcpus:
```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
}
}
]
}
]
}'
```
# CLI (Command Line Interface)
The <a href="https://github.com/linode/linode-cli" target="_top">Linode CLI</a> allows you to easily
work with the API using intuitive and simple syntax. It requires a
[Personal Access Token](#section/Personal-Access-Token)
for authentication, and gives you access to all of the features and functionality
of the Linode API that are documented here with CLI examples.
Endpoints that do not have CLI examples are currently unavailable through the CLI, but
can be accessed via other methods such as Shell commands and other third-party applications.
contact:
name: Linode
url: /
servers:
- url: https://api.linode.com/v4
paths:
/account:
x-linode-cli-command: account
get:
x-linode-grant: read_only
tags:
- Account
summary: View Account
description: >
Returns the contact and billing information related to
your Account.
operationId: getAccount
x-linode-cli-action: view
security:
- personalAccessToken: []
- oauth:
- account:read_only
responses:
'200':
description: Returns a single Account object.
content:
application/json:
schema:
$ref: '#/components/schemas/Account'
default:
$ref: '#/components/responses/ErrorResponse'
x-code-samples:
- lang: Shell
source: >
curl -H "Authorization: Bearer $TOKEN" \
https://api.linode.com/v4/account
- lang: CLI
source: >
linode-cli account view
put:
x-linode-grant: read_write
tags:
- Account
summary: Update Account
description: >
Updates contact and billing information
related to your Account.
operationId: updateAccount
x-linode-cli-action: update
security:
- personalAccessToken: []
- oauth:
- account:read_write
requestBody:
description: Update contact and billing information.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Account'
responses:
'200':
description: The updated Account.
content:
application/json:
schema:
$ref: '#/components/schemas/Account'
default:
$ref: '#/components/responses/ErrorResponse'
x-code-samples:
- lang: Shell
source: >
curl -H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-X PUT -d '{
"address_1": "123 Main St.",
"address_2": "Suite 101",
"city": "Philadelphia",
"company": "My Company, LLC",
"country": "US",
"email": "jsmith@mycompany.com",
"first_name": "John",
"last_name": "Smith",
"phone": "555-555-1212",
"state": "PA",
"zip": 19102,
}
}' \
https://api.linode.com/v4/account
- lang: CLI
source: >
linode-cli account update \
--first_name John \
--last_name Smith
/account/credit-card:
x-linode-cli-command: account
post:
x-linode-grant: read_write
tags:
- Account
summary: Add/Edit Credit Card
description: >
Adds/edit credit card information to your Account.
Only one credit card can be associated with your Account, so using this
endpoint will overwrite your currently active card information with the
new credit card.
operationId: createCreditCard
x-linode-cli-action: update-card
security:
- personalAccessToken: []
- oauth:
- account:read_write
requestBody:
description: Update the credit card information associated with your Account.
required: true
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/CreditCard'
- properties:
cvv:
type: string
description: >
The Card Verification Value on the back of the card.
example: '123'
responses:
'200':
description: Credit Card updated.
content:
application/json:
schema:
type: object
default:
$ref: '#/components/responses/ErrorResponse'
x-code-samples:
- lang: Shell
source: >
curl -H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-X POST -d '{
"card_number": "4111111111111111",
"expiry_month": 11,
"expiry_year": 2020
}' \
https://api.linode.com/v4/account/credit-card
- lang: CLI
source: >
linode-cli account update-card \
--card_number 4111111111111111 \
--expiry_month 11 \
--expiry_year 2025
/account/events:
x-linode-cli-command: events
get:
x-linode-grant: read_only
parameters:
- $ref: '#/components/parameters/pageOffset'
- $ref: '#/components/parameters/pageSize'
tags:
- Account
summary: List Events
description: >
Returns a collection of Event objects representing
actions taken on your Account. The Events returned depends on your
grants.
operationId: getEvents
x-linode-cli-action: list
security:
- personalAccessToken: []
- oauth:
- events:read_only
responses:
'200':
description: Returns a paginated lists of Event objects.
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Event'
page:
$ref: '#/components/schemas/PaginationEnvelope/properties/page'
pages:
$ref: '#/components/schemas/PaginationEnvelope/properties/pages'
results:
$ref: '#/components/schemas/PaginationEnvelope/properties/results'
default:
$ref: '#/components/responses/ErrorResponse'
x-code-samples:
- lang: Shell
source: >
curl -H "Authorization: Bearer $TOKEN" \
https://api.linode.com/v4/account/events
- lang: CLI
source: >
linode-cli events list
/account/events/{eventId}:
x-linode-cli-command: events
parameters:
- name: eventId
in: path
description: The ID of the Event.
required: true
schema:
type: integer
get:
x-linode-grant: read_only
tags:
- Account
summary: View Event
description: Returns a single Event object.
operationId: getEvent
x-linode-cli-action: view
security:
- personalAccessToken: []
- oauth:
- events:read_only
responses:
'200':
description: An Event object
content:
application/json:
schema:
$ref: '#/components/schemas/Event'
default:
$ref: '#/components/responses/ErrorResponse'
x-code-samples:
- lang: Shell
source: >
curl -H "Authorization: Bearer $TOKEN" \
https://api.linode.com/v4/account/events/123
- lang: CLI
source: >
linode-cli events view 123
/account/events/{eventId}/read:
x-linode-cli-command: events
parameters:
- name: eventId
in: path
description: The ID of the Event to designate as read.
required: true
schema:
type: integer
post:
x-linode-grant: read_write
tags:
- Account
summary: Mark Event as Read
description: Marks a single Event as read.
operationId: eventRead
x-linode-cli-action: mark-read
security:
- personalAccessToken: []
- oauth:
- events:read_write
responses:
'200':
description: Event read.
content:
application/json:
schema:
type: object
default:
$ref: '#/components/responses/ErrorResponse'
x-code-samples:
- lang: Shell
source: >
curl -H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-X POST \
https://api.linode.com/v4/account/events/123/read
- lang: CLI
source: >
linode-cli events mark-read 123
/account/events/{eventId}/seen:
x-linode-cli-command: events
parameters:
- name: eventId
in: path
description: The ID of the Event to designate as seen.
required: true
schema:
type: integer
post:
x-linode-grant: read_write
tags:
- Account
summary: Mark Event as Seen
description: >
Marks all Events up to and including this Event by ID as seen.
operationId: eventSeen
x-linode-cli-action: mark-seen
security:
- personalAccessToken: []
- oauth:
- events:read_only
responses:
'200':
description: Events seen.
content:
application/json:
schema:
type: object
default:
$ref: '#/components/responses/ErrorResponse'
x-code-samples:
- lang: Shell
source: >
curl -H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-X POST \
https://api.linode.com/v4/account/events/123/seen
- lang: CLI
source: >
linode-cli events mark-seen 123
/account/invoices:
x-linode-cli-command: account
get:
x-linode-grant: read_only
parameters:
- $ref: '#/components/parameters/pageOffset'
- $ref: '#/components/parameters/pageSize'
tags:
- Account
summary: List Invoices
description: >
Returns a paginated list of Invoices against your Account.
operationId: getInvoices
x-linode-cli-action: invoices-list
security:
- personalAccessToken: []
- oauth:
- account:read_only
responses:
'200':
description: Returns a paginated list of Invoice objects.
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Invoice'
page:
$ref: '#/components/schemas/PaginationEnvelope/properties/page'
pages:
$ref: '#/components/schemas/PaginationEnvelope/properties/pages'
results:
$ref: '#/components/schemas/PaginationEnvelope/properties/results'
default:
$ref: '#/components/responses/ErrorResponse'
x-code-samples:
- lang: Shell
source: >
curl -H "Authorization: Bearer $TOKEN" \
https://api.linode.com/v4/account/invoices
- lang: CLI
source: >
linode-cli account invoices-list
/account/invoices/{invoiceId}:
x-linode-cli-command: account
parameters:
- name: invoiceId
in: path
description: The ID of the Invoice.
required: true
schema:
type: integer
get:
x-linode-grant: read_only
tags:
- Account
summary: View Invoice
description: Returns a single Invoice object.
operationId: getInvoice
x-linode-cli-action: invoice-view
security:
- personalAccessToken: []
- oauth:
- account:read_only
responses:
'200':
description: An Invoice object
content:
application/json:
schema:
$ref: '#/components/schemas/Invoice'
default:
$ref: '#/components/responses/ErrorResponse'
x-code-samples:
- lang: Shell
source: >
curl -H "Authorization: Bearer $TOKEN" \
https://api.linode.com/v4/account/invoices/123
- lang: CLI
source: >
linode-cli account invoice-view 123
/account/invoices/{invoiceId}/items:
x-linode-cli-command: account
parameters:
- name: invoiceId
in: path
description: The ID of the Invoice.
required: true
schema:
type: integer
get:
x-linode-grant: read_only
parameters:
- $ref: '#/components/parameters/pageOffset'
- $ref: '#/components/parameters/pageSize'
tags:
- Account
summary: List Invoice Items
description: Returns a paginated list of Invoice items.
operationId: getInvoiceItems
x-linode-cli-action: invoice-items
security:
- personalAccessToken: []
- oauth:
- account:read_only
responses:
'200':
description: A paginated list of InvoiceItem objects
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/InvoiceItem'
page:
$ref: '#/components/schemas/PaginationEnvelope/properties/page'
pages:
$ref: '#/components/schemas/PaginationEnvelope/properties/pages'
results:
$ref: '#/components/schemas/PaginationEnvelope/properties/results'
default:
$ref: '#/components/responses/ErrorResponse'
x-code-samples:
- lang: Shell
source: >
curl -H "Authorization: Bearer $TOKEN" \
https://api.linode.com/v4/account/invoices/123/items
- lang: CLI
source: >
linode-cli account invoice-items 123
/account/notifications:
x-linode-cli-command: account
get:
x-linode-grant: read_only
tags:
- Account
summary: List Notifications
description: >
Returns a collection of Notification objects representing
important, often time-sensitive items related to your Account.
You cannot interact directly with Notifications, and a Notification will disappear
when the circumstances causing it have been resolved. For
example, if you have an important Ticket open, you must respond to the
Ticket to dismiss the Notification.
operationId: getNotifications
x-linode-cli-action: notifications-list
security:
- personalAccessToken: []
- oauth:
- account:read_only
responses:
'200':
description: Returns a paginated list of Notification objects.
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Notification'
page:
$ref: '#/components/schemas/PaginationEnvelope/properties/page'
pages:
$ref: '#/components/schemas/PaginationEnvelope/properties/pages'
results:
$ref: '#/components/schemas/PaginationEnvelope/properties/results'
default:
$ref: '#/components/responses/ErrorResponse'
parameters:
- $ref: '#/components/parameters/pageOffset'
- $ref: '#/components/parameters/pageSize'
x-code-samples:
- lang: Shell
source: >
curl -H "Authorization: Bearer $TOKEN" \
https://api.linode.com/v4/account/notifications
- lang: CLI
source: >
linode-cli account notifications-list
/account/oauth-clients:
x-linode-cli-command: account
get:
x-linode-grant: read_only
parameters:
- $ref: '#/components/parameters/pageOffset'
- $ref: '#/components/parameters/pageSize'
tags:
- Account
summary: List OAuth Clients
description: >
Returns a paginated list of OAuth Clients registered to your Account. OAuth
Clients allow users to log into applications you write or host using their
Linode Account, and may allow them to grant some level of access to their
Linodes or other entities to your application.
operationId: getClients
x-linode-cli-action: clients-list
security:
- personalAccessToken: []
- oauth:
- account:read_only
responses:
'200':
description: A paginated list of OAuth Clients.
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/OAuthClient'
page:
$ref: '#/components/schemas/PaginationEnvelope/properties/page'
pages:
$ref: '#/components/schemas/PaginationEnvelope/properties/pages'
results:
$ref: '#/components/schemas/PaginationEnvelope/properties/results'
default:
$ref: '#/components/responses/ErrorResponse'
x-code-samples:
- lang: Shell
source: >
curl -H "Authorization: Bearer $TOKEN" \
https://api.linode.com/v4/account/oauth-clients
- lang: CLI
source: >
linode-cli account clients-list
post:
tags:
- Account
summary: Create OAuth Client
description: >
Creates an OAuth Client, which can be used to allow users
(using their Linode account) to log in to your own application, and optionally grant
your application some amount of access to their Linodes or other entities.
operationId: createClient
x-linode-cli-action: client-create
security:
- personalAccessToken: []
- oauth:
- account:read_write
requestBody:
description: Information about the OAuth Client to create.
content:
application/json:
schema:
required:
- label
- redirect_uri
allOf:
- $ref: '#/components/schemas/OAuthClient'
- type: object
properties:
public:
type: boolean
description: Whether to create a public or private client.
example: false
responses:
'200':
description: Client created successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/OAuthClient'
default:
$ref: '#/components/responses/ErrorResponse'
x-code-samples:
- lang: Shell
source: >
curl -H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-X POST -d '{
"redirect_uri": "https://example.org/oauth/callback",
"label": "Test_Client_1",
"public": false
}' \
https://api.linode.com/v4/account/oauth-clients
- lang: CLI
source: >
linode-cli account client-create \
--label Test_Client_1 \
--redirect_uri https://example.org/callback
/account/oauth-clients/{clientId}:
parameters:
- name: clientId
in: path
description: The OAuth Client ID to look up.
required: true
schema:
type: string
x-linode-cli-command: account
get:
tags:
- Account
summary: View OAuth Client
description: >
Returns information about a single OAuth client.
operationId: getClient
x-linode-cli-action: client-view
security:
- personalAccessToken: []
- oauth:
- account:read_only
responses:
'200':
description: Information about the requested client.
content:
application/json:
schema:
$ref: '#/components/schemas/OAuthClient'
default:
$ref: '#/components/responses/ErrorResponse'
x-code-samples:
- lang: Shell
source: >
curl -H "Authorization: Bearer $TOKEN" \
https://api.linode.com/v4/account/oauth-clients/edc6790ea9db4d224c5c
- lang: CLI
source: >
linode-cli account client-view \
edc6790ea9db4d224c5c
put:
tags:
- Account
summary: Update OAuth Client
description: >
Update information about an OAuth Client on your Account. This can be
especially useful to update the `redirect_uri` of your client in the event
that the callback url changed in your application.
operationId: updateClient
x-linode-cli-action: client-update
security:
- personalAccessToken: []
- oauth:
- account:read_write
requestBody:
description: The fields to update.
content:
application/json:
schema:
$ref: '#/components/schemas/OAuthClient'
responses:
'200':
description: Client updated successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/OAuthClient'
default:
$ref: '#/components/responses/ErrorResponse'
x-code-samples:
- lang: Shell
source: >
curl -H "Content-Type: application/json" \
-H "Authorization: Bearer $TOKEN" \
-X PUT -d '{
"redirect_uri": "https://example.org/oauth/callback",
"label": "Test_Client_1"
}
}' \
https://api.linode.com/v4/account/oauth-clients/edc6790ea9db4d224c5c
- lang: CLI
source: >
linode-cli account client-update \
edc6790ea9db4d224c5c \
--label Test_Client_1
delete:
tags:
- Account
summary: Delete OAuth Client
description: >
Deletes an OAuth Client registered with Linode. The Client ID and
Client secret will no longer be accepted by <a target="_top" href="https://login.linode.com">https://login.linode.com</a>,
and all tokens issued to this client will be invalidated (meaning that
if your application was using a token, it will no longer work).