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
9b582bdd
Commit
9b582bdd
authored
Jan 01, 2020
by
Ahmad Nemati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
5554ee7b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
aruba.js
aruba.js
+12
-12
No files found.
aruba.js
View file @
9b582bdd
...
...
@@ -76,16 +76,16 @@ async function getDetailsofServer(dc, id) {
}
async
function
createFloatingIp
(
dc
)
{
let
url
=
generateUrl
(
d
c
,
'
SetPurchaseIpAddress
'
)
let
url
=
generateUrl
(
foundD
c
,
'
SetPurchaseIpAddress
'
)
let
d
=
await
doRequest
(
url
,
auth
)
d
=
d
.
Value
await
attachedToServer
(
d
c
,
d
.
ResourceId
)
await
attachedToServer
(
foundD
c
,
d
.
ResourceId
)
return
d
}
async
function
getAllIps
(
dc
)
{
let
url
=
generateUrl
(
d
c
,
'
GetPurchasedIpAddresses
'
)
let
url
=
generateUrl
(
foundD
c
,
'
GetPurchasedIpAddresses
'
)
let
d
=
await
doRequest
(
url
,
auth
)
...
...
@@ -93,12 +93,12 @@ async function getAllIps(dc) {
}
async
function
deleteAllIps
(
dc
)
{
let
ips
=
await
getAllIps
(
d
c
)
let
ips
=
await
getAllIps
(
foundD
c
)
for
(
let
i
=
0
;
i
<
ips
.
length
;
i
++
)
{
if
(
ips
[
i
].
Value
!==
masterIp
)
{
let
d
=
await
deleteIp
(
d
c
,
ips
[
i
].
ResourceId
)
let
d
=
await
deleteIp
(
foundD
c
,
ips
[
i
].
ResourceId
)
console
.
log
(
d
)
}
...
...
@@ -112,7 +112,7 @@ async function deleteAllIps(dc) {
async
function
attachedToServer
(
dc
,
resourceId
)
{
let
url
=
generateUrl
(
d
c
,
'
SetEnqueueAssociateIpAddress
'
)
let
url
=
generateUrl
(
foundD
c
,
'
SetEnqueueAssociateIpAddress
'
)
let
body
=
auth
body
.
IpRequest
=
{
NetworkAdapterId
:
networkId
,
IpAddressResourceIds
:
[
resourceId
]}
...
...
@@ -125,7 +125,7 @@ async function attachedToServer(dc, resourceId) {
async
function
unAttachedToServer
(
dc
,
resourceId
)
{
let
url
=
generateUrl
(
d
c
,
'
SetEnqueueDeassociateIpAddress
'
)
let
url
=
generateUrl
(
foundD
c
,
'
SetEnqueueDeassociateIpAddress
'
)
let
body
=
auth
body
.
IpRequest
=
{
NetworkAdapterId
:
networkId
,
IpAddressResourceIds
:
[
resourceId
]}
...
...
@@ -138,13 +138,13 @@ async function unAttachedToServer(dc, resourceId) {
async
function
attachedToServerByIp
(
dc
,
ip
)
{
let
ips
=
await
getAllIps
(
d
c
)
let
ips
=
await
getAllIps
(
foundD
c
)
for
(
let
i
=
0
;
i
<
ips
.
length
;
i
++
)
{
if
(
ips
[
i
].
Value
===
ip
)
{
await
attachedToServer
(
d
c
,
ips
[
i
].
ResourceId
)
await
attachedToServer
(
foundD
c
,
ips
[
i
].
ResourceId
)
break
}
}
...
...
@@ -163,7 +163,7 @@ async function RemovedByIp(dc, ip) {
{
if
(
ips
[
i
].
Value
===
ip
)
{
await
deleteIp
(
d
c
,
ips
[
i
].
ResourceId
)
await
deleteIp
(
foundD
c
,
ips
[
i
].
ResourceId
)
break
}
}
...
...
@@ -175,8 +175,8 @@ async function RemovedByIp(dc, ip) {
}
async
function
deleteIp
(
dc
,
id
)
{
await
unAttachedToServer
(
d
c
,
id
)
let
url
=
generateUrl
(
d
c
,
'
SetRemoveIpAddress
'
)
await
unAttachedToServer
(
foundD
c
,
id
)
let
url
=
generateUrl
(
foundD
c
,
'
SetRemoveIpAddress
'
)
let
body
=
auth
body
.
IpAddressResourceId
=
id
let
d
=
await
doRequest
(
url
,
body
)
...
...
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