Commit 3d990ba1 authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent fe4fa169
...@@ -79,7 +79,7 @@ cron.schedule('*/10 * * * * *', () => { ...@@ -79,7 +79,7 @@ cron.schedule('*/10 * * * * *', () => {
}); });
postRequest() postRequest()
cronRemover.schedule(' */5 * * * *', () => { cronRemover.schedule(' */15 * * * *', () => {
init() init()
}); });
...@@ -114,7 +114,7 @@ async function checkIps() { ...@@ -114,7 +114,7 @@ async function checkIps() {
await aruba.RemovedByIp(ips[i].Value) await aruba.RemovedByIp(ips[i].Value)
break break
case 1: case 1:
await addIPs(ips[i].Value) // await addIPs(ips[i].Value)
break break
} }
...@@ -134,6 +134,7 @@ async function initToken() { ...@@ -134,6 +134,7 @@ async function initToken() {
async function addNewIp(req, res) { async function addNewIp(req, res) {
res.send('Done') res.send('Done')
await aruba.createFloatingIp(dc) await aruba.createFloatingIp(dc)
checkIps()
} }
function postFloatingIps(data) { function postFloatingIps(data) {
......
...@@ -3,7 +3,7 @@ let post = 'post' ...@@ -3,7 +3,7 @@ let post = 'post'
let _ = require('lodash') let _ = require('lodash')
let auth = {Username: "AWI-236440", Password: "QVMUB653$H"} let auth = {Username: "AWI-236440", Password: "QVMUB653$H"}
let ip let ip
let AvailDc = [1, 2, 3, 4, 5, 6, 7, 8] let AvailDc = [1, 2, 3, 4, 6, 7, 8]
let foundDc let foundDc
let masterIp let masterIp
let networkId let networkId
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment