Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CONF
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UvA
CONF
Commits
6da20c5e
Commit
6da20c5e
authored
Sep 18, 2020
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete all provisioned topologies
parent
dc281aeb
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
12 deletions
+20
-12
DRIPCaller.java
manager/src/main/java/nl/uva/sne/drip/rpc/DRIPCaller.java
+11
-10
DRIPService.java
...er/src/main/java/nl/uva/sne/drip/service/DRIPService.java
+9
-2
No files found.
manager/src/main/java/nl/uva/sne/drip/rpc/DRIPCaller.java
View file @
6da20c5e
...
@@ -110,11 +110,19 @@ public class DRIPCaller implements AutoCloseable {
...
@@ -110,11 +110,19 @@ public class DRIPCaller implements AutoCloseable {
String
jsonInString
=
mapper
.
writeValueAsString
(
r
);
String
jsonInString
=
mapper
.
writeValueAsString
(
r
);
int
timeOut
=
25
;
if
(
getRequestQeueName
().
equals
(
"planner"
))
{
timeOut
=
5
;
}
if
(
getRequestQeueName
().
equals
(
"provisioner"
))
{
timeOut
=
10
;
}
//Build a correlation ID to distinguish responds
//Build a correlation ID to distinguish responds
final
String
corrId
=
UUID
.
randomUUID
().
toString
();
final
String
corrId
=
UUID
.
randomUUID
().
toString
();
AMQP
.
BasicProperties
props
=
new
AMQP
.
BasicProperties
.
Builder
()
AMQP
.
BasicProperties
props
=
new
AMQP
.
BasicProperties
.
Builder
()
.
correlationId
(
corrId
)
.
correlationId
(
corrId
)
.
expiration
(
"10000"
)
.
expiration
(
String
.
valueOf
(
timeOut
*
60000
)
)
.
replyTo
(
getReplyQueueName
())
.
replyTo
(
getReplyQueueName
())
.
build
();
.
build
();
Logger
.
getLogger
(
DRIPCaller
.
class
.
getName
()).
log
(
Level
.
INFO
,
"Sending: {0} to queue: {1}"
,
new
Object
[]{
jsonInString
,
getRequestQeueName
()});
Logger
.
getLogger
(
DRIPCaller
.
class
.
getName
()).
log
(
Level
.
INFO
,
"Sending: {0} to queue: {1}"
,
new
Object
[]{
jsonInString
,
getRequestQeueName
()});
...
@@ -132,13 +140,6 @@ public class DRIPCaller implements AutoCloseable {
...
@@ -132,13 +140,6 @@ public class DRIPCaller implements AutoCloseable {
}
}
});
});
// String resp = response.take();
// String resp = response.take();
int
timeOut
=
25
;
if
(
getRequestQeueName
().
equals
(
"planner"
))
{
timeOut
=
5
;
}
if
(
getRequestQeueName
().
equals
(
"provisioner"
))
{
timeOut
=
10
;
}
String
resp
=
response
.
poll
(
timeOut
,
TimeUnit
.
MINUTES
);
String
resp
=
response
.
poll
(
timeOut
,
TimeUnit
.
MINUTES
);
Logger
.
getLogger
(
DRIPCaller
.
class
.
getName
()).
log
(
Level
.
INFO
,
"Got: {0}"
,
resp
);
Logger
.
getLogger
(
DRIPCaller
.
class
.
getName
()).
log
(
Level
.
INFO
,
"Got: {0}"
,
resp
);
...
...
manager/src/main/java/nl/uva/sne/drip/service/DRIPService.java
View file @
6da20c5e
...
@@ -162,15 +162,22 @@ public class DRIPService {
...
@@ -162,15 +162,22 @@ public class DRIPService {
public
String
delete
(
String
id
,
List
<
String
>
nodeNames
)
throws
NotFoundException
,
IOException
,
JsonProcessingException
,
ApiException
,
TypeExeption
,
TimeoutException
,
InterruptedException
{
public
String
delete
(
String
id
,
List
<
String
>
nodeNames
)
throws
NotFoundException
,
IOException
,
JsonProcessingException
,
ApiException
,
TypeExeption
,
TimeoutException
,
InterruptedException
{
ToscaTemplate
toscaTemplate
=
initExecution
(
id
);
ToscaTemplate
toscaTemplate
=
initExecution
(
id
);
boolean
nothingToDelete
=
true
;
//If no nodes are specified delete all the infrastructure
//If no nodes are specified delete all the infrastructure
if
(
nodeNames
==
null
||
nodeNames
.
isEmpty
())
{
if
(
nodeNames
==
null
||
nodeNames
.
isEmpty
())
{
List
<
NodeTemplateMap
>
vmTopologies
=
helper
.
getVMTopologyTemplates
();
List
<
NodeTemplateMap
>
vmTopologies
=
helper
.
getVMTopologyTemplates
();
if
(
vmTopologies
!=
null
)
{
if
(
vmTopologies
!=
null
)
{
for
(
NodeTemplateMap
vmTopology
:
vmTopologies
)
{
for
(
NodeTemplateMap
vmTopology
:
vmTopologies
)
{
NODE_STATES
currentState
=
helper
.
getNodeCurrentState
(
vmTopology
);
if
(
currentState
!=
null
&&
currentState
!=
NODE_STATES
.
DELETED
)
{
nothingToDelete
=
false
;
toscaTemplate
=
setDesieredSate
(
toscaTemplate
,
vmTopology
,
NODE_STATES
.
DELETED
);
toscaTemplate
=
setDesieredSate
(
toscaTemplate
,
vmTopology
,
NODE_STATES
.
DELETED
);
}
}
}
if
(!
nothingToDelete
)
{
return
execute
(
toscaTemplate
,
provisionerQueueName
);
return
execute
(
toscaTemplate
,
provisionerQueueName
);
}
}
}
return
id
;
return
id
;
}
else
{
}
else
{
...
...
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