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

Save converted compose

parent 4daa36a2
version: '3' version: '3'
services: services:
telegreen: graphite:
build: restart: always
context: ../software/telegreen image: vladwing/graphite
image: beia/telegreen volumes:
ports: - graphite_data:/opt/graphite/storage
- "8080:80" environment:
environment: - VIRTUAL_HOST=graphite.beia.switch
- MYSQL_ROOT_PASSWORD=doesntmatter networks:
- MYSQL_DATABASE=telegreen - web
- MYSQL_USER=telegreen - graphite
- MYSQL_PASSWORD=password grafana:
- MYSQL_HOST=telegreen_db restart: always
depends_on: image: grafana/grafana
- telegreen_db environment:
networks: - GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_PASSWORD:-secret}
- db - VIRTUAL_HOST=grafana.beia.switch
- monitoring volumes:
- external - grafana_data:/var/lib/grafana
telegreen_db: depends_on:
build: - graphite
context: ../software/database networks:
image: beia/telegreen_db - web
environment: monitoring_server:
- MYSQL_ROOT_PASSWORD=doesntmatter image: salmant/ul_monitoring_server_container_image
- MYSQL_DATABASE=telegreen ports:
- MYSQL_USER=telegreen - "8080:8080"
- MYSQL_PASSWORD=password - "4242:4242"
- MYSQL_HOST=telegreen_db - "4245:4245"
networks: - "7199:7199"
- db - "7000:7000"
- monitoring - "7001:7001"
alerter: - "9160:9160"
build: - "9042:9042"
context: ../software/samplegen - "8012:8012"
image: beia/alerter - "61621:61621"
command: environment:
- "/srv/beia/scripts/run-node.sh /srv/beia/samplegen app/AlerterApp.class.js" - MONITORING_SERVER=monitoring_server
image: beia/alerter - VIRTUAL_HOST=jcatascopia.beia.switch
environment: - VIRTUAL_PORT=8080
- MYSQL_ROOT_PASSWORD=doesntmatter networks:
- MYSQL_DATABASE=telegreen - asap
- MYSQL_USER=telegreen - web
- MYSQL_PASSWORD=password monitoring_adapter:
- MYSQL_HOST=telegreen_db restart: always
depends_on: image: beia/monitoring_adapter
- telegreen_db environment:
networks: - GRAPHITE_SERVER=graphite
- db - MONITORING_PREFIX=eu.beia.switch
- external - MONITORING_SERVER=${MONITORING_SERVER:-monitoring_server}
samplegen: depends_on:
build: - graphite
context: ../software/samplegen - monitoring_server
image: beia/samplegen networks:
command: - graphite
- "/srv/beia/scripts/run-node.sh /srv/beia/samplegen app/SampleGeneratorApp.class.js" - data
ports: - asap
- "8128:8000" data_collector:
environment: image: beia/data_collector
- MYSQL_ROOT_PASSWORD=doesntmatter environment:
- MYSQL_DATABASE=telegreen # - CONFIG=config
- MYSQL_USER=telegreen - STATSD_HOST=monitoring_adapter
- MYSQL_PASSWORD=password depends_on:
- MYSQL_HOST=telegreen_db # - config
depends_on: - monitoring_adapter
- telegreen_db networks:
networks: # - config
- db - data
- external alerter:
beia_mon: image: beia/alerter
build: environment:
context: ../software/monitoring # - CONFIG=config
image: beia/monitoring - STATSD_HOST=monitoring_adapter
depends_on: - VIRTUAL_HOST=alerter.beia.switch
- telegreen - NOTIFICATION_SERVICE=notify
- telegreen_db depends_on:
networks: - notify
- monitoring # - config
- external networks:
networks: # - config
db: - web
external: - data
monitoring: # config:
\ No newline at end of file # image: beia/config_manager
# environment:
# - TOSCA_URL=${TOSCA_URL:-http://www.google.com}
# networks:
# - config
web:
image: jwilder/nginx-proxy
ports:
- "80:80/tcp"
volumes:
- /var/run/docker.sock:/tmp/docker.sock:ro
networks:
- web
notify:
image: beia/notify
environment:
depends_on:
- 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:
# - 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:
- sip
volumes:
graphite_data:
grafana_data:
networks:
# config:
data:
web:
graphite:
sip:
asap:
...@@ -36,6 +36,7 @@ import org.springframework.web.bind.annotation.RestController; ...@@ -36,6 +36,7 @@ import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import nl.uva.sne.drip.api.exception.BadRequestException; 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.ToscaService;
import nl.uva.sne.drip.api.service.UserService; import nl.uva.sne.drip.api.service.UserService;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
...@@ -57,6 +58,9 @@ public class ToscaController { ...@@ -57,6 +58,9 @@ public class ToscaController {
@Autowired @Autowired
private ToscaService toscaService; private ToscaService toscaService;
@Autowired
private ConfigurationService configurationService;
@RequestMapping(value = "/post", method = RequestMethod.POST) @RequestMapping(value = "/post", method = RequestMethod.POST)
@RolesAllowed({UserService.USER, UserService.ADMIN}) @RolesAllowed({UserService.USER, UserService.ADMIN})
public @ResponseBody public @ResponseBody
...@@ -152,7 +156,8 @@ public class ToscaController { ...@@ -152,7 +156,8 @@ public class ToscaController {
public @ResponseBody public @ResponseBody
String transform(@PathVariable("id") String id, @RequestParam(value = "type") String type) { String transform(@PathVariable("id") String id, @RequestParam(value = "type") String type) {
try { try {
return toscaService.transform(id, type); String ymlContents = toscaService.transform(id, type);
return configurationService.saveStringContents(ymlContents);
} catch (JSONException | IOException | TimeoutException | InterruptedException ex) { } catch (JSONException | IOException | TimeoutException | InterruptedException ex) {
Logger.getLogger(ToscaController.class.getName()).log(Level.SEVERE, null, 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 ...@@ -117,23 +117,23 @@ def execute_playbook(hosts, playbook_path,user,ssh_key_file,extra_vars,passwords
ok = results_callback.host_ok ok = results_callback.host_ok
answer = [] answer = []
for res in ok: 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) 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 unreachable = results_callback.host_unreachable
for res in 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) 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 host_failed = results_callback.host_failed
for res in 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) 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) 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