Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
Aruba-Master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Aruba-Master
Commits
431e2f7a
Commit
431e2f7a
authored
Apr 17, 2020
by
Ahmad Nemati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
af25290c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
5 deletions
+19
-5
app.js
app.js
+4
-3
aruba.js
aruba.js
+15
-2
No files found.
app.js
View file @
431e2f7a
...
...
@@ -69,6 +69,7 @@ cronRemover.schedule(' */2 * * * *', () => {
});
init
()
async
function
init
()
{
await
initToken
()
...
...
@@ -120,12 +121,12 @@ async function sleep(millis) {
async
function
initToken
()
{
let
d
=
aruba
.
getDc
()
if
(
typeof
d
===
"
undefined
"
)
await
aruba
.
init
()
// remover()
aruba
.
logData
()
}
...
...
aruba.js
View file @
431e2f7a
...
...
@@ -12,7 +12,7 @@ let serverId
//test()
async
function
test
()
{
ip
=
'
94.177.244.45
'
ip
=
'
195.231.67.162
'
for
(
let
i
=
0
;
i
<
AvailDc
.
length
;
i
++
)
{
let
servers
=
await
getAllServers
(
AvailDc
[
i
])
servers
=
servers
.
Value
...
...
@@ -47,6 +47,8 @@ async function test() {
async
function
init
()
{
if
(
typeof
foundDc
!==
"
undefined
"
)
return
true
ip
=
await
getIp
()
for
(
let
i
=
0
;
i
<
AvailDc
.
length
;
i
++
)
{
let
servers
=
await
getAllServers
(
AvailDc
[
i
])
...
...
@@ -60,7 +62,6 @@ async function init() {
let
server
=
await
getDetailsofServer
(
AvailDc
[
i
],
servers
[
j
].
ServerId
)
server
=
server
.
Value
if
(
ip
===
server
.
NetworkAdapters
[
0
].
IPAddresses
[
0
].
Value
)
{
masterIp
=
server
.
NetworkAdapters
[
0
].
IPAddresses
[
0
].
Value
networkId
=
server
.
NetworkAdapters
[
0
].
Id
serverId
=
server
.
ServerId
foundDc
=
AvailDc
[
i
]
...
...
@@ -71,6 +72,8 @@ async function init() {
}
return
true
}
...
...
@@ -235,6 +238,7 @@ async function doRequest(url, body) {
resolve
(
JSON
.
parse
(
body
))
}
catch
(
e
)
{
console
.
log
(
e
)
resolve
(
true
)
// console.log('Problem --->' + options.url)
// console.log(e)
...
...
@@ -299,6 +303,14 @@ function getIp() {
}
function
logData
()
{
console
.
log
(
'
foundDc ->
'
+
foundDc
)
console
.
log
(
'
masterIp ->
'
+
masterIp
)
console
.
log
(
'
networkId ->
'
+
networkId
)
console
.
log
(
'
serverId ->
'
+
serverId
)
}
module
.
exports
=
{
init
:
init
,
...
...
@@ -306,6 +318,7 @@ module.exports =
attachedToServerByIp
:
attachedToServerByIp
,
RemovedByIp
:
RemovedByIp
,
getDc
:
getDc
,
logData
:
logData
,
createFloatingIp
:
createFloatingIp
...
...
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