Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
flowengine-docker
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template
flowengine-docker
Commits
9fdda8ac
Commit
9fdda8ac
authored
Oct 20, 2023
by
marwan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init flowengine grafana influxdb package
parent
c784e986
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
20 deletions
+15
-20
bash-influx/init.bash
+15
-20
No files found.
bash-influx/init.bash
View file @
9fdda8ac
...
@@ -11,27 +11,22 @@ OrgID=''
...
@@ -11,27 +11,22 @@ OrgID=''
LengthOrgID
=
0
LengthOrgID
=
0
while
[
"
$LengthOrgID
"
-ne
16
]
while
[
"
$LengthOrgID
"
-ne
16
]
do
do
sleep 1
sleep 1
orgInfo
=
$(
influx org list
--token
$INFLUX_TOKEN
--host
$URI
)
orgInfo
=
$(
influx org list
--token
$INFLUX_TOKEN
--host
$URI
)
orgInfo
=
$(
echo
"
$orgInfo
"
| sed
-e
's/^[ \t]*//'
)
orgInfo
=
$(
echo
"
$orgInfo
"
| sed
-e
's/^[ \t]*//'
)
#ID Name
#ID Name
#ae4907f2f6f4ac66 primary
#ae4907f2f6f4ac66 primary
name
=
''
name
=
''
while
read
-r
line
;
do
while
read
-r
line
;
do
echo
$line
echo
$line
name
=
$(
echo
"
$line
"
| awk
'{print $2}'
| sed
's/[^a-zA-Z0-9]//g'
)
name
=
$(
echo
"
$line
"
| awk
'{print $2}'
| sed
's/[^a-zA-Z0-9]//g'
)
echo
$name
echo
$name
if
[
"
$ORG_NAME
"
==
"
$name
"
]
;
then
if
[
"
$ORG_NAME
"
==
"
$name
"
]
;
then
OrgID
=(
$(
echo
"
$line
"
| awk
'{print $1}'
)
)
OrgID
=(
$(
echo
"
$line
"
| awk
'{print $1}'
)
)
fi
fi
done
<<<
"
$(
echo
"
$orgInfo
"
| awk
'NR > 1'
)
"
done
<<<
"
$(
echo
"
$orgInfo
"
| awk
'NR > 1'
)
"
LengthOrgID
=
${#
OrgID
}
LengthOrgID
=
${#
OrgID
}
#echo $LengthOrgID
#if [ "$LengthOrgID" -ne 16 ]; then
# echo cannot get orgID
# exit 0;
#fi
done
done
echo
"OrgID:
${
OrgID
[@]
}
"
echo
"OrgID:
${
OrgID
[@]
}
"
curl
--request
POST
${
URI
}
/api/v2/buckets
-H
"Authorization: Token
${
INFLUX_TOKEN
}
"
-H
"Accept: application/json"
-H
"Content-Type: application/json"
-d
"{
\"
name
\"
:
\"
${
BUCKET_NAME
}
\"
,
\"
description
\"
:
\"
A bucket holding air sensor data
\"
,
\"
orgID
\"
:
\"
${
OrgID
[@]
}
\"
,
\"
retentionRules
\"
: [ {
\"
type
\"
:
\"
expire
\"
,
\"
everySeconds
\"
: 15552000 } ] }"
#2592000
curl
--request
POST
${
URI
}
/api/v2/buckets
-H
"Authorization: Token
${
INFLUX_TOKEN
}
"
-H
"Accept: application/json"
-H
"Content-Type: application/json"
-d
"{
\"
name
\"
:
\"
${
BUCKET_NAME
}
\"
,
\"
description
\"
:
\"
A bucket holding air sensor data
\"
,
\"
orgID
\"
:
\"
${
OrgID
[@]
}
\"
,
\"
retentionRules
\"
: [ {
\"
type
\"
:
\"
expire
\"
,
\"
everySeconds
\"
: 15552000 } ] }"
#2592000
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment