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
22c6117e
Commit
22c6117e
authored
Jul 14, 2020
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
removed accept headers
parent
a7f2ee92
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
22 additions
and
23 deletions
+22
-23
CredentialApiController.java
...ain/java/nl/uva/sne/drip/api/CredentialApiController.java
+2
-2
DeployerApiController.java
.../main/java/nl/uva/sne/drip/api/DeployerApiController.java
+5
-5
PlannerApiController.java
...c/main/java/nl/uva/sne/drip/api/PlannerApiController.java
+5
-5
ProvisionerApiController.java
...in/java/nl/uva/sne/drip/api/ProvisionerApiController.java
+5
-5
ToscaTemplateApiController.java
.../java/nl/uva/sne/drip/api/ToscaTemplateApiController.java
+5
-6
No files found.
manager/src/main/java/nl/uva/sne/drip/api/CredentialApiController.java
View file @
22c6117e
...
...
@@ -47,7 +47,7 @@ public class CredentialApiController implements CredentialApi {
public
ResponseEntity
<
String
>
createCredentials
(
@ApiParam
(
value
=
"Created user object"
,
required
=
true
)
@Valid
@RequestBody
Credential
body
)
{
String
accept
=
request
.
getHeader
(
"Accept"
);
//
String accept = request.getHeader("Accept");
// if (accept != null && accept.contains("application/json")) {
try
{
String
id
=
credentialService
.
save
(
body
);
...
...
@@ -63,7 +63,7 @@ public class CredentialApiController implements CredentialApi {
@Override
public
ResponseEntity
<
List
<
String
>>
getCredentialIDs
()
{
String
accept
=
request
.
getHeader
(
"Accept"
);
//
String accept = request.getHeader("Accept");
// if (accept != null && accept.contains("application/json")) {
List
<
String
>
ids
=
credentialService
.
getAllIds
();
return
new
ResponseEntity
<>(
ids
,
HttpStatus
.
OK
);
...
...
manager/src/main/java/nl/uva/sne/drip/api/DeployerApiController.java
View file @
22c6117e
...
...
@@ -40,8 +40,8 @@ public class DeployerApiController implements DeployerApi {
@ApiParam
(
value
=
"ID of topolog template to deploy"
,
required
=
true
)
@PathVariable
(
"id"
)
String
id
)
{
String
accept
=
request
.
getHeader
(
"Accept"
);
if
(
accept
!=
null
&&
accept
.
contains
(
""
))
{
//
String accept = request.getHeader("Accept");
//
if (accept != null && accept.contains("")) {
try
{
String
planedYemplateId
=
dripService
.
deploy
(
id
,
null
);
return
new
ResponseEntity
<>(
planedYemplateId
,
HttpStatus
.
OK
);
...
...
@@ -51,9 +51,9 @@ public class DeployerApiController implements DeployerApi {
return
new
ResponseEntity
<>(
HttpStatus
.
INTERNAL_SERVER_ERROR
);
}
}
else
{
return
new
ResponseEntity
<>(
HttpStatus
.
NOT_ACCEPTABLE
);
}
//
} else {
//
return new ResponseEntity<>(HttpStatus.NOT_ACCEPTABLE);
//
}
}
}
manager/src/main/java/nl/uva/sne/drip/api/PlannerApiController.java
View file @
22c6117e
...
...
@@ -40,8 +40,8 @@ public class PlannerApiController implements PlannerApi {
public
ResponseEntity
<
String
>
planToscaTemplateByID
(
@ApiParam
(
value
=
"ID of topolog template to plan"
,
required
=
true
)
@PathVariable
(
"id"
)
String
id
)
{
String
accept
=
request
.
getHeader
(
"Accept"
);
if
(
accept
!=
null
&&
accept
.
contains
(
"text/plain"
))
{
//
String accept = request.getHeader("Accept");
//
if (accept != null && accept.contains("text/plain")) {
try
{
String
planedYemplateId
=
dripService
.
plan
(
id
);
...
...
@@ -51,9 +51,9 @@ public class PlannerApiController implements PlannerApi {
return
new
ResponseEntity
<>(
HttpStatus
.
INTERNAL_SERVER_ERROR
);
}
}
else
{
return
new
ResponseEntity
<>(
HttpStatus
.
NOT_ACCEPTABLE
);
}
//
} else {
//
return new ResponseEntity<>(HttpStatus.NOT_ACCEPTABLE);
//
}
}
...
...
manager/src/main/java/nl/uva/sne/drip/api/ProvisionerApiController.java
View file @
22c6117e
...
...
@@ -45,8 +45,8 @@ public class ProvisionerApiController implements ProvisionerApi {
public
ResponseEntity
<
String
>
provisionPlanToscaTemplateByID
(
@ApiParam
(
value
=
"ID of topolog template to provision"
,
required
=
true
)
@PathVariable
(
"id"
)
String
id
)
{
String
accept
=
request
.
getHeader
(
"Accept"
);
if
(
accept
!=
null
&&
accept
.
contains
(
"text/plain"
))
{
//
String accept = request.getHeader("Accept");
//
if (accept != null && accept.contains("text/plain")) {
try
{
String
planedYemplateId
=
dripService
.
provision
(
id
);
return
new
ResponseEntity
<>(
planedYemplateId
,
HttpStatus
.
OK
);
...
...
@@ -57,9 +57,9 @@ public class ProvisionerApiController implements ProvisionerApi {
java
.
util
.
logging
.
Logger
.
getLogger
(
ProvisionerApiController
.
class
.
getName
()).
log
(
Level
.
SEVERE
,
null
,
ex
);
return
ResponseEntity
.
status
(
HttpStatus
.
INTERNAL_SERVER_ERROR
).
body
(
ex
.
getMessage
());
}
}
else
{
return
new
ResponseEntity
<>(
HttpStatus
.
NOT_ACCEPTABLE
);
}
//
} else {
//
return new ResponseEntity<>(HttpStatus.NOT_ACCEPTABLE);
//
}
}
}
manager/src/main/java/nl/uva/sne/drip/api/ToscaTemplateApiController.java
View file @
22c6117e
...
...
@@ -52,7 +52,7 @@ public class ToscaTemplateApiController implements ToscaTemplateApi {
@ApiParam
(
value
=
"ID of topology template to return"
,
required
=
true
)
@PathVariable
(
"id"
)
String
id
,
@ApiParam
(
value
=
"The node(s) to delete"
)
@Valid
@RequestParam
(
value
=
"node_names"
,
required
=
false
)
List
<
String
>
nodeName
)
{
String
accept
=
request
.
getHeader
(
"Accept"
);
//
String accept = request.getHeader("Accept");
// if (accept != null && accept.contains("text/plain")) {
try
{
dripService
.
delete
(
id
,
nodeName
);
...
...
@@ -70,9 +70,8 @@ public class ToscaTemplateApiController implements ToscaTemplateApi {
@Override
public
ResponseEntity
<
String
>
getToscaTemplateByID
(
@ApiParam
(
value
=
"ID of topolog template to return"
,
required
=
true
)
@PathVariable
(
"id"
)
String
id
)
{
String
accept
=
request
.
getHeader
(
"Accept"
);
//
String accept = request.getHeader("Accept");
// if (accept != null && accept.contains("text/plain")) {
try
{
String
ymlStr
=
toscaTemplateService
.
findByID
(
id
);
return
new
ResponseEntity
<>(
ymlStr
,
HttpStatus
.
OK
);
...
...
@@ -92,7 +91,7 @@ public class ToscaTemplateApiController implements ToscaTemplateApi {
value
=
"ID of topolog template to return"
,
required
=
true
)
@PathVariable
(
"id"
)
String
id
,
@ApiParam
(
value
=
"file detail"
)
@Valid
@RequestPart
(
"file"
)
MultipartFile
file
)
{
String
accept
=
request
.
getHeader
(
"Accept"
);
//
String accept = request.getHeader("Accept");
// if (accept != null && accept.contains("text/plain")) {
try
{
id
=
toscaTemplateService
.
updateToscaTemplateByID
(
id
,
file
);
...
...
@@ -109,7 +108,7 @@ public class ToscaTemplateApiController implements ToscaTemplateApi {
@Override
public
ResponseEntity
<
String
>
uploadToscaTemplate
(
@ApiParam
(
value
=
"file detail"
)
@Valid
@RequestPart
(
"file"
)
MultipartFile
file
)
{
String
accept
=
request
.
getHeader
(
"Accept"
);
//
String accept = request.getHeader("Accept");
// if (accept != null && accept.contains("*/*")) {
try
{
String
id
=
toscaTemplateService
.
saveFile
(
file
);
...
...
@@ -127,7 +126,7 @@ public class ToscaTemplateApiController implements ToscaTemplateApi {
@Override
public
ResponseEntity
<
List
<
String
>>
getToscaTemplateIDs
()
{
String
accept
=
request
.
getHeader
(
"Accept"
);
//
String accept = request.getHeader("Accept");
// if (accept != null && accept.contains("application/json")) {
List
<
String
>
ids
=
toscaTemplateService
.
getAllIds
();
return
new
ResponseEntity
<>(
ids
,
HttpStatus
.
NOT_IMPLEMENTED
);
...
...
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