Ejemplo n.º 1
0
def list_projects():
    """
    List docker compose projects
    """
    global projects
    projects = find_yml_files(YML_PATH)
    return jsonify(projects=projects)
Ejemplo n.º 2
0
def list_projects():
    """
    List docker compose projects
    """
    global projects
    projects = find_yml_files(YML_PATH)
    return jsonify(projects=projects)
Ejemplo n.º 3
0
def load_projects():
    """
    load project definitions (docker-compose.yml files)
    """
    global projects
    projects = find_yml_files(YML_PATH)
    logging.debug(projects)
Ejemplo n.º 4
0
def load_projects():
    """
    load project definitions (docker-compose.yml files)
    """
    global projects
    projects = find_yml_files(YML_PATH)
    logging.debug(projects)
Ejemplo n.º 5
0
  disable_authentication, set_authentication
from json import loads
import logging
import requests
import docker
import os
import traceback

# Flask Application
API_V1 = '/api/v1/'
YML_PATH = '/opt/docker-compose-projects'
logging.basicConfig(level=logging.DEBUG)
app = Flask(__name__, static_url_path='')

# load project definitions
projects = find_yml_files(YML_PATH)

logging.debug(projects)


def get_project_with_name(name):
    """
    get docker compose project given a project name
    """
    path = projects[name]
    return get_project(path)


# REST endpoints

Ejemplo n.º 6
0
import docker
import requests
from flask import Flask, jsonify, request
from scripts.bridge import ps_, get_project, get_container_from_id, get_yml_path
from scripts.find_yml import find_yml_files
from scripts.requires_auth import requires_auth, authentication_enabled, \
  disable_authentication, set_authentication

# Flask Application
API_V1 = '/api/v1/'
YML_PATH = '/opt/docker-compose-projects'
logging.basicConfig(level=logging.DEBUG)
app = Flask(__name__, static_url_path='')

# load project definitions
projects = find_yml_files(YML_PATH)

logging.debug(projects)


def get_project_with_name(name):
    """
    get docker compose project given a project name
    """
    path = projects[name]
    return get_project(path)

# REST endpoints

@app.route(API_V1 + "projects", methods=['GET'])
def list_projects():