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
f2c80f09
Commit
f2c80f09
authored
Mar 07, 2017
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added javadoc
parent
aae36e4a
Changes
13
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
1099 additions
and
47 deletions
+1099
-47
MOG.yaml
doc/composer_files/MOG.yaml
+0
-0
tosca_output_app_52.yaml
doc/input_tosca_files/tosca_output_app_52.yaml
+833
-0
pom.xml
drip-api/pom.xml
+19
-1
CloudConfigurationController.java
...l/uva/sne/drip/api/rest/CloudConfigurationController.java
+41
-8
DeployController.java
.../main/java/nl/uva/sne/drip/api/rest/DeployController.java
+22
-1
PlannerController.java
...main/java/nl/uva/sne/drip/api/rest/PlannerController.java
+32
-2
ProvisionController.java
...in/java/nl/uva/sne/drip/api/rest/ProvisionController.java
+23
-1
ToscaController.java
...c/main/java/nl/uva/sne/drip/api/rest/ToscaController.java
+24
-4
UserController.java
...rc/main/java/nl/uva/sne/drip/api/rest/UserController.java
+20
-4
UserPublicKeysController.java
...va/nl/uva/sne/drip/api/rest/UserPublicKeysController.java
+44
-11
UserScriptController.java
...n/java/nl/uva/sne/drip/api/rest/UserScriptController.java
+33
-11
UserScript.java
...c/main/java/nl/uva/sne/drip/commons/types/UserScript.java
+1
-1
Consumer.java
.../main/java/nl/uva/sne/drip/drip/provisioner/Consumer.java
+7
-3
No files found.
doc/MOG.yaml
→
doc/
composer_files/
MOG.yaml
View file @
f2c80f09
File moved
doc/input_tosca_files/tosca_output_app_52.yaml
0 → 100644
View file @
f2c80f09
topology_template
:
node_templates
:
"
2b0cf14b-91f4-4f83-ae02-48acd5226b68"
:
type
:
"
Switch.nodes.Compute"
properties
:
dockers
:
"
mogswitch/InputDistributor"
domain
:
"
ec2.us-east-1.amazonaws.com"
installation
:
null
name
:
"
2b0cf14b-91f4-4f83-ae02-48acd5226b68"
script
:
"
/root/SWITCH/users/fran/files/1488469056493/GUI_script.sh"
instanceId
:
"
i-0427a8aa1e93534bd"
OStype
:
"
Ubuntu
16.04"
public_address
:
"
34.207.155.161"
role
:
slave
ethernet_port
:
-
subnet_name
:
s1
name
:
p1
address
:
"
192.168.10.12"
nodetype
:
"
t2.medium"
subnet_name
:
"
d3d6b7ab-0299-40f4-bf73-4901a9bac1fd"
"
d3d6b7ab-0299-40f4-bf73-4901a9bac1fd"
:
type
:
"
Switch.nodes.VirtualNetwork"
properties
:
subnet
:
"
192.168.10.0"
netmask
:
"
255.255.255.0"
name
:
s1
"
a86289cc-12f4-4f67-9aef-76ac78f6d752"
:
artifacts
:
input_distributor_image
:
type
:
"
tosca.artifacts.Deployment.Image.Container.Docker"
file
:
"
mogswitch/InputDistributor:1.0"
repository
:
SWITCH_docker_hub
requirements
:
-
monitored_by
:
"
e6cae4b0-be6e-427f-8315-1b90325ae9bf"
-
host
:
"
2b0cf14b-91f4-4f83-ae02-48acd5226b68"
type
:
"
Switch.nodes.Application.Container.Docker.MOG_InputDistributor"
properties
:
waitingTime
:
5
multicastAddrIP
:
"
255.2.2.0"
QoS
:
response_time
:
30
out_ports
:
"
754f2eb9-61f6-467b-9c3d-d70170349d30"
:
type
:
out
port
:
"
1
"
scaling_mode
:
single
ports_mapping
:
port_mapping_0
:
host_port
:
2000
container_port
:
2000
multicastAddrPort
:
3000
videoWidth
:
176
inPort
:
2000
videoHeight
:
100
"
8496a2eb-184c-4002-b67b-c14c8b6d4716"
:
type
:
"
Switch.nodes.MonitoringAgent"
properties
:
agent_id
:
null
probes
:
CPU_Probe
:
active
:
true
metrics
:
cpuSystem_metric
:
type
:
double
name
:
cpuSystem
unit
:
"
%"
cpuIdle_metric
:
type
:
double
name
:
cpuIdle
unit
:
"
%"
cpuIOwait_metric
:
type
:
double
name
:
cpuIOwait
unit
:
"
%"
cpuTotal_metric
:
thresholds
:
threshold_1
:
operator
:
less_than
value
:
20
threshold_0
:
operator
:
greater_than
value
:
80
type
:
double
name
:
cpuTotal
unit
:
"
%"
cpuUser_metric
:
type
:
double
name
:
cpuUser
unit
:
"
%"
static
:
false
name
:
CPU
DiskStats_Probe
:
active
:
true
metrics
:
readkbps_metric
:
type
:
double
name
:
readkbps
unit
:
"
KB/s"
iotime_metric
:
thresholds
:
threshold_0
:
operator
:
greater_than
value
:
60
type
:
double
name
:
iotime
unit
:
"
%"
writekbps_metric
:
type
:
double
name
:
writekbps
unit
:
"
KB/s"
static
:
false
name
:
DiskStats
Disk_Probe
:
active
:
true
metrics
:
diskTotal_metric
:
type
:
long
name
:
diskTotal
unit
:
MB
diskFree_metric
:
thresholds
:
threshold_0
:
operator
:
greater_than
value
:
500
type
:
long
name
:
diskFree
unit
:
MB
static
:
false
name
:
Disk
AppLevel_Probe
:
active
:
true
metrics
:
input_frame_rate_metric
:
thresholds
:
threshold_0
:
operator
:
less_than
value
:
24
type
:
integer
name
:
input_frame_rate
unit
:
"
frames/s"
static
:
false
name
:
AppLevel
path
:
"
/probes/app_level.jar"
StaticInfo_Probe
:
active
:
true
metrics
:
arch_metric
:
type
:
string
name
:
arch
btime_metric
:
type
:
string
name
:
btime
cpuNum_metric
:
type
:
string
name
:
cpuNum
os_metric
:
type
:
string
name
:
os
static
:
true
name
:
StaticInfo
Network_Probe
:
active
:
true
metrics
:
netBytesIN_metric
:
type
:
double
name
:
netBytesIN
unit
:
"
bytes/s"
netBytesOUT_metric
:
type
:
double
name
:
netBytesOUT
unit
:
"
bytes/s"
netPacketsIN_metric
:
type
:
double
name
:
netPacketsIN
unit
:
"
bytes/s"
netPacketsOUT_metric
:
type
:
double
name
:
netPacketsOUT
unit
:
"
bytes/s"
static
:
false
name
:
Network
Memory_Probe
:
active
:
true
metrics
:
memFree_metric
:
type
:
integer
name
:
memFree
unit
:
KB
memUsedPercent_metric
:
thresholds
:
threshold_1
:
operator
:
less_than
value
:
20
threshold_0
:
operator
:
greater_than
value
:
80
type
:
double
name
:
memUsedPercent
unit
:
"
%"
memTotal_metric
:
type
:
integer
name
:
memTotal
unit
:
KB
memSwapFree_metric
:
type
:
integer
name
:
memSwapFree
unit
:
KB
memUsed_metric
:
type
:
integer
name
:
memUsed
unit
:
KB
memSwapTotal_metric
:
type
:
integer
name
:
memSwapTotal
unit
:
KB
memCache_metric
:
type
:
integer
name
:
memCache
unit
:
KB
static
:
false
name
:
Memory
"
550279b3-4d96-4b6f-9441-a27d151ded50"
:
artifacts
:
monitoring_server_image
:
type
:
"
tosca.artifacts.Deployment.Image.Container.Docker"
file
:
"
salmant/salman_monitoring_server_container_image"
repository
:
SWITCH_docker_hub
requirements
:
-
host
:
"
2133df17-be2f-41eb-830d-4cb5399bbc0a"
type
:
"
Switch.nodes.Application.Container.Docker.MonitoringServer"
properties
:
ports_mapping
:
port_mapping_1
:
host_port
:
4242
container_port
:
4242
port_mapping_0
:
host_port
:
8080
container_port
:
8080
port_mapping_3
:
host_port
:
7199
container_port
:
7199
port_mapping_2
:
host_port
:
4245
container_port
:
4245
port_mapping_5
:
host_port
:
7001
container_port
:
7001
port_mapping_4
:
host_port
:
7000
container_port
:
7000
port_mapping_7
:
host_port
:
9042
container_port
:
9042
port_mapping_6
:
host_port
:
9160
container_port
:
9160
port_mapping_9
:
host_port
:
61621
container_port
:
61621
port_mapping_8
:
host_port
:
8012
container_port
:
8012
scaling_mode
:
single
QoS
:
response_time
:
50
"
119e5daa-1548-4842-a042-b18947bc879c"
:
type
:
"
Switch.nodes.Compute"
properties
:
dockers
:
"
mogswitch/ProxyTranscoder"
domain
:
"
ec2.us-east-1.amazonaws.com"
installation
:
null
name
:
"
119e5daa-1548-4842-a042-b18947bc879c"
script
:
"
/root/SWITCH/users/fran/files/1488469056493/GUI_script.sh"
instanceId
:
"
i-01207f6fc7bbbfa42"
OStype
:
"
Ubuntu
16.04"
public_address
:
"
34.207.64.189"
role
:
master
ethernet_port
:
-
subnet_name
:
s1
name
:
p1
address
:
"
192.168.10.10"
nodetype
:
"
t2.medium"
subnet_name
:
"
d3d6b7ab-0299-40f4-bf73-4901a9bac1fd"
"
469c812f-32ab-4159-be93-aab3957d6e19"
:
artifacts
:
proxy_transcoder_image
:
type
:
"
tosca.artifacts.Deployment.Image.Container.Docker"
file
:
"
mogswitch/ProxyTranscoder:1.0"
repository
:
SWITCH_docker_hub
requirements
:
-
monitored_by
:
"
8496a2eb-184c-4002-b67b-c14c8b6d4716"
-
host
:
"
119e5daa-1548-4842-a042-b18947bc879c"
type
:
"
Switch.nodes.Application.Container.Docker.MOG_ProxyTranscoder"
properties
:
multicastAddrPort
:
3000
QoS
:
response_time
:
35
scaling_mode
:
single
in_ports
:
"
7c1e270b-e888-420b-9c31-ba9947ef07bf"
:
type
:
in
port
:
"
1
"
multicastAddrIP
:
"
255.2.2.0"
ports_mapping
:
port_mapping_0
:
host_port
:
80
container_port
:
8081
videoWidth
:
170
videoHeight
:
176
"
e6cae4b0-be6e-427f-8315-1b90325ae9bf"
:
type
:
"
Switch.nodes.MonitoringAgent"
properties
:
agent_id
:
null
probes
:
CPU_Probe
:
active
:
true
metrics
:
cpuSystem_metric
:
type
:
double
name
:
cpuSystem
unit
:
"
%"
cpuIdle_metric
:
type
:
double
name
:
cpuIdle
unit
:
"
%"
cpuIOwait_metric
:
type
:
double
name
:
cpuIOwait
unit
:
"
%"
cpuTotal_metric
:
thresholds
:
threshold_1
:
operator
:
less_than
value
:
20
threshold_0
:
operator
:
greater_than
value
:
80
type
:
double
name
:
cpuTotal
unit
:
"
%"
cpuUser_metric
:
type
:
double
name
:
cpuUser
unit
:
"
%"
static
:
false
name
:
CPU
DiskStats_Probe
:
active
:
true
metrics
:
readkbps_metric
:
type
:
double
name
:
readkbps
unit
:
"
KB/s"
iotime_metric
:
thresholds
:
threshold_0
:
operator
:
greater_than
value
:
60
type
:
double
name
:
iotime
unit
:
"
%"
writekbps_metric
:
type
:
double
name
:
writekbps
unit
:
"
KB/s"
static
:
false
name
:
DiskStats
Disk_Probe
:
active
:
true
metrics
:
diskTotal_metric
:
type
:
long
name
:
diskTotal
unit
:
MB
diskFree_metric
:
thresholds
:
threshold_0
:
operator
:
greater_than
value
:
500
type
:
long
name
:
diskFree
unit
:
MB
static
:
false
name
:
Disk
AppLevel_Probe
:
active
:
true
metrics
:
output_frame_rate_metric
:
thresholds
:
threshold_0
:
operator
:
less_than
value
:
24
type
:
integer
name
:
output_frame_rate
unit
:
"
frames/s"
static
:
false
name
:
AppLevel
path
:
"
/probes/app_level.jar"
StaticInfo_Probe
:
active
:
true
metrics
:
arch_metric
:
type
:
string
name
:
arch
btime_metric
:
type
:
string
name
:
btime
cpuNum_metric
:
type
:
string
name
:
cpuNum
os_metric
:
type
:
string
name
:
os
static
:
true
name
:
StaticInfo
Network_Probe
:
active
:
true
metrics
:
netBytesIN_metric
:
type
:
double
name
:
netBytesIN
unit
:
"
bytes/s"
netBytesOUT_metric
:
type
:
double
name
:
netBytesOUT
unit
:
"
bytes/s"
netPacketsIN_metric
:
type
:
double
name
:
netPacketsIN
unit
:
"
bytes/s"
netPacketsOUT_metric
:
type
:
double
name
:
netPacketsOUT
unit
:
"
bytes/s"
static
:
false
name
:
Network
Memory_Probe
:
active
:
true
metrics
:
memFree_metric
:
type
:
integer
name
:
memFree
unit
:
KB
memUsedPercent_metric
:
thresholds
:
threshold_1
:
operator
:
less_than
value
:
20
threshold_0
:
operator
:
greater_than
value
:
80
type
:
double
name
:
memUsedPercent
unit
:
"
%"
memTotal_metric
:
type
:
integer
name
:
memTotal
unit
:
KB
memSwapFree_metric
:
type
:
integer
name
:
memSwapFree
unit
:
KB
memUsed_metric
:
type
:
integer
name
:
memUsed
unit
:
KB
memSwapTotal_metric
:
type
:
integer
name
:
memSwapTotal
unit
:
KB
memCache_metric
:
type
:
integer
name
:
memCache
unit
:
KB
static
:
false
name
:
Memory
"
8d60f295-c18a-4f30-b3cd-1699226e5827"
:
type
:
"
Switch.nodes.Application.Connection"
properties
:
latency
:
500
QoS
:
response_time
:
50
target
:
netmask
:
"
255.255.255.0"
component_name
:
"
469c812f-32ab-4159-be93-aab3957d6e19"
port_name
:
"
7c1e270b-e888-420b-9c31-ba9947ef07bf"
address
:
"
192.168.10.12"
source
:
netmask
:
"
255.255.255.0"
component_name
:
"
a86289cc-12f4-4f67-9aef-76ac78f6d752"
port_name
:
"
754f2eb9-61f6-467b-9c3d-d70170349d30"
address
:
"
192.168.10.11"
bandwidth
:
1000000
"
2133df17-be2f-41eb-830d-4cb5399bbc0a"
:
type
:
"
Switch.nodes.Compute"
properties
:
dockers
:
"
salmant/salman_monitoring_server_container_image"
domain
:
"
ec2.us-east-1.amazonaws.com"
installation
:
null
name
:
"
2133df17-be2f-41eb-830d-4cb5399bbc0a"
script
:
"
/root/SWITCH/users/fran/files/1488469056493/GUI_script.sh"
instanceId
:
"
i-0b99400636083370c"
OStype
:
"
Ubuntu
16.04"
public_address
:
"
54.84.232.172"
role
:
slave
ethernet_port
:
-
subnet_name
:
s1
name
:
p1
address
:
"
192.168.10.11"
nodetype
:
"
t2.medium"
subnet_name
:
"
d3d6b7ab-0299-40f4-bf73-4901a9bac1fd"
artifact_types
:
"
tosca.artifacts.Deployment.Image.Container.Docker"
:
derived_from
:
"
tosca.artifacts.Deployment.Image"
description
:
adadad
node_types
:
"
Switch.nodes.Component"
:
derived_from
:
"
tosca.nodes.Root"
"
Switch.nodes.Network"
:
derived_from
:
"
tosca.nodes.network.Network"
"
Switch.nodes.Constraint"
:
properties
:
QoS
:
type
:
"
Switch.datatypes.QoS.AppComponent"
derived_from
:
"
tosca.nodes.Root"
"
Switch.nodes.Compute"
:
properties
:
dockers
:
required
:
false
type
:
string
domain
:
type
:
string
installation
:
type
:
string
name
:
required
:
false
type
:
string
script
:
type
:
string
public_address
:
type
:
string
instanceId
:
required
:
false
type
:
string
ethernet_port
:
entry_schema
:
type
:
"
Switch.datatypes.ethernet_port"
required
:
false
type
:
list
role
:
type
:
string
OStype
:
type
:
string
nodetype
:
type
:
string
subnet_name
:
required
:
false
type
:
string
derived_from
:
"
tosca.nodes.Compute"
"
Switch.nodes.VirtualNetwork"
:
properties
:
subnet
:
default
:
"
192.168.10.0"
type
:
string
netmask
:
default
:
"
255.255.255.0"
type
:
string
name
:
type
:
string
derived_from
:
"
tosca.nodes.Root"
"
Switch.nodes.Application.Container.Docker.MOG_ProxyTranscoder"
:
artifacts
:
proxy_transcoder_image
:
type
:
"
tosca.artifacts.Deployment.Image.Container.Docker"
repository
:
SWITCH_docker_hub
file
:
"
mogswitch/ProxyTranscoder:1.0"
properties
:
multicastAddrPort
:
default
:
3000
type
:
integer
multicastAddrIP
:
default
:
"
255.2.2.0"
type
:
string
videoWidth
:
default
:
176
type
:
integer
videoHeight
:
default
:
100
type
:
integer
derived_from
:
"
Switch.nodes.Application.Container.Docker"
"
Switch.nodes.AdaptationProfile"
:
derived_from
:
"
tosca.nodes.Root"
"
Switch.nodes.MonitoringAgent"
:
requirements
:
-
monitor_server_endpoint
:
node
:
"
Switch.nodes.Application.Container.Docker.MonitoringServer"
capability
:
"
tosca.capabilities.Node"
relationship
:
"
tosca.relationships.DependsOn"
properties
:
agent_id
:
default
:
null
type
:
string
probes
:
entry_schema
:
type
:
"
Switch.datatypes.monitoring.probe"
type
:
map
derived_from
:
"
tosca.nodes.Root"
"
Switch.nodes.Requirement"
:
properties
:
host
:
type
:
"
Switch.datatypes.hw.host"
os
:
type
:
"
Switch.datatypes.hw.os"
derived_from
:
"
tosca.nodes.Root"
"
Switch.nodes.EventListener"
:
derived_from
:
"
tosca.nodes.Root"
"
Switch.nodes.Application.Connection"
:
properties
:
source
:
type
:
"
Switch.datatypes.Application.Connection.EndPoint"
bandwidth
:
type
:
integer
multicast
:
required
:
false
type
:
"
Switch.datatypes.Network.Multicast"
jitter
:
required
:
false
type
:
integer
target
:
type
:
"
Switch.datatypes.Application.Connection.EndPoint"
latency
:
type
:
integer
QoS
:
type
:
"
Switch.datatypes.QoS.AppComponent"
derived_from
:
"
tosca.nodes.Root"
"
Switch.nodes.Application.Container.Docker"
:
requirements
:
-
monitored_by
:
node
:
"
Switch.nodes.MonitoringAgent"
capability
:
"
tosca.capabilities.Node"
relationship
:
"
tosca.relationships.DependsOn"
properties
:
in_ports
:
entry_schema
:
type
:
"
Switch.datatypes.port"
required
:
false
type
:
map
out_ports
:
entry_schema
:
type
:
"
Switch.datatypes.port"
required
:
false
type
:
map
ports_mapping
:
entry_schema
:
type
:
"
Switch.datatypes.port_mapping"
type
:
map
scaling_mode
:
required
:
false
type
:
string
QoS
:
required
:
false
type
:
"
Switch.datatypes.QoS.AppComponent"
derived_from
:
"
tosca.nodes.Container.Application"
"
Switch.nodes.ExternalComponent"
:
derived_from
:
"
tosca.nodes.Root"
"
Switch.nodes.Application.Container.Docker.MOG_InputDistributor"
:
artifacts
:
input_distributor_image
:
type
:
"
tosca.artifacts.Deployment.Image.Container.Docker"
repository
:
SWITCH_docker_hub
file
:
"
mogswitch/InputDistributor:1.0"
requirements
:
-
monitored_by
:
node
:
"
Switch.nodes.MonitoringAgent"
capability
:
"
tosca.capabilities.Node"
relationship
:
"
tosca.relationships.DependsOn"
properties
:
waitingTime
:
default
:
5
type
:
integer
multicastAddrIP
:
default
:
"
255.2.2.0"
type
:
string
multicastAddrPort
:
default
:
3000
type
:
integer
videoWidth
:
default
:
176
type
:
integer
inPort
:
default
:
2000
type
:
integer
videoHeight
:
default
:
100
type
:
integer
derived_from
:
"
Switch.nodes.Application.Container.Docker"
"
Switch.nodes.Application.Container.Docker.MonitoringServer"
:
artifacts
:
monitoring_server_image
:
type
:
"
tosca.artifacts.Deployment.Image.Container.Docker"
repository
:
SWITCH_docker_hub
file
:
"
salmant/salman_monitoring_server_container_image"
properties
:
ports_mapping
:
entry_schema
:
type
:
"
Switch.datatypes.port_mapping"
type
:
map
derived_from
:
"
Switch.nodes.Application.Container.Docker"
"
Switch.nodes.MessagePasser"
:
derived_from
:
"
tosca.nodes.Root"
repositories
:
SWITCH_docker_hub
:
url
:
"
https://github.com/switch-project"
credential
:
token_type
:
"
X-Auth-Token"
token
:
604bbe45ac7143a79e14f3158df67091
protocol
:
xauth
description
:
"
switch
repository
in
GitHub"
data_types
:
"
Switch.datatypes.monitoring.metric.threshold"
:
properties
:
operator
:
type
:
string
value
:
type
:
integer
derived_from
:
"
tosca.datatypes.Root"
"
Switch.datatypes.port"
:
properties
:
type
:
type
:
string
port
:
type
:
string
derived_from
:
"
tosca.datatypes.Root"
"
Switch.datatypes.Application.Connection.EndPoint"
:
properties
:
netmask
:
type
:
string
component_name
:
type
:
string
port_name
:
type
:
string
address
:
type
:
string
derived_from
:
"
tosca.datatypes.Root"
"
Switch.datatypes.monitoring.probe"
:
properties
:
active
:
type
:
boolean
path
:
required
:
false
type
:
string
static
:
type
:
boolean
name
:
type
:
string
metrics
:
entry_schema
:
type
:
"
Switch.datatypes.monitoring.metric"
type
:
map
derived_from
:
"
tosca.datatypes.Root"
"
Switch.datatypes.hw.host"
:
properties
:
cpu_frequency
:
type
:
float
mem_size
:
type
:
integer
num_cpus
:
type
:
integer
disk_size
:
type
:
integer
derived_from
:
"
tosca.datatypes.Root"
"
Switch.datatypes.ethernet_port"
:
properties
:
subnet_name
:
type
:
string
name
:
type
:
string
address
:
type
:
string
derived_from
:
"
tosca.datatypes.Root"
"
Switch.datatypes.hw.os"
:
properties
:
os_version
:
type
:
string
distribution
:
type
:
string
type
:
type
:
string
architecture
:
type
:
string
derived_from
:
"
tosca.datatypes.Root"
"
Switch.datatypes.QoS.AppComponent"
:
properties
:
response_time
:
type
:
integer
derived_from
:
"
tosca.datatypes.Root"
"
Switch.datatypes.Application.Connection.Multicast"
:
properties
:
multicastAddrPort
:
type
:
string
multicastAddrIP
:
type
:
string
derived_from
:
"
tosca.datatypes.Root"
"
Switch.datatypes.Network.Multicast"
:
properties
:
multicastAddrPort
:
type
:
string
multicastAddrIP
:
type
:
string
derived_from
:
"
tosca.datatypes.Root"
"
Switch.datatypes.port_mapping"
:
properties
:
host_port
:
type
:
integer
container_port
:
type
:
integer
derived_from
:
"
tosca.datatypes.Root"
"
Switch.datatypes.monitoring.metric"
:
properties
:
thresholds
:
entry_schema
:
type
:
"
Switch.datatypes.monitoring.metric.threshold"
required
:
false
type
:
map
type
:
type
:
string
name
:
type
:
string
unit
:
required
:
false
type
:
string
derived_from
:
"
tosca.datatypes.Root"
tosca_definitions_version
:
tosca_simple_yaml_1_0
\ No newline at end of file
drip-api/pom.xml
View file @
f2c80f09
...
...
@@ -175,6 +175,24 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>
com.webcohesion.enunciate
</groupId>
<artifactId>
enunciate-maven-plugin
</artifactId>
<version>
2.8.0
</version>
<executions>
<execution>
<goals>
<goal>
docs
</goal>
</goals>
<configuration>
<!-- the directory where to put the docs -->
<docsDir>
${project.build.directory}/docs
</docsDir>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/rest/CloudConfigurationController.java
View file @
f2c80f09
...
...
@@ -44,6 +44,10 @@ import org.springframework.web.bind.annotation.RequestParam;
import
org.springframework.web.multipart.MultipartFile
;
/**
*
* This controller is responsible for handling CloudCredentials.
* CloudCredentials are a represntation of the credentials that are used by the
* provisoner to request for resources (VMs)
*
* @author S. Koulouzis
*/
...
...
@@ -55,22 +59,34 @@ public class CloudConfigurationController {
@Autowired
private
CloudCredentialsDao
cloudCredentialsDao
;
// curl -H "Content-Type: application/json" -X POST -d '{"key":"my_secret_password","keyIdAlias":"geni","logineKeys":[{"attributes":null,"key":"-----BEGINRSAPUBLICKEY-----\nMIIBCgKCAQEA+xGZ/wcz9ugFpP07Nspo6U17l0YhFiFpxxU4pTk3Lifz9R3zsIsu\nERwta7+fWIfxOo208ett/jhskiVodSEt3QBGh4XBipyWopKwZ93HHaDVZAALi/2A\n+xTBtWdEo7XGUujKDvC2/aZKukfjpOiUI8AhLAfjmlcD/UZ1QPh0mHsglRNCmpCw\nmwSXA9VNmhz+PiB+Dml4WWnKW/VHo2ujTXxq7+efMU4H2fny3Se3KYOsFPFGZ1TN\nQSYlFuShWrHPtiLmUdPoP6CV2mML1tk+l7DIIqXrQhLUKDACeM5roMx0kLhUWB8P\n+0uj1CNlNN4JRZlC7xFfqiMbFRU9Z4N6YwIDAQAB\n-----ENDRSAPUBLICKEY-----","type":"PUBLIC"},{"attributes":null,"key":"-----BEGINRSAPRIVATEKEY-----\nMIICXAIBAAKBgQCqGKukO1De7zhZj6+H0qtjTkVxwTCpvKe4eCZ0FPqri0cb2JZfXJ/DgYSF6vUp\nwmJG8wVQZKjeGcjDOL5UlsuusFncCzWBQ7RKNUSesmQRMSGkVb1/3j+skZ6UtW+5u09lHNsj6tQ5\n1s1SPrCBkedbNf0Tp0GbMJDyR4e9T04ZZwIDAQABAoGAFijko56+qGyN8M0RVyaRAXz++xTqHBLh\n3tx4VgMtrQ+WEgCjhoTwo23KMBAuJGSYnRmoBZM3lMfTKevIkAidPExvYCdm5dYq3XToLkkLv5L2\npIIVOFMDG+KESnAFV7l2c+cnzRMW0+b6f8mR1CJzZuxVLL6Q02fvLi55/mbSYxECQQDeAw6fiIQX\nGukBI4eMZZt4nscy2o12KyYner3VpoeE+Np2q+Z3pvAMd/aNzQ/W9WaI+NRfcxUJrmfPwIGm63il\nAkEAxCL5HQb2bQr4ByorcMWm/hEP2MZzROV73yF41hPsRC9m66KrheO9HPTJuo3/9s5p+sqGxOlF\nL0NDt4SkosjgGwJAFklyR1uZ/wPJjj611cdBcztlPdqoxssQGnh85BzCj/u3WqBpE2vjvyyvyI5k\nX6zk7S0ljKtt2jny2+00VsBerQJBAJGC1Mg5Oydo5NwD6BiROrPxGo2bpTbu/fhrT8ebHkTz2epl\nU9VQQSQzY1oZMVX8i1m5WUTLPz2yLJIBQVdXqhMCQBGoiuSoSjafUhV7i1cEGpb88h5NBYZzWXGZ\n37sJ5QsW+sJyoNde3xH8vdXhzU7eT82D6X/scw9RZz+/6rCJ4p0=\n-----ENDRSAPRIVATEKEY-----","type":"PRIVATE"}],"cloudProviderName":"exogeni"}' http://localhost:8080/drip-api/configuration
// curl -H "Content-Type: application/json" -X POST -d '{"key":"AKISAKISAKIS","keyIdAlias":"6J76J76J76J76J76J76J7","logineKys":[{"attributes":{"domain_name":"California"},"type":"PUBLIC","key":"-----BEGINRSAPRIVATEKEY-----\nMIIEpQIBAAKCAQEA3Tz2mr7SZiAMfQyuvBjM9Oi..Z1BjP5CE/Wm/Rr500P\nRK+Lh9x5eJPo5CAZ3/ANBE0sTK0ZsDGMak2m1g7..3VHqIxFTz0Ta1d+NAj\nwnLe4nOb7/eEJbDPkk05ShhBrJGBKKxb8n104o/..PdzbFMIyNjJzBM2o5y\n5A13wiLitEO7nco2WfyYkQzaxCw0AwzlkVHiIyC..71pSzkv6sv+4IDMbT/\nXpCo8L6wTarzrywnQsh+etLD6FtTjYbbrvZ8RQM..Hg2qxraAV++HNBYmNW\ns0duEdjUbJK+ZarypXI9TtnS4o1Ckj7POfljiQI..IBAFyidxtqRQyv5KrD\nkbJ+q+rsJxQlaipn2M4lGuQJEfIxELFDyd3XpxP..Un/82NZNXlPmRIopXs\n2T91jiLZEUKQw+n73j26adTbteuEaPGSrTZxBLR..yssO0wWomUyILqVeti\n6AkL0NJAuKcucHGqWVgUIa4g1haE0ilcm6dWUDo..fd+PpzdCJf1s4NdUWK\nYV2GJcutGQb+jqT5DTUqAgST7N8M28rwjK6nVMI..BUpP0xpPnuYDyPOw6x\n4hBt8DZQYyduzIXBXRBKNiNdv8fum68/5klHxp6..4HRkMUL958UVeljUsT\nBFQlO9UCgYEA/VqzXVzlz8K36VSTMPEhB5zBATV..PRiXtYK1YpYV4/jSUj\nvvT4hP8uoYNC+BlEMi98LtnxZIh0V4rqHDsScAq..VyeSLH0loKMZgpwFEm\nbEIDnEOD0nKrfT/9K9sPYgvB43wsLEtUujaYw3W..Liy0WKmB8CgYEA34xn\n1QlOOhHBn9Z8qYjoDYhvcj+a89tD9eMPhesfQFw..rsfGcXIonFmWdVygbe\n6Doihc+GIYIq/QP4jgMksE1ADvczJSke92ZfE2i..fitBpQERNJO0BlabfP\nALs5NssKNmLkWS2U2BHCbv4DzDXwiQB37KPOL1c..kBHfF2/htIs20d1UVL\n+PK+aXKwguI6bxLGZ3of0UH+mGsSl0mkp7kYZCm..OTQtfeRqP8rDSC7DgA\nkHc5ajYqh04AzNFaxjRo+M3IGICUaOdKnXd0Fda..QwfoaX4QlRTgLqb7AN\nZTzM9WbmnYoXrx17kZlT3lsCgYEAm757XI3WJVj..WoLj1+v48WyoxZpcai\nuv9bT4Cj+lXRS+gdKHK+SH7J3x2CRHVS+WH/SVC..DxuybvebDoT0TkKiCj\nBWQaGzCaJqZa+POHK0klvS+9ln0/6k539p95tfX..X4TCzbVG6+gJiX0ysz\nYfehn5MCgYEAkMiKuWHCsVyCab3RUf6XA9gd3qY..fCTIGtS1tR5PgFIV+G\nengiVoWc/hkj8SBHZz1n1xLN7KDf8ySU06MDggB..hJ+gXJKy+gf3mF5Kmj\nDtkpjGHQzPF6vOe907y5NQLvVFGXUq/FIJZxB8k..fJdHEm2M4=\n-----ENDRSAPRIVATEKEY-----"},{"attributes":{"domain_name":"Virginia"},"type":"PUBLIC","key":"-----BEGINRSAPRIVATEKEY-----\nMIICXAIBAAKBgQCqGKukO1De7zhZj6+H0qtjTkVxwTCpvKe4eCZ0FPqri0cb2JZfXJ/DgYSF6vUp\nwmJG8wVQZKjeGcjDOL5UlsuusFncCzWBQ7RKNUSesmQRMSGkVb1/3j+skZ6UtW+5u09lHNsj6tQ5\n1s1SPrCBkedbNf0Tp0GbMJDyR4e9T04ZZwIDAQABAoGAFijko56+qGyN8M0RVyaRAXz++xTqHBLh\n3tx4VgMtrQ+WEgCjhoTwo23KMBAuJGSYnRmoBZM3lMfTKevIkAidPExvYCdm5dYq3XToLkkLv5L2\npIIVOFMDG+KESnAFV7l2c+cnzRMW0+b6f8mR1CJzZuxVLL6Q02fvLi55/mbSYxECQQDeAw6fiIQX\nGukBI4eMZZt4nscy2o12KyYner3VpoeE+Np2q+Z3pvAMd/aNzQ/W9WaI+NRfcxUJrmfPwIGm63il\nAkEAxCL5HQb2bQr4ByorcMWm/hEP2MZzROV73yF41hPsRC9m66KrheO9HPTJuo3/9s5p+sqGxOlF\nL0NDt4SkosjgGwJAFklyR1uZ/wPJjj611cdBcztlPdqoxssQGnh85BzCj/u3WqBpE2vjvyyvyI5k\nX6zk7S0ljKtt2jny2+00VsBerQJBAJGC1Mg5Oydo5NwD6BiROrPxGo2bpTbu/fhrT8ebHkTz2epl\nU9VQQSQzY1oZMVX8i1m5WUTLPz2yLJIBQVdXqhMCQBGoiuSoSjafUhV7i1cEGpb88h5NBYZzWXGZ\n37sJ5QsW+sJyoNde3xH8vdXhzU7eT82D6X/scw9RZz+/6rCJ4p0=\n-----ENDRSAPRIVATEKEY-----"}],"cloudProviderName":"ec2"}'
/**
* Post the cloud credentials.
*
* @param cloudCredentials
* @return the CloudCredentials id
*/
@RequestMapping
(
method
=
RequestMethod
.
POST
)
@RolesAllowed
({
UserService
.
USER
,
UserService
.
ADMIN
})
public
@ResponseBody
String
postConf
(
@RequestBody
CloudCredentials
c
c
)
{
if
(
c
c
.
getKey
()
==
null
)
{
String
postConf
(
@RequestBody
CloudCredentials
c
loudCredentials
)
{
if
(
c
loudCredentials
.
getKey
()
==
null
)
{
throw
new
NullKeyException
();
}
if
(
c
c
.
getKeyIdAlias
()
==
null
)
{
if
(
c
loudCredentials
.
getKeyIdAlias
()
==
null
)
{
throw
new
NullKeyIDException
();
}
cloudCredentialsDao
.
save
(
c
c
);
return
c
c
.
getId
();
cloudCredentialsDao
.
save
(
c
loudCredentials
);
return
c
loudCredentials
.
getId
();
}
/**
* Upload the login keys for a cloud provider. The cloud credentials have to
* be created
*
* @param file
* @param id
* @return the CloudCredentials id
*/
@RequestMapping
(
value
=
"/upload/{id}"
,
method
=
RequestMethod
.
POST
)
@RolesAllowed
({
UserService
.
USER
,
UserService
.
ADMIN
})
public
@ResponseBody
...
...
@@ -106,6 +122,12 @@ public class CloudConfigurationController {
return
null
;
}
/**
* Get the cloud credentials
*
* @param id the id of the cloud credentials
* @return the cloud credentials
*/
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
@RolesAllowed
({
UserService
.
USER
,
UserService
.
ADMIN
})
public
@ResponseBody
...
...
@@ -117,6 +139,12 @@ public class CloudConfigurationController {
return
cc
;
}
/**
* Delete the cloud credentials
*
* @param id the id of the cloud credentials
* @return the id of the cloud credentials
*/
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@RolesAllowed
({
UserService
.
USER
,
UserService
.
ADMIN
})
public
@ResponseBody
...
...
@@ -125,7 +153,12 @@ public class CloudConfigurationController {
return
"Deleted :"
+
id
;
}
@RequestMapping
(
value
=
"/ids"
)
/**
* Gets all the IDs of the stored cloud credentials
*
* @return a list of stored IDs
*/
@RequestMapping
(
value
=
"/ids"
,
method
=
RequestMethod
.
GET
)
@RolesAllowed
({
UserService
.
USER
,
UserService
.
ADMIN
})
public
@ResponseBody
List
<
String
>
getIds
()
{
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/rest/DeployController.java
View file @
f2c80f09
...
...
@@ -53,6 +53,7 @@ import org.springframework.web.bind.annotation.PathVariable;
import
org.springframework.web.bind.annotation.RequestParam
;
/**
* This controller is responsible for deploying a cluster on provisoned resources.
*
* @author S. Koulouzis
*/
...
...
@@ -73,6 +74,12 @@ public class DeployController {
@Autowired
private
ClusterCredentialService
clusterCredentialService
;
/**
* Deploys a cluster on a provisioned resources.
* @param provisionID
* @param clusterType
* @return the id of the cluster credentials
*/
@RequestMapping
(
value
=
"/deploy/{id}/"
,
method
=
RequestMethod
.
GET
,
params
=
{
"cluster"
})
@RolesAllowed
({
UserService
.
USER
,
UserService
.
ADMIN
})
public
@ResponseBody
...
...
@@ -101,6 +108,11 @@ public class DeployController {
return
null
;
}
/**
* Gets the cluster credentials.
* @param id
* @return the cluster credentials
*/
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
@RolesAllowed
({
UserService
.
USER
,
UserService
.
ADMIN
})
public
@ResponseBody
...
...
@@ -112,6 +124,10 @@ public class DeployController {
return
clusterC
;
}
/**
* Gets the IDs of all the stored cluster credentials
* @return a list of all the IDs
*/
@RequestMapping
(
value
=
"/ids"
,
method
=
RequestMethod
.
GET
)
@RolesAllowed
({
UserService
.
USER
,
UserService
.
ADMIN
})
public
@ResponseBody
...
...
@@ -124,6 +140,11 @@ public class DeployController {
return
ids
;
}
/**
* Deletes a cluster credential
* @param id. The id of the cluster credential
* @return the id f the deleted cluster credential
*/
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@RolesAllowed
({
UserService
.
USER
,
UserService
.
ADMIN
})
public
@ResponseBody
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/rest/PlannerController.java
View file @
f2c80f09
...
...
@@ -37,6 +37,8 @@ import nl.uva.sne.drip.commons.types.Plan;
import
org.springframework.web.bind.annotation.RequestParam
;
/**
* This controller is responsible for planing the type of resources to be provisopned
* based on a TOSCA description.
*
* @author S. Koulouzis
*/
...
...
@@ -50,6 +52,12 @@ public class PlannerController {
@Autowired
private
PlannerService
plannerService
;
/**
* Plans resources (number, size of VMs etc).
* @param toscaId. The id of the TOSCA description
* @return the id of the created plan
*/
@RequestMapping
(
value
=
"/plan/{tosca_id}"
,
method
=
RequestMethod
.
GET
)
@RolesAllowed
({
UserService
.
USER
,
UserService
.
ADMIN
})
public
@ResponseBody
...
...
@@ -68,6 +76,12 @@ public class PlannerController {
return
null
;
}
/**
* Gets a plan
* @param id. The id iof the plan
* @param format. The format (yml,json)
* @return the plan
*/
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
,
params
=
{
"format"
})
@RolesAllowed
({
UserService
.
USER
,
UserService
.
ADMIN
})
public
@ResponseBody
...
...
@@ -80,6 +94,12 @@ public class PlannerController {
return
null
;
}
/**
* Gets the ID of the TOSCA description that was used to generate the plan.
* The plan is represented by its ID
* @param id. The plan id
* @return the TOSCA description ID
*/
@RequestMapping
(
value
=
"/tosca/{id}"
,
method
=
RequestMethod
.
GET
)
@RolesAllowed
({
UserService
.
USER
,
UserService
.
ADMIN
})
public
@ResponseBody
...
...
@@ -87,6 +107,11 @@ public class PlannerController {
return
plannerService
.
getToscaID
(
id
);
}
/**
* Deletes the plan.
* @param id . The ID of the plan
* @return The ID of the deleted plan
*/
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@RolesAllowed
({
UserService
.
USER
,
UserService
.
ADMIN
})
public
@ResponseBody
...
...
@@ -95,7 +120,12 @@ public class PlannerController {
return
"Deleted : "
+
id
;
}
@RequestMapping
(
value
=
"/ids"
)
/**
* Gets the IDs of all the stored plans
* @return a list of IDs
*/
@RequestMapping
(
value
=
"/ids"
,
method
=
RequestMethod
.
GET
)
@RolesAllowed
({
UserService
.
USER
,
UserService
.
ADMIN
})
public
@ResponseBody
List
<
String
>
getIds
()
{
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/rest/ProvisionController.java
View file @
f2c80f09
...
...
@@ -67,7 +67,8 @@ import org.springframework.web.bind.annotation.PathVariable;
import
org.springframework.web.bind.annotation.RequestBody
;
/**
*
* This controller is responsible for obtaining resources from cloud providers
* based the plan generated by the planner
* @author S. Koulouzis
*/
@RestController
...
...
@@ -93,6 +94,11 @@ public class ProvisionController {
@Autowired
private
SimplePlannerService
planService
;
/**
* Gets the ProvisionInfo
* @param id. The id of the ProvisionInfo
* @return the requested ProvisionInfo
*/
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
@RolesAllowed
({
UserService
.
USER
,
UserService
.
ADMIN
})
public
@ResponseBody
...
...
@@ -100,6 +106,11 @@ public class ProvisionController {
return
provisionService
.
getDao
().
findOne
(
id
);
}
/**
* Deletes the ProvisionInfo
* @param id. The ID of the ProvisionInfo to be deleted
* @return the ID of the deleted ProvisionInfo
*/
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@RolesAllowed
({
UserService
.
USER
,
UserService
.
ADMIN
})
public
@ResponseBody
...
...
@@ -112,6 +123,11 @@ public class ProvisionController {
throw
new
NotFoundException
();
}
/**
* Gets the IDs of all the stored ProvisionInfo
* @return a list of IDs
*/
@RequestMapping
(
value
=
"/ids"
,
method
=
RequestMethod
.
GET
)
@RolesAllowed
({
UserService
.
USER
,
UserService
.
ADMIN
})
public
@ResponseBody
...
...
@@ -124,6 +140,12 @@ public class ProvisionController {
return
ids
;
}
/**
* Provison the resources specified by a plan.
* @param req. The ProvisionInfo. This is a container the plan ID,
* cloud credent ID, etc.
* @return The ID of the provisioned ProvisionInfo
*/
@RequestMapping
(
value
=
"/provision"
,
method
=
RequestMethod
.
POST
)
@RolesAllowed
({
UserService
.
USER
,
UserService
.
ADMIN
})
public
@ResponseBody
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/rest/ToscaController.java
View file @
f2c80f09
...
...
@@ -37,7 +37,8 @@ import nl.uva.sne.drip.api.service.ToscaService;
import
nl.uva.sne.drip.api.service.UserService
;
/**
*
* This controller is responsible for storing TOSCA descriptions that can be used
* by the planner.
* @author S. Koulouzis
*/
@RestController
...
...
@@ -48,7 +49,11 @@ public class ToscaController {
@Autowired
private
ToscaService
toscaService
;
// curl -X POST -F "file=@DRIP/input.yaml" localhost:8080/drip-api/upload
/**
* Uploads and stores a TOSCA description file
* @param file. The TOSCA description file
* @return the ID of the TOSCA description
*/
@RequestMapping
(
value
=
"/upload"
,
method
=
RequestMethod
.
POST
)
@RolesAllowed
({
UserService
.
USER
,
UserService
.
ADMIN
})
public
@ResponseBody
...
...
@@ -64,7 +69,13 @@ public class ToscaController {
return
null
;
}
// curl http://localhost:8080/drip-api/tosca/589e1160d9925f9dc127e882/?fromat=yaml
/**
* Gets the TOSCA description.
* @param id the ID TOSCA description.
* @param format. the format to display the TOSCA description.
* @return the TOSCA description.
*/
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
,
params
=
{
"format"
})
@RolesAllowed
({
UserService
.
USER
,
UserService
.
ADMIN
})
public
@ResponseBody
...
...
@@ -77,6 +88,11 @@ public class ToscaController {
return
null
;
}
/**
* Deletes the TOSCA description.
* @param id. The ID of TOSCA description to delete.
* @return The ID of the deleted TOSCA description.
*/
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@RolesAllowed
({
UserService
.
USER
,
UserService
.
ADMIN
})
public
@ResponseBody
...
...
@@ -85,7 +101,11 @@ public class ToscaController {
return
"Deleted : "
+
id
;
}
// http://localhost:8080/drip-api/tosca/ids
/**
* Gets the IDs of all the stored TOSCA descriptionss.
* @return a list of all the IDs
*/
@RequestMapping
(
value
=
"/ids"
)
@RolesAllowed
({
UserService
.
USER
,
UserService
.
ADMIN
})
public
@ResponseBody
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/rest/UserController.java
View file @
f2c80f09
...
...
@@ -20,8 +20,6 @@ import java.util.List;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
javax.annotation.security.RolesAllowed
;
import
nl.uva.sne.drip.api.exception.BadRequestException
;
import
nl.uva.sne.drip.api.exception.NotFoundException
;
import
nl.uva.sne.drip.api.exception.PasswordNullException
;
import
nl.uva.sne.drip.api.exception.UserExistsException
;
import
nl.uva.sne.drip.api.exception.UserNotFoundException
;
...
...
@@ -40,6 +38,7 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import
org.springframework.web.bind.annotation.RequestBody
;
/**
* This controller is responsible for handling user accounts
*
* @author S. Koulouzis
*/
...
...
@@ -55,7 +54,7 @@ public class UserController {
* Register new user. A normal user cannot create accounts, only the user
* with the 'ADMIN' role can do that.
*
* @param user
* @param user
. The user to register
* @return Response on success: The ID of the newly register user. Response
* on fail: If the user name already exists, or the user name is 'null' or
* the password is 'null' there will be a 'BadRequestException'
...
...
@@ -91,6 +90,12 @@ public class UserController {
return
this
.
register
(
user
);
}
/**
* Gets the user.
*
* @param id. The ID of the user to retrive
* @return the requested user.
*/
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
@RolesAllowed
({
UserService
.
ADMIN
})
public
@ResponseBody
...
...
@@ -107,6 +112,12 @@ public class UserController {
return
null
;
}
/**
* Deletes a user
*
* @param id. The ID of the user to delete
* @return The ID of the deleted user
*/
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@RolesAllowed
({
UserService
.
ADMIN
})
public
@ResponseBody
...
...
@@ -124,6 +135,11 @@ public class UserController {
return
null
;
}
/**
* Gets the IDs of all the stored users
*
* @return a list of all the IDs
*/
@RequestMapping
(
value
=
"/ids"
,
method
=
RequestMethod
.
GET
)
@RolesAllowed
({
UserService
.
ADMIN
})
public
@ResponseBody
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/rest/UserPublicKeysController.java
View file @
f2c80f09
...
...
@@ -30,7 +30,6 @@ import org.springframework.web.bind.annotation.RequestParam;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.multipart.MultipartFile
;
import
nl.uva.sne.drip.api.dao.UserKeyDao
;
import
nl.uva.sne.drip.api.exception.BadRequestException
;
import
nl.uva.sne.drip.api.exception.NotFoundException
;
import
nl.uva.sne.drip.api.service.UserKeyService
;
...
...
@@ -39,6 +38,9 @@ import org.springframework.web.bind.annotation.PathVariable;
import
org.springframework.web.bind.annotation.RequestBody
;
/**
* This controller is responsible for handling user public keys. These keys can
* be used by the provisoner to allow the user to login to the VMs from the
* machine the keys correspond to.
*
* @author S. Koulouzis
*/
...
...
@@ -51,6 +53,12 @@ public class UserPublicKeysController {
private
UserKeyService
service
;
// curl -v -X POST -F "file=@.ssh/id_dsa.pub" localhost:8080/drip-api/user_key/upload
/**
* Uploads a public key (id_dsa.pub,id_rsa.pub)
*
* @param file the public key file
* @return the ID of the stored public key
*/
@RequestMapping
(
value
=
"/upload"
,
method
=
RequestMethod
.
POST
)
@RolesAllowed
({
UserService
.
USER
,
UserService
.
ADMIN
})
public
@ResponseBody
...
...
@@ -78,30 +86,44 @@ public class UserPublicKeysController {
}
// curl -H "Content-Type: application/json" -X POST -d '{"key":"ssh-rsa AAAAB3NzaDWBqs75i849MytgwgQcRYMcsXIki0yeYTKABH6JqoiyFBHtYlyh/EV1t6cujb9LyNP4J5EN4fPbtwKYvxecd0LojSPxl4wjQlfrHyg6iKUYB7hVzGqACMvgYZHrtHPfrdEmOGPplPVPpoaX2j+u0BZ0yYhrWMKjzyYZKa68yy5N18+Gq+1p83HfUDwIU9wWaUYdgEvDujqF6b8p3z6LDx9Ob+RanSMZSt+b8eZRcd+F2Oy/gieJEJ8kc152VIOv8UY1xB3hVEwVnSRGgrAsa+9PChfF6efXUGWiKf8KBlWgBOYsSTsOY4ks9zkXMnbcTdC+o7xspOkyIcWjv us@u\n","name":"id_rsa.pub"}' localhost:8080/drip-api/user_key/
/**
* Posts the LoginKey and stores it. The LoginKey is a container for public
* key contents. The public key contents are represented in the 'key' field.
* All new lines in the 'key' field have to be replaced with the '\n'
* character.
*
* @param key. The LoginKey
* @return the ID of the LoginKey
*/
@RequestMapping
(
method
=
RequestMethod
.
POST
)
@RolesAllowed
({
UserService
.
USER
,
UserService
.
ADMIN
})
public
@ResponseBody
String
postKey
(
@RequestBody
LoginKey
uk
)
{
LoginKey
.
Type
type
=
uk
.
getType
();
String
postKey
(
@RequestBody
LoginKey
key
)
{
LoginKey
.
Type
type
=
key
.
getType
();
if
(
type
!=
null
&&
type
.
equals
(
LoginKey
.
Type
.
PRIVATE
))
{
throw
new
BadRequestException
(
"Key can't be private"
);
}
if
(
uk
.
getKey
()
==
null
)
{
if
(
key
.
getKey
()
==
null
)
{
throw
new
BadRequestException
(
"Key can't be empty"
);
}
String
originalName
=
uk
.
getName
();
String
originalName
=
key
.
getName
();
if
(
originalName
==
null
)
{
originalName
=
"id.pub"
;
}
String
name
=
System
.
currentTimeMillis
()
+
"_"
+
originalName
;
uk
.
setName
(
name
);
uk
.
setType
(
LoginKey
.
Type
.
PUBLIC
);
key
.
setName
(
name
);
key
.
setType
(
LoginKey
.
Type
.
PUBLIC
);
service
.
getDao
().
save
(
uk
);
return
uk
.
getId
();
service
.
getDao
().
save
(
key
);
return
key
.
getId
();
}
//curl localhost:8080/drip-api/user_key/58a20be263d4a5898835676e
/**
* Gets the LoginKey.
*
* @param id . The ID of the LoginKey to return
* @return The LoginKey
*/
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
@RolesAllowed
({
UserService
.
USER
,
UserService
.
ADMIN
})
public
@ResponseBody
...
...
@@ -114,7 +136,12 @@ public class UserPublicKeysController {
}
// localhost:8080/drip-api/user_key/ids
@RequestMapping
(
value
=
"/ids"
)
/**
* Gets the IDs of all the stored LoginKey
*
* @return a list of all the IDs
*/
@RequestMapping
(
value
=
"/ids"
,
method
=
RequestMethod
.
GET
)
@RolesAllowed
({
UserService
.
USER
,
UserService
.
ADMIN
})
public
@ResponseBody
List
<
String
>
getIds
()
{
...
...
@@ -126,6 +153,12 @@ public class UserPublicKeysController {
return
ids
;
}
/**
* Deletes a LoginKey
*
* @param id. The ID of the LoginKey to deleted.
* @return The ID of the deleted LoginKey
*/
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
@RolesAllowed
({
UserService
.
USER
,
UserService
.
ADMIN
})
public
@ResponseBody
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/rest/UserScriptController.java
View file @
f2c80f09
...
...
@@ -20,7 +20,6 @@ import java.util.ArrayList;
import
java.util.List
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
org.json.JSONException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -30,10 +29,13 @@ import org.springframework.web.bind.annotation.ResponseBody;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.multipart.MultipartFile
;
import
nl.uva.sne.drip.api.dao.UserScriptDao
;
import
nl.uva.sne.drip.api.exception.NotFoundException
;
import
nl.uva.sne.drip.commons.types.UserScript
;
import
org.springframework.web.bind.annotation.PathVariable
;
/**
* This controller is responsible for handling user scripts. These user can be
* used by the provisoner to run on the created VMs.
*
* @author S. Koulouzis
*/
...
...
@@ -46,9 +48,15 @@ public class UserScriptController {
private
UserScriptDao
dao
;
// curl -v -X POST -F "file=@script.sh" localhost:8080/drip-api/rest/user_script/upload
/**
* Uploads a script
*
* @param file. The file of the script
* @return the ID of the stopred script
*/
@RequestMapping
(
value
=
"/upload"
,
method
=
RequestMethod
.
POST
)
public
@ResponseBody
String
uploadUserScript
(
@RequestParam
(
"file"
)
MultipartFile
file
)
throws
JSONException
{
String
uploadUserScript
(
@RequestParam
(
"file"
)
MultipartFile
file
)
{
if
(!
file
.
isEmpty
())
{
try
{
String
originalFileName
=
file
.
getOriginalFilename
();
...
...
@@ -70,19 +78,33 @@ public class UserScriptController {
return
null
;
}
// @RequestMapping(method = RequestMethod.POST)
// public @ResponseBody
// String postConf(UserScript us) {
// String name = System.currentTimeMillis() + "_" + us.getName();
// us.setName(name);
// dao.save(us);
// return us.getId();
// }
/**
* Gets a script
*
* @param id. The ID of the script to return
* @return the script
*/
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
GET
)
public
UserScript
get
(
@PathVariable
(
"id"
)
String
id
)
{
public
@ResponseBody
UserScript
get
(
@PathVariable
(
"id"
)
String
id
)
{
return
dao
.
findOne
(
id
);
}
@RequestMapping
(
value
=
"/{id}"
,
method
=
RequestMethod
.
DELETE
)
public
String
delete
(
@PathVariable
(
"id"
)
String
id
)
{
UserScript
script
=
dao
.
findOne
(
id
);
if
(
script
==
null
)
{
throw
new
NotFoundException
();
}
dao
.
delete
(
id
);
return
"Deleted: "
+
id
;
}
/**
* Gets the IDs of all the stored scripts
*
* @return a list of all the IDs
*/
@RequestMapping
(
value
=
"/ids"
)
public
@ResponseBody
List
<
String
>
getIds
()
{
...
...
drip-commons/src/main/java/nl/uva/sne/drip/commons/types/UserScript.java
View file @
f2c80f09
/*
@ResponseBody
/*
* Copyright 2017 S. Koulouzis, Wang Junchao, Huan Zhou, Yang Hu
*
* Licensed under the Apache License, Version 2.0 (the "License");
...
...
drip-provisioner/src/main/java/nl/uva/sne/drip/drip/provisioner/Consumer.java
View file @
f2c80f09
...
...
@@ -149,7 +149,7 @@ public class Consumer extends DefaultConsumer {
File
ec2ConfFile
=
null
;
File
geniConfFile
=
null
;
//loop through the parameters in a message to find the input files
String
logDir
,
mainTopologyPath
,
sshKeyFilePath
,
scriptPath
;
String
logDir
,
mainTopologyPath
,
sshKeyFilePath
=
null
,
scriptPath
=
null
;
ArrayList
<
TopologyElement
>
topologyInfoArray
=
new
ArrayList
();
List
<
String
>
certificateNames
=
new
ArrayList
();
...
...
@@ -180,10 +180,14 @@ public class Consumer extends DefaultConsumer {
logDir
=
getLogDirPath
(
parameters
,
tempInputDirPath
);
File
sshKey
=
getSSHKey
(
parameters
,
tempInputDirPath
);
if
(
sshKey
!=
null
)
{
sshKeyFilePath
=
sshKey
.
getAbsolutePath
();
}
File
scriptFile
=
getSciptFile
(
parameters
,
tempInputDirPath
);
if
(
scriptFile
!=
null
)
{
scriptPath
=
scriptFile
.
getAbsolutePath
();
}
File
curDir
=
new
File
(
tempInputDirPath
);
for
(
File
f
:
curDir
.
listFiles
())
{
...
...
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