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
c95c94cc
Commit
c95c94cc
authored
Dec 12, 2019
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add credential to VM topology
parent
ddb85e7c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
14 deletions
+29
-14
data.yml
TOSCA/types/data.yml
+1
-1
ToscaHelper.java
.../main/java/nl/uva/sne/drip/commons/utils/ToscaHelper.java
+16
-2
DRIPService.java
...er/src/main/java/nl/uva/sne/drip/service/DRIPService.java
+2
-2
workspace.xml
drip-planner/.idea/workspace.xml
+9
-9
Credential.yml
openAPI/schema/TOSCA/Credential.yml
+1
-0
No files found.
TOSCA/types/data.yml
View file @
c95c94cc
...
@@ -3,7 +3,7 @@ tosca_definitions_version: tosca_simple_yaml_1_0
...
@@ -3,7 +3,7 @@ tosca_definitions_version: tosca_simple_yaml_1_0
data_types
:
data_types
:
tosca.datatypes.ARTICONF.Credential
:
tosca.datatypes.ARTICONF.Credential
:
derived_from
:
tosca.datatypes.
ARTICONF.
Credential
derived_from
:
tosca.datatypes.Credential
properties
:
properties
:
cloud_provider_name
:
cloud_provider_name
:
type
:
string
type
:
string
...
...
drip-commons/src/main/java/nl/uva/sne/drip/commons/utils/ToscaHelper.java
View file @
c95c94cc
...
@@ -23,6 +23,7 @@ import com.fasterxml.jackson.dataformat.yaml.YAMLGenerator;
...
@@ -23,6 +23,7 @@ import com.fasterxml.jackson.dataformat.yaml.YAMLGenerator;
import
java.io.File
;
import
java.io.File
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
nl.uva.sne.drip.model.NodeTemplate
;
import
nl.uva.sne.drip.model.NodeTemplate
;
...
@@ -175,12 +176,25 @@ public class ToscaHelper {
...
@@ -175,12 +176,25 @@ public class ToscaHelper {
}
}
}
}
public
void
setCredentialsInVMTopology
(
NodeTemplate
vmTopology
,
Credential
credential
)
throws
Exception
{
public
NodeTemplate
setCredentialsInVMTopology
(
NodeTemplate
vmTopology
,
Credential
credential
)
throws
Exception
{
if
(
vmTopology
.
getType
().
equals
(
VM_TOPOLOGY
))
{
if
(
vmTopology
.
getType
().
equals
(
VM_TOPOLOGY
))
{
vmTopology
.
getAttributes
();
Map
<
String
,
Object
>
att
=
vmTopology
.
getAttributes
();
Map
<
String
,
Object
>
toscaCredential
=
new
HashMap
<>();
toscaCredential
.
put
(
"protocol"
,
credential
.
getProtocol
());
toscaCredential
.
put
(
"token_type"
,
credential
.
getTokenType
());
toscaCredential
.
put
(
"token"
,
credential
.
getToken
());
toscaCredential
.
put
(
"keys"
,
credential
.
getKeys
());
toscaCredential
.
put
(
"user"
,
credential
.
getUser
());
toscaCredential
.
put
(
"cloud_provider_name"
,
credential
.
getCloudProviderName
());
att
.
put
(
"credential"
,
toscaCredential
);
return
vmTopology
;
}
else
{
}
else
{
throw
new
Exception
(
"NodeTemplate is not of type: "
+
VM_TOPOLOGY
+
" it is of type: "
+
vmTopology
.
getType
());
throw
new
Exception
(
"NodeTemplate is not of type: "
+
VM_TOPOLOGY
+
" it is of type: "
+
vmTopology
.
getType
());
}
}
}
}
public
ToscaTemplate
setVMTopologyInToscaTemplate
(
NodeTemplate
vmTopology
)
{
throw
new
UnsupportedOperationException
(
"Not supported yet."
);
//To change body of generated methods, choose Tools | Templates.
}
}
}
drip-manager/src/main/java/nl/uva/sne/drip/service/DRIPService.java
View file @
c95c94cc
...
@@ -101,8 +101,8 @@ public class DRIPService {
...
@@ -101,8 +101,8 @@ public class DRIPService {
credentials
=
credentialService
.
findByProvider
(
provider
.
toLowerCase
());
credentials
=
credentialService
.
findByProvider
(
provider
.
toLowerCase
());
if
(
credentials
!=
null
&&
credentials
.
size
()
>
0
)
{
if
(
credentials
!=
null
&&
credentials
.
size
()
>
0
)
{
Credential
credential
=
getBestCredential
(
vmTopology
,
credentials
);
Credential
credential
=
getBestCredential
(
vmTopology
,
credentials
);
helper
.
setCredentialsInVMTopology
(
vmTopology
,
credential
);
vmTopology
=
helper
.
setCredentialsInVMTopology
(
vmTopology
,
credential
);
toscaTemplate
=
helper
.
setVMTopologyInToscaTemplate
(
vmTopology
);
return
toscaTemplate
;
return
toscaTemplate
;
}
}
}
}
...
...
drip-planner/.idea/workspace.xml
View file @
c95c94cc
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<project
version=
"4"
>
<project
version=
"4"
>
<component
name=
"ChangeListManager"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"e478ccae-5352-4e8e-9efb-3f5cda44e877"
name=
"Default Changelist"
comment=
""
>
<list
default=
"true"
id=
"e478ccae-5352-4e8e-9efb-3f5cda44e877"
name=
"Default Changelist"
comment=
""
>
<change
beforePath=
"$PROJECT_DIR$/.
./TOSCA/application_example_updated.yaml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/../TOSCA/application_example_updated.ya
ml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.
idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.x
ml"
afterDir=
"false"
/>
</list>
</list>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"SHOW_DIALOG"
value=
"false"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
<option
name=
"HIGHLIGHT_CONFLICTS"
value=
"true"
/>
...
@@ -245,25 +245,25 @@
...
@@ -245,25 +245,25 @@
<screen
x=
"67"
y=
"34"
width=
"2493"
height=
"1406"
/>
<screen
x=
"67"
y=
"34"
width=
"2493"
height=
"1406"
/>
</state>
</state>
<state
x=
"1043"
y=
"437"
width=
"530"
height=
"598"
key=
"FileChooserDialogImpl/67.34.2493.1406@67.34.2493.1406"
timestamp=
"1575907769017"
/>
<state
x=
"1043"
y=
"437"
width=
"530"
height=
"598"
key=
"FileChooserDialogImpl/67.34.2493.1406@67.34.2493.1406"
timestamp=
"1575907769017"
/>
<state
width=
"1825"
height=
"283"
key=
"GridCell.Tab.0.bottom"
timestamp=
"1576165
003401
"
>
<state
width=
"1825"
height=
"283"
key=
"GridCell.Tab.0.bottom"
timestamp=
"1576165
782177
"
>
<screen
x=
"67"
y=
"34"
width=
"1853"
height=
"1046"
/>
<screen
x=
"67"
y=
"34"
width=
"1853"
height=
"1046"
/>
</state>
</state>
<state
width=
"1825"
height=
"283"
key=
"GridCell.Tab.0.bottom/67.34.1853.1046@67.34.1853.1046"
timestamp=
"1576165
003401
"
/>
<state
width=
"1825"
height=
"283"
key=
"GridCell.Tab.0.bottom/67.34.1853.1046@67.34.1853.1046"
timestamp=
"1576165
782177
"
/>
<state
width=
"2465"
height=
"410"
key=
"GridCell.Tab.0.bottom/67.34.2493.1406@67.34.2493.1406"
timestamp=
"1576092018571"
/>
<state
width=
"2465"
height=
"410"
key=
"GridCell.Tab.0.bottom/67.34.2493.1406@67.34.2493.1406"
timestamp=
"1576092018571"
/>
<state
width=
"1825"
height=
"283"
key=
"GridCell.Tab.0.center"
timestamp=
"1576165
003399
"
>
<state
width=
"1825"
height=
"283"
key=
"GridCell.Tab.0.center"
timestamp=
"1576165
782175
"
>
<screen
x=
"67"
y=
"34"
width=
"1853"
height=
"1046"
/>
<screen
x=
"67"
y=
"34"
width=
"1853"
height=
"1046"
/>
</state>
</state>
<state
width=
"1825"
height=
"283"
key=
"GridCell.Tab.0.center/67.34.1853.1046@67.34.1853.1046"
timestamp=
"1576165
003399
"
/>
<state
width=
"1825"
height=
"283"
key=
"GridCell.Tab.0.center/67.34.1853.1046@67.34.1853.1046"
timestamp=
"1576165
782175
"
/>
<state
width=
"2465"
height=
"410"
key=
"GridCell.Tab.0.center/67.34.2493.1406@67.34.2493.1406"
timestamp=
"1576092018571"
/>
<state
width=
"2465"
height=
"410"
key=
"GridCell.Tab.0.center/67.34.2493.1406@67.34.2493.1406"
timestamp=
"1576092018571"
/>
<state
width=
"1825"
height=
"283"
key=
"GridCell.Tab.0.left"
timestamp=
"1576165
003398
"
>
<state
width=
"1825"
height=
"283"
key=
"GridCell.Tab.0.left"
timestamp=
"1576165
782174
"
>
<screen
x=
"67"
y=
"34"
width=
"1853"
height=
"1046"
/>
<screen
x=
"67"
y=
"34"
width=
"1853"
height=
"1046"
/>
</state>
</state>
<state
width=
"1825"
height=
"283"
key=
"GridCell.Tab.0.left/67.34.1853.1046@67.34.1853.1046"
timestamp=
"1576165
003398
"
/>
<state
width=
"1825"
height=
"283"
key=
"GridCell.Tab.0.left/67.34.1853.1046@67.34.1853.1046"
timestamp=
"1576165
782174
"
/>
<state
width=
"2465"
height=
"410"
key=
"GridCell.Tab.0.left/67.34.2493.1406@67.34.2493.1406"
timestamp=
"1576092018570"
/>
<state
width=
"2465"
height=
"410"
key=
"GridCell.Tab.0.left/67.34.2493.1406@67.34.2493.1406"
timestamp=
"1576092018570"
/>
<state
width=
"1825"
height=
"283"
key=
"GridCell.Tab.0.right"
timestamp=
"1576165
003400
"
>
<state
width=
"1825"
height=
"283"
key=
"GridCell.Tab.0.right"
timestamp=
"1576165
782176
"
>
<screen
x=
"67"
y=
"34"
width=
"1853"
height=
"1046"
/>
<screen
x=
"67"
y=
"34"
width=
"1853"
height=
"1046"
/>
</state>
</state>
<state
width=
"1825"
height=
"283"
key=
"GridCell.Tab.0.right/67.34.1853.1046@67.34.1853.1046"
timestamp=
"1576165
003400
"
/>
<state
width=
"1825"
height=
"283"
key=
"GridCell.Tab.0.right/67.34.1853.1046@67.34.1853.1046"
timestamp=
"1576165
782176
"
/>
<state
width=
"2465"
height=
"410"
key=
"GridCell.Tab.0.right/67.34.2493.1406@67.34.2493.1406"
timestamp=
"1576092018571"
/>
<state
width=
"2465"
height=
"410"
key=
"GridCell.Tab.0.right/67.34.2493.1406@67.34.2493.1406"
timestamp=
"1576092018571"
/>
<state
width=
"2465"
height=
"471"
key=
"GridCell.Tab.1.bottom"
timestamp=
"1575891470098"
>
<state
width=
"2465"
height=
"471"
key=
"GridCell.Tab.1.bottom"
timestamp=
"1575891470098"
>
<screen
x=
"67"
y=
"34"
width=
"2493"
height=
"1406"
/>
<screen
x=
"67"
y=
"34"
width=
"2493"
height=
"1406"
/>
...
...
openAPI/schema/TOSCA/Credential.yml
View file @
c95c94cc
...
@@ -20,3 +20,4 @@
...
@@ -20,3 +20,4 @@
description
:
"
The
optional
user
(name
or
ID)
used
for
non-token
based
credentials."
description
:
"
The
optional
user
(name
or
ID)
used
for
non-token
based
credentials."
cloud_provider_name
:
cloud_provider_name
:
type
:
"
string"
type
:
"
string"
description
:
"
The
cloud
provider
name
e.g.
ec2."
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