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
e3ff8cf2
Commit
e3ff8cf2
authored
Jan 10, 2020
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
moved username to properties
parent
afb637cc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
33 deletions
+18
-33
nodes.yaml
TOSCA/types/nodes.yaml
+4
-4
ToscaHelper.java
.../main/java/nl/uva/sne/drip/commons/utils/ToscaHelper.java
+13
-23
DRIPService.java
...er/src/main/java/nl/uva/sne/drip/service/DRIPService.java
+0
-1
CloudStormService.java
...n/java/nl/uva/sne/drip/provisioner/CloudStormService.java
+1
-5
No files found.
TOSCA/types/nodes.yaml
View file @
e3ff8cf2
...
...
@@ -162,6 +162,10 @@ node_types:
type
:
string
required
:
true
default
:
"
Ubuntu
18.04"
user_name
:
type
:
string
required
:
true
default
:
"
vm_user"
# outputs for this node
attributes
:
private_ip
:
...
...
@@ -183,10 +187,6 @@ node_types:
type
:
string
required
:
false
description
:
the type of VM depending on the provider. e.g. XOSmall, t.medium etc. It has to match the mem_size, num_cores etc.
user_name
:
type
:
string
required
:
true
default
:
"
vm_user"
host_name
:
type
:
string
required
:
true
...
...
drip-commons/src/main/java/nl/uva/sne/drip/commons/utils/ToscaHelper.java
View file @
e3ff8cf2
...
...
@@ -70,8 +70,6 @@ public class ToscaHelper {
Configuration
.
getDefaultApiClient
().
setBasePath
(
sureToscaBasePath
);
Configuration
.
getDefaultApiClient
().
setConnectTimeout
(
1200000
);
api
=
new
DefaultApi
(
Configuration
.
getDefaultApiClient
());
System
.
err
.
println
(
"ConnectTimeout: "
+
api
.
getApiClient
().
getConnectTimeout
());
this
.
objectMapper
=
new
ObjectMapper
(
new
YAMLFactory
().
disable
(
YAMLGenerator
.
Feature
.
WRITE_DOC_START_MARKER
));
objectMapper
.
disable
(
SerializationFeature
.
WRITE_DATES_AS_TIMESTAMPS
);
objectMapper
.
setSerializationInclusion
(
JsonInclude
.
Include
.
NON_NULL
);
...
...
@@ -217,27 +215,6 @@ public class ToscaHelper {
return
toscaTemplate
;
}
// public NodeTemplateMap setProvisionerInterfaceInVMTopology(NodeTemplateMap vmTopologyMap, Map<String, Object> provisionInterface) throws ApiException {
// vmTopologyMap.getNodeTemplate().setInterfaces(provisionInterface);
// return vmTopologyMap;
// }
private
Map
<
String
,
Object
>
getBestProvisionInterfaceDefinition
(
List
<
Map
<
String
,
Object
>>
definitions
)
{
for
(
Map
<
String
,
Object
>
def
:
definitions
)
{
if
(
def
.
containsKey
(
"tosca.interfaces.ARTICONF.CloudsStorm"
))
{
return
def
;
}
}
return
null
;
}
private
Map
<
String
,
Object
>
getProvisionInterfaceInstanceDefaultValues
(
Map
<
String
,
Object
>
definition
,
String
operation
)
throws
ApiException
{
String
type
=
definition
.
keySet
().
iterator
().
next
();
String
[]
typeArray
=
type
.
split
(
"\\."
);
Map
<
String
,
Object
>
provisionInterface
=
api
.
getDefaultInterface
(
String
.
valueOf
(
id
),
type
,
typeArray
[
typeArray
.
length
-
1
],
operation
);
// provisionInterface.remove("")
return
provisionInterface
;
}
// public Map<String, Object> getProvisionInterface(Provisioner provisioner, String operation) throws ApiException {
// List<String> toscaInterfaceTypes = new ArrayList<>();
// toscaInterfaceTypes.add(provisioner.getToscaInterfaceType());
...
...
@@ -251,6 +228,19 @@ public class ToscaHelper {
}
public
NodeTemplateMap
setProvisionerInterfaceInVMTopology
(
NodeTemplateMap
vmTopologyMap
,
Map
<
String
,
Object
>
provisionerInterface
)
{
System
.
err
.
println
(
provisionerInterface
);
throw
new
UnsupportedOperationException
(
"Not supported yet."
);
//To change body of generated methods, choose Tools | Templates.
}
public
String
getVMTopologyUser
()
throws
ApiException
{
List
<
NodeTemplateMap
>
vmTopologyTemplatesMap
=
getVMTopologyTemplates
();
for
(
NodeTemplateMap
nodeTemplateMap
:
vmTopologyTemplatesMap
)
{
List
<
NodeTemplateMap
>
vmTemplatesMap
=
getTemplateVMsForVMTopology
(
nodeTemplateMap
);
for
(
NodeTemplateMap
vmMap
:
vmTemplatesMap
)
{
Map
<
String
,
Object
>
att
=
vmMap
.
getNodeTemplate
().
getAttributes
();
}
}
return
"vm_user"
;
}
}
drip-manager/src/main/java/nl/uva/sne/drip/service/DRIPService.java
View file @
e3ff8cf2
...
...
@@ -16,7 +16,6 @@ import java.util.logging.Logger;
import
nl.uva.sne.drip.api.NotFoundException
;
import
nl.uva.sne.drip.commons.utils.ToscaHelper
;
import
nl.uva.sne.drip.model.Message
;
import
nl.uva.sne.drip.model.NodeTemplate
;
import
nl.uva.sne.drip.model.NodeTemplateMap
;
import
nl.uva.sne.drip.model.tosca.Credential
;
import
nl.uva.sne.drip.model.tosca.ToscaTemplate
;
...
...
drip-provisioner/src/main/java/nl/uva/sne/drip/provisioner/CloudStormService.java
View file @
e3ff8cf2
...
...
@@ -118,7 +118,7 @@ class CloudStormService {
CloudsStormTopTopology
topTopology
=
new
CloudsStormTopTopology
();
String
publicKeyPath
=
buildSSHKeyPair
(
tempInputDirPath
);
topTopology
.
setPublicKeyPath
(
publicKeyPath
);
topTopology
.
setUserName
(
getUserName
());
topTopology
.
setUserName
(
helper
.
getVMTopologyUser
());
Map
<
String
,
Object
>
subTopologiesAndVMs
=
getCloudsStormSubTopologiesAndVMs
(
tempInputDirPath
);
List
<
CloudsStormSubTopology
>
cloudsStormSubTopology
=
(
List
<
CloudsStormSubTopology
>)
subTopologiesAndVMs
.
get
(
"cloud_storm_subtopologies"
);
...
...
@@ -141,10 +141,6 @@ class CloudStormService {
return
publicKeyPath
;
}
private
String
getUserName
()
{
return
"vm_user"
;
}
private
Map
<
String
,
Object
>
getCloudsStormSubTopologiesAndVMs
(
String
tempInputDirPath
)
throws
ApiException
,
IOException
,
Exception
{
List
<
NodeTemplateMap
>
vmTopologyTemplatesMap
=
helper
.
getVMTopologyTemplates
();
List
<
CloudsStormSubTopology
>
cloudsStormSubTopologies
=
new
ArrayList
<>();
...
...
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