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
6d03d0aa
Commit
6d03d0aa
authored
Dec 21, 2019
by
Ahmad Nemati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
293fb21e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
3 deletions
+24
-3
Hetzner.js
Hetzner.js
+21
-0
app.js
app.js
+1
-1
test.js
test.js
+2
-2
No files found.
Hetzner.js
View file @
6d03d0aa
...
...
@@ -103,6 +103,27 @@ class Hetzner {
}
async
removeAllFloatingIps
()
{
try
{
let
ips
=
await
this
.
getAllFloatingIps
()
for
(
let
i
=
0
;
i
<
ips
.
length
;
i
++
)
{
await
this
.
delFloatingIp
(
ips
[
i
].
id
)
}
}
catch
(
e
)
{
}
return
true
}
async
getMasterServerId
()
{
try
{
...
...
app.js
View file @
6d03d0aa
...
...
@@ -48,7 +48,7 @@ async function newFloatingIpsOrder(req, res) {
let
order
=
parseInt
(
req
.
params
.
num
)
res
.
send
(
'
Floating Ips from
'
+
(
order
===
1
?
'
Nuremberg
'
:
'
Falkenstein
'
)
+
'
Requested
'
)
let
ips
=
await
het
.
getAllFloatingIps
()
if
(
ips
.
length
===
0
)
if
(
ips
.
length
===
1
0
)
return
let
masterid
=
await
het
.
getMasterServerId
()
let
floatNum
=
10
-
ips
.
length
...
...
test.js
View file @
6d03d0aa
...
...
@@ -15,12 +15,12 @@ const cryptLib = require('@skavinvarnan/cryptlib');
const
key
=
"
6*sN_rZxHD4!X$=T
"
;
let
Hetzner
=
require
(
'
./Hetzner
'
)
let
het
postFloatingIps
([
'
127.0.0.1
'
,
'
127.0.0.2
'
]
)
tesT
(
)
async
function
tesT
()
{
await
init
()
// let masterid=await het.getMasterServerId()
let
d
=
await
het
.
remove
FloatingIpByIp
(
'
78.47.38.44
'
)
let
d
=
await
het
.
remove
AllFloatingIps
(
'
78.47.38.44
'
)
console
.
log
(
d
)
}
...
...
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