-
Notifications
You must be signed in to change notification settings - Fork 10
/
legacy.yml
889 lines (880 loc) · 30.8 KB
/
legacy.yml
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
openapi: 3.0.0
info:
title: Influx Legacy API
version: 2.0.1
license:
name: MIT
url: 'https://opensource.org/licenses/MIT'
servers:
- url: ''
paths:
/query:
get:
operationId: GetLegacyQuery
tags:
- Legacy Query
summary: Query with the 1.x compatibility API
description: Queries InfluxDB using InfluxQL.
parameters:
- $ref: '#/components/parameters/TraceSpan'
- in: header
name: Accept
schema:
type: string
description: |
Media type that the client can understand.
**Note**: With `application/csv`, query results include [**unix timestamps**]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#unix-timestamp) instead of [RFC3339 timestamps]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#rfc3339-timestamp).
default: application/json
enum:
- application/json
- application/csv
- text/csv
- application/x-msgpack
- in: header
name: Accept-Encoding
description: The content encoding (usually a compression algorithm) that the client can understand.
schema:
type: string
description: 'The content coding. Use `gzip` for compressed data or `identity` for unmodified, uncompressed data.'
default: identity
enum:
- gzip
- identity
- in: header
name: Content-Type
schema:
type: string
enum:
- application/json
- in: query
name: u
description: The InfluxDB 1.x username to authenticate the request.
schema:
type: string
- in: query
name: p
description: The InfluxDB 1.x password to authenticate the request.
schema:
type: string
- in: query
name: db
required: true
description: |
The database to query data from.
This is mapped to an InfluxDB [bucket]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#bucket).
For more information, see [Database and retention policy mapping]({{% INFLUXDB_DOCS_URL %}}/api/influxdb-1x/dbrp/).
schema:
type: string
- in: query
name: rp
description: |
The retention policy to query data from.
This is mapped to an InfluxDB [bucket]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#bucket).
For more information, see [Database and retention policy mapping]({{% INFLUXDB_DOCS_URL %}}/api/influxdb-1x/dbrp/).
schema:
type: string
- in: query
name: q
required: true
description: 'The InfluxQL query to execute. To execute multiple queries, delimit queries with a semicolon (`;`).'
schema:
type: string
- in: query
name: epoch
description: |
A unix timestamp precision.
Formats timestamps as [unix (epoch) timestamps]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#unix-timestamp) the specified precision
instead of [RFC3339 timestamps]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#rfc3339-timestamp) with nanosecond precision.
schema:
type: string
enum:
- ns
- u
- µ
- ms
- s
- m
- h
responses:
'200':
description: Query results
headers:
Content-Encoding:
description: Lists encodings (usually compression algorithms) that have been applied to the response payload.
schema:
type: string
description: |
The content coding:
- `gzip`: compressed data
- `identity`: unmodified, uncompressed data.
default: identity
enum:
- gzip
- identity
Transfer-Encoding:
description: |
`chunked` if the response is chunked.
schema:
type: string
description: The transfer encoding.
default: chunked
enum:
- chunked
Trace-Id:
description: 'The trace ID, if generated, of the request.'
schema:
type: string
description: Trace ID of a request.
content:
text/csv:
schema:
$ref: '#/components/schemas/InfluxqlCsvResponse'
application/csv:
schema:
$ref: '#/components/schemas/InfluxqlCsvResponse'
application/json:
schema:
$ref: '#/components/schemas/InfluxqlJsonResponse'
examples:
influxql-chunk_size_2:
value: |
{"results":[{"statement_id":0,"series":[{"name":"mymeas","columns":["time","myfield","mytag"],"values":[["2016-05-19T18:37:55Z",90,"1"],["2016-05-19T18:37:56Z",90,"1"]],"partial":true}],"partial":true}]}
{"results":[{"statement_id":0,"series":[{"name":"mymeas","columns":["time","myfield","mytag"],"values":[["2016-05-19T18:37:57Z",90,"1"],["2016-05-19T18:37:58Z",90,"1"]]}]}]}
application/x-msgpack:
schema:
type: string
format: binary
'429':
description: |
#### InfluxDB Cloud:
- returns this error if a **read** or **write** request exceeds your
plan's [adjustable service quotas]({{% INFLUXDB_DOCS_URL %}}/account-management/limits/#adjustable-service-quotas)
or if a **delete** request exceeds the maximum
[global limit]({{% INFLUXDB_DOCS_URL %}}/account-management/limits/#global-limits)
- returns `Retry-After` header that describes when to try the write again.
#### InfluxDB OSS:
- doesn't return this error.
headers:
Retry-After:
description: A non-negative decimal integer indicating the seconds to delay after the response is received.
schema:
type: integer
format: int32
default:
description: Error processing query
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/write:
post:
operationId: PostLegacyWrite
tags:
- Legacy Write
summary: Write time series data into InfluxDB in a V1-compatible format
requestBody:
description: Line protocol body
required: true
content:
text/plain:
schema:
type: string
parameters:
- $ref: '#/components/parameters/TraceSpan'
- in: query
name: u
description: The InfluxDB 1.x username to authenticate the request.
schema:
type: string
- in: query
name: p
description: The InfluxDB 1.x password to authenticate the request.
schema:
type: string
- in: query
name: db
schema:
type: string
required: true
description: 'Bucket to write to. If none exists, InfluxDB creates a bucket with a default 3-day retention policy.'
- in: query
name: rp
schema:
type: string
description: Retention policy name.
- in: query
name: precision
schema:
type: string
description: Write precision.
- in: header
name: Content-Encoding
description: 'When present, its value indicates to the database that compression is applied to the line protocol body.'
schema:
type: string
description: Specifies that the line protocol in the body is encoded with gzip or not encoded with identity.
default: identity
enum:
- gzip
- identity
responses:
'204':
description: Write data is correctly formatted and accepted for writing to the bucket.
'400':
description: Line protocol poorly formed and no points were written. Response can be used to determine the first malformed line in the body line-protocol. All data in body was rejected and not written.
content:
application/json:
schema:
$ref: '#/components/schemas/LineProtocolError'
'401':
description: Token doesn't have sufficient permissions to write to this organization and bucket or the organization and bucket do not exist.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'403':
description: No token was sent and they are required.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'413':
description: Write has been rejected because the payload is too large. Error message returns max size supported. All data in body was rejected and not written.
content:
application/json:
schema:
$ref: '#/components/schemas/LineProtocolLengthError'
'429':
description: Token is temporarily over quota. The Retry-After header describes when to try the write again.
headers:
Retry-After:
description: A non-negative decimal integer indicating the seconds to delay after the response is received.
schema:
type: integer
format: int32
'503':
description: Server is temporarily unavailable to accept writes. The Retry-After header describes when to try the write again.
headers:
Retry-After:
description: A non-negative decimal integer indicating the seconds to delay after the response is received.
schema:
type: integer
format: int32
default:
description: Internal server error
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/legacy/authorizations:
servers:
- url: /private
get:
operationId: GetLegacyAuthorizations
tags:
- Legacy Authorizations
summary: List all legacy authorizations
parameters:
- $ref: '#/components/parameters/TraceSpan'
- in: query
name: userID
schema:
type: string
description: |
A user ID.
Only returns legacy authorizations scoped to the specified [user]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#user).
- in: query
name: user
schema:
type: string
description: |
A user name.
Only returns legacy authorizations scoped to the specified [user]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#user).
- in: query
name: orgID
schema:
type: string
description: |
An organization ID.
Only returns legacy authorizations that belong to the specified [organization]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#organization).
- in: query
name: org
schema:
type: string
description: |
An organization name.
Only returns legacy authorizations that belong to the specified [organization]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#organization).
- in: query
name: token
schema:
type: string
description: |
An authorization name token.
Only returns legacy authorizations with the specified name.
- in: query
name: authID
schema:
type: string
description: |
An authorization ID.
Returns the specified legacy authorization.
responses:
'200':
description: Success. The response body contains a list of legacy `authorizations`.
content:
application/json:
schema:
type: object
properties:
links:
readOnly: true
$ref: '#/components/schemas/Links'
authorizations:
type: array
items:
$ref: '#/components/schemas/Authorization'
default:
description: Unexpected error
$ref: '#/components/responses/ServerError'
post:
operationId: PostLegacyAuthorizations
tags:
- Legacy Authorizations
summary: Create a legacy authorization
description: |
Creates a legacy authorization and returns the legacy authorization.
#### Required permissions
- `write-users USER_ID` if you pass the `userID` property in the request body.
*`USER_ID`* is the ID of the user that you want to scope the authorization to.
parameters:
- $ref: '#/components/parameters/TraceSpan'
requestBody:
description: The legacy authorization to create.
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/LegacyAuthorizationPostRequest'
responses:
'201':
description: |
Created. The legacy authorization is created.
The response body contains the newly created legacy authorization.
content:
application/json:
schema:
$ref: '#/components/schemas/Authorization'
'400':
description: Invalid request
$ref: '#/components/responses/ServerError'
'401':
description: |
Unauthorized.
The API token passed doesn't have the permissions necessary for the
request.
content:
application/json:
schema:
properties:
code:
description: |
The HTTP status code description. Default is `unauthorized`.
readOnly: true
type: string
enum:
- unauthorized
message:
readOnly: true
description: A human-readable message that may contain detail about the error.
type: string
examples:
unauthorizedWriteUsers:
summary: 'The token doesn''t have the write:user permission'
value:
code: unauthorized
message: 'write:users/08028e90933bf000 is unauthorized'
default:
description: Unexpected error
$ref: '#/components/responses/ServerError'
'/legacy/authorizations/{authID}':
servers:
- url: /private
get:
operationId: GetLegacyAuthorizationsID
tags:
- Legacy Authorizations
summary: Retrieve a legacy authorization
parameters:
- $ref: '#/components/parameters/TraceSpan'
- in: path
name: authID
schema:
type: string
required: true
description: The ID of the legacy authorization to get.
responses:
'200':
description: Legacy authorization details
content:
application/json:
schema:
$ref: '#/components/schemas/Authorization'
default:
description: Unexpected error
$ref: '#/components/responses/ServerError'
patch:
operationId: PatchLegacyAuthorizationsID
tags:
- Legacy Authorizations
summary: Update a legacy authorization to be active or inactive
requestBody:
description: Legacy authorization to update
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AuthorizationUpdateRequest'
parameters:
- $ref: '#/components/parameters/TraceSpan'
- in: path
name: authID
schema:
type: string
required: true
description: The ID of the legacy authorization to update.
responses:
'200':
description: The active or inactive legacy authorization
content:
application/json:
schema:
$ref: '#/components/schemas/Authorization'
default:
description: Unexpected error
$ref: '#/components/responses/ServerError'
delete:
operationId: DeleteLegacyAuthorizationsID
tags:
- Legacy Authorizations
summary: Delete a legacy authorization
parameters:
- $ref: '#/components/parameters/TraceSpan'
- in: path
name: authID
schema:
type: string
required: true
description: The ID of the legacy authorization to delete.
responses:
'204':
description: Legacy authorization deleted
default:
description: Unexpected error
$ref: '#/components/responses/ServerError'
'/legacy/authorizations/{authID}/password':
servers:
- url: /private
post:
operationId: PostLegacyAuthorizationsIDPassword
tags:
- Legacy Authorizations
summary: Set a legacy authorization password
parameters:
- $ref: '#/components/parameters/TraceSpan'
- in: path
name: authID
schema:
type: string
required: true
description: The ID of the legacy authorization to update.
requestBody:
description: New password
required: true
content:
application/json:
schema:
properties:
password:
type: string
required:
- password
responses:
'204':
description: Legacy authorization password set
default:
description: Unexpected error
$ref: '#/components/responses/ServerError'
components:
parameters:
TraceSpan:
in: header
name: Zap-Trace-Span
description: OpenTracing span context
example:
trace_id: '1'
span_id: '1'
baggage:
key: value
required: false
schema:
type: string
schemas:
LegacyAuthorizationPostRequest:
required:
- orgID
- permissions
allOf:
- $ref: '#/components/schemas/AuthorizationUpdateRequest'
- type: object
properties:
orgID:
type: string
description: The organization ID. Identifies the organization that the authorization is scoped to.
userID:
type: string
description: The user ID. Identifies the user that the authorization is scoped to.
token:
type: string
description: The name that you provide for the authorization.
permissions:
type: array
minItems: 1
description: |
The list of permissions that provide `read` and `write` access to organization resources.
An authorization must contain at least one permission.
items:
$ref: '#/components/schemas/Permission'
InfluxqlJsonResponse:
description: |
The JSON response for an InfluxQL query.
A response contains the collection of results for a query.
`results` is an array of resultset objects.
If the response is chunked, the `transfer-encoding` response header is set to `chunked` and each resultset object is sent in a separate JSON object.
type: object
properties:
results:
type: array
oneOf:
- required:
- statement_id
- error
- required:
- statement_id
- series
items:
type: object
description: |
A resultset object that contains the `statement_id` and the `series` array.
Except for `statement_id`, all properties are optional and omitted if empty. If a property is not present, it is assumed to be `null`.
properties:
statement_id:
type: integer
description: |
An integer that represents the statement's position in the query. If statement results are buffered in memory, `statement_id` is used to combine statement results.
error:
type: string
series:
type: array
description: |
An array of series objects--the results of the query. A series of rows shares the same group key returned from the execution of a statement.
If a property is not present, it is assumed to be `null`.
items:
type: object
properties:
name:
type: string
description: The name of the series
tags:
type: object
description: |
A map of tag key-value pairs. If a tag key is not present, it is assumed to be `null`.
additionalProperties:
type: string
partial:
type: boolean
description: |
True if the series is not complete--the response data is chunked; otherwise, false or omitted.
columns:
type: array
description: An array of column names
items:
type: string
values:
type: array
description: |
An array of rows, where each row is an array of values.
items:
type: array
items: {}
partial:
type: boolean
description: |
True if the resultset is not complete--the response data is chunked; otherwise, false or omitted.
InfluxqlCsvResponse:
description: CSV Response to InfluxQL Query
type: string
example: |
name,tags,time,test_field,test_tag test_measurement,,1603740794286107366,1,tag_value test_measurement,,1603740870053205649,2,tag_value test_measurement,,1603741221085428881,3,tag_value
Authorization:
required:
- orgID
- permissions
allOf:
- $ref: '#/components/schemas/AuthorizationUpdateRequest'
- type: object
properties:
createdAt:
type: string
format: date-time
readOnly: true
updatedAt:
type: string
format: date-time
readOnly: true
orgID:
type: string
description: |
The organization ID.
Specifies the [organization]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#organization) that the authorization is scoped to.
permissions:
type: array
minItems: 1
description: |
The list of permissions.
An authorization must have at least one permission.
items:
$ref: '#/components/schemas/Permission'
id:
readOnly: true
type: string
description: The authorization ID.
token:
readOnly: true
type: string
description: |
The API token.
The token value is unique to the authorization.
[API tokens]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#token) are
used to authenticate and authorize InfluxDB API requests and `influx`
CLI commands--after receiving the request, InfluxDB checks that the
token is valid and that the `permissions` allow the requested action(s).
userID:
readOnly: true
type: string
description: 'The user ID. Specifies the [user]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#user) that owns the authorization. If _scoped_, the user that the authorization is scoped to; otherwise, the creator of the authorization.'
user:
readOnly: true
type: string
description: |
The user name.
Specifies the [user]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#user) that owns the authorization.
If the authorization is _scoped_ to a user, the user;
otherwise, the creator of the authorization.
org:
readOnly: true
type: string
description: |
The organization name.
Specifies the [organization]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#organization)
that the token is scoped to.
links:
type: object
readOnly: true
example:
self: /api/v2/authorizations/1
user: /api/v2/users/12
properties:
self:
readOnly: true
$ref: '#/components/schemas/Link'
user:
readOnly: true
$ref: '#/components/schemas/Link'
AuthorizationUpdateRequest:
properties:
status:
description: 'Status of the token. If `inactive`, InfluxDB rejects requests that use the token.'
default: active
type: string
enum:
- active
- inactive
description:
type: string
description: A description of the token.
Permission:
required:
- action
- resource
properties:
action:
type: string
enum:
- read
- write
resource:
type: object
required:
- type
properties:
type:
type: string
enum:
- authorizations
- buckets
- dashboards
- orgs
- tasks
- telegrafs
- users
- variables
- secrets
- labels
- views
- documents
- notificationRules
- notificationEndpoints
- checks
- dbrp
- annotations
- sources
- scrapers
- notebooks
- remotes
- replications
- instance
- flows
- functions
- subscriptions
description: |
A resource type.
Identifies the API resource's type (or _kind_).
id:
type: string
description: |
A resource ID.
Identifies a specific resource.
name:
type: string
description: |
The name of the resource.
_Note: not all resource types have a `name` property_.
orgID:
type: string
description: |
An organization ID.
Identifies the organization that owns the resource.
org:
type: string
description: |
An organization name.
The organization that owns the resource.
Links:
type: object
description: |
URI pointers for additional paged results.
properties:
next:
$ref: '#/components/schemas/Link'
self:
$ref: '#/components/schemas/Link'
prev:
$ref: '#/components/schemas/Link'
required:
- self
Link:
type: string
format: uri
readOnly: true
description: URI of resource.
LineProtocolError:
properties:
code:
description: Code is the machine-readable error code.
readOnly: true
type: string
enum:
- internal error
- not found
- conflict
- invalid
- empty value
- unavailable
message:
readOnly: true
description: Human-readable message.
type: string
op:
readOnly: true
description: Describes the logical code operation when the error occurred. Useful for debugging.
type: string
err:
readOnly: true
description: Stack of errors that occurred during processing of the request. Useful for debugging.
type: string
line:
readOnly: true
description: First line in the request body that contains malformed data.
type: integer
format: int32
required:
- code
LineProtocolLengthError:
properties:
code:
description: Code is the machine-readable error code.
readOnly: true
type: string
enum:
- invalid
message:
readOnly: true
description: Human-readable message.
type: string
required:
- code
- message
Error:
properties:
code:
$ref: '#/components/schemas/ErrorCode'
message:
readOnly: true
description: Human-readable message.
type: string
op:
readOnly: true
description: Describes the logical code operation when the error occurred. Useful for debugging.
type: string
err:
readOnly: true
description: Stack of errors that occurred during processing of the request. Useful for debugging.
type: string
required:
- code
ErrorCode:
description: code is the machine-readable error code.
readOnly: true
type: string
enum:
- internal error
- not implemented
- not found
- conflict
- invalid
- unprocessable entity
- empty value
- unavailable
- forbidden
- too many requests
- unauthorized
- method not allowed
- request too large
- unsupported media type
responses:
ServerError:
description: Non 2XX error response from server.
content:
application/json:
schema:
$ref: '#/components/schemas/Error'