Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toxophilist/sprint 11 #133

Merged
merged 2 commits into from
Oct 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,6 @@ containers/.oci

containers/oci/*
!containers/oci/example_config
!containers/cloud

!okitweb/static/model
2 changes: 1 addition & 1 deletion containers/cloud/cloud_init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ write_files:

runcmd:
# Install Required Python Modules
- sudo bash -c "pip3 install --no-cache-dir flask==1.1.1 gunicorn==20.0.4 oci==2.22.0 pandas==1.1.2 pyyaml==5.2 requests==2.24.0"
- sudo bash -c "pip3 install --no-cache-dir flask==1.1.1 gunicorn==20.0.4 oci==2.22.0 pandas==1.1.2 pyyaml==5.2 requests==2.24.0 xlswriter==1.3.6"
# Clone OKIT
- sudo bash -c "git clone -b toxophilist/sprint-11 --depth 1 https://github.com/oracle/oci-designer-toolkit.git /okit"
- sudo bash -c "mkdir /okit/{log,workspace}"
Expand Down
1 change: 1 addition & 0 deletions containers/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ RUN yum install -y \
pandas==1.1.2 \
pyyaml==5.2 \
requests==2.24.0 \
xlswriter==1.3.6 \
# Create Workspace
&& mkdir -p /okit/{config,log,visualiser,okitweb,workspace,templates} \
&& mkdir -p /okit/okitweb/static/okit/templates \
Expand Down
3 changes: 2 additions & 1 deletion containers/vagrant/configure_software.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,6 @@ pip3 install --no-cache-dir \
oci==2.22.0 \
pandas==1.1.2 \
pyyaml==5.2 \
requests==2.24.0
requests==2.24.0 \
xlswriter==1.3.6

21 changes: 21 additions & 0 deletions okitweb/okitOci.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@
from facades.ociInternetGateway import OCIInternetGateways
from facades.ociIPSecConnection import OCIIPSecConnections
from facades.ociLoadBalancer import OCILoadBalancers
from facades.ociLoadBalancerShape import OCILoadBalancerShapes
from facades.ociLocalPeeringGateway import OCILocalPeeringGateways
from facades.ociMySQLConfiguration import OCIMySQLConfigurations
from facades.ociMySQLDatabaseSystem import OCIMySQLDatabaseSystems
from facades.ociMySQLShape import OCIMySQLShapes
from facades.ociMySQLVersion import OCIMySQLVersions
from facades.ociNATGateway import OCINATGateways
from facades.ociNetworkSecurityGroup import OCINetworkSecurityGroups
from facades.ociObjectStorageBuckets import OCIObjectStorageBuckets
Expand Down Expand Up @@ -261,6 +266,10 @@ def ociArtifacts(artifact):
logger.info('---- Processing LocalPeeringGateways')
oci_local_peering_gateways = OCILocalPeeringGateways(config=config, profile=config_profile, compartment_id=query_json['compartment_id'], vcn_id=query_json['vcn_id'])
response_json = oci_local_peering_gateways.list(filter=query_json.get('local_peering_gateway_filter', None))
elif artifact == 'MySQLDatabaseSystem':
logger.info('---- Processing MySQL Database Systems')
oci_mysql_database_systems = OCIMySQLDatabaseSystems(config=config, profile=config_profile, compartment_id=query_json['compartment_id'])
response_json = oci_mysql_database_systems.list(filter=query_json.get('mysql_database_system_filter', None))
elif artifact == 'NATGateway':
logger.info('---- Processing NAT Gateways')
oci_nat_gateways = OCINATGateways(config=config, profile=config_profile, compartment_id=query_json['compartment_id'], vcn_id=query_json['vcn_id'])
Expand Down Expand Up @@ -338,6 +347,18 @@ def dropdownQuery():
# Fast Connect Provider Services
fast_connect_provider_services = OCIFastConnectProviderServices()
dropdown_json["fast_connect_provider_services"] = sorted(fast_connect_provider_services.list(), key=lambda k: k['provider_name'])
# MySQL Shapes
mysql_shapes = OCIMySQLShapes()
dropdown_json["mysql_shapes"] = sorted(mysql_shapes.list(), key=lambda k: k['name'])
# Database Versions
mysql_versions = OCIMySQLVersions()
dropdown_json["mysql_versions"] = sorted(mysql_versions.list(), key=lambda k: k['version_family'])
# MySQL Configurations
mysql_configurations = OCIMySQLConfigurations()
dropdown_json["mysql_configurations"] = sorted(mysql_configurations.list(), key=lambda k: k['display_name'])
# Instance Shapes
oci_loadbalancer_shapes = OCILoadBalancerShapes()
dropdown_json["loadbalancer_shapes"] = oci_loadbalancer_shapes.list()
return dropdown_json
else:
return 'Unknown Method', 500
Expand Down
16 changes: 16 additions & 0 deletions okitweb/static/okit/js/okit.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,22 @@ class OkitOCIData {
return [...new Set(images)].sort((a, b) => b - a);
}

getMySQLConfigurations(shape_name='') {
if (shape_name === '') {
return this.mysql_configurations;
} else {
return this.mysql_configurations.filter(function(dss) {return dss.shape_name === shape_name;});
}
}

getMySQLShapes() {
return this.mysql_shapes;
}

getMySQLVersions(family='') {
return this.mysql_versions[0].versions;
}

getRegions() {
return this.regions;
}
Expand Down
Loading