We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c1a825c commit a5d9870Copy full SHA for a5d9870
src/flows/templates/types/tools.ts
@@ -0,0 +1,34 @@
1
+export default register =>
2
+ register({
3
+ type: 'tools',
4
+ init: (id, token) => {
5
+ const headers = {
6
+ 'Content-Type': 'application/json',
7
+ 'Accept-Encoding': 'gzip',
8
+ Authorization: `Token ${token}`,
9
+ }
10
+
11
+ return fetch(
12
+ `https://influxdb.aws.influxdata.io/api/v2private/notebooks/${id}`,
13
+ {
14
+ method: 'GET',
15
+ headers,
16
17
+ )
18
+ .then(res => res.json())
19
+ .then(res => {
20
+ delete res.id
21
+ delete res.orgID
22
+ res.spec.pipes.unshift({
23
+ type: 'region',
24
+ region: 'https://influxdb.aws.influxdata.io',
25
+ token,
26
+ source: 'custom',
27
+ visible: true,
28
+ title: 'Tools Cluster',
29
+ })
30
31
+ return res
32
33
+ },
34
0 commit comments