Commit 0eb7e855 authored by Spiros Koulouzis's avatar Spiros Koulouzis

Save converted compose

parent 4daa36a2
version: '3'
services:
telegreen:
build:
context: ../software/telegreen
image: beia/telegreen
graphite:
restart: always
image: vladwing/graphite
volumes:
- graphite_data:/opt/graphite/storage
environment:
- VIRTUAL_HOST=graphite.beia.switch
networks:
- web
- graphite
grafana:
restart: always
image: grafana/grafana
environment:
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD:-secret}
- VIRTUAL_HOST=grafana.beia.switch
volumes:
- grafana_data:/var/lib/grafana
depends_on:
- graphite
networks:
- web
monitoring_server:
image: salmant/ul_monitoring_server_container_image
ports:
- "8080:80"
- "8080:8080"
- "4242:4242"
- "4245:4245"
- "7199:7199"
- "7000:7000"
- "7001:7001"
- "9160:9160"
- "9042:9042"
- "8012:8012"
- "61621:61621"
environment:
- MONITORING_SERVER=monitoring_server
- VIRTUAL_HOST=jcatascopia.beia.switch
- VIRTUAL_PORT=8080
networks:
- asap
- web
monitoring_adapter:
restart: always
image: beia/monitoring_adapter
environment:
- MYSQL_ROOT_PASSWORD=doesntmatter
- MYSQL_DATABASE=telegreen
- MYSQL_USER=telegreen
- MYSQL_PASSWORD=password
- MYSQL_HOST=telegreen_db
- GRAPHITE_SERVER=graphite
- MONITORING_PREFIX=eu.beia.switch
- MONITORING_SERVER=${MONITORING_SERVER:-monitoring_server}
depends_on:
- telegreen_db
- graphite
- monitoring_server
networks:
- db
- monitoring
- external
telegreen_db:
build:
context: ../software/database
image: beia/telegreen_db
- graphite
- data
- asap
data_collector:
image: beia/data_collector
environment:
- MYSQL_ROOT_PASSWORD=doesntmatter
- MYSQL_DATABASE=telegreen
- MYSQL_USER=telegreen
- MYSQL_PASSWORD=password
- MYSQL_HOST=telegreen_db
# - CONFIG=config
- STATSD_HOST=monitoring_adapter
depends_on:
# - config
- monitoring_adapter
networks:
- db
- monitoring
# - config
- data
alerter:
build:
context: ../software/samplegen
image: beia/alerter
command:
- "/srv/beia/scripts/run-node.sh /srv/beia/samplegen app/AlerterApp.class.js"
image: beia/alerter
environment:
- MYSQL_ROOT_PASSWORD=doesntmatter
- MYSQL_DATABASE=telegreen
- MYSQL_USER=telegreen
- MYSQL_PASSWORD=password
- MYSQL_HOST=telegreen_db
# - CONFIG=config
- STATSD_HOST=monitoring_adapter
- VIRTUAL_HOST=alerter.beia.switch
- NOTIFICATION_SERVICE=notify
depends_on:
- telegreen_db
- notify
# - config
networks:
- db
- external
samplegen:
build:
context: ../software/samplegen
image: beia/samplegen
command:
- "/srv/beia/scripts/run-node.sh /srv/beia/samplegen app/SampleGeneratorApp.class.js"
# - config
- web
- data
# config:
# image: beia/config_manager
# environment:
# - TOSCA_URL=${TOSCA_URL:-http://www.google.com}
# networks:
# - config
web:
image: jwilder/nginx-proxy
ports:
- "8128:8000"
- "80:80/tcp"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
networks:
- web
notify:
image: beia/notify
environment:
- MYSQL_ROOT_PASSWORD=doesntmatter
- MYSQL_DATABASE=telegreen
- MYSQL_USER=telegreen
- MYSQL_PASSWORD=password
- MYSQL_HOST=telegreen_db
depends_on:
- telegreen_db
- monitoring_adapter
- notify_asterisk
- notify_redis
environment:
# - CONFIG=config
- ARI_URL=http://notify_asterisk:8088
- ARI_USERNAME=ari_user
- ARI_PASSWORD=ari_secret
- REDIS_HOST=notify_redis
- REDIS_PORT=6379
- DEFAULT_SIP=sipserver
- MONITORING_ADAPTER=monitoring_adapter
networks:
- db
- external
beia_mon:
build:
context: ../software/monitoring
image: beia/monitoring
depends_on:
- telegreen
- telegreen_db
# - config
- data
- sip
notify_asterisk:
image: beia/asterisk
environment:
- SIP_USERNAME=${SIP_USERNAME}
- SIP_HOST=${SIP_HOST}
- SIP_PORT=${SIP_PORT:-26999}
- SIP_SECRET=${SIP_SECRET}
- SIP_EXTENSION=${SIP_EXTENSION}
- SIP_PEERNAME=sipserver
- ARI_USERNAME=ari_user
- ARI_SECRET=ari_secret
networks:
- sip
notify_redis:
image: redis:alpine
networks:
- monitoring
- external
- sip
volumes:
graphite_data:
grafana_data:
networks:
db:
external:
monitoring:
\ No newline at end of file
# config:
data:
web:
graphite:
sip:
asap:
......@@ -36,6 +36,7 @@ import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.bind.annotation.PathVariable;
import nl.uva.sne.drip.api.exception.BadRequestException;
import nl.uva.sne.drip.api.service.ConfigurationService;
import nl.uva.sne.drip.api.service.ToscaService;
import nl.uva.sne.drip.api.service.UserService;
import org.springframework.web.bind.annotation.RequestBody;
......@@ -57,6 +58,9 @@ public class ToscaController {
@Autowired
private ToscaService toscaService;
@Autowired
private ConfigurationService configurationService;
@RequestMapping(value = "/post", method = RequestMethod.POST)
@RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody
......@@ -152,7 +156,8 @@ public class ToscaController {
public @ResponseBody
String transform(@PathVariable("id") String id, @RequestParam(value = "type") String type) {
try {
return toscaService.transform(id, type);
String ymlContents = toscaService.transform(id, type);
return configurationService.saveStringContents(ymlContents);
} catch (JSONException | IOException | TimeoutException | InterruptedException ex) {
Logger.getLogger(ToscaController.class.getName()).log(Level.SEVERE, null, ex);
}
......
......@@ -117,23 +117,23 @@ def execute_playbook(hosts, playbook_path,user,ssh_key_file,extra_vars,passwords
ok = results_callback.host_ok
answer = []
for res in ok:
resp = json.dumps({"host":res['ip'], "result":res['result']._result,"task":res['task']._task})
resp = json.dumps({"host":res['ip'], "result":res['result']._result,"task":res['task']})
logger.info(resp)
answer.append({"host":res['ip'], "result":res['result']._result})
answer.append({"host":res['ip'], "result":res['result']._result,"task":res['task']})
unreachable = results_callback.host_unreachable
for res in unreachable:
resp = json.dumps({"host":res['ip'], "result":res['result']._result,"task":res['task']._task})
resp = json.dumps({"host":res['ip'], "result":res['result']._result,"task":res['task']})
logger.info(resp)
answer.append({"host":res['ip'], "result":res['result']._result})
answer.append({"host":res['ip'], "result":res['result']._result,"task":res['task']})
host_failed = results_callback.host_failed
for res in host_failed:
resp = json.dumps({"host":res['ip'], "result":res['result']._result, "task":res['task']._task})
resp = json.dumps({"host":res['ip'], "result":res['result']._result, "task":res['task']})
logger.info(resp)
answer.append({"host":res['ip'], "result":res['result']._result})
answer.append({"host":res['ip'], "result":res['result']._result,"task":res['task']})
return json.dumps(answer)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment