-
Notifications
You must be signed in to change notification settings - Fork 10
/
cloud.json
22281 lines (22281 loc) · 758 KB
/
cloud.json
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.0",
"info": {
"title": "InfluxDB Cloud API Service",
"version": "2.0.1",
"description": "The InfluxDB v2 API provides a programmatic interface for all interactions with InfluxDB. Access the InfluxDB API using the `/api/v2/` endpoint.\n",
"license": {
"name": "MIT",
"url": "https://opensource.org/licenses/MIT"
}
},
"servers": [
{
"url": "/api/v2"
}
],
"tags": [
{
"name": "Authorizations (API tokens)",
"description": "Create and manage authorizations (API tokens).\n\nAn _authorization_ contains a list of `read` and `write`\npermissions for organization resources and provides an API token for authentication.\nAn authorization belongs to an organization and only contains permissions for that organization.\n\nWe recommend the following for managing your tokens:\n\n- Create a generic user to create and manage tokens for writing data.\n- Store your tokens in a secure password vault for future access.\n\n### User sessions with authorizations\n\nOptionally, when creating an authorization, you can scope it to a specific user.\nIf the user signs in with username and password, creating a _user session_,\nthe session carries the permissions granted by all the user's authorizations.\nFor more information, see [how to assign a token to a specific user]({{% INFLUXDB_DOCS_URL %}}/security/tokens/create-token/).\nTo create a user session, use the [`POST /api/v2/signin` endpoint](#operation/PostSignin).\n\n### Related endpoints\n\n- [Signin](#tag/Signin)\n- [Signout](#tag/Signout)\n\n### Related guides\n\n- [Authorize API requests]({{% INFLUXDB_DOCS_URL %}}/api-guide/api_intro/#authentication)\n- [Manage API tokens]({{% INFLUXDB_DOCS_URL %}}/security/tokens/)\n- [Assign a token to a specific user]({{% INFLUXDB_DOCS_URL %}}/security/tokens/create-token/)\n"
},
{
"name": "Buckets",
"description": "Store your data in InfluxDB [buckets]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#bucket).\nA bucket is a named location where time series data is stored. All buckets\nhave a [retention period]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#retention-period),\na duration of time that each data point persists. InfluxDB drops all\npoints with timestamps older than the bucket’s retention period.\nA bucket belongs to an organization.\n\n### Related guides\n\n- [Manage buckets]({{% INFLUXDB_DOCS_URL %}}/organizations/buckets/)\n"
},
{
"name": "DBRPs",
"description": "The InfluxDB 1.x data model includes [databases](https://docs.influxdata.com/influxdb/v1.8/concepts/glossary/#database)\nand [retention policies](https://docs.influxdata.com/influxdb/v1.8/concepts/glossary/#retention-policy-rp).\nInfluxDB 2.x replaces databases and retention policies with buckets.\nTo support InfluxDB 1.x query and write patterns in InfluxDB 2.x,\ndatabases and retention policies are mapped to buckets using the\ndatabase and retention policy (DBRP) mapping service.\nThe DBRP mapping service uses the database and retention policy\nspecified in 1.x compatibility API requests to route operations to a bucket.\n\n### Related guides\n\n- [Database and retention policy mapping]({{% INFLUXDB_DOCS_URL %}}/reference/api/influxdb-1x/dbrp/)\n"
},
{
"name": "Invokable Scripts",
"description": "Store, manage, and execute scripts in InfluxDB.\nA script stores your custom Flux script and provides an invokable\nendpoint that accepts runtime parameters.\nIn a script, you can specify custom runtime parameters\n(`params`)--for example, `params.myparameter`.\nOnce you create a script, InfluxDB generates an\n[`/api/v2/scripts/SCRIPT_ID/invoke` endpoint](#operation/PostScriptsIDInvoke)\nfor your organization.\nYou can run the script from API requests and tasks, defining parameter\nvalues for each run.\nWhen the script runs, InfluxDB replaces `params` references in the\nscript with the runtime parameter values you define.\n\nUse the `/api/v2/scripts` endpoints to create and manage scripts.\nSee related guides to learn how to define parameters and execute scripts.\n\n### Related guides\n\n- [Invoke custom scripts]({{% INFLUXDB_DOCS_URL %}}/api-guide/api-invokable-scripts/) from API requests.\n- [Create a task that references a script]({{% INFLUXDB_DOCS_URL %}}/process-data/manage-tasks/create-task/#create-a-task-that-references-a-script)\n"
},
{
"name": "Delete",
"description": "Delete data from an InfluxDB bucket.\n"
},
{
"name": "Organizations",
"description": "Manage your [organization]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#organization).\nAn organization is a workspace for a group of users. Organizations can be\nused to separate different environments, projects, teams or users within\nInfluxDB.\n\nUse the `/api/v2/orgs` endpoints to view and manage organizations.\n"
},
{
"name": "Query",
"description": "Retrieve data, analyze queries, and get query suggestions.\n"
},
{
"name": "Tasks",
"description": "Process and analyze your data with [tasks]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#task)\nin the InfluxDB task engine.\nUse the `/api/v2/tasks` endpoints to schedule and manage tasks, retry task runs, and retrieve run logs.\n\nTo configure a task, provide the script and the schedule to run the task.\nFor examples, see how to create a task with the [`POST /api/v2/tasks` endpoint](#operation/PostTasks).\n\n<span id=\"tasks-schemaref-task\" />\n\n### Properties\n\nA `task` object contains information about an InfluxDB task resource.\n\nThe following table defines the properties that appear in this object:\n\n<SchemaDefinition schemaRef=\"#/components/schemas/Task\" />\n\n### Related guides\n\n- [Get started with tasks]({{% INFLUXDB_DOCS_URL %}}/process-data/get-started/)\n- [Common data processing tasks]({{% INFLUXDB_DOCS_URL %}}/process-data/common-tasks/)\n- [Create a script](https://docs.influxdata.com/influxdb/cloud/api-guide/api-invokable-scripts/#create-an-invokable-script)\n"
},
{
"name": "Templates",
"description": "Export and apply InfluxDB **templates**.\nManage **stacks** of templated InfluxDB resources.\n\nInfluxDB templates are prepackaged configurations for resources.\nUse InfluxDB templates to configure a fresh instance of InfluxDB,\nback up your dashboard configuration, or share your configuration.\n\nUse the `/api/v2/templates` endpoints to export templates and apply templates.\n\n**InfluxDB stacks** are stateful InfluxDB templates that let you\nadd, update, and remove installed template resources over time, avoid duplicating\nresources when applying the same or similar templates more than once, and\napply changes to distributed instances of InfluxDB OSS or InfluxDB Cloud.\n\nUse the `/api/v2/stacks` endpoints to manage installed template resources.\n\n### Related guides\n\n- [InfluxDB stacks]({{% INFLUXDB_DOCS_URL %}}/influxdb-templates/stacks/)\n- [InfluxDB templates]({{% INFLUXDB_DOCS_URL %}}/influxdb-templates/)\n"
},
{
"name": "Users",
"description": "Retrieve specific users.\n\nInfluxDB Cloud lets you invite and collaborate with multiple users in your organization.\nTo invite and remove users from your organization, use the InfluxDB Cloud user interface (UI);\nyou can't use the InfluxDB API to manage users in InfluxDB Cloud.\nOnce a user is added to your organization, you can use the\n`GET /api/v2/users` and `GET /api/v2/users/USER_ID` API endpoints to\nview specific members.\n\n### User sessions with authorizations\n\nOptionally, you can scope an authorization (and its API token) to a user.\nIf a user signs in with username and password, creating a _user session_,\nthe session carries the permissions granted by all the user's authorizations.\nTo create a user session, use the [`POST /api/v2/signin` endpoint](#operation/PostSignin).\n\n### Related guides\n\n- [Manage users]({{% INFLUXDB_DOCS_URL %}}/organizations/users/)\n"
},
{
"name": "Write",
"description": "Write time series data to [buckets]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#bucket).\n"
},
{
"name": "Authentication",
"description": "Use one of the following schemes to authenticate to the InfluxDB API:\n\n- [Token authentication](#section/Authentication/TokenAuthentication)\n- [Basic authentication](#section/Authentication/BasicAuthentication)\n- [Querystring authentication](#section/Authentication/QuerystringAuthentication)\n<!-- ReDoc-Inject: <security-definitions> -->\n",
"x-traitTag": true
},
{
"name": "Quick start",
"x-traitTag": true,
"description": "See the [**API Quick Start**]({{% INFLUXDB_DOCS_URL %}}/api-guide/api_intro/)\nto get up and running authenticating with tokens, writing to buckets, and querying data.\n\n[**InfluxDB API client libraries**]({{% INFLUXDB_DOCS_URL %}}/api-guide/client-libraries/)\nare available for popular languages and ready to import into your application.\n"
},
{
"name": "Supported operations",
"x-traitTag": true,
"description": "The following table shows the most common operations that the InfluxDB `/api/v2` API supports.\nSome resources may support other operations that perform functions more specific to those resources.\nFor example, you can use the `PATCH /api/v2/scripts` endpoint to update properties of a script\nresource.\n\n| Operation | |\n|:----------|:-----------------------------------------------------------------------|\n| Write | Writes (`POST`) data to a bucket. |\n| Run | Executes (`POST`) a query or script and returns the result. |\n| List |\tRetrieves (`GET`) a list of zero or more resources. |\n| Create |\tCreates (`POST`) a new resource and returns the resource. |\n| Update |\tModifies (`PUT`) an existing resource to reflect data in your request. |\n| Delete |\tRemoves (`DELETE`) a specific resource. |\n"
},
{
"name": "Headers",
"x-traitTag": true,
"description": "InfluxDB `/api/v2` API endpoints use standard HTTP request and response headers.\nThe following table shows common headers used by many InfluxDB API endpoints.\nSome endpoints may use other headers that perform functions more specific to those endpoints--for example,\nthe `POST /api/v2/write` endpoint accepts the `Content-Encoding` header to indicate the compression applied to line protocol in the request body.\n\n| Header | Value type | Description |\n|:------------------------ |:--------------------- |:-------------------------------------------|\n| `Accept` | string | The content type that the client can understand. |\n| `Authorization` | string | The authorization scheme and credential. |\n| `Content-Length` | integer | The size of the entity-body, in bytes, sent to the database. |\n| `Content-Type` | string | The format of the data in the request body. |\n"
},
{
"name": "Common parameters",
"x-traitTag": true,
"description": "To specify resources, some InfluxDB API endpoints require parameters or\nproperties in the request--for example,\nwriting to a `bucket` resource in an `org` (_organization_ resource).\n\n### Common parameters\n\n| Query parameter | Value type | Description |\n|:------------------------ |:--------------------- |:-------------------------------------------|\n| `bucket` | string | The bucket name or ID ([find your bucket]({{% INFLUXDB_DOCS_URL %}}/organizations/buckets/view-buckets/). |\n| `bucketID` | string | The bucket ID ([find your bucket]({{% INFLUXDB_DOCS_URL %}}/organizations/buckets/view-buckets/). |\n| `org` | string | The organization name or ID ([find your organization]({{% INFLUXDB_DOCS_URL %}}/organizations/view-orgs/). |\n| `orgID` | 16-byte string | The organization ID ([find your organization]({{% INFLUXDB_DOCS_URL %}}/organizations/view-orgs/). |\n"
},
{
"name": "Pagination",
"x-traitTag": true,
"description": "Some InfluxDB API [list operations](#tag/SupportedOperations) may support the following query parameters for paginating results:\n\n | Query parameter | Value type | Description |\n |:------------------------ |:--------------------- |:-------------------------------------------|\n | `limit` | integer | The maximum number of records to return (after other parameters are applied). |\n | `offset` | integer | The number of records to skip (before `limit`, after other parameters are applied). |\n | `after` | string (resource ID) | Only returns resources created after the specified resource. |\n\n ### Limitations\n\n - For specific endpoint parameters and examples, see the endpoint definition.\n - If you specify an `offset` parameter value greater than the total number of records,\n then InfluxDB returns an empty list in the response\n (given `offset` skips the specified number of records).\n\n The following example passes `offset=50` to skip the first 50 results,\n but the user only has 10 buckets:\n\n ```sh\n curl --request GET \"INFLUX_URL/api/v2/buckets?limit=1&offset=50\" \\\n --header \"Authorization: Token INFLUX_API_TOKEN\"\n ```\n\n The response contains the following:\n\n ```json\n {\n \"links\": {\n \"prev\": \"/api/v2/buckets?descending=false\\u0026limit=1\\u0026offset=49\\u0026orgID=ORG_ID\",\n \"self\": \"/api/v2/buckets?descending=false\\u0026limit=1\\u0026offset=50\\u0026orgID=ORG_ID\"\n },\n \"buckets\": []\n }\n ```\n"
},
{
"name": "Response codes",
"x-traitTag": true,
"description": "InfluxDB `/api/v2` API endpoints use standard HTTP status codes for success and failure responses.\nThe response body may include additional details.\nFor details about a specific operation's response,\nsee **Responses** and **Response Samples** for that operation.\n\nAPI operations may return the following HTTP status codes:\n\n| Code | Status | Description |\n|:-----------:|:------------------------ |:--------------------- |\n| `200` | Success | |\n| `204` | No content | For a `POST` request, `204` indicates that InfluxDB accepted the request and request data is valid. Asynchronous operations, such as `write`, might not have completed yet. |\n| `400` | Bad request | InfluxDB can't parse the request due to an incorrect parameter or bad syntax. For _writes_, the error may indicate one of the following problems: <ul><li>Line protocol is malformed. The response body contains the first malformed line in the data and indicates what was expected. For partial writes, the number of points written and the number of points rejected are also included. For more information, check the `rejected_points` measurement in your [_monitoring bucket](/influxdb/cloud/reference/internals/system-buckets/#_monitoring-system-bucket).</li><li>`Authorization` header is missing or malformed or the API token doesn't have permission for the operation.</li></ul> |\n| `401` | Unauthorized | May indicate one of the following: <ul><li>`Authorization: Token` header is missing or malformed</li><li>API token value is missing from the header</li><li>API token doesn't have permission. For more information about token types and permissions, see [Manage API tokens](https://docs.influxdata.com/influxdb/cloud/security/tokens/)</li></ul> |\n| `404` | Not found | Requested resource was not found. `message` in the response body provides details about the requested resource. |\n| `405` | Method not allowed | The API path doesn't support the HTTP method used in the request--for example, you send a `POST` request to an endpoint that only allows `GET`. |\n| `413` | Request entity too large | Request payload exceeds the size limit. |\n| `422` | Unprocessable entity | Request data is invalid. `code` and `message` in the response body provide details about the problem. |\n| `429` | Too many requests | API token is temporarily over the request quota. The `Retry-After` header describes when to try the request again. |\n| `500` | Internal server error | |\n| `503` | Service unavailable | Server is temporarily unavailable to process the request. The `Retry-After` header describes when to try the request again. |\n"
}
],
"x-tagGroups": [
{
"name": "Overview",
"tags": [
"Quick start",
"Authentication",
"Supported operations",
"Headers",
"Pagination",
"Response codes"
]
},
{
"name": "Popular endpoints",
"tags": [
"Data I/O endpoints",
"Security and access endpoints",
"System information endpoints"
]
},
{
"name": "All endpoints",
"tags": []
}
],
"paths": {
"/signin": {
"post": {
"operationId": "PostSignin",
"summary": "Create a user session.",
"description": "Authenticates [Basic authentication credentials](#section/Authentication/BasicAuthentication)\nfor a [user]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#user),\nand then, if successful, generates a user session.\n\nTo authenticate a user, pass the HTTP `Authorization` header with the\n`Basic` scheme and the base64-encoded username and password.\nFor syntax and more information, see [Basic Authentication](#section/Authentication/BasicAuthentication) for\nsyntax and more information.\n\nIf authentication is successful, InfluxDB creates a new session for the user\nand then returns the session cookie in the `Set-Cookie` response header.\n\nInfluxDB stores user sessions in memory only.\nThey expire within ten minutes and during restarts of the InfluxDB instance.\n\n#### User sessions with authorizations\n\n- In InfluxDB Cloud, a user session inherits all the user's permissions for\n the organization.\n- In InfluxDB OSS, a user session inherits all the user's permissions for all\n the organizations that the user belongs to.\n\n#### Related endpoints\n\n- [Signout](#tag/Signout)\n",
"tags": [
"Security and access endpoints",
"Signin"
],
"security": [
{
"BasicAuthentication": []
}
],
"parameters": [
{
"$ref": "#/components/parameters/TraceSpan"
}
],
"responses": {
"204": {
"description": "Success.\nThe user is authenticated.\nThe `Set-Cookie` response header contains the session cookie.\n"
},
"401": {
"description": "Unauthorized.\nThis error may be caused by one of the following problems:\n\n- The user doesn't have access.\n- The user passed incorrect credentials in the request.\n- The credentials are formatted incorrectly in the request.\n",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"403": {
"description": "Forbidden. The user account is disabled.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"default": {
"description": "Unsuccessful authentication.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"x-codeSamples": [
{
"lang": "Shell",
"label": "cURL: signin with --user option encoding",
"source": "curl --request POST http://localhost:8086/api/v2/signin \\\n --user \"USERNAME:PASSWORD\"\n"
}
]
}
},
"/signout": {
"post": {
"operationId": "PostSignout",
"summary": "Expire a user session",
"tags": [
"Security and access endpoints",
"Signout"
],
"description": "Expires a user session specified by a session cookie.\n\nUse this endpoint to expire a user session that was generated when the user\nauthenticated with the InfluxDB Developer Console (UI) or the `POST /api/v2/signin` endpoint.\n\nFor example, the `POST /api/v2/signout` endpoint represents the third step\nin the following three-step process\nto authenticate a user, retrieve the `user` resource, and then expire the session:\n\n1. Send a request with the user's [Basic authentication credentials](#section/Authentication/BasicAuthentication)\n to the `POST /api/v2/signin` endpoint to create a user session and\n generate a session cookie.\n2. Send a request to the `GET /api/v2/me` endpoint, passing the stored session cookie\n from step 1 to retrieve user information.\n3. Send a request to the `POST /api/v2/signout` endpoint, passing the stored session\n cookie to expire the session.\n\n_See the complete example in request samples._\n\nInfluxDB stores user sessions in memory only.\nIf a user doesn't sign out, then the user session automatically expires within ten minutes or\nduring a restart of the InfluxDB instance.\n\nTo learn more about cookies in HTTP requests, see\n[Mozilla Developer Network (MDN) Web Docs, HTTP cookies](https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies).\n\n#### Related endpoints\n\n- [Signin](#tag/Signin)\n",
"parameters": [
{
"$ref": "#/components/parameters/TraceSpan"
}
],
"responses": {
"204": {
"description": "Success. The session is expired."
},
"401": {
"description": "Unauthorized.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
},
"default": {
"description": "The session expiry is unsuccessful.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"x-codeSamples": [
{
"lang": "Shell",
"label": "cURL: sign in a user, verify the user session, and then end the session",
"source": "# The following example shows how to use cURL and the InfluxDB API\n# to do the following:\n# 1. Sign in a user with a username and password.\n# 2. Check that the user session exists for the user.\n# 3. Sign out the user to expire the session.\n# 4. Check that the session is no longer active.\n\n# 1. Send a request to `POST /api/v2/signin` to sign in the user.\n# In your request, pass the following:\n#\n# - `--user` option with basic authentication credentials.\n# - `-c` option with a file path where cURL will write cookies.\n\n curl --request POST \\\n -c ./cookie-file.tmp \\\n \"$INFLUX_URL/api/v2/signin\" \\\n --user \"${INFLUX_USER_NAME}:${INFLUX_USER_PASSWORD}\"\n\n# 2. To check that a user session exists for the user in step 1,\n# send a request to `GET /api/v2/me`.\n# In your request, pass the `-b` option with the session cookie file path from step 1.\n\n curl --request GET \\\n -b ./cookie-file.tmp \\\n \"$INFLUX_URL/api/v2/me\"\n\n# InfluxDB responds with the `user` resource.\n\n# 3. Send a request to `POST /api/v2/signout` to expire the user session.\n# In your request, pass the `-b` option with the session cookie file path from step 1.\n\n curl --request POST \\\n -b ./cookie-file.tmp \\\n \"$INFLUX_URL/api/v2/signout\"\n\n# If the user session is successfully expired, InfluxDB responds with\n an HTTP `204` status code.\n\n# 4. To check that the user session is expired, call `GET /api/v2/me` again,\n# passing the `-b` option with the cookie file path.\n\n curl --request GET \\\n -b ./cookie-file.tmp \\\n \"$INFLUX_URL/api/v2/me\"\n\n# If the user session is expired, InfluxDB responds with an HTTP `401` status code.\n"
}
]
}
},
"/ping": {
"get": {
"operationId": "GetPing",
"summary": "Get the status of the instance",
"description": "Retrieves the status and InfluxDB version of the instance.\n\nUse this endpoint to monitor uptime for the InfluxDB instance. The response\nreturns a HTTP `204` status code to inform you the instance is available.\n\n#### InfluxDB Cloud\n\n- Isn't versioned and doesn't return `X-Influxdb-Version` in the headers.\n\n#### Related guides\n\n- [Influx ping]({{% INFLUXDB_DOCS_URL %}}/reference/cli/influx/ping/)\n",
"servers": [
{
"url": ""
}
],
"tags": [
"Ping",
"System information endpoints"
],
"responses": {
"204": {
"description": "Success.\nHeaders contain InfluxDB version information.\n",
"headers": {
"X-Influxdb-Build": {
"schema": {
"type": "string"
},
"description": "The type of InfluxDB build.\n"
},
"X-Influxdb-Version": {
"schema": {
"type": "integer"
},
"description": "The version of InfluxDB.\n\n#### InfluxDB Cloud\n - Doesn't return version.\n"
}
}
}
},
"x-codeSamples": [
{
"lang": "Shell",
"label": "cURL",
"source": "curl --request GET \"http://localhost:8086/ping\"\n"
}
]
},
"head": {
"operationId": "HeadPing",
"summary": "Get the status of the instance",
"description": "Returns the status and InfluxDB version of the instance.\n\nUse this endpoint to monitor uptime for the InfluxDB instance. The response\nreturns a HTTP `204` status code to inform you the instance is available.\n\n#### InfluxDB Cloud\n\n- Isn't versioned and doesn't return `X-Influxdb-Version` in the headers.\n\n#### Related guides\n\n- [Influx ping]({{% INFLUXDB_DOCS_URL %}}/reference/cli/influx/ping/)\n",
"servers": [
{
"url": ""
}
],
"tags": [
"Ping"
],
"responses": {
"204": {
"description": "Success.\nHeaders contain InfluxDB version information.\n",
"headers": {
"X-Influxdb-Build": {
"schema": {
"type": "string"
},
"description": "The type of InfluxDB build."
},
"X-Influxdb-Version": {
"schema": {
"type": "integer"
},
"description": "The version of InfluxDB.\n\n#### InfluxDB Cloud\n- Doesn't return version.\n"
}
}
}
},
"x-codeSamples": [
{
"lang": "Shell",
"label": "cURL",
"source": "curl --request HEAD \"http://localhost:8086/ping\"\n"
}
]
}
},
"/": {
"get": {
"operationId": "GetRoutes",
"summary": "List all top level routes",
"description": "Retrieves all the top level routes for the InfluxDB API.\n\n#### Limitations\n\n- Only returns top level routes--for example, the response contains\n`\"tasks\":\"/api/v2/tasks\"`, and doesn't contain resource-specific routes\nfor tasks (`/api/v2/tasks/TASK_ID/...`).\n",
"tags": [
"Routes",
"System information endpoints"
],
"parameters": [
{
"$ref": "#/components/parameters/TraceSpan"
}
],
"responses": {
"200": {
"description": "Success.\nThe response body contains key-value pairs with the resource name and\ntop-level route.\n",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Routes"
}
}
}
}
}
}
},
"/dbrps": {
"get": {
"operationId": "GetDBRPs",
"tags": [
"DBRPs"
],
"summary": "List database retention policy mappings",
"description": "Lists database retention policy (DBRP) mappings.\n\n#### Related guide\n\n- [Database and retention policy mapping]({{% INFLUXDB_DOCS_URL %}}/reference/api/influxdb-1x/dbrp/)\n",
"parameters": [
{
"$ref": "#/components/parameters/TraceSpan"
},
{
"in": "query",
"name": "orgID",
"description": "An organization ID.\nOnly returns DBRP mappings for the specified organization.\n",
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "org",
"description": "An organization name.\nOnly returns DBRP mappings for the specified organization.\n",
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "id",
"description": "A DBPR mapping ID.\nOnly returns the specified DBRP mapping.\n",
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "bucketID",
"description": "A bucket ID.\nOnly returns DBRP mappings that belong to the specified bucket.\n",
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "default",
"description": "Specifies filtering on default",
"schema": {
"type": "boolean"
}
},
{
"in": "query",
"name": "db",
"description": "A database.\nOnly returns DBRP mappings that belong to the 1.x database.\n",
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "rp",
"description": "A [retention policy](https://docs.influxdata.com/influxdb/v1.8/concepts/glossary/#retention-policy-rp).\nSpecifies the 1.x retention policy to filter on.\n",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "Success. The response body contains a list of database retention policy mappings.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DBRPs"
},
"examples": {
"successResponse": {
"value": {
"content": [
{
"id": "0a3cbb5dd526a000",
"database": "example_database_1",
"retention_policy": "autogen",
"default": true,
"orgID": "bea7ea952287f70d",
"bucketID": "4d4d9d5b61dee751"
},
{
"id": "0a3cbcde20e38000",
"database": "example_database_2",
"retention_policy": "example_retention_policy",
"default": false,
"orgID": "bea7ea952287f70d",
"bucketID": "4d4d9d5b61dee751"
}
]
}
}
}
}
}
},
"400": {
"description": "Bad request. The request has one or more invalid parameters.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"invalidRequest": {
"description": "The query parameters contain invalid values.\n",
"value": {
"code": "invalid",
"message": "invalid ID"
}
}
}
}
}
},
"401": {
"$ref": "#/components/responses/AuthorizationError"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
},
"default": {
"description": "Unexpected error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
},
"post": {
"operationId": "PostDBRP",
"tags": [
"DBRPs"
],
"summary": "Add a database retention policy mapping",
"description": "Creates a database retention policy (DBRP) mapping and returns the mapping.\n\nUse this endpoint to add InfluxDB 1.x API compatibility to your\nInfluxDB Cloud or InfluxDB OSS 2.x buckets. Your buckets must contain a\nDBRP mapping in order to query and write using the InfluxDB 1.x API.\nobject.\n\n#### Related guide\n\n- [Database and retention policy mapping]({{% INFLUXDB_DOCS_URL %}}/reference/api/influxdb-1x/dbrp/)\n",
"parameters": [
{
"$ref": "#/components/parameters/TraceSpan"
}
],
"requestBody": {
"description": "The database retention policy mapping to add.\n\nNote that _`retention_policy`_ is a required parameter in the request body.\nThe value of _`retention_policy`_ can be any arbitrary `string` name or\nvalue, with the default value commonly set as `autogen`.\nThe value of _`retention_policy`_ isn't a [retention_policy]({{% INFLUXDB_DOCS_URL %}}/reference/glossary/#retention-policy-rp)\n",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DBRPCreate"
}
}
}
},
"responses": {
"201": {
"description": "Created. The response body contains the database retention policy mapping.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DBRP"
},
"examples": {
"successResponse": {
"value": {
"id": "0a3cbb5dd526a000",
"database": "example_database",
"retention_policy": "autogen",
"default": true,
"orgID": "bea7ea952287f70d",
"bucketID": "4d4d9d5b61dee751"
}
}
}
}
}
},
"400": {
"description": "Bad request. The mapping in the request has one or more invalid IDs.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"invalidRequest": {
"description": "The query parameters contain invalid values.\n",
"value": {
"code": "invalid",
"message": "invalid ID"
}
}
}
}
}
},
"401": {
"$ref": "#/components/responses/AuthorizationError"
},
"404": {
"$ref": "#/components/responses/ResourceNotFoundError"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
},
"default": {
"description": "Unexpected error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"x-codeSamples": [
{
"lang": "Shell",
"label": "cURL: create a database retention policy mapping",
"source": "curl --request POST \\\n \"http://localhost:8086/api/v2/dbrp/\" \\\n --header 'Content-type: application/json' \\\n --header \"Authorization: Token INFLUXDB_TOKEN\" \\\n --data-binary @- << EOF\n { \\\n \"bucketID\": \"INFLUXDB_BUCKET_ID\", \\\n \"orgID\": \"INFLUXDB_ORG_ID\", \\\n \"database\": \"database_name\", \\\n \"default\": true, \\\n \"retention_policy\": \"example_retention_policy_name\" \\\n }\nEOF\n"
}
]
}
},
"/dbrps/{dbrpID}": {
"get": {
"operationId": "GetDBRPsID",
"tags": [
"DBRPs"
],
"summary": "Retrieve a database retention policy mapping",
"description": "Retrieves the specified retention policy (DBRP) mapping.\n\n#### Related guide\n\n- [Database and retention policy mapping]({{% INFLUXDB_DOCS_URL %}}/reference/api/influxdb-1x/dbrp/)\n",
"parameters": [
{
"$ref": "#/components/parameters/TraceSpan"
},
{
"in": "query",
"name": "orgID",
"description": "An organization ID.\nSpecifies the organization that owns the DBRP mapping.\n",
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "org",
"description": "An organization name.\nSpecifies the organization that owns the DBRP mapping.\n",
"schema": {
"type": "string"
}
},
{
"in": "path",
"name": "dbrpID",
"schema": {
"type": "string"
},
"required": true,
"description": "A DBRP mapping ID.\nSpecifies the DBRP mapping.\n"
}
],
"responses": {
"200": {
"description": "Success. The response body contains the DBRP mapping.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DBRPGet"
},
"examples": {
"successResponse": {
"value": {
"content": {
"id": "0a3cbb5dd526a000",
"database": "example_database_1",
"retention_policy": "autogen",
"default": true,
"orgID": "bea7ea952287f70d",
"bucketID": "4d4d9d5b61dee751"
}
}
}
}
}
}
},
"400": {
"description": "Bad Request. Query parameters contain invalid values.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"invalidRequest": {
"description": "The query parameters contain invalid values.\n",
"value": {
"code": "invalid",
"message": "invalid ID"
}
}
}
}
}
},
"401": {
"$ref": "#/components/responses/AuthorizationError"
},
"404": {
"$ref": "#/components/responses/ResourceNotFoundError"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
},
"default": {
"description": "Unexpected error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
},
"patch": {
"operationId": "PatchDBRPID",
"tags": [
"DBRPs"
],
"summary": "Update a database retention policy mapping",
"requestBody": {
"description": "Updates the database retention policy (DBRP) mapping and returns the mapping.\n\nUse this endpoint to modify the _retention policy_ (`retention_policy` property) of a DBRP mapping.\n\n#### Related guide\n\n- [Database and retention policy mapping]({{% INFLUXDB_DOCS_URL %}}/reference/api/influxdb-1x/dbrp/)\n",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DBRPUpdate"
}
}
}
},
"parameters": [
{
"$ref": "#/components/parameters/TraceSpan"
},
{
"in": "query",
"name": "orgID",
"description": "An organization ID.\nSpecifies the organization that owns the DBRP mapping.\n",
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "org",
"description": "An organization name.\nSpecifies the organization that owns the DBRP mapping.\n",
"schema": {
"type": "string"
}
},
{
"in": "path",
"name": "dbrpID",
"schema": {
"type": "string"
},
"required": true,
"description": "A DBRP mapping ID.\nSpecifies the DBRP mapping.\n"
}
],
"responses": {
"200": {
"description": "An updated mapping",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DBRPGet"
},
"examples": {
"successResponse": {
"value": {
"content": {
"id": "0a3cbb5dd526a000",
"database": "example_database",
"retention_policy": "example_retention_policy",
"default": false,
"orgID": "bea7ea952287f70d",
"bucketID": "4d4d9d5b61dee751"
}
}
}
}
}
}
},
"400": {
"description": "Bad Request. Query parameters contain invalid values.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"invalidRequest": {
"description": "The query parameters contain invalid values.\n",
"value": {
"code": "invalid",
"message": "invalid ID"
}
}
}
}
}
},
"401": {
"$ref": "#/components/responses/AuthorizationError"
},
"404": {
"$ref": "#/components/responses/ResourceNotFoundError"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
},
"default": {
"description": "Unexpected error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
},
"x-codeSamples": [
{
"lang": "Shell",
"label": "cURL: Update a DBRP mapping",
"source": "curl --request PATCH \\\n \"http://localhost:8086/api/v2/dbrp/DBRP_ID\" \\\n --header 'Content-type: application/json' \\\n --header \"Authorization: Token INFLUX_API_TOKEN\" \\\n --data-binary @- << EOF\n {\n \"default\": true,\n \"retention_policy\": \"example_retention_policy_name\"\n }\nEOF\n"
}
]
},
"delete": {
"operationId": "DeleteDBRPID",
"tags": [
"DBRPs"
],
"summary": "Delete a database retention policy",
"description": "Deletes the specified database retention policy (DBRP) mapping.\n\n#### Related guide\n\n- [Database and retention policy mapping]({{% INFLUXDB_DOCS_URL %}}/reference/api/influxdb-1x/dbrp/)\n",
"parameters": [
{
"$ref": "#/components/parameters/TraceSpan"
},
{
"in": "query",
"name": "orgID",
"description": "An organization ID.\nSpecifies the organization that owns the DBRP mapping.\n",
"schema": {
"type": "string"
}
},
{
"in": "query",
"name": "org",
"description": "An organization name.\nSpecifies the organization that owns the DBRP mapping.\n",
"schema": {
"type": "string"
}
},
{
"in": "path",
"name": "dbrpID",
"schema": {
"type": "string"
},
"required": true,
"description": "A DBRP mapping ID.\nOnly returns the specified DBRP mapping.\n"
}
],
"responses": {
"204": {
"description": "Success. The delete is accepted."
},
"400": {
"description": "Bad Request. Query parameters contain invalid values.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
},
"examples": {
"invalidRequest": {
"description": "The query parameters contain invalid values.\n",
"value": {
"code": "invalid",
"message": "invalid ID"
}
}
}
}
}
},
"401": {
"$ref": "#/components/responses/AuthorizationError"
},
"404": {
"$ref": "#/components/responses/ResourceNotFoundError"
},
"500": {
"$ref": "#/components/responses/InternalServerError"
},
"default": {
"description": "Unexpected error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/telegraf/plugins": {
"get": {
"operationId": "GetTelegrafPlugins",
"tags": [
"Telegraf Plugins"
],
"summary": "List all Telegraf plugins",
"parameters": [
{
"$ref": "#/components/parameters/TraceSpan"
},
{
"in": "query",
"name": "type",
"description": "The type of plugin desired.",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "A list of Telegraf plugins.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TelegrafPlugins"
}
}
}
},
"default": {
"description": "Unexpected error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
}
},
"/telegrafs": {
"get": {
"operationId": "GetTelegrafs",
"tags": [
"Telegrafs"
],
"summary": "List all Telegraf configurations",
"parameters": [
{
"$ref": "#/components/parameters/TraceSpan"
},
{
"in": "query",
"name": "orgID",
"description": "The organization ID the Telegraf config belongs to.",
"schema": {
"type": "string"
}
}
],
"responses": {
"200": {
"description": "A list of Telegraf configurations",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Telegrafs"
}
}
}
},
"default": {
"description": "Unexpected error",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Error"
}
}
}
}
}
},
"post": {
"operationId": "PostTelegrafs",
"tags": [
"Telegrafs"
],
"summary": "Create a Telegraf configuration",
"parameters": [
{
"$ref": "#/components/parameters/TraceSpan"
}
],
"requestBody": {
"description": "Telegraf configuration to create",
"required": true,
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/TelegrafPluginRequest"
}
}
}
},
"responses": {
"201": {
"description": "Telegraf configuration created",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/Telegraf"
}
}