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
2f8b45bf
Commit
2f8b45bf
authored
Mar 07, 2017
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implemented API v0 for backwords compatibility
parent
5f66fae5
Changes
43
Hide whitespace changes
Inline
Side-by-side
Showing
43 changed files
with
317 additions
and
69 deletions
+317
-69
enunciate.xml
drip-api/enunciate.xml
+4
-2
pom.xml
drip-api/pom.xml
+9
-0
ConverterConfig.java
...c/main/java/nl/uva/sne/drip/api/conf/ConverterConfig.java
+32
-0
WebAppInitializer.java
...main/java/nl/uva/sne/drip/api/conf/WebAppInitializer.java
+1
-0
CloudCredentialsDao.java
...ain/java/nl/uva/sne/drip/api/dao/CloudCredentialsDao.java
+1
-1
ClusterCredentialsDao.java
...n/java/nl/uva/sne/drip/api/dao/ClusterCredentialsDao.java
+1
-1
PlanDao.java
drip-api/src/main/java/nl/uva/sne/drip/api/dao/PlanDao.java
+1
-1
ProvisionInfoDao.java
...c/main/java/nl/uva/sne/drip/api/dao/ProvisionInfoDao.java
+1
-1
ToscaDao.java
drip-api/src/main/java/nl/uva/sne/drip/api/dao/ToscaDao.java
+1
-1
UserDao.java
drip-api/src/main/java/nl/uva/sne/drip/api/dao/UserDao.java
+1
-1
UserKeyDao.java
...api/src/main/java/nl/uva/sne/drip/api/dao/UserKeyDao.java
+1
-1
UserScriptDao.java
.../src/main/java/nl/uva/sne/drip/api/dao/UserScriptDao.java
+1
-1
DRIPCaller.java
...api/src/main/java/nl/uva/sne/drip/api/rpc/DRIPCaller.java
+2
-2
PlannerCaller.java
.../src/main/java/nl/uva/sne/drip/api/rpc/PlannerCaller.java
+1
-1
PlannerService.java
...main/java/nl/uva/sne/drip/api/service/PlannerService.java
+4
-4
SimplePlannerService.java
...ava/nl/uva/sne/drip/api/service/SimplePlannerService.java
+4
-4
ToscaService.java
...c/main/java/nl/uva/sne/drip/api/service/ToscaService.java
+1
-1
UserKeyService.java
...main/java/nl/uva/sne/drip/api/service/UserKeyService.java
+1
-1
UserService.java
...rc/main/java/nl/uva/sne/drip/api/service/UserService.java
+1
-1
PlannerController0.java
.../java/nl/uva/sne/drip/api/v0/rest/PlannerController0.java
+85
-0
CloudConfigurationController.java
...va/sne/drip/api/v1/rest/CloudConfigurationController.java
+3
-3
DeployController.java
...in/java/nl/uva/sne/drip/api/v1/rest/DeployController.java
+8
-8
PlannerController.java
...n/java/nl/uva/sne/drip/api/v1/rest/PlannerController.java
+2
-2
ProvisionController.java
...java/nl/uva/sne/drip/api/v1/rest/ProvisionController.java
+9
-9
ToscaController.java
...ain/java/nl/uva/sne/drip/api/v1/rest/ToscaController.java
+2
-2
UserController.java
...main/java/nl/uva/sne/drip/api/v1/rest/UserController.java
+2
-2
UserPublicKeysController.java
...nl/uva/sne/drip/api/v1/rest/UserPublicKeysController.java
+2
-2
UserScriptController.java
...ava/nl/uva/sne/drip/api/v1/rest/UserScriptController.java
+2
-2
Converter.java
...rc/main/java/nl/uva/sne/drip/commons/utils/Converter.java
+3
-3
Plan.java
.../src/main/java/nl/uva/sne/drip/commons/v0/types/Plan.java
+92
-0
Result.java
...rc/main/java/nl/uva/sne/drip/commons/v0/types/Result.java
+27
-0
CloudCredentials.java
...va/nl/uva/sne/drip/commons/v1/types/CloudCredentials.java
+1
-1
ClusterCredentials.java
.../nl/uva/sne/drip/commons/v1/types/ClusterCredentials.java
+1
-1
DeployParameter.java
...ava/nl/uva/sne/drip/commons/v1/types/DeployParameter.java
+1
-1
IMessage.java
.../main/java/nl/uva/sne/drip/commons/v1/types/IMessage.java
+1
-1
LoginKey.java
.../main/java/nl/uva/sne/drip/commons/v1/types/LoginKey.java
+1
-1
Message.java
...c/main/java/nl/uva/sne/drip/commons/v1/types/Message.java
+1
-1
MessageParameter.java
...va/nl/uva/sne/drip/commons/v1/types/MessageParameter.java
+1
-1
Plan.java
.../src/main/java/nl/uva/sne/drip/commons/v1/types/Plan.java
+1
-1
ProvisionInfo.java
.../java/nl/uva/sne/drip/commons/v1/types/ProvisionInfo.java
+1
-1
ToscaRepresentation.java
...nl/uva/sne/drip/commons/v1/types/ToscaRepresentation.java
+1
-1
User.java
.../src/main/java/nl/uva/sne/drip/commons/v1/types/User.java
+1
-1
UserScript.java
...ain/java/nl/uva/sne/drip/commons/v1/types/UserScript.java
+1
-1
No files found.
drip-api/enunciate.xml
View file @
2f8b45bf
...
@@ -7,8 +7,10 @@
...
@@ -7,8 +7,10 @@
</facets>
</facets>
<api-classes>
<api-classes>
<include
pattern=
"nl.uva.sne.drip.api.rest.*"
/>
<include
pattern=
"nl.uva.sne.drip.api.v1.rest.*"
/>
<include
pattern=
"nl.uva.sne.drip.commons.types.*"
/>
<include
pattern=
"nl.uva.sne.drip.api.v0.rest.*"
/>
<include
pattern=
"nl.uva.sne.drip.commons.v1.types.*"
/>
<include
pattern=
"nl.uva.sne.drip.commons.v0.types.*"
/>
</api-classes>
</api-classes>
...
...
drip-api/pom.xml
View file @
2f8b45bf
...
@@ -132,6 +132,15 @@
...
@@ -132,6 +132,15 @@
<version>
1.0-SNAPSHOT
</version>
<version>
1.0-SNAPSHOT
</version>
</dependency>
</dependency>
<dependency>
<groupId>
org.springframework
</groupId>
<artifactId>
spring-oxm
</artifactId>
<version>
4.3.7.RELEASE
</version>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/conf/ConverterConfig.java
0 → 100644
View file @
2f8b45bf
/*
* Copyright 2017 S. Koulouzis, Wang Junchao, Huan Zhou, Yang Hu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
nl
.
uva
.
sne
.
drip
.
api
.
conf
;
import
org.springframework.context.annotation.ComponentScan
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.web.servlet.config.annotation.EnableWebMvc
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter
;
/**
*
* @author alogo
*/
@EnableWebMvc
@Configuration
@ComponentScan
({
"nl.uva.sne.drip.api"
})
public
class
ConverterConfig
extends
WebMvcConfigurerAdapter
{
}
drip-api/src/main/java/nl/uva/sne/drip/api/conf/WebAppInitializer.java
View file @
2f8b45bf
...
@@ -28,6 +28,7 @@ public class WebAppInitializer implements WebApplicationInitializer {
...
@@ -28,6 +28,7 @@ public class WebAppInitializer implements WebApplicationInitializer {
ctx
.
register
(
MultipartConfig
.
class
);
ctx
.
register
(
MultipartConfig
.
class
);
ctx
.
register
(
MongoConfig
.
class
);
ctx
.
register
(
MongoConfig
.
class
);
ctx
.
register
(
SecurityConfig
.
class
);
ctx
.
register
(
SecurityConfig
.
class
);
ctx
.
register
(
ConverterConfig
.
class
);
ctx
.
setServletContext
(
servletContext
);
ctx
.
setServletContext
(
servletContext
);
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/dao/CloudCredentialsDao.java
View file @
2f8b45bf
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
*/
*/
package
nl
.
uva
.
sne
.
drip
.
api
.
dao
;
package
nl
.
uva
.
sne
.
drip
.
api
.
dao
;
import
nl.uva.sne.drip.commons.types.CloudCredentials
;
import
nl.uva.sne.drip.commons.
v1.
types.CloudCredentials
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
/**
/**
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/dao/ClusterCredentialsDao.java
View file @
2f8b45bf
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
*/
*/
package
nl
.
uva
.
sne
.
drip
.
api
.
dao
;
package
nl
.
uva
.
sne
.
drip
.
api
.
dao
;
import
nl.uva.sne.drip.commons.types.ClusterCredentials
;
import
nl.uva.sne.drip.commons.
v1.
types.ClusterCredentials
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
/**
/**
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/dao/PlanDao.java
View file @
2f8b45bf
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
*/
*/
package
nl
.
uva
.
sne
.
drip
.
api
.
dao
;
package
nl
.
uva
.
sne
.
drip
.
api
.
dao
;
import
nl.uva.sne.drip.commons.types.Plan
;
import
nl.uva.sne.drip.commons.
v1.
types.Plan
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
/**
/**
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/dao/ProvisionInfoDao.java
View file @
2f8b45bf
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
*/
*/
package
nl
.
uva
.
sne
.
drip
.
api
.
dao
;
package
nl
.
uva
.
sne
.
drip
.
api
.
dao
;
import
nl.uva.sne.drip.commons.types.ProvisionInfo
;
import
nl.uva.sne.drip.commons.
v1.
types.ProvisionInfo
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
/**
/**
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/dao/ToscaDao.java
View file @
2f8b45bf
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
*/
*/
package
nl
.
uva
.
sne
.
drip
.
api
.
dao
;
package
nl
.
uva
.
sne
.
drip
.
api
.
dao
;
import
nl.uva.sne.drip.commons.types.ToscaRepresentation
;
import
nl.uva.sne.drip.commons.
v1.
types.ToscaRepresentation
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
/**
/**
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/dao/UserDao.java
View file @
2f8b45bf
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
*/
*/
package
nl
.
uva
.
sne
.
drip
.
api
.
dao
;
package
nl
.
uva
.
sne
.
drip
.
api
.
dao
;
import
nl.uva.sne.drip.commons.types.User
;
import
nl.uva.sne.drip.commons.
v1.
types.User
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
/**
/**
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/dao/UserKeyDao.java
View file @
2f8b45bf
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
*/
*/
package
nl
.
uva
.
sne
.
drip
.
api
.
dao
;
package
nl
.
uva
.
sne
.
drip
.
api
.
dao
;
import
nl.uva.sne.drip.commons.types.LoginKey
;
import
nl.uva.sne.drip.commons.
v1.
types.LoginKey
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
/**
/**
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/dao/UserScriptDao.java
View file @
2f8b45bf
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
*/
*/
package
nl
.
uva
.
sne
.
drip
.
api
.
dao
;
package
nl
.
uva
.
sne
.
drip
.
api
.
dao
;
import
nl.uva.sne.drip.commons.types.UserScript
;
import
nl.uva.sne.drip.commons.
v1.
types.UserScript
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
/**
/**
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/rpc/DRIPCaller.java
View file @
2f8b45bf
...
@@ -17,8 +17,8 @@ import java.util.concurrent.BlockingQueue;
...
@@ -17,8 +17,8 @@ import java.util.concurrent.BlockingQueue;
import
java.util.concurrent.TimeoutException
;
import
java.util.concurrent.TimeoutException
;
import
java.util.logging.Level
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
java.util.logging.Logger
;
import
nl.uva.sne.drip.commons.types.Message
;
import
nl.uva.sne.drip.commons.
v1.
types.Message
;
import
nl.uva.sne.drip.commons.types.MessageParameter
;
import
nl.uva.sne.drip.commons.
v1.
types.MessageParameter
;
import
nl.uva.sne.drip.commons.utils.Converter
;
import
nl.uva.sne.drip.commons.utils.Converter
;
import
org.json.JSONArray
;
import
org.json.JSONArray
;
import
org.json.JSONException
;
import
org.json.JSONException
;
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/rpc/PlannerCaller.java
View file @
2f8b45bf
...
@@ -20,7 +20,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
...
@@ -20,7 +20,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.concurrent.TimeoutException
;
import
java.util.concurrent.TimeoutException
;
import
nl.uva.sne.drip.commons.types.Message
;
import
nl.uva.sne.drip.commons.
v1.
types.Message
;
/**
/**
*
*
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/service/PlannerService.java
View file @
2f8b45bf
...
@@ -29,10 +29,10 @@ import nl.uva.sne.drip.api.dao.PlanDao;
...
@@ -29,10 +29,10 @@ import nl.uva.sne.drip.api.dao.PlanDao;
import
nl.uva.sne.drip.api.exception.BadRequestException
;
import
nl.uva.sne.drip.api.exception.BadRequestException
;
import
nl.uva.sne.drip.api.exception.NotFoundException
;
import
nl.uva.sne.drip.api.exception.NotFoundException
;
import
nl.uva.sne.drip.api.rpc.PlannerCaller
;
import
nl.uva.sne.drip.api.rpc.PlannerCaller
;
import
nl.uva.sne.drip.commons.types.Message
;
import
nl.uva.sne.drip.commons.
v1.
types.Message
;
import
nl.uva.sne.drip.commons.types.MessageParameter
;
import
nl.uva.sne.drip.commons.
v1.
types.MessageParameter
;
import
nl.uva.sne.drip.commons.types.Plan
;
import
nl.uva.sne.drip.commons.
v1.
types.Plan
;
import
nl.uva.sne.drip.commons.types.ToscaRepresentation
;
import
nl.uva.sne.drip.commons.
v1.
types.ToscaRepresentation
;
import
nl.uva.sne.drip.commons.utils.Converter
;
import
nl.uva.sne.drip.commons.utils.Converter
;
import
nl.uva.sne.drip.drip.converter.P2PConverter
;
import
nl.uva.sne.drip.drip.converter.P2PConverter
;
import
nl.uva.sne.drip.drip.converter.SimplePlanContainer
;
import
nl.uva.sne.drip.drip.converter.SimplePlanContainer
;
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/service/SimplePlannerService.java
View file @
2f8b45bf
...
@@ -29,10 +29,10 @@ import java.util.concurrent.TimeoutException;
...
@@ -29,10 +29,10 @@ import java.util.concurrent.TimeoutException;
import
nl.uva.sne.drip.api.dao.PlanDao
;
import
nl.uva.sne.drip.api.dao.PlanDao
;
import
nl.uva.sne.drip.api.exception.NotFoundException
;
import
nl.uva.sne.drip.api.exception.NotFoundException
;
import
nl.uva.sne.drip.api.rpc.PlannerCaller
;
import
nl.uva.sne.drip.api.rpc.PlannerCaller
;
import
nl.uva.sne.drip.commons.types.Message
;
import
nl.uva.sne.drip.commons.
v1.
types.Message
;
import
nl.uva.sne.drip.commons.types.MessageParameter
;
import
nl.uva.sne.drip.commons.
v1.
types.MessageParameter
;
import
nl.uva.sne.drip.commons.types.Plan
;
import
nl.uva.sne.drip.commons.
v1.
types.Plan
;
import
nl.uva.sne.drip.commons.types.ToscaRepresentation
;
import
nl.uva.sne.drip.commons.
v1.
types.ToscaRepresentation
;
import
nl.uva.sne.drip.commons.utils.Converter
;
import
nl.uva.sne.drip.commons.utils.Converter
;
import
org.json.JSONException
;
import
org.json.JSONException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/service/ToscaService.java
View file @
2f8b45bf
...
@@ -20,7 +20,7 @@ import java.util.List;
...
@@ -20,7 +20,7 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
import
nl.uva.sne.drip.api.dao.ToscaDao
;
import
nl.uva.sne.drip.api.dao.ToscaDao
;
import
nl.uva.sne.drip.api.exception.NotFoundException
;
import
nl.uva.sne.drip.api.exception.NotFoundException
;
import
nl.uva.sne.drip.commons.types.ToscaRepresentation
;
import
nl.uva.sne.drip.commons.
v1.
types.ToscaRepresentation
;
import
nl.uva.sne.drip.commons.utils.Converter
;
import
nl.uva.sne.drip.commons.utils.Converter
;
import
org.json.JSONException
;
import
org.json.JSONException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/service/UserKeyService.java
View file @
2f8b45bf
...
@@ -18,7 +18,7 @@ package nl.uva.sne.drip.api.service;
...
@@ -18,7 +18,7 @@ package nl.uva.sne.drip.api.service;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
nl.uva.sne.drip.api.dao.UserKeyDao
;
import
nl.uva.sne.drip.api.dao.UserKeyDao
;
import
nl.uva.sne.drip.commons.types.LoginKey
;
import
nl.uva.sne.drip.commons.
v1.
types.LoginKey
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/service/UserService.java
View file @
2f8b45bf
...
@@ -20,7 +20,7 @@ import java.util.HashSet;
...
@@ -20,7 +20,7 @@ import java.util.HashSet;
import
java.util.logging.Level
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
java.util.logging.Logger
;
import
nl.uva.sne.drip.api.dao.UserDao
;
import
nl.uva.sne.drip.api.dao.UserDao
;
import
nl.uva.sne.drip.commons.types.User
;
import
nl.uva.sne.drip.commons.
v1.
types.User
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.core.userdetails.UserDetails
;
import
org.springframework.security.core.userdetails.UserDetails
;
import
org.springframework.security.core.userdetails.UserDetailsService
;
import
org.springframework.security.core.userdetails.UserDetailsService
;
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/v0/rest/PlannerController0.java
0 → 100644
View file @
2f8b45bf
/*
* Copyright 2017 S. Koulouzis, Wang Junchao, Huan Zhou, Yang Hu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
nl
.
uva
.
sne
.
drip
.
api
.
v0
.
rest
;
import
java.io.IOException
;
import
java.util.concurrent.TimeoutException
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
nl.uva.sne.drip.commons.v0.types.Result
;
import
javax.annotation.security.RolesAllowed
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
nl.uva.sne.drip.api.service.PlannerService
;
import
nl.uva.sne.drip.api.service.ToscaService
;
import
nl.uva.sne.drip.api.service.UserService
;
import
nl.uva.sne.drip.commons.utils.Converter
;
import
nl.uva.sne.drip.commons.v0.types.Plan
;
import
org.json.JSONException
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.RequestBody
;
/**
* This controller is responsible for planing the type of resources to be
* provisopned based on a TOSCA description.
*
* @author S. Koulouzis
*/
@RestController
@RequestMapping
(
"/user/v0.0/switch/plan"
)
@Component
public
class
PlannerController0
{
@Autowired
private
PlannerService
plannerService
;
@Autowired
private
ToscaService
toscaService
;
@RequestMapping
(
value
=
"/planning"
,
method
=
RequestMethod
.
POST
,
consumes
=
MediaType
.
TEXT_XML_VALUE
)
@RolesAllowed
({
UserService
.
USER
,
UserService
.
ADMIN
})
public
@ResponseBody
Result
plan
(
@RequestBody
Plan
plan0
)
{
try
{
nl
.
uva
.
sne
.
drip
.
commons
.
v1
.
types
.
ToscaRepresentation
toscaRep
=
new
nl
.
uva
.
sne
.
drip
.
commons
.
v1
.
types
.
ToscaRepresentation
();
toscaRep
.
setKvMap
(
Converter
.
ymlString2Map
(
plan0
.
getFile
()));
toscaService
.
getDao
().
save
(
toscaRep
);
nl
.
uva
.
sne
.
drip
.
commons
.
v1
.
types
.
Plan
plan1
=
plannerService
.
getPlan
(
toscaRep
.
getId
());
return
null
;
}
catch
(
JSONException
|
IOException
|
TimeoutException
|
InterruptedException
ex
)
{
Logger
.
getLogger
(
PlannerController0
.
class
.
getName
()).
log
(
Level
.
SEVERE
,
null
,
ex
);
}
return
null
;
}
@RequestMapping
(
value
=
"/get"
,
method
=
RequestMethod
.
GET
,
produces
=
MediaType
.
TEXT_XML_VALUE
)
@RolesAllowed
({
UserService
.
USER
,
UserService
.
ADMIN
})
public
@ResponseBody
Plan
plan
()
{
Plan
p
=
new
Plan
();
p
.
setFile
(
"tosca_definitions_version: tosca_simple_yaml_1_0\\n\\n\\ndescription: example file for infrastructure planner\\n\\n\\nrepositories:\\n MOG_docker_hub: \\n description: MOG project’s code repository in GitHub\\n url: https://github.com/switch-project/mog\\n credential:\\n protocol: xauth\\n token_type: X-Auth-Token\\n # token encoded in Base64\\n token: 604bbe45ac7143a79e14f3158df67091\\n\\n\\nartifact_types:\\n tosca.artifacts.Deployment.Image.Container.Docker:\\n derived_from: tosca.artifacts.Deployment.Image\\n\\n\\ndata_types:\\n Switch.datatypes.QoS.AppComponent:\\n derived_from: tosca.datatypes.Root\\n properties:\\n response_time:\\n type: string\\n\\n Switch.datatypes.Application.Connection.EndPoint:\\n derived_from: tosca.datatypes.Root\\n properties:\\n address:\\n type: string\\n component_name:\\n type: string\\n netmask:\\n type: string\\n port_name:\\n type: string\\n\\n Switch.datatypes.Application.Connection.Multicast:\\n derived_from: tosca.datatypes.Root\\n properties:\\n multicastAddrIP:\\n type: string\\n multicastAddrPort:\\n type: integer\\n\\n Switch.datatypes.Network.EndPoint:\\n derived_from: tosca.datatypes.Root\\n properties:\\n address:\\n type: string\\n host_name:\\n type: string\\n netmask:\\n type: string\\n port_name:\\n type: string\\n\\n Switch.datatypes.Network.Multicast:\\n derived_from: tosca.datatypes.Root\\n properties:\\n multicastAddrIP:\\n type: string\\n multicastAddrPort:\\n type: integer\\n\\n\\nnode_types:\\n\\n Switch.nodes.Application.Container.Docker:\\n derived_from: tosca.nodes.Container.Application\\n properties:\\n QoS:\\n type: Switch.datatypes.QoS.AppComponent\\n artifacts:\\n docker_image:\\n type: tosca.artifacts.Deployment.Image.Container.Docker\\n interfaces:\\n Standard:\\n create:\\n inputs:\\n command:\\n type: string\\n exported_ports:\\n type: list\\n entry_schema:\\n type: string\\n port_bindings:\\n type: list\\n entry_schema:\\n type: string\\n\\n Switch.nodes.Application.Container.Docker.MOG.InputDistributor:\\n derived_from: Switch.nodes.Application.Container.Docker\\n artifacts:\\n docker_image:\\n type: tosca.artifacts.Deployment.Image.Container.Docker\\n file: \"mogswitch/InputDistributor:1.0\"\\n repository: MOG_docker_hub\\n properties:\\n inPort: \\n type: integer\\n waitingTime:\\n type: integer\\n multicastAddrIP:\\n type: string\\n multicastAddrPort:\\n type: integer\\n videoWidth:\\n type: integer\\n videoHeight:\\n type: integer\\n\\n Switch.nodes.Application.Container.Docker.MOG.ProxyTranscoder:\\n derived_from: Switch.nodes.Application.Container.Docker \\n artifacts:\\n docker_image:\\n type: tosca.artifacts.Deployment.Image.Container.Docker\\n file: \"mogswitch/ProxyTranscoder:1.0\"\\n repository: MOG_docker_hub\\n properties:\\n multicastAddrIP: \\n type: string\\n multicastAddrPort:\\n type: integer\\n videoWidth:\\n type: integer\\n videoHeight:\\n type: integer\\n\\n Switch.nodes.Application.Connection:\\n derived_from: tosca.nodes.Root \\n properties:\\n source:\\n type: Switch.datatypes.Application.Connection.EndPoint\\n target:\\n type: Switch.datatypes.Application.Connection.EndPoint\\n bandwidth:\\n type: string\\n latency: \\n type: string\\n jitter: \\n type: string\\n multicast:\\n type: Switch.datatypes.Application.Connection.Multicast\\n\\n Switch.nodes.Compute:\\n derived_from: tosca.nodes.Compute\\n properties:\\n OStype:\\n type: string\\n nodetype:\\n type: string\\n domain:\\n type: string\\n public_address:\\n type: string\\n \n"
+
" ethernet_port:\\n type: list\\n entry_schema:\\n type: tosca.datatypes.network.NetworkInfo\\n script:\\n type: string\\n installation:\\n type: string\\n ssh_credential:\\n type: tosca.datatypes.Credential\\n\\n Switch.nodes.Network:\\n derived_from: tosca.nodes.network.Network\\n properties:\\n bandwidth:\\n type: string\\n latency:\\n type: string\\n jitter:\\n type: string\\n source:\\n type: Switch.datatypes.Network.EndPoint\\n target:\\n type: Switch.datatypes.Network.EndPoint\\n multicast:\\n type: Switch.datatypes.Network.Multicast\\n\\n\\ntopology_template:\\n \\n node_templates:\\n 2d13d708e3a9441ab8336ce874e08dd1:\\n type: Switch.nodes.Application.Container.Docker.MOG.InputDistributor\\n artifacts:\\n docker_image:\\n file: \"mogswitch/InputDistributor:1.0\"\\n type: tosca.artifacts.Deployment.Image.Container.Docker\\n repository: MOG_docker_hub\\n properties:\\n QoS:\\n response_time: 30ms\\n inPort: 2000\\n waitingTime: 5\\n multicastAddrIP: 255.2.2.0\\n multicastAddrPort: 3000\\n videoWidth: 176\\n videoHeight: 100\\n interfaces:\\n Standard:\\n create:\\n implementation: docker_image\\n inputs:\\n command: InputDistributor\\n exported_ports:\\n - 2000\\n port_bindings:\\n - \"2000:2000\"\\n - \"3000:3000\"\\n\\n 8fcc1788d9ee462c826572c79fdb2a6a:\\n type: Switch.nodes.Application.Container.Docker.MOG.ProxyTranscoder\\n artifacts:\\n docker_image:\\n file: \"mogswitch/ProxyTranscoder:1.0\"\\n type: tosca.artifacts.Deployment.Image.Container.Docker\\n repository: MOG_docker_hub\\n properties:\\n QoS:\\n response_time: 30ms\\n multicastAddrIP: 255.2.2.0\\n multicastAddrPort: 3000\\n videoWidth: 176\\n videoHeight: 100\\n interfaces:\\n Standard:\\n create:\\n implementation: docker_image\\n inputs:\\n command: ProxyTranscoder\\n exported_ports:\\n - 80\\n port_bindings:\\n - \"8080:80\"\\n\\n 5e0add703c8a43938a39301f572e46c0:\\n type: Switch.nodes.Application.Connection\\n properties:\\n source:\\n address: 192.168.21.11\\n component_name: 2d13d708e3a9441ab8336ce874e08dd1\\n netmask: 255.255.255.0\\n port_name: \"inputDistributor_out\"\\n target:\\n address: 192.168.21.12\\n component_name: 8fcc1788d9ee462c826572c79fdb2a6a\\n netmask: 255.255.255.0\\n port_name: \"proxyTranscoder_in\"\\n latency: 30ms\\n bandwidth: 130MB/s\\n jitter: 500ms\\n multicast:\\n multicastAddrIP: 255.2.2.0\\n multicastAddrPort: 3000\\n"
);
p
.
setPwd
(
"123"
);
p
.
setUser
(
"user"
);
return
p
;
}
}
drip-api/src/main/java/nl/uva/sne/drip/api/v1/rest/CloudConfigurationController.java
View file @
2f8b45bf
...
@@ -25,7 +25,7 @@ import java.util.Map;
...
@@ -25,7 +25,7 @@ import java.util.Map;
import
java.util.logging.Level
;
import
java.util.logging.Level
;
import
java.util.logging.Logger
;
import
java.util.logging.Logger
;
import
javax.annotation.security.RolesAllowed
;
import
javax.annotation.security.RolesAllowed
;
import
nl.uva.sne.drip.commons.types.CloudCredentials
;
import
nl.uva.sne.drip.commons.
v1.
types.CloudCredentials
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -38,7 +38,7 @@ import nl.uva.sne.drip.api.exception.NotFoundException;
...
@@ -38,7 +38,7 @@ import nl.uva.sne.drip.api.exception.NotFoundException;
import
nl.uva.sne.drip.api.exception.NullKeyException
;
import
nl.uva.sne.drip.api.exception.NullKeyException
;
import
nl.uva.sne.drip.api.exception.NullKeyIDException
;
import
nl.uva.sne.drip.api.exception.NullKeyIDException
;
import
nl.uva.sne.drip.api.service.UserService
;
import
nl.uva.sne.drip.api.service.UserService
;
import
nl.uva.sne.drip.commons.types.LoginKey
;
import
nl.uva.sne.drip.commons.
v1.
types.LoginKey
;
import
org.apache.commons.io.FilenameUtils
;
import
org.apache.commons.io.FilenameUtils
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
@@ -54,7 +54,7 @@ import org.springframework.web.multipart.MultipartFile;
...
@@ -54,7 +54,7 @@ import org.springframework.web.multipart.MultipartFile;
* @author S. Koulouzis
* @author S. Koulouzis
*/
*/
@RestController
@RestController
@RequestMapping
(
"/user/configuration/cloud"
)
@RequestMapping
(
"/user/
v1.0/
configuration/cloud"
)
@Component
@Component
public
class
CloudConfigurationController
{
public
class
CloudConfigurationController
{
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/v1/rest/DeployController.java
View file @
2f8b45bf
...
@@ -29,8 +29,8 @@ import javax.annotation.security.RolesAllowed;
...
@@ -29,8 +29,8 @@ import javax.annotation.security.RolesAllowed;
import
nl.uva.sne.drip.api.dao.CloudCredentialsDao
;
import
nl.uva.sne.drip.api.dao.CloudCredentialsDao
;
import
nl.uva.sne.drip.api.exception.BadRequestException
;
import
nl.uva.sne.drip.api.exception.BadRequestException
;
import
nl.uva.sne.drip.api.exception.NotFoundException
;
import
nl.uva.sne.drip.api.exception.NotFoundException
;
import
nl.uva.sne.drip.commons.types.Message
;
import
nl.uva.sne.drip.commons.
v1.
types.Message
;
import
nl.uva.sne.drip.commons.types.MessageParameter
;
import
nl.uva.sne.drip.commons.
v1.
types.MessageParameter
;
import
org.json.JSONException
;
import
org.json.JSONException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
...
@@ -44,11 +44,11 @@ import nl.uva.sne.drip.api.rpc.DeployerCaller;
...
@@ -44,11 +44,11 @@ import nl.uva.sne.drip.api.rpc.DeployerCaller;
import
nl.uva.sne.drip.api.service.ClusterCredentialService
;
import
nl.uva.sne.drip.api.service.ClusterCredentialService
;
import
nl.uva.sne.drip.api.service.ProvisionService
;
import
nl.uva.sne.drip.api.service.ProvisionService
;
import
nl.uva.sne.drip.api.service.UserService
;
import
nl.uva.sne.drip.api.service.UserService
;
import
nl.uva.sne.drip.commons.types.CloudCredentials
;
import
nl.uva.sne.drip.commons.
v1.
types.CloudCredentials
;
import
nl.uva.sne.drip.commons.types.ClusterCredentials
;
import
nl.uva.sne.drip.commons.
v1.
types.ClusterCredentials
;
import
nl.uva.sne.drip.commons.types.DeployParameter
;
import
nl.uva.sne.drip.commons.
v1.
types.DeployParameter
;
import
nl.uva.sne.drip.commons.types.LoginKey
;
import
nl.uva.sne.drip.commons.
v1.
types.LoginKey
;
import
nl.uva.sne.drip.commons.types.ProvisionInfo
;
import
nl.uva.sne.drip.commons.
v1.
types.ProvisionInfo
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
...
@@ -58,7 +58,7 @@ import org.springframework.web.bind.annotation.RequestParam;
...
@@ -58,7 +58,7 @@ import org.springframework.web.bind.annotation.RequestParam;
* @author S. Koulouzis
* @author S. Koulouzis
*/
*/
@RestController
@RestController
@RequestMapping
(
"/user/deployer"
)
@RequestMapping
(
"/user/
v1.0/
deployer"
)
@Component
@Component
public
class
DeployController
{
public
class
DeployController
{
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/v1/rest/PlannerController.java
View file @
2f8b45bf
...
@@ -33,7 +33,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
...
@@ -33,7 +33,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
nl.uva.sne.drip.api.service.PlannerService
;
import
nl.uva.sne.drip.api.service.PlannerService
;
import
nl.uva.sne.drip.api.service.UserService
;
import
nl.uva.sne.drip.api.service.UserService
;
import
nl.uva.sne.drip.commons.types.Plan
;
import
nl.uva.sne.drip.commons.
v1.
types.Plan
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
/**
/**
...
@@ -43,7 +43,7 @@ import org.springframework.web.bind.annotation.RequestParam;
...
@@ -43,7 +43,7 @@ import org.springframework.web.bind.annotation.RequestParam;
* @author S. Koulouzis
* @author S. Koulouzis
*/
*/
@RestController
@RestController
@RequestMapping
(
"/user/planner"
)
@RequestMapping
(
"/user/
v1.0/
planner"
)
@Component
@Component
public
class
PlannerController
{
public
class
PlannerController
{
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/v1/rest/ProvisionController.java
View file @
2f8b45bf
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
package
nl
.
uva
.
sne
.
drip
.
api
.
v1
.
rest
;
package
nl
.
uva
.
sne
.
drip
.
api
.
v1
.
rest
;
import
com.fasterxml.jackson.core.JsonParser
;
import
com.fasterxml.jackson.core.JsonParser
;
import
nl.uva.sne.drip.commons.types.ProvisionInfo
;
import
nl.uva.sne.drip.commons.
v1.
types.ProvisionInfo
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
java.io.ByteArrayOutputStream
;
import
java.io.ByteArrayOutputStream
;
...
@@ -33,8 +33,8 @@ import java.util.logging.Level;
...
@@ -33,8 +33,8 @@ import java.util.logging.Level;
import
java.util.logging.Logger
;
import
java.util.logging.Logger
;
import
javax.annotation.security.RolesAllowed
;
import
javax.annotation.security.RolesAllowed
;
import
nl.uva.sne.drip.api.dao.CloudCredentialsDao
;
import
nl.uva.sne.drip.api.dao.CloudCredentialsDao
;
import
nl.uva.sne.drip.commons.types.Message
;
import
nl.uva.sne.drip.commons.
v1.
types.Message
;
import
nl.uva.sne.drip.commons.types.MessageParameter
;
import
nl.uva.sne.drip.commons.
v1.
types.MessageParameter
;
import
nl.uva.sne.drip.commons.utils.Converter
;
import
nl.uva.sne.drip.commons.utils.Converter
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
...
@@ -55,11 +55,11 @@ import nl.uva.sne.drip.api.service.SimplePlannerService;
...
@@ -55,11 +55,11 @@ import nl.uva.sne.drip.api.service.SimplePlannerService;
import
nl.uva.sne.drip.api.service.UserKeyService
;
import
nl.uva.sne.drip.api.service.UserKeyService
;
import
nl.uva.sne.drip.api.service.UserScriptService
;
import
nl.uva.sne.drip.api.service.UserScriptService
;
import
nl.uva.sne.drip.api.service.UserService
;
import
nl.uva.sne.drip.api.service.UserService
;
import
nl.uva.sne.drip.commons.types.CloudCredentials
;
import
nl.uva.sne.drip.commons.
v1.
types.CloudCredentials
;
import
nl.uva.sne.drip.commons.types.DeployParameter
;
import
nl.uva.sne.drip.commons.
v1.
types.DeployParameter
;
import
nl.uva.sne.drip.commons.types.LoginKey
;
import
nl.uva.sne.drip.commons.
v1.
types.LoginKey
;
import
nl.uva.sne.drip.commons.types.Plan
;
import
nl.uva.sne.drip.commons.
v1.
types.Plan
;
import
nl.uva.sne.drip.commons.types.UserScript
;
import
nl.uva.sne.drip.commons.
v1.
types.UserScript
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.FileUtils
;
import
org.apache.commons.io.FilenameUtils
;
import
org.apache.commons.io.FilenameUtils
;
import
org.json.JSONException
;
import
org.json.JSONException
;
...
@@ -72,7 +72,7 @@ import org.springframework.web.bind.annotation.RequestBody;
...
@@ -72,7 +72,7 @@ import org.springframework.web.bind.annotation.RequestBody;
* @author S. Koulouzis
* @author S. Koulouzis
*/
*/
@RestController
@RestController
@RequestMapping
(
"/user/provisioner"
)
@RequestMapping
(
"/user/
v1.0/
provisioner"
)
@Component
@Component
public
class
ProvisionController
{
public
class
ProvisionController
{
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/v1/rest/ToscaController.java
View file @
2f8b45bf
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
*/
*/
package
nl
.
uva
.
sne
.
drip
.
api
.
v1
.
rest
;
package
nl
.
uva
.
sne
.
drip
.
api
.
v1
.
rest
;
import
nl.uva.sne.drip.commons.types.ToscaRepresentation
;
import
nl.uva.sne.drip.commons.
v1.
types.ToscaRepresentation
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
...
@@ -42,7 +42,7 @@ import nl.uva.sne.drip.api.service.UserService;
...
@@ -42,7 +42,7 @@ import nl.uva.sne.drip.api.service.UserService;
* @author S. Koulouzis
* @author S. Koulouzis
*/
*/
@RestController
@RestController
@RequestMapping
(
"/user/tosca"
)
@RequestMapping
(
"/user/
v1.0/
tosca"
)
@Component
@Component
public
class
ToscaController
{
public
class
ToscaController
{
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/v1/rest/UserController.java
View file @
2f8b45bf
...
@@ -24,7 +24,7 @@ import nl.uva.sne.drip.api.exception.PasswordNullException;
...
@@ -24,7 +24,7 @@ import nl.uva.sne.drip.api.exception.PasswordNullException;
import
nl.uva.sne.drip.api.exception.UserExistsException
;
import
nl.uva.sne.drip.api.exception.UserExistsException
;
import
nl.uva.sne.drip.api.exception.UserNotFoundException
;
import
nl.uva.sne.drip.api.exception.UserNotFoundException
;
import
nl.uva.sne.drip.api.exception.UserNullException
;
import
nl.uva.sne.drip.api.exception.UserNullException
;
import
nl.uva.sne.drip.commons.types.User
;
import
nl.uva.sne.drip.commons.
v1.
types.User
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
...
@@ -43,7 +43,7 @@ import org.springframework.web.bind.annotation.RequestBody;
...
@@ -43,7 +43,7 @@ import org.springframework.web.bind.annotation.RequestBody;
* @author S. Koulouzis
* @author S. Koulouzis
*/
*/
@RestController
@RestController
@RequestMapping
(
"/manager/user/"
)
@RequestMapping
(
"/manager/
v1.0/
user/"
)
@Component
@Component
public
class
UserController
{
public
class
UserController
{
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/v1/rest/UserPublicKeysController.java
View file @
2f8b45bf
...
@@ -17,7 +17,7 @@ package nl.uva.sne.drip.api.v1.rest;
...
@@ -17,7 +17,7 @@ package nl.uva.sne.drip.api.v1.rest;
import
com.webcohesion.enunciate.metadata.rs.ResponseCode
;
import
com.webcohesion.enunciate.metadata.rs.ResponseCode
;
import
com.webcohesion.enunciate.metadata.rs.StatusCodes
;
import
com.webcohesion.enunciate.metadata.rs.StatusCodes
;
import
nl.uva.sne.drip.commons.types.LoginKey
;
import
nl.uva.sne.drip.commons.
v1.
types.LoginKey
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
...
@@ -47,7 +47,7 @@ import org.springframework.web.bind.annotation.RequestBody;
...
@@ -47,7 +47,7 @@ import org.springframework.web.bind.annotation.RequestBody;
* @author S. Koulouzis
* @author S. Koulouzis
*/
*/
@RestController
@RestController
@RequestMapping
(
"/user/user_key"
)
@RequestMapping
(
"/user/
v1.0/
user_key"
)
@Component
@Component
public
class
UserPublicKeysController
{
public
class
UserPublicKeysController
{
...
...
drip-api/src/main/java/nl/uva/sne/drip/api/v1/rest/UserScriptController.java
View file @
2f8b45bf
...
@@ -30,7 +30,7 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -30,7 +30,7 @@ import org.springframework.web.bind.annotation.RestController;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
nl.uva.sne.drip.api.dao.UserScriptDao
;
import
nl.uva.sne.drip.api.dao.UserScriptDao
;
import
nl.uva.sne.drip.api.exception.NotFoundException
;
import
nl.uva.sne.drip.api.exception.NotFoundException
;
import
nl.uva.sne.drip.commons.types.UserScript
;
import
nl.uva.sne.drip.commons.
v1.
types.UserScript
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.PathVariable
;
/**
/**
...
@@ -40,7 +40,7 @@ import org.springframework.web.bind.annotation.PathVariable;
...
@@ -40,7 +40,7 @@ import org.springframework.web.bind.annotation.PathVariable;
* @author S. Koulouzis
* @author S. Koulouzis
*/
*/
@RestController
@RestController
@RequestMapping
(
"/user/user_script"
)
@RequestMapping
(
"/user/
v1.0/
user_script"
)
@Component
@Component
public
class
UserScriptController
{
public
class
UserScriptController
{
...
...
drip-api/src/main/java/nl/uva/sne/drip/commons/utils/Converter.java
View file @
2f8b45bf
...
@@ -26,9 +26,9 @@ import java.util.Iterator;
...
@@ -26,9 +26,9 @@ import java.util.Iterator;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Properties
;
import
java.util.Properties
;
import
nl.uva.sne.drip.commons.types.CloudCredentials
;
import
nl.uva.sne.drip.commons.
v1.
types.CloudCredentials
;
import
nl.uva.sne.drip.commons.types.Message
;
import
nl.uva.sne.drip.commons.
v1.
types.Message
;
import
nl.uva.sne.drip.commons.types.MessageParameter
;
import
nl.uva.sne.drip.commons.
v1.
types.MessageParameter
;
import
org.json.JSONArray
;
import
org.json.JSONArray
;
import
org.json.JSONException
;
import
org.json.JSONException
;
import
org.json.JSONObject
;
import
org.json.JSONObject
;
...
...
drip-api/src/main/java/nl/uva/sne/drip/commons/v0/types/Plan.java
0 → 100644
View file @
2f8b45bf
/*
* Copyright 2017 S. Koulouzis, Wang Junchao, Huan Zhou, Yang Hu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
nl
.
uva
.
sne
.
drip
.
commons
.
v0
.
types
;
import
com.webcohesion.enunciate.metadata.DocumentationExample
;
import
java.io.Serializable
;
import
javax.xml.bind.annotation.XmlElement
;
import
javax.xml.bind.annotation.XmlRootElement
;
/**
*
* This class represents a plan to be provided to the planner.
*
* @author S. Koulouzis
*/
@XmlRootElement
public
class
Plan
implements
Serializable
{
private
String
user
;
private
String
pwd
;
private
String
file
;
/**
* Not used. It's only there for backwords compatibility
*
* @return the user
*/
@DocumentationExample
(
"user"
)
public
String
getUser
()
{
return
user
;
}
/**
* @param user the user to set
*/
public
void
setUser
(
String
user
)
{
this
.
user
=
user
;
}
/**
* Not used. It's only there for backwords compatibility
*
* @return the pwd
*/
@DocumentationExample
(
"123"
)
public
String
getPwd
()
{
return
pwd
;
}
/**
* The password
*
* @param pwd the pwd to set
*/
public
void
setPwd
(
String
pwd
)
{
this
.
pwd
=
pwd
;
}
/**
* The contents of the TOSCA description
*
* @return the file
*/
@DocumentationExample
(
"tosca_definitions_version: tosca_simple_yaml_1_0\\n\\n\\ndescription: example file for infrastructure planner\\n\\n\\nrepositories:\\n MOG_docker_hub: \\n description: MOG project’s code repository in GitHub\\n url: https://github.com/switch-project/mog\\n credential:\\n protocol: xauth\\n token_type: X-Auth-Token\\n # token encoded in Base64\\n token: 604bbe45ac7143a79e14f3158df67091\\n\\n\\nartifact_types:\\n tosca.artifacts.Deployment.Image.Container.Docker:\\n derived_from: tosca.artifacts.Deployment.Image\\n\\n\\ndata_types:\\n Switch.datatypes.QoS.AppComponent:\\n derived_from: tosca.datatypes.Root\\n properties:\\n response_time:\\n type: string\\n\\n Switch.datatypes.Application.Connection.EndPoint:\\n derived_from: tosca.datatypes.Root\\n properties:\\n address:\\n type: string\\n component_name:\\n type: string\\n netmask:\\n type: string\\n port_name:\\n type: string\\n\\n Switch.datatypes.Application.Connection.Multicast:\\n derived_from: tosca.datatypes.Root\\n properties:\\n multicastAddrIP:\\n type: string\\n multicastAddrPort:\\n type: integer\\n\\n Switch.datatypes.Network.EndPoint:\\n derived_from: tosca.datatypes.Root\\n properties:\\n address:\\n type: string\\n host_name:\\n type: string\\n netmask:\\n type: string\\n port_name:\\n type: string\\n\\n Switch.datatypes.Network.Multicast:\\n derived_from: tosca.datatypes.Root\\n properties:\\n multicastAddrIP:\\n type: string\\n multicastAddrPort:\\n type: integer\\n\\n\\nnode_types:\\n\\n Switch.nodes.Application.Container.Docker:\\n derived_from: tosca.nodes.Container.Application\\n properties:\\n QoS:\\n type: Switch.datatypes.QoS.AppComponent\\n artifacts:\\n docker_image:\\n type: tosca.artifacts.Deployment.Image.Container.Docker\\n interfaces:\\n Standard:\\n create:\\n inputs:\\n command:\\n type: string\\n exported_ports:\\n type: list\\n entry_schema:\\n type: string\\n port_bindings:\\n type: list\\n entry_schema:\\n type: string\\n\\n Switch.nodes.Application.Container.Docker.MOG.InputDistributor:\\n derived_from: Switch.nodes.Application.Container.Docker\\n artifacts:\\n docker_image:\\n type: tosca.artifacts.Deployment.Image.Container.Docker\\n file: \"mogswitch/InputDistributor:1.0\"\\n repository: MOG_docker_hub\\n properties:\\n inPort: \\n type: integer\\n waitingTime:\\n type: integer\\n multicastAddrIP:\\n type: string\\n multicastAddrPort:\\n type: integer\\n videoWidth:\\n type: integer\\n videoHeight:\\n type: integer\\n\\n Switch.nodes.Application.Container.Docker.MOG.ProxyTranscoder:\\n derived_from: Switch.nodes.Application.Container.Docker \\n artifacts:\\n docker_image:\\n type: tosca.artifacts.Deployment.Image.Container.Docker\\n file: \"mogswitch/ProxyTranscoder:1.0\"\\n repository: MOG_docker_hub\\n properties:\\n multicastAddrIP: \\n type: string\\n multicastAddrPort:\\n type: integer\\n videoWidth:\\n type: integer\\n videoHeight:\\n type: integer\\n\\n Switch.nodes.Application.Connection:\\n derived_from: tosca.nodes.Root \\n properties:\\n source:\\n type: Switch.datatypes.Application.Connection.EndPoint\\n target:\\n type: Switch.datatypes.Application.Connection.EndPoint\\n bandwidth:\\n type: string\\n latency: \\n type: string\\n jitter: \\n type: string\\n multicast:\\n type: Switch.datatypes.Application.Connection.Multicast\\n\\n Switch.nodes.Compute:\\n derived_from: tosca.nodes.Compute\\n properties:\\n OStype:\\n type: string\\n nodetype:\\n type: string\\n domain:\\n type: string\\n public_address:\\n type: string\\n \n"
+
" ethernet_port:\\n type: list\\n entry_schema:\\n type: tosca.datatypes.network.NetworkInfo\\n script:\\n type: string\\n installation:\\n type: string\\n ssh_credential:\\n type: tosca.datatypes.Credential\\n\\n Switch.nodes.Network:\\n derived_from: tosca.nodes.network.Network\\n properties:\\n bandwidth:\\n type: string\\n latency:\\n type: string\\n jitter:\\n type: string\\n source:\\n type: Switch.datatypes.Network.EndPoint\\n target:\\n type: Switch.datatypes.Network.EndPoint\\n multicast:\\n type: Switch.datatypes.Network.Multicast\\n\\n\\ntopology_template:\\n \\n node_templates:\\n 2d13d708e3a9441ab8336ce874e08dd1:\\n type: Switch.nodes.Application.Container.Docker.MOG.InputDistributor\\n artifacts:\\n docker_image:\\n file: \"mogswitch/InputDistributor:1.0\"\\n type: tosca.artifacts.Deployment.Image.Container.Docker\\n repository: MOG_docker_hub\\n properties:\\n QoS:\\n response_time: 30ms\\n inPort: 2000\\n waitingTime: 5\\n multicastAddrIP: 255.2.2.0\\n multicastAddrPort: 3000\\n videoWidth: 176\\n videoHeight: 100\\n interfaces:\\n Standard:\\n create:\\n implementation: docker_image\\n inputs:\\n command: InputDistributor\\n exported_ports:\\n - 2000\\n port_bindings:\\n - \"2000:2000\"\\n - \"3000:3000\"\\n\\n 8fcc1788d9ee462c826572c79fdb2a6a:\\n type: Switch.nodes.Application.Container.Docker.MOG.ProxyTranscoder\\n artifacts:\\n docker_image:\\n file: \"mogswitch/ProxyTranscoder:1.0\"\\n type: tosca.artifacts.Deployment.Image.Container.Docker\\n repository: MOG_docker_hub\\n properties:\\n QoS:\\n response_time: 30ms\\n multicastAddrIP: 255.2.2.0\\n multicastAddrPort: 3000\\n videoWidth: 176\\n videoHeight: 100\\n interfaces:\\n Standard:\\n create:\\n implementation: docker_image\\n inputs:\\n command: ProxyTranscoder\\n exported_ports:\\n - 80\\n port_bindings:\\n - \"8080:80\"\\n\\n 5e0add703c8a43938a39301f572e46c0:\\n type: Switch.nodes.Application.Connection\\n properties:\\n source:\\n address: 192.168.21.11\\n component_name: 2d13d708e3a9441ab8336ce874e08dd1\\n netmask: 255.255.255.0\\n port_name: \"inputDistributor_out\"\\n target:\\n address: 192.168.21.12\\n component_name: 8fcc1788d9ee462c826572c79fdb2a6a\\n netmask: 255.255.255.0\\n port_name: \"proxyTranscoder_in\"\\n latency: 30ms\\n bandwidth: 130MB/s\\n jitter: 500ms\\n multicast:\\n multicastAddrIP: 255.2.2.0\\n multicastAddrPort: 3000\\n"
)
public
String
getFile
()
{
return
file
;
}
/**
* @param file the file to set
*/
public
void
setFile
(
String
file
)
{
this
.
file
=
file
;
}
}
drip-api/src/main/java/nl/uva/sne/drip/commons/v0/types/Result.java
0 → 100644
View file @
2f8b45bf
/*
* Copyright 2017 S. Koulouzis, Wang Junchao, Huan Zhou, Yang Hu
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
nl
.
uva
.
sne
.
drip
.
commons
.
v0
.
types
;
import
javax.xml.bind.annotation.XmlRootElement
;
/**
*
* @author S. Koulouzis
*/
@XmlRootElement
public
class
Result
{
}
drip-api/src/main/java/nl/uva/sne/drip/commons/types/CloudCredentials.java
→
drip-api/src/main/java/nl/uva/sne/drip/commons/
v1/
types/CloudCredentials.java
View file @
2f8b45bf
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
package
nl
.
uva
.
sne
.
drip
.
commons
.
types
;
package
nl
.
uva
.
sne
.
drip
.
commons
.
v1
.
types
;
import
com.webcohesion.enunciate.metadata.DocumentationExample
;
import
com.webcohesion.enunciate.metadata.DocumentationExample
;
import
java.util.List
;
import
java.util.List
;
...
...
drip-api/src/main/java/nl/uva/sne/drip/commons/types/ClusterCredentials.java
→
drip-api/src/main/java/nl/uva/sne/drip/commons/
v1/
types/ClusterCredentials.java
View file @
2f8b45bf
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
package
nl
.
uva
.
sne
.
drip
.
commons
.
types
;
package
nl
.
uva
.
sne
.
drip
.
commons
.
v1
.
types
;
import
com.webcohesion.enunciate.metadata.DocumentationExample
;
import
com.webcohesion.enunciate.metadata.DocumentationExample
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.annotation.Id
;
...
...
drip-api/src/main/java/nl/uva/sne/drip/commons/types/DeployParameter.java
→
drip-api/src/main/java/nl/uva/sne/drip/commons/
v1/
types/DeployParameter.java
View file @
2f8b45bf
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
package
nl
.
uva
.
sne
.
drip
.
commons
.
types
;
package
nl
.
uva
.
sne
.
drip
.
commons
.
v1
.
types
;
/**
/**
*
*
...
...
drip-api/src/main/java/nl/uva/sne/drip/commons/types/IMessage.java
→
drip-api/src/main/java/nl/uva/sne/drip/commons/
v1/
types/IMessage.java
View file @
2f8b45bf
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
package
nl
.
uva
.
sne
.
drip
.
commons
.
types
;
package
nl
.
uva
.
sne
.
drip
.
commons
.
v1
.
types
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
...
...
drip-api/src/main/java/nl/uva/sne/drip/commons/types/LoginKey.java
→
drip-api/src/main/java/nl/uva/sne/drip/commons/
v1/
types/LoginKey.java
View file @
2f8b45bf
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
package
nl
.
uva
.
sne
.
drip
.
commons
.
types
;
package
nl
.
uva
.
sne
.
drip
.
commons
.
v1
.
types
;
import
com.webcohesion.enunciate.metadata.DocumentationExample
;
import
com.webcohesion.enunciate.metadata.DocumentationExample
;
import
java.util.Map
;
import
java.util.Map
;
...
...
drip-api/src/main/java/nl/uva/sne/drip/commons/types/Message.java
→
drip-api/src/main/java/nl/uva/sne/drip/commons/
v1/
types/Message.java
View file @
2f8b45bf
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
package
nl
.
uva
.
sne
.
drip
.
commons
.
types
;
package
nl
.
uva
.
sne
.
drip
.
commons
.
v1
.
types
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.List
;
import
java.util.List
;
...
...
drip-api/src/main/java/nl/uva/sne/drip/commons/types/MessageParameter.java
→
drip-api/src/main/java/nl/uva/sne/drip/commons/
v1/
types/MessageParameter.java
View file @
2f8b45bf
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
package
nl
.
uva
.
sne
.
drip
.
commons
.
types
;
package
nl
.
uva
.
sne
.
drip
.
commons
.
v1
.
types
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.Map
;
import
java.util.Map
;
...
...
drip-api/src/main/java/nl/uva/sne/drip/commons/types/Plan.java
→
drip-api/src/main/java/nl/uva/sne/drip/commons/
v1/
types/Plan.java
View file @
2f8b45bf
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
package
nl
.
uva
.
sne
.
drip
.
commons
.
types
;
package
nl
.
uva
.
sne
.
drip
.
commons
.
v1
.
types
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.Set
;
...
...
drip-api/src/main/java/nl/uva/sne/drip/commons/types/ProvisionInfo.java
→
drip-api/src/main/java/nl/uva/sne/drip/commons/
v1/
types/ProvisionInfo.java
View file @
2f8b45bf
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
package
nl
.
uva
.
sne
.
drip
.
commons
.
types
;
package
nl
.
uva
.
sne
.
drip
.
commons
.
v1
.
types
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
...
drip-api/src/main/java/nl/uva/sne/drip/commons/types/ToscaRepresentation.java
→
drip-api/src/main/java/nl/uva/sne/drip/commons/
v1/
types/ToscaRepresentation.java
View file @
2f8b45bf
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
package
nl
.
uva
.
sne
.
drip
.
commons
.
types
;
package
nl
.
uva
.
sne
.
drip
.
commons
.
v1
.
types
;
import
java.util.Map
;
import
java.util.Map
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.annotation.Id
;
...
...
drip-api/src/main/java/nl/uva/sne/drip/commons/types/User.java
→
drip-api/src/main/java/nl/uva/sne/drip/commons/
v1/
types/User.java
View file @
2f8b45bf
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
package
nl
.
uva
.
sne
.
drip
.
commons
.
types
;
package
nl
.
uva
.
sne
.
drip
.
commons
.
v1
.
types
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
import
com.fasterxml.jackson.annotation.JsonProperty
;
...
...
drip-api/src/main/java/nl/uva/sne/drip/commons/types/UserScript.java
→
drip-api/src/main/java/nl/uva/sne/drip/commons/
v1/
types/UserScript.java
View file @
2f8b45bf
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* See the License for the specific language governing permissions and
* limitations under the License.
* limitations under the License.
*/
*/
package
nl
.
uva
.
sne
.
drip
.
commons
.
types
;
package
nl
.
uva
.
sne
.
drip
.
commons
.
v1
.
types
;
import
com.webcohesion.enunciate.metadata.DocumentationExample
;
import
com.webcohesion.enunciate.metadata.DocumentationExample
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.annotation.Id
;
...
...
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