-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from brianwalborn/develop
Release v1.0
- Loading branch information
Showing
58 changed files
with
500 additions
and
454 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,31 @@ | ||
import json | ||
import os | ||
from cloud_browser.services.custom.check_auto_scaling_groups import Scanner | ||
from flask import current_app as app | ||
from flask import Blueprint, flash, render_template | ||
from cloud_browser.blueprints.utils.breadcrumb import Breadcrumb | ||
from cloud_browser.tasks.get_auto_scaling_groups import GetAutoScalingGroups | ||
from flask import Blueprint, flash, render_template, request | ||
|
||
bp = Blueprint('autoscaling', __name__) | ||
|
||
@bp.route('/autoscaling') | ||
def index(): | ||
f = open(os.path.join(app.static_folder, 'data', 'services.json')) | ||
services = json.load(f) | ||
actions = [] | ||
@bp.route('/autoscaling/get_life_cycle_hooks') | ||
def get_life_cycle_hooks(): | ||
auto_scaling_groups = [] | ||
|
||
for service in services: | ||
if service['name'] == 'autoscaling': actions = service['actions'] | ||
try: | ||
auto_scaling_groups.extend(GetAutoScalingGroups().get_auto_scaling_groups()) | ||
|
||
if not auto_scaling_groups: flash('No results returned. Please review settings.', 'warning') | ||
except Exception as e: | ||
flash(e, 'error') | ||
|
||
return render_template('actions.html', service = 'autoscaling', actions = actions) | ||
return render_template('autoscaling/life_cycle_hooks.html', auto_scaling_groups = auto_scaling_groups, breadcrumbs = Breadcrumb.get_breadcrumbs(request.path), service = 'get_life_cycle_hooks') | ||
|
||
@bp.route('/autoscaling/check_auto_scaling_groups') | ||
def check_auto_scaling_groups(): | ||
@bp.route('/autoscaling/get_suspended_processes') | ||
def get_suspended_processes(): | ||
auto_scaling_groups = [] | ||
|
||
try: | ||
scanner = Scanner() | ||
auto_scaling_groups.extend(scanner.get_auto_scaling_groups()) | ||
auto_scaling_groups.extend(GetAutoScalingGroups().get_auto_scaling_groups()) | ||
|
||
if not auto_scaling_groups: flash('No results returned. Please review settings.', 'warning') | ||
except Exception as e: | ||
flash(e, 'error') | ||
|
||
return render_template('autoscaling/check_auto_scaling_groups.html', auto_scaling_groups = auto_scaling_groups, service = 'check_auto_scaling_groups') | ||
return render_template('autoscaling/suspended_processes.html', auto_scaling_groups = auto_scaling_groups, breadcrumbs = Breadcrumb.get_breadcrumbs(request.path), service = 'get_suspended_processes') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import json | ||
import os | ||
from cloud_browser.blueprints.utils.breadcrumb import Breadcrumb | ||
from flask import current_app as app | ||
from flask import Blueprint, render_template, request | ||
|
||
bp = Blueprint('base', __name__) | ||
|
||
@bp.route('/') | ||
def index(): | ||
f = open(os.path.join(app.static_folder, 'data', 'services.json')) | ||
services = json.load(f) | ||
|
||
return render_template('base.html', services = services) | ||
|
||
@bp.route('/<string:service>') | ||
def load_tasks(service): | ||
f = open(os.path.join(app.static_folder, 'data', 'services.json')) | ||
services = json.load(f) | ||
tasks = [] | ||
|
||
for aws_service in services: | ||
if aws_service['name'] == service: tasks = aws_service['tasks'] | ||
|
||
return render_template('tasks.html', breadcrumbs = Breadcrumb.get_breadcrumbs(request.path), service = service, tasks = tasks) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,16 @@ | ||
import json | ||
import os | ||
from cloud_browser.services.custom.generate_conf_cons import Generator | ||
from flask import current_app as app | ||
from flask import Blueprint, flash, render_template | ||
from cloud_browser.blueprints.utils.breadcrumb import Breadcrumb | ||
from cloud_browser.tasks.generate_conf_cons import GenerateConfCons | ||
from flask import Blueprint, flash, render_template, request | ||
|
||
bp = Blueprint('ec2', __name__) | ||
|
||
@bp.route('/ec2') | ||
def index(): | ||
f = open(os.path.join(app.static_folder, 'data', 'services.json')) | ||
services = json.load(f) | ||
actions = [] | ||
|
||
for service in services: | ||
if service['name'] == 'ec2': actions = service['actions'] | ||
|
||
return render_template('actions.html', service = 'ec2', actions = actions) | ||
|
||
@bp.route('/ec2/generate_conf_cons') | ||
def generate_conf_cons(): | ||
xml = '' | ||
|
||
try: | ||
generator = Generator() | ||
xml = generator.run() | ||
xml = GenerateConfCons().generate() | ||
except Exception as e: | ||
flash(e, 'error') | ||
|
||
return render_template('ec2/generate_conf_cons.html', service = 'generate_conf_cons', xml = xml) | ||
return render_template('ec2/generate_conf_cons.html', breadcrumbs = Breadcrumb.get_breadcrumbs(request.path), service = 'generate_conf_cons', xml = xml) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,18 @@ | ||
import json | ||
import os | ||
from cloud_browser.services.custom.check_load_balancer_health import Check | ||
from flask import current_app as app | ||
from flask import Blueprint, flash, render_template | ||
from cloud_browser.blueprints.utils.breadcrumb import Breadcrumb | ||
from cloud_browser.tasks.load_balancer_health import LoadBalancerHealth | ||
from flask import Blueprint, flash, render_template, request | ||
|
||
bp = Blueprint('elb', __name__) | ||
|
||
@bp.route('/elb') | ||
def index(): | ||
f = open(os.path.join(app.static_folder, 'data', 'services.json')) | ||
services = json.load(f) | ||
actions = [] | ||
|
||
for service in services: | ||
if service['name'] == 'elb': actions = service['actions'] | ||
|
||
return render_template('actions.html', service = 'elb', actions = actions) | ||
|
||
@bp.route('/elb/check_load_balancer_health') | ||
def check_load_balancer_health(): | ||
@bp.route('/elb/get_load_balancer_health') | ||
def get_load_balancer_health(): | ||
load_balancers = [] | ||
|
||
try: | ||
check = Check() | ||
load_balancers.extend(check.get_load_balancer_instance_health()) | ||
load_balancers.extend(LoadBalancerHealth().get_load_balancer_health()) | ||
|
||
if not load_balancers: flash('No results returned. Please review settings.', 'warning') | ||
except Exception as e: | ||
flash(e, 'error') | ||
|
||
return render_template('elb/check_load_balancer_health.html', load_balancers = load_balancers, service = 'check_load_balancer_health') | ||
return render_template('elb/load_balancer_health.html', breadcrumbs = Breadcrumb.get_breadcrumbs(request.path), load_balancers = load_balancers, service = 'get_load_balancer_health') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,16 @@ | ||
import cloud_browser.services.custom.check_target_group_health as health | ||
import json | ||
import os | ||
from flask import current_app as app | ||
from flask import Blueprint, flash, render_template | ||
from cloud_browser.blueprints.utils.breadcrumb import Breadcrumb | ||
from cloud_browser.tasks.target_group_health import TargetGroupHealth | ||
from flask import Blueprint, flash, render_template, request | ||
|
||
bp = Blueprint('elbv2', __name__) | ||
|
||
@bp.route('/elbv2') | ||
def index(): | ||
f = open(os.path.join(app.static_folder, 'data', 'services.json')) | ||
services = json.load(f) | ||
actions = [] | ||
|
||
for service in services: | ||
if service['name'] == 'elbv2': actions = service['actions'] | ||
|
||
return render_template('actions.html', service = 'elbv2', actions = actions) | ||
|
||
@bp.route('/elbv2/check_target_group_health') | ||
def check_target_group_health(): | ||
@bp.route('/elbv2/get_target_group_health') | ||
def get_target_group_health(): | ||
results = [] | ||
|
||
try: | ||
results = health.check_target_group_health() | ||
results = TargetGroupHealth().get_target_group_health() | ||
except Exception as e: | ||
flash(e, 'error') | ||
|
||
return render_template('elbv2/check_target_group_health.html', target_groups = results, service = 'check_target_group_health') | ||
return render_template('elbv2/target_group_health.html', breadcrumbs = Breadcrumb.get_breadcrumbs(request.path), target_groups = results, service = 'get_target_group_health') |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
class Breadcrumb: | ||
def get_breadcrumbs(path: str) -> list[str]: | ||
breadcrumbs: list[Crumb] = [] | ||
crumbs: list[str] = path.split('/') | ||
|
||
for crumb in crumbs: | ||
if not breadcrumbs: | ||
breadcrumbs.append(Crumb('home', True, '/')) | ||
continue | ||
|
||
breadcrumbs.append(Crumb(crumb, crumbs.index(crumb) < len(crumbs) - 1, f'{path.split(crumb)[0]}/{crumb}'.replace('//', '/'))) | ||
|
||
return breadcrumbs | ||
|
||
class Crumb: | ||
def __init__(self, display, enabled, path): | ||
self.display: str = display | ||
self.enabled: bool = enabled | ||
self.path: str = path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.