From 583773fab2adc1a2f1cfcc9c36408bfb9250f898 Mon Sep 17 00:00:00 2001 From: Andrew Hopkinson Date: Thu, 17 Sep 2020 17:43:41 +0100 Subject: [PATCH 01/42] Fix Service Gateway only offers all services when drawn but then provisions Object Storage #107 --- okitweb/okitOci.py | 15 +- okitweb/static/okit/json/dropdown.json | 715 ++++++++++++++---- .../model/js/artefacts/service_gateway.js | 2 +- .../{hidden => compute}/Instance_Pool.svg | 0 .../{Waf.svg => Web_Application_Firewall.svg} | 0 .../Ipsec.svg => networking/IPSec.svg} | 0 okitweb/templates/okit/okit_designer.html | 4 +- .../okit/propertysheets/service_gateway.html | 3 +- visualiser/facades/ociConnection.py | 11 + visualiser/facades/ociServiceGateway.py | 24 +- visualiser/facades/ociServices.py | 51 ++ visualiser/parsers/okitHclJsonParser.py | 2 +- .../terraform/service_gateway.jinja2 | 7 +- 13 files changed, 650 insertions(+), 184 deletions(-) rename okitweb/static/okit/palette/{hidden => compute}/Instance_Pool.svg (100%) rename okitweb/static/okit/palette/hidden/{Waf.svg => Web_Application_Firewall.svg} (100%) rename okitweb/static/okit/palette/{hidden/Ipsec.svg => networking/IPSec.svg} (100%) create mode 100644 visualiser/facades/ociServices.py diff --git a/okitweb/okitOci.py b/okitweb/okitOci.py index 398f8c9a7..9ec0827ae 100644 --- a/okitweb/okitOci.py +++ b/okitweb/okitOci.py @@ -50,6 +50,7 @@ from facades.ociRouteTable import OCIRouteTables from facades.ociSecurityList import OCISecurityLists from facades.ociServiceGateway import OCIServiceGateways +from facades.ociServices import OCIServices from facades.ociShape import OCIShapes from facades.ociSubnet import OCISubnets from facades.ociTenancy import OCITenancies @@ -295,14 +296,24 @@ def ociArtifacts(artifact): def dropdownQuery(): if request.method == 'GET': dropdown_json = {} + # Regions + oci_regions = OCIRegions() + dropdown_json["regions"] = sorted(oci_regions.list(), key=lambda k: k['name']) + # Services + oci_services = OCIServices() + dropdown_json["services"] = sorted(oci_services.list(), key=lambda k: k['name']) + # Instance Shapes oci_shapes = OCIShapes() dropdown_json["shapes"] = sorted(oci_shapes.list(), key=lambda k: k['sort_key']) + oci_images = OCIImages() + dropdown_json["images"] = sorted(oci_images.list(), key=lambda k: k['sort_key']) + # Database System Shapes db_system_shapes = OCIDatabaseSystemShapes() dropdown_json["db_system_shapes"] = sorted(db_system_shapes.list(), key=lambda k: k['shape']) + # Database Versions db_versions = OCIDatabaseVersions() dropdown_json["db_versions"] = sorted(db_versions.list(), key=lambda k: k['version']) - oci_images = OCIImages() - dropdown_json["images"] = sorted(oci_images.list(), key=lambda k: k['sort_key']) + # Instance Images return dropdown_json else: return 'Unknown Method', 500 diff --git a/okitweb/static/okit/json/dropdown.json b/okitweb/static/okit/json/dropdown.json index 7fbc1808f..a25112751 100644 --- a/okitweb/static/okit/json/dropdown.json +++ b/okitweb/static/okit/json/dropdown.json @@ -607,9 +607,9 @@ "compartment_id": null, "create_image_allowed": true, "defined_tags": {}, - "display_name": "Canonical-Ubuntu-16.04-Gen2-GPU-2020.06.11-0", + "display_name": "Canonical-Ubuntu-16.04-Gen2-GPU-2020.09.11-0", "freeform_tags": {}, - "id": "ocid1.image.oc1.phx.aaaaaaaamzhlsblmr7keoyh7ss2o7hjv2k7c3gywhy4reoar224yz5zvxq6q", + "id": "ocid1.image.oc1.phx.aaaaaaaa2v6cjmd7amwh4c3qgid5eoblpv4yhapqzy7qdxq2wwwfzr4vztga", "launch_mode": "NATIVE", "launch_options": { "boot_volume_type": "PARAVIRTUALIZED", @@ -625,7 +625,7 @@ "shapes": [], "size_in_mbs": 47694, "sort_key": "Canonical Ubuntu 16.04", - "time_created": "2020-06-12T18:44:15.987000+00:00" + "time_created": "2020-09-11T04:26:21.564000+00:00" }, { "agent_features": null, @@ -679,6 +679,32 @@ "sort_key": "Canonical Ubuntu 16.04", "time_created": "2020-07-22T20:24:11.371000+00:00" }, + { + "agent_features": null, + "base_image_id": null, + "compartment_id": null, + "create_image_allowed": true, + "defined_tags": {}, + "display_name": "Canonical-Ubuntu-16.04-2020.09.08-0", + "freeform_tags": {}, + "id": "ocid1.image.oc1.phx.aaaaaaaaxx5rtokz3ieto6z5rsiosh4diglkacbilz37edcvmqt2wlh4jzmq", + "launch_mode": "NATIVE", + "launch_options": { + "boot_volume_type": "PARAVIRTUALIZED", + "firmware": "UEFI_64", + "is_consistent_volume_naming_enabled": true, + "is_pv_encryption_in_transit_enabled": true, + "network_type": "PARAVIRTUALIZED", + "remote_data_volume_type": "PARAVIRTUALIZED" + }, + "lifecycle_state": "AVAILABLE", + "operating_system": "Canonical Ubuntu", + "operating_system_version": "16.04", + "shapes": [], + "size_in_mbs": 47694, + "sort_key": "Canonical Ubuntu 16.04", + "time_created": "2020-09-11T16:55:34.138000+00:00" + }, { "agent_features": null, "base_image_id": null, @@ -737,9 +763,9 @@ "compartment_id": null, "create_image_allowed": true, "defined_tags": {}, - "display_name": "Canonical-Ubuntu-16.04-2020.06.11-0", + "display_name": "Canonical-Ubuntu-16.04-Minimal-2020.09.08-0", "freeform_tags": {}, - "id": "ocid1.image.oc1.phx.aaaaaaaatrkb3nejqezqr2hazbzgqjzsjb5jmw7xhvqafiuxtkhailmnwivq", + "id": "ocid1.image.oc1.phx.aaaaaaaas6vfj6o3nvgdxagq6sc64gcvcmjlbpke7jcidwddwe2q425v4oya", "launch_mode": "NATIVE", "launch_options": { "boot_volume_type": "PARAVIRTUALIZED", @@ -751,11 +777,11 @@ }, "lifecycle_state": "AVAILABLE", "operating_system": "Canonical Ubuntu", - "operating_system_version": "16.04", + "operating_system_version": "16.04 Minimal", "shapes": [], "size_in_mbs": 47694, - "sort_key": "Canonical Ubuntu 16.04", - "time_created": "2020-06-12T18:42:20.616000+00:00" + "sort_key": "Canonical Ubuntu 16.04 Minimal", + "time_created": "2020-09-11T04:27:11.769000+00:00" }, { "agent_features": null, @@ -815,9 +841,9 @@ "compartment_id": null, "create_image_allowed": true, "defined_tags": {}, - "display_name": "Canonical-Ubuntu-16.04-Minimal-2020.06.11-0", + "display_name": "Canonical-Ubuntu-18.04-2020.09.10-0", "freeform_tags": {}, - "id": "ocid1.image.oc1.phx.aaaaaaaaetnvdvw2lsuwrtdirbvhfcm33pdxk66dhfcjzkqi2tjidbgl3yga", + "id": "ocid1.image.oc1.phx.aaaaaaaawzjacdq4gcbtfl2nwe53fusymdc6o56g6pnfbw2v3466j4czdk7a", "launch_mode": "NATIVE", "launch_options": { "boot_volume_type": "PARAVIRTUALIZED", @@ -829,11 +855,11 @@ }, "lifecycle_state": "AVAILABLE", "operating_system": "Canonical Ubuntu", - "operating_system_version": "16.04 Minimal", + "operating_system_version": "18.04", "shapes": [], "size_in_mbs": 47694, - "sort_key": "Canonical Ubuntu 16.04 Minimal", - "time_created": "2020-06-12T18:44:51.216000+00:00" + "sort_key": "Canonical Ubuntu 18.04", + "time_created": "2020-09-11T04:27:04.714000+00:00" }, { "agent_features": null, @@ -893,9 +919,9 @@ "compartment_id": null, "create_image_allowed": true, "defined_tags": {}, - "display_name": "Canonical-Ubuntu-18.04-2020.06.11-0", + "display_name": "Canonical-Ubuntu-18.04-Minimal-2020.09.10-0", "freeform_tags": {}, - "id": "ocid1.image.oc1.phx.aaaaaaaa2idgsogk3ialam2xdzoeipz4wli5itgjaki5n72objvaiygcyzwa", + "id": "ocid1.image.oc1.phx.aaaaaaaaegwxhu6zbvjfrb43omsfo2tle5qjiqj7su72rwo624jdmfe2pfeq", "launch_mode": "NATIVE", "launch_options": { "boot_volume_type": "PARAVIRTUALIZED", @@ -907,11 +933,11 @@ }, "lifecycle_state": "AVAILABLE", "operating_system": "Canonical Ubuntu", - "operating_system_version": "18.04", + "operating_system_version": "18.04 Minimal", "shapes": [], "size_in_mbs": 47694, - "sort_key": "Canonical Ubuntu 18.04", - "time_created": "2020-06-12T18:42:58.028000+00:00" + "sort_key": "Canonical Ubuntu 18.04 Minimal", + "time_created": "2020-09-11T17:18:28.552000+00:00" }, { "agent_features": null, @@ -971,9 +997,9 @@ "compartment_id": null, "create_image_allowed": true, "defined_tags": {}, - "display_name": "Canonical-Ubuntu-18.04-Minimal-2020.06.11-0", + "display_name": "Canonical-Ubuntu-20.04-2020.09.07-0", "freeform_tags": {}, - "id": "ocid1.image.oc1.phx.aaaaaaaa45lzmijcz4iavrfxg4czkcufpqkvrd2rqhdyq6lykxpetfyfxkea", + "id": "ocid1.image.oc1.phx.aaaaaaaao6hcptgplqxdm2wcocrislrmb67wdqytypw3mlzv2ivrusxnflzq", "launch_mode": "NATIVE", "launch_options": { "boot_volume_type": "PARAVIRTUALIZED", @@ -985,11 +1011,11 @@ }, "lifecycle_state": "AVAILABLE", "operating_system": "Canonical Ubuntu", - "operating_system_version": "18.04 Minimal", + "operating_system_version": "20.04", "shapes": [], "size_in_mbs": 47694, - "sort_key": "Canonical Ubuntu 18.04 Minimal", - "time_created": "2020-06-12T18:44:15.568000+00:00" + "sort_key": "Canonical Ubuntu 20.04", + "time_created": "2020-09-11T19:36:09.750000+00:00" }, { "agent_features": null, @@ -1049,9 +1075,9 @@ "compartment_id": null, "create_image_allowed": true, "defined_tags": {}, - "display_name": "Canonical-Ubuntu-20.04-2020.06.11-0", + "display_name": "Canonical-Ubuntu-20.04-Minimal-2020.09.07-0", "freeform_tags": {}, - "id": "ocid1.image.oc1.phx.aaaaaaaagxjw52zc22yyyqtid5737elillsqt2vxokj5wdnvhvswhyol74qq", + "id": "ocid1.image.oc1.phx.aaaaaaaaizxszm6byd2azc5hz5hfxx7gr3r4f5v3inm2ukopzr5juvpslofa", "launch_mode": "NATIVE", "launch_options": { "boot_volume_type": "PARAVIRTUALIZED", @@ -1063,11 +1089,11 @@ }, "lifecycle_state": "AVAILABLE", "operating_system": "Canonical Ubuntu", - "operating_system_version": "20.04", + "operating_system_version": "20.04 Minimal", "shapes": [], "size_in_mbs": 47694, - "sort_key": "Canonical Ubuntu 20.04", - "time_created": "2020-06-12T18:44:14.738000+00:00" + "sort_key": "Canonical Ubuntu 20.04 Minimal", + "time_created": "2020-09-11T19:34:04.433000+00:00" }, { "agent_features": null, @@ -1121,32 +1147,6 @@ "sort_key": "Canonical Ubuntu 20.04 Minimal", "time_created": "2020-07-22T20:24:30.596000+00:00" }, - { - "agent_features": null, - "base_image_id": null, - "compartment_id": null, - "create_image_allowed": true, - "defined_tags": {}, - "display_name": "Canonical-Ubuntu-20.04-Minimal-2020.06.11-0", - "freeform_tags": {}, - "id": "ocid1.image.oc1.phx.aaaaaaaaoigo34hq77miw7synhozkrmonwij7qcs6smntlsp5cf4lixbgm4a", - "launch_mode": "NATIVE", - "launch_options": { - "boot_volume_type": "PARAVIRTUALIZED", - "firmware": "UEFI_64", - "is_consistent_volume_naming_enabled": true, - "is_pv_encryption_in_transit_enabled": true, - "network_type": "PARAVIRTUALIZED", - "remote_data_volume_type": "PARAVIRTUALIZED" - }, - "lifecycle_state": "AVAILABLE", - "operating_system": "Canonical Ubuntu", - "operating_system_version": "20.04 Minimal", - "shapes": [], - "size_in_mbs": 47694, - "sort_key": "Canonical Ubuntu 20.04 Minimal", - "time_created": "2020-06-12T18:46:02.787000+00:00" - }, { "agent_features": null, "base_image_id": null, @@ -1745,6 +1745,32 @@ "sort_key": "Oracle Linux 8", "time_created": "2020-07-28T16:00:35.017000+00:00" }, + { + "agent_features": null, + "base_image_id": null, + "compartment_id": null, + "create_image_allowed": true, + "defined_tags": {}, + "display_name": "Windows-Server-2012-R2-Datacenter-Edition-BM-Gen2-E2-2020.08.26-0", + "freeform_tags": {}, + "id": "ocid1.image.oc1.phx.aaaaaaaaopy32lgqiazzcccuaonheaq3hdegl27dvpaesy4q2j3yi3tup27a", + "launch_mode": "NATIVE", + "launch_options": { + "boot_volume_type": "PARAVIRTUALIZED", + "firmware": "UEFI_64", + "is_consistent_volume_naming_enabled": false, + "is_pv_encryption_in_transit_enabled": true, + "network_type": "VFIO", + "remote_data_volume_type": "PARAVIRTUALIZED" + }, + "lifecycle_state": "AVAILABLE", + "operating_system": "Windows", + "operating_system_version": "Server 2012 R2 Datacenter", + "shapes": [], + "size_in_mbs": 262144, + "sort_key": "Windows Server 2012 R2 Datacenter", + "time_created": "2020-09-01T22:19:18.917000+00:00" + }, { "agent_features": null, "base_image_id": null, @@ -1803,9 +1829,9 @@ "compartment_id": null, "create_image_allowed": true, "defined_tags": {}, - "display_name": "Windows-Server-2012-R2-Datacenter-Edition-BM-Gen2-E2-2020.05.19-0", + "display_name": "Windows-Server-2012-R2-Datacenter-Edition-BM-Gen2-DenseIO-2020.08.31-0", "freeform_tags": {}, - "id": "ocid1.image.oc1.phx.aaaaaaaa3sbwzsy3v6otzcopx47ecjtf7tgtpzn7z57e3tckdpm36l62d5yq", + "id": "ocid1.image.oc1.phx.aaaaaaaaitfr3bbz2nkfwi4f4spd33lvod2brjgvzsvpwbpchngqw3zkynuq", "launch_mode": "NATIVE", "launch_options": { "boot_volume_type": "PARAVIRTUALIZED", @@ -1821,7 +1847,7 @@ "shapes": [], "size_in_mbs": 262144, "sort_key": "Windows Server 2012 R2 Datacenter", - "time_created": "2020-05-27T01:23:37.487000+00:00" + "time_created": "2020-09-01T22:18:51.838000+00:00" }, { "agent_features": null, @@ -1881,9 +1907,9 @@ "compartment_id": null, "create_image_allowed": true, "defined_tags": {}, - "display_name": "Windows-Server-2012-R2-Datacenter-Edition-BM-Gen2-DenseIO-2020.05.19-0", + "display_name": "Windows-Server-2012-R2-Datacenter-Edition-BM-Gen2-2020.08.26-0", "freeform_tags": {}, - "id": "ocid1.image.oc1.phx.aaaaaaaaukpf5ovr2niehs5jcqwhv4f72iai74u4eam4fywwfl4gn3ihdgza", + "id": "ocid1.image.oc1.phx.aaaaaaaapazc6izdinxd4ihfpflnhqiw4yyprru3cbwvatnvyurr6znbh4ga", "launch_mode": "NATIVE", "launch_options": { "boot_volume_type": "PARAVIRTUALIZED", @@ -1899,7 +1925,7 @@ "shapes": [], "size_in_mbs": 262144, "sort_key": "Windows Server 2012 R2 Datacenter", - "time_created": "2020-05-26T20:23:02.921000+00:00" + "time_created": "2020-09-01T22:16:59.844000+00:00" }, { "agent_features": null, @@ -1959,9 +1985,9 @@ "compartment_id": null, "create_image_allowed": true, "defined_tags": {}, - "display_name": "Windows-Server-2012-R2-Datacenter-Edition-BM-Gen2-2020.05.19-0", + "display_name": "Windows-Server-2012-R2-Datacenter-Edition-BM-2020.08.26-0", "freeform_tags": {}, - "id": "ocid1.image.oc1.phx.aaaaaaaamgwan7u4o3pa7fxjqvubt7xkqk7bpnlibn6vrdhmj5y6ryli4bnq", + "id": "ocid1.image.oc1.phx.aaaaaaaa4zxr45dqgmqevwgchxn6pxn6qvowynosrre4crofbfh4ojyu5mlq", "launch_mode": "NATIVE", "launch_options": { "boot_volume_type": "PARAVIRTUALIZED", @@ -1977,7 +2003,7 @@ "shapes": [], "size_in_mbs": 262144, "sort_key": "Windows Server 2012 R2 Datacenter", - "time_created": "2020-05-26T20:23:47.465000+00:00" + "time_created": "2020-09-01T22:19:17.816000+00:00" }, { "agent_features": null, @@ -2037,25 +2063,25 @@ "compartment_id": null, "create_image_allowed": true, "defined_tags": {}, - "display_name": "Windows-Server-2012-R2-Datacenter-Edition-BM-2020.05.19-0", + "display_name": "Windows-Server-2012-R2-Standard-Edition-VM-Gen2-E2-2020.08.27-0", "freeform_tags": {}, - "id": "ocid1.image.oc1.phx.aaaaaaaaug32foq3h3hdkralflbnstlvudugrlpkeckjmy4wyf4ab2z35dea", - "launch_mode": "NATIVE", + "id": "ocid1.image.oc1.phx.aaaaaaaawzxvick5aconxusn7u2yl5sc6pka57jp5ucopa43h7qcflnzwj2q", + "launch_mode": "PARAVIRTUALIZED", "launch_options": { "boot_volume_type": "PARAVIRTUALIZED", "firmware": "UEFI_64", "is_consistent_volume_naming_enabled": false, "is_pv_encryption_in_transit_enabled": true, - "network_type": "VFIO", + "network_type": "PARAVIRTUALIZED", "remote_data_volume_type": "PARAVIRTUALIZED" }, "lifecycle_state": "AVAILABLE", "operating_system": "Windows", - "operating_system_version": "Server 2012 R2 Datacenter", + "operating_system_version": "Server 2012 R2 Standard", "shapes": [], "size_in_mbs": 262144, - "sort_key": "Windows Server 2012 R2 Datacenter", - "time_created": "2020-05-26T20:24:55.518000+00:00" + "sort_key": "Windows Server 2012 R2 Standard", + "time_created": "2020-09-01T22:18:28.810000+00:00" }, { "agent_features": null, @@ -2115,16 +2141,16 @@ "compartment_id": null, "create_image_allowed": true, "defined_tags": {}, - "display_name": "Windows-Server-2012-R2-Standard-Edition-VM-Gen2-E2-2020.05.19-0", + "display_name": "Windows-Server-2012-R2-Standard-Edition-VM-Gen2-2020.08.26-0", "freeform_tags": {}, - "id": "ocid1.image.oc1.phx.aaaaaaaauwrwpcq6l2nxknkhnu6uz62ivzm5ot5ntyiypctyhggcrv4aacda", - "launch_mode": "PARAVIRTUALIZED", + "id": "ocid1.image.oc1.phx.aaaaaaaa2qh6tmjcnz4f5gas3izogscyejihtiytpo7pyws2erfai6k7yrva", + "launch_mode": "NATIVE", "launch_options": { "boot_volume_type": "PARAVIRTUALIZED", "firmware": "UEFI_64", "is_consistent_volume_naming_enabled": false, "is_pv_encryption_in_transit_enabled": true, - "network_type": "PARAVIRTUALIZED", + "network_type": "VFIO", "remote_data_volume_type": "PARAVIRTUALIZED" }, "lifecycle_state": "AVAILABLE", @@ -2133,7 +2159,7 @@ "shapes": [], "size_in_mbs": 262144, "sort_key": "Windows Server 2012 R2 Standard", - "time_created": "2020-05-27T01:24:48.639000+00:00" + "time_created": "2020-09-02T16:47:52.101000+00:00" }, { "agent_features": null, @@ -2193,9 +2219,9 @@ "compartment_id": null, "create_image_allowed": true, "defined_tags": {}, - "display_name": "Windows-Server-2012-R2-Standard-Edition-VM-Gen2-2020.05.19-0", + "display_name": "Windows-Server-2012-R2-Standard-Edition-VM-2020.08.26-0", "freeform_tags": {}, - "id": "ocid1.image.oc1.phx.aaaaaaaaa6hsa7qdjxuhs6r7ehgdu3sknjagkxobfuzeddu7ojxmp3vst6dq", + "id": "ocid1.image.oc1.phx.aaaaaaaai7tvw72cljtgywsg5dgfz47i7vy74equqzibxvxkgdgksnb4cafq", "launch_mode": "NATIVE", "launch_options": { "boot_volume_type": "PARAVIRTUALIZED", @@ -2211,7 +2237,7 @@ "shapes": [], "size_in_mbs": 262144, "sort_key": "Windows Server 2012 R2 Standard", - "time_created": "2020-05-29T23:13:39.042000+00:00" + "time_created": "2020-09-01T22:17:20.868000+00:00" }, { "agent_features": null, @@ -2265,32 +2291,6 @@ "sort_key": "Windows Server 2012 R2 Standard", "time_created": "2020-06-12T18:52:30.040000+00:00" }, - { - "agent_features": null, - "base_image_id": null, - "compartment_id": null, - "create_image_allowed": true, - "defined_tags": {}, - "display_name": "Windows-Server-2012-R2-Standard-Edition-VM-2020.05.19-0", - "freeform_tags": {}, - "id": "ocid1.image.oc1.phx.aaaaaaaauwbr5hcfy3rg4advxedc4qpfuguougoynm3fhzblxue5wfe7hl4a", - "launch_mode": "NATIVE", - "launch_options": { - "boot_volume_type": "PARAVIRTUALIZED", - "firmware": "UEFI_64", - "is_consistent_volume_naming_enabled": false, - "is_pv_encryption_in_transit_enabled": true, - "network_type": "VFIO", - "remote_data_volume_type": "PARAVIRTUALIZED" - }, - "lifecycle_state": "AVAILABLE", - "operating_system": "Windows", - "operating_system_version": "Server 2012 R2 Standard", - "shapes": [], - "size_in_mbs": 262144, - "sort_key": "Windows Server 2012 R2 Standard", - "time_created": "2020-05-26T20:24:52.291000+00:00" - }, { "agent_features": null, "base_image_id": null, @@ -2525,32 +2525,6 @@ "sort_key": "Windows Server 2016 Standard", "time_created": "2020-08-27T06:56:40.761000+00:00" }, - { - "agent_features": null, - "base_image_id": null, - "compartment_id": null, - "create_image_allowed": true, - "defined_tags": {}, - "display_name": "Windows-Server-2016-Standard-Edition-VM-Gen2-2020.08.26-0", - "freeform_tags": {}, - "id": "ocid1.image.oc1.phx.aaaaaaaalmpp3iu7emu3a6vdzul4vgn3ibzxnjwgknshhygdfp6nzhlll6za", - "launch_mode": "NATIVE", - "launch_options": { - "boot_volume_type": "PARAVIRTUALIZED", - "firmware": "UEFI_64", - "is_consistent_volume_naming_enabled": false, - "is_pv_encryption_in_transit_enabled": true, - "network_type": "VFIO", - "remote_data_volume_type": "PARAVIRTUALIZED" - }, - "lifecycle_state": "AVAILABLE", - "operating_system": "Windows", - "operating_system_version": "Server 2016 Standard", - "shapes": [], - "size_in_mbs": 262144, - "sort_key": "Windows Server 2016 Standard", - "time_created": "2020-08-27T06:56:40.761000+00:00" - }, { "agent_features": null, "base_image_id": null, @@ -2629,32 +2603,6 @@ "sort_key": "Windows Server 2016 Standard", "time_created": "2020-08-31T05:02:40.232000+00:00" }, - { - "agent_features": null, - "base_image_id": null, - "compartment_id": null, - "create_image_allowed": true, - "defined_tags": {}, - "display_name": "Windows-Server-2016-Standard-Edition-VM-E3-2020.08.26-0", - "freeform_tags": {}, - "id": "ocid1.image.oc1.phx.aaaaaaaafwkpnyue24ldea75hwp5efu6lqgbdc6wqhzfogsek4hxn3dhmn6a", - "launch_mode": "PARAVIRTUALIZED", - "launch_options": { - "boot_volume_type": "PARAVIRTUALIZED", - "firmware": "UEFI_64", - "is_consistent_volume_naming_enabled": false, - "is_pv_encryption_in_transit_enabled": true, - "network_type": "VFIO", - "remote_data_volume_type": "PARAVIRTUALIZED" - }, - "lifecycle_state": "AVAILABLE", - "operating_system": "Windows", - "operating_system_version": "Server 2016 Standard", - "shapes": [], - "size_in_mbs": 262144, - "sort_key": "Windows Server 2016 Standard", - "time_created": "2020-08-31T05:02:40.232000+00:00" - }, { "agent_features": null, "base_image_id": null, @@ -2895,9 +2843,9 @@ "compartment_id": null, "create_image_allowed": true, "defined_tags": {}, - "display_name": "Windows-Server-2019-Standard-Edition-VM-Gen2-2020.08.28-0", + "display_name": "Windows-Server-2019-Standard-Edition-VM-Gen2-2020.07.17-0", "freeform_tags": {}, - "id": "ocid1.image.oc1.phx.aaaaaaaaxj2cachojmpi3vzok4u5gfeff5a3ozhkareyxomh6z2po7egnsla", + "id": "ocid1.image.oc1.phx.aaaaaaaafruz4sutfyotjvrqjhl72ogzbb5hphzra5us2454zgrtgdmrwe7a", "launch_mode": "PARAVIRTUALIZED", "launch_options": { "boot_volume_type": "PARAVIRTUALIZED", @@ -2913,7 +2861,7 @@ "shapes": [], "size_in_mbs": 262144, "sort_key": "Windows Server 2019 Standard", - "time_created": "2020-08-31T05:36:47.896000+00:00" + "time_created": "2020-07-23T16:39:29.362000+00:00" }, { "agent_features": null, @@ -2921,9 +2869,9 @@ "compartment_id": null, "create_image_allowed": true, "defined_tags": {}, - "display_name": "Windows-Server-2019-Standard-Edition-VM-Gen2-2020.07.17-0", + "display_name": "Windows-Server-2019-Standard-Edition-VM-Gen2-2020.06.10-0", "freeform_tags": {}, - "id": "ocid1.image.oc1.phx.aaaaaaaafruz4sutfyotjvrqjhl72ogzbb5hphzra5us2454zgrtgdmrwe7a", + "id": "ocid1.image.oc1.phx.aaaaaaaa2uk7nfkcbuazuo23bk2ffsiq2z6usksv7ci6hzqznqonflgeuzxa", "launch_mode": "PARAVIRTUALIZED", "launch_options": { "boot_volume_type": "PARAVIRTUALIZED", @@ -2939,7 +2887,7 @@ "shapes": [], "size_in_mbs": 262144, "sort_key": "Windows Server 2019 Standard", - "time_created": "2020-07-23T16:39:29.362000+00:00" + "time_created": "2020-06-11T23:55:06.327000+00:00" }, { "agent_features": null, @@ -2947,16 +2895,16 @@ "compartment_id": null, "create_image_allowed": true, "defined_tags": {}, - "display_name": "Windows-Server-2019-Standard-Edition-VM-Gen2-2020.06.10-0", + "display_name": "Windows-Server-2019-Standard-Edition-VM-E3-2020.08.28-0", "freeform_tags": {}, - "id": "ocid1.image.oc1.phx.aaaaaaaa2uk7nfkcbuazuo23bk2ffsiq2z6usksv7ci6hzqznqonflgeuzxa", + "id": "ocid1.image.oc1.phx.aaaaaaaa4sbfynqzp65hr2ldkyv7espg3yw6yy2blwg4kmdnk3x6yxt4h2ea", "launch_mode": "PARAVIRTUALIZED", "launch_options": { "boot_volume_type": "PARAVIRTUALIZED", "firmware": "UEFI_64", "is_consistent_volume_naming_enabled": false, "is_pv_encryption_in_transit_enabled": true, - "network_type": "PARAVIRTUALIZED", + "network_type": "VFIO", "remote_data_volume_type": "PARAVIRTUALIZED" }, "lifecycle_state": "AVAILABLE", @@ -2965,7 +2913,59 @@ "shapes": [], "size_in_mbs": 262144, "sort_key": "Windows Server 2019 Standard", - "time_created": "2020-06-11T23:55:06.327000+00:00" + "time_created": "2020-08-31T05:36:40.341000+00:00" + }, + { + "agent_features": null, + "base_image_id": null, + "compartment_id": null, + "create_image_allowed": true, + "defined_tags": {}, + "display_name": "Windows-Server-2019-Standard-Edition-VM-E3-2020.07.17-0", + "freeform_tags": {}, + "id": "ocid1.image.oc1.phx.aaaaaaaave37qksnqh5koegipc3kat2xoiafuuyudwxripvbmuncwrd43bjq", + "launch_mode": "PARAVIRTUALIZED", + "launch_options": { + "boot_volume_type": "PARAVIRTUALIZED", + "firmware": "UEFI_64", + "is_consistent_volume_naming_enabled": false, + "is_pv_encryption_in_transit_enabled": true, + "network_type": "VFIO", + "remote_data_volume_type": "PARAVIRTUALIZED" + }, + "lifecycle_state": "AVAILABLE", + "operating_system": "Windows", + "operating_system_version": "Server 2019 Standard", + "shapes": [], + "size_in_mbs": 262144, + "sort_key": "Windows Server 2019 Standard", + "time_created": "2020-07-23T06:21:58.083000+00:00" + }, + { + "agent_features": null, + "base_image_id": null, + "compartment_id": null, + "create_image_allowed": true, + "defined_tags": {}, + "display_name": "Windows-Server-2019-Standard-Edition-VM-E3-2020.06.10-0", + "freeform_tags": {}, + "id": "ocid1.image.oc1.phx.aaaaaaaa7t2atiuif357ijbianc4z2jb2xcrydpqp3o4xty4nyxa5twuo62a", + "launch_mode": "PARAVIRTUALIZED", + "launch_options": { + "boot_volume_type": "PARAVIRTUALIZED", + "firmware": "UEFI_64", + "is_consistent_volume_naming_enabled": false, + "is_pv_encryption_in_transit_enabled": true, + "network_type": "VFIO", + "remote_data_volume_type": "PARAVIRTUALIZED" + }, + "lifecycle_state": "AVAILABLE", + "operating_system": "Windows", + "operating_system_version": "Server 2019 Standard", + "shapes": [], + "size_in_mbs": 262144, + "sort_key": "Windows Server 2019 Standard", + "time_created": "2020-06-11T23:54:19.666000+00:00" }, { "agent_features": null, @@ -3098,6 +3098,389 @@ "time_created": "2020-05-26T21:50:51.365000+00:00" } ], + "regions": [ + { + "display_name": "AP Chuncheon", + "id": "ap-chuncheon-1", + "key": "YNY", + "name": "ap-chuncheon-1" + }, + { + "display_name": "AP Hyderabad", + "id": "ap-hyderabad-1", + "key": "HYD", + "name": "ap-hyderabad-1" + }, + { + "display_name": "AP Melbourne", + "id": "ap-melbourne-1", + "key": "MEL", + "name": "ap-melbourne-1" + }, + { + "display_name": "AP Mumbai", + "id": "ap-mumbai-1", + "key": "BOM", + "name": "ap-mumbai-1" + }, + { + "display_name": "AP Osaka", + "id": "ap-osaka-1", + "key": "KIX", + "name": "ap-osaka-1" + }, + { + "display_name": "AP Seoul", + "id": "ap-seoul-1", + "key": "ICN", + "name": "ap-seoul-1" + }, + { + "display_name": "AP Sydney", + "id": "ap-sydney-1", + "key": "SYD", + "name": "ap-sydney-1" + }, + { + "display_name": "AP Tokyo", + "id": "ap-tokyo-1", + "key": "NRT", + "name": "ap-tokyo-1" + }, + { + "display_name": "CA Montreal", + "id": "ca-montreal-1", + "key": "YUL", + "name": "ca-montreal-1" + }, + { + "display_name": "CA Toronto", + "id": "ca-toronto-1", + "key": "YYZ", + "name": "ca-toronto-1" + }, + { + "display_name": "EU Amsterdam", + "id": "eu-amsterdam-1", + "key": "AMS", + "name": "eu-amsterdam-1" + }, + { + "display_name": "EU Frankfurt", + "id": "eu-frankfurt-1", + "key": "FRA", + "name": "eu-frankfurt-1" + }, + { + "display_name": "EU Zurich", + "id": "eu-zurich-1", + "key": "ZRH", + "name": "eu-zurich-1" + }, + { + "display_name": "ME Jeddah", + "id": "me-jeddah-1", + "key": "JED", + "name": "me-jeddah-1" + }, + { + "display_name": "SA Saopaulo", + "id": "sa-saopaulo-1", + "key": "GRU", + "name": "sa-saopaulo-1" + }, + { + "display_name": "UK London", + "id": "uk-london-1", + "key": "LHR", + "name": "uk-london-1" + }, + { + "display_name": "US Ashburn", + "id": "us-ashburn-1", + "key": "IAD", + "name": "us-ashburn-1" + }, + { + "display_name": "US Phoenix", + "id": "us-phoenix-1", + "key": "PHX", + "name": "us-phoenix-1" + }, + { + "display_name": "US Sanjose", + "id": "us-sanjose-1", + "key": "SJC", + "name": "us-sanjose-1" + } + ], + "services": [ + { + "description": "Analytics", + "display_name": "analytics", + "name": "analytics" + }, + { + "description": "API Gateway", + "display_name": "api-gateway", + "name": "api-gateway" + }, + { + "description": "Application Performance Monitoring", + "display_name": "apm", + "name": "apm" + }, + { + "description": "Application Migration", + "display_name": "application-migration", + "name": "application-migration" + }, + { + "description": "Auto Scaling", + "display_name": "auto-scaling", + "name": "auto-scaling" + }, + { + "description": "Big Data", + "display_name": "big-data", + "name": "big-data" + }, + { + "description": "Block Volume", + "display_name": "block-storage", + "name": "block-storage" + }, + { + "description": "Blockchain", + "display_name": "blockchain", + "name": "blockchain" + }, + { + "description": "Caching", + "display_name": "caching", + "name": "caching" + }, + { + "description": "Cloud Shell", + "display_name": "cloud-shell", + "name": "cloud-shell" + }, + { + "description": "Cloud Guard", + "display_name": "cloudguard", + "name": "cloudguard" + }, + { + "description": "Compartments", + "display_name": "compartments", + "name": "compartments" + }, + { + "description": "Compute", + "display_name": "compute", + "name": "compute" + }, + { + "description": "Compute Management", + "display_name": "compute-management", + "name": "compute-management" + }, + { + "description": "Container Engine", + "display_name": "container-engine", + "name": "container-engine" + }, + { + "description": "Data Catalog", + "display_name": "data-catalog", + "name": "data-catalog" + }, + { + "description": "Data Flow", + "display_name": "data-flow", + "name": "data-flow" + }, + { + "description": "Data Flow Interactive", + "display_name": "data-flow-interactive", + "name": "data-flow-interactive" + }, + { + "description": "Data Integration", + "display_name": "data-integration", + "name": "data-integration" + }, + { + "description": "Data Science", + "display_name": "data-science", + "name": "data-science" + }, + { + "description": "Data Transfer", + "display_name": "data-transfer", + "name": "data-transfer" + }, + { + "description": "Database", + "display_name": "database", + "name": "database" + }, + { + "description": "Database Migration", + "display_name": "database-migration", + "name": "database-migration" + }, + { + "description": "Digital Assistant", + "display_name": "digital-assistant", + "name": "digital-assistant" + }, + { + "description": "DNS", + "display_name": "dns", + "name": "dns" + }, + { + "description": "Email Delivery", + "display_name": "email-delivery", + "name": "email-delivery" + }, + { + "description": "Events", + "display_name": "events", + "name": "events" + }, + { + "description": "Functions", + "display_name": "faas", + "name": "faas" + }, + { + "description": "Fast Connect", + "display_name": "fast-connect", + "name": "fast-connect" + }, + { + "description": "File Storage", + "display_name": "filesystem", + "name": "filesystem" + }, + { + "description": "Health Check", + "display_name": "health-checks", + "name": "health-checks" + }, + { + "description": "Integration", + "display_name": "integration", + "name": "integration" + }, + { + "description": "Key Management", + "display_name": "kms", + "name": "kms" + }, + { + "description": "Limits", + "display_name": "limits", + "name": "limits" + }, + { + "description": "LbaaS", + "display_name": "load-balancer", + "name": "load-balancer" + }, + { + "description": "Logging", + "display_name": "logging", + "name": "logging" + }, + { + "description": "Management Agent", + "display_name": "management-agent", + "name": "management-agent" + }, + { + "description": "MySQL", + "display_name": "mysql", + "name": "mysql" + }, + { + "description": "NoSQL", + "display_name": "nosql", + "name": "nosql" + }, + { + "description": "Notifications", + "display_name": "notifications", + "name": "notifications" + }, + { + "description": "Object Storage", + "display_name": "object-storage", + "name": "object-storage" + }, + { + "description": "VMware Solution", + "display_name": "ocvp", + "name": "ocvp" + }, + { + "description": "Optimizer", + "display_name": "optimizer", + "name": "optimizer" + }, + { + "description": "Regions", + "display_name": "regions", + "name": "regions" + }, + { + "description": "Resource Manager", + "display_name": "resource-manager", + "name": "resource-manager" + }, + { + "description": "Service Connector Hub", + "display_name": "service-connector-hub", + "name": "service-connector-hub" + }, + { + "description": "Splat canary", + "display_name": "splat-canary", + "name": "splat-canary" + }, + { + "description": "Splat test", + "display_name": "splat-store-test-quota-family", + "name": "splat-store-test-quota-family" + }, + { + "description": "Streaming", + "display_name": "streaming", + "name": "streaming" + }, + { + "description": "Test", + "display_name": "test-family", + "name": "test-family" + }, + { + "description": "Virtual Cloud Network", + "display_name": "vcn", + "name": "vcn" + }, + { + "description": "VPN", + "display_name": "vpn", + "name": "vpn" + }, + { + "description": "WaaS", + "display_name": "waas", + "name": "waas" + } + ], "shapes": [ { "gpu_description": null, diff --git a/okitweb/static/okit/model/js/artefacts/service_gateway.js b/okitweb/static/okit/model/js/artefacts/service_gateway.js index 2f04844ba..58df2f9a5 100644 --- a/okitweb/static/okit/model/js/artefacts/service_gateway.js +++ b/okitweb/static/okit/model/js/artefacts/service_gateway.js @@ -17,7 +17,7 @@ class ServiceGateway extends OkitArtifact { this.display_name = this.generateDefaultName(okitjson.service_gateways.length + 1); this.compartment_id = data.compartment_id; this.vcn_id = data.parent_id; - this.service_name = 'All Services'; + this.service_name = ''; this.autonomous_database_ids = []; this.object_storage_bucket_ids = []; this.route_table_id = ''; diff --git a/okitweb/static/okit/palette/hidden/Instance_Pool.svg b/okitweb/static/okit/palette/compute/Instance_Pool.svg similarity index 100% rename from okitweb/static/okit/palette/hidden/Instance_Pool.svg rename to okitweb/static/okit/palette/compute/Instance_Pool.svg diff --git a/okitweb/static/okit/palette/hidden/Waf.svg b/okitweb/static/okit/palette/hidden/Web_Application_Firewall.svg similarity index 100% rename from okitweb/static/okit/palette/hidden/Waf.svg rename to okitweb/static/okit/palette/hidden/Web_Application_Firewall.svg diff --git a/okitweb/static/okit/palette/hidden/Ipsec.svg b/okitweb/static/okit/palette/networking/IPSec.svg similarity index 100% rename from okitweb/static/okit/palette/hidden/Ipsec.svg rename to okitweb/static/okit/palette/networking/IPSec.svg diff --git a/okitweb/templates/okit/okit_designer.html b/okitweb/templates/okit/okit_designer.html index df0f7cb0a..d071c94d0 100644 --- a/okitweb/templates/okit/okit_designer.html +++ b/okitweb/templates/okit/okit_designer.html @@ -153,7 +153,7 @@
  • Ansible
  • Resource Manager
  • - + {% endblock %} diff --git a/okitweb/templates/okit/propertysheets/service_gateway.html b/okitweb/templates/okit/propertysheets/service_gateway.html index 5824b97ae..fc8c76e1a 100644 --- a/okitweb/templates/okit/propertysheets/service_gateway.html +++ b/okitweb/templates/okit/propertysheets/service_gateway.html @@ -10,7 +10,8 @@
    Virtual Cloud Network
    Name
    Services
    {% endblock %} diff --git a/visualiser/facades/ociConnection.py b/visualiser/facades/ociConnection.py index 070787ce9..f9bfb9f17 100644 --- a/visualiser/facades/ociConnection.py +++ b/visualiser/facades/ociConnection.py @@ -160,6 +160,17 @@ def connect(self): return +class OCILimitsConnection(OCIConnection): + def __init__(self, config=None, configfile=None, profile=None): + self.compartment_ocid = None + super(OCILimitsConnection, self).__init__(config=config, configfile=configfile, profile=profile) + + def connect(self): + self.client = oci.limits.LimitsClient(config=self.config, signer=self.signer) + self.compartment_ocid = self.config["tenancy"] + return + + class OCILoadBalancerConnection(OCIConnection): def __init__(self, config=None, configfile=None, profile=None): super(OCILoadBalancerConnection, self).__init__(config=config, configfile=configfile, profile=profile) diff --git a/visualiser/facades/ociServiceGateway.py b/visualiser/facades/ociServiceGateway.py index 137f3a09a..44aaafbc5 100644 --- a/visualiser/facades/ociServiceGateway.py +++ b/visualiser/facades/ociServiceGateway.py @@ -58,21 +58,27 @@ def list(self, compartment_id=None, filter=None): for service_gateway in self.service_gateways_json: if service_gateway['route_table_id'] is None: service_gateway['route_table_id'] = '' + for service in service_gateway['services']: + service_elements = service['service_name'].split() + del service_elements[1] + service_gateway['service_name'] = " ".join(service_elements) + # At the moment we only have 2 optiona All or OCI Object Storage hence we just need the first 3 characters + service_gateway['service_name'] = service_elements[0] # Build List of ServiceGateway Objects - self.service_gateways_obj = [] - for service_gateway in self.service_gateways_json: - self.service_gateways_obj.append(OCIServiceGateway(self.config, self.configfile, self.profile, service_gateway)) + #self.service_gateways_obj = [] + #for service_gateway in self.service_gateways_json: + # self.service_gateways_obj.append(OCIServiceGateway(self.config, self.configfile, self.profile, service_gateway)) else: logger.warn('Virtual Cloud Network Id has not been specified.') return self.service_gateways_json -class OCIServiceGateway(object): - def __init__(self, config=None, configfile=None, profile=None, data=None): - self.config = config - self.configfile = configfile - self.profile = profile - self.data = data +#class OCIServiceGateway(object): +# def __init__(self, config=None, configfile=None, profile=None, data=None): +# self.config = config +# self.configfile = configfile +# self.profile = profile +# self.data = data diff --git a/visualiser/facades/ociServices.py b/visualiser/facades/ociServices.py new file mode 100644 index 000000000..e2470d41b --- /dev/null +++ b/visualiser/facades/ociServices.py @@ -0,0 +1,51 @@ +#!/usr/bin/python + +# Copyright (c) 2020, Oracle and/or its affiliates. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. + +"""Provide Module Description +""" + +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# +__author__ = ["Andrew Hopkinson (Oracle Cloud Solutions A-Team)"] +__version__ = "1.0.0" +__module__ = "ociService" +# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# + + +import oci + +from common.okitCommon import logJson +from common.okitLogging import getLogger +from facades.ociConnection import OCILimitsConnection + +# Configure logging +logger = getLogger() + + +class OCIServices(OCILimitsConnection): + def __init__(self, config=None, configfile=None, profile=None): + self.services_json = [] + super(OCIServices, self).__init__(config=config, configfile=configfile, profile=profile) + + def get(self, service_id): + service = self.client.get_service(service_id=service_id).data + self.services_json = [self.toJson(service)] + return self.services_json[0] + + def list(self, filter={}): + services = oci.pagination.list_call_get_all_results(self.client.list_services, compartment_id=self.compartment_ocid).data + # Convert to Json object + services_json = self.toJson(services) + logger.debug(str(services_json)) + + # Filter results + self.services_json = self.filterJsonObjectList(services_json, filter) + logger.debug(str(self.services_json)) + logJson(self.services_json) + + # Build List of Service Objects that have methods for getting VCN / Security Lists / Route Tables etc + for service in self.services_json: + service['display_name'] = service['name'] + return sorted(self.services_json, key=lambda k: k['display_name']) + diff --git a/visualiser/parsers/okitHclJsonParser.py b/visualiser/parsers/okitHclJsonParser.py index b5a682a37..1e59c19c1 100644 --- a/visualiser/parsers/okitHclJsonParser.py +++ b/visualiser/parsers/okitHclJsonParser.py @@ -109,7 +109,7 @@ def parse(self, hcl_json=None): if self.hcl_json is not None: # Loop through resource for resource in self.hcl_json["resource"]: - for resource_key, resource_value in resource.items(): + for resource_key, resource_value in resource.items(): for artefact in resource_value: for artefact_key, artefact_value in artefact.items(): for artefact_json in artefact_value: diff --git a/visualiser/templates/terraform/service_gateway.jinja2 b/visualiser/templates/terraform/service_gateway.jinja2 index 0bfcf8c54..a1a3fe01d 100644 --- a/visualiser/templates/terraform/service_gateway.jinja2 +++ b/visualiser/templates/terraform/service_gateway.jinja2 @@ -1,15 +1,18 @@ # ------ Get List Service OCIDs -data "oci_core_services" "{{ resource_name }}Services" { +locals { + {{ resource_name }}ServiceId = lookup([for x in data.oci_core_services.RegionServices.services: x if substr(x.name, 0, 3) == {{ service_name | safe }}][0], "id") } + # ------ Create Service Gateway resource "oci_core_service_gateway" "{{ resource_name }}" { # Required compartment_id = {{ compartment_id }} vcn_id = {{ vcn_id }} services { - service_id = data.oci_core_services.{{ resource_name }}Services.services[0]["id"] + # service_id = data.oci_core_services.{{ resource_name }}Services.services[0]["id"] + service_id = local.{{ resource_name }}ServiceId } # Optional display_name = {{ display_name | safe }} From dc97afecb9361db9189c1e8aeca87e77afd99c93 Mon Sep 17 00:00:00 2001 From: Andrew Hopkinson Date: Thu, 17 Sep 2020 17:49:07 +0100 Subject: [PATCH 02/42] Fix Service Gateway only offers all services when drawn but then provisions Object Storage #107 --- visualiser/templates/ansible/region_data.jinja2 | 1 + 1 file changed, 1 insertion(+) diff --git a/visualiser/templates/ansible/region_data.jinja2 b/visualiser/templates/ansible/region_data.jinja2 index 1d9957407..2db1ec7f0 100644 --- a/visualiser/templates/ansible/region_data.jinja2 +++ b/visualiser/templates/ansible/region_data.jinja2 @@ -23,5 +23,6 @@ - name: Get details of all the available services oci_service_facts: + region: "{{ region }}" register: RegionServices From fa5c2e4acefb2cf50d2a20cdf006fe58efee1ab6 Mon Sep 17 00:00:00 2001 From: Andrew Hopkinson Date: Thu, 17 Sep 2020 17:54:48 +0100 Subject: [PATCH 03/42] Fix Service Gateway only offers all services when drawn but then provisions Object Storage #107 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6ca8d346e..7cc1c626b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ # Release Notes +## Version 0.12.0 +**Release Date**: 7th October 2020 +### Features + +### Bug Fixes +1. Fix Service Gateway only offers all services when drawn but then provisions Object Storage #107 + + ## Version 0.11.0 **Release Date**: 16th September 2020 ### Features From cb7903e1404697183e29c87f73c17086152d7300 Mon Sep 17 00:00:00 2001 From: Andrew Hopkinson Date: Fri, 18 Sep 2020 13:10:48 +0100 Subject: [PATCH 04/42] Fix Service Gateway only offers all services when drawn but then provisions Object Storage #107 --- visualiser/templates/ansible/service_gateway.jinja2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/visualiser/templates/ansible/service_gateway.jinja2 b/visualiser/templates/ansible/service_gateway.jinja2 index 9aac92e43..3bdf49d51 100644 --- a/visualiser/templates/ansible/service_gateway.jinja2 +++ b/visualiser/templates/ansible/service_gateway.jinja2 @@ -14,7 +14,7 @@ compartment_id: "{{ compartment_id }}" vcn_id: "{{ vcn_id }}" services: - - service_id: "{{ '{{' }} ({{ resource_name }}Service.services | map(attribute='id') | list)[0] {{ '}}' }}" + - service_id: "{{ '{{' }} ({{ resource_name }}Service.services | selectattr('service_name', 'match', '{{ service_name }}') | map(attribute='id') | list)[0] {{ '}}' }}" # Optional display_name: "{{ display_name | safe }}" {% if route_table_id is defined %} From 9615bd217066119e592456216dfa7c1f1ef161e1 Mon Sep 17 00:00:00 2001 From: Andrew Hopkinson Date: Fri, 18 Sep 2020 16:44:54 +0100 Subject: [PATCH 05/42] Fix Service Gateway related route rules do not allow setting a Destination Service #109 --- .../okit/view/designer/js/artefacts/route_table.js | 10 ++++++++++ visualiser/generators/okitGenerator.py | 3 +-- visualiser/templates/ansible/route_table.jinja2 | 4 ++-- visualiser/templates/terraform/route_table.jinja2 | 6 +++--- visualiser/templates/terraform/service_gateway.jinja2 | 2 -- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/okitweb/static/okit/view/designer/js/artefacts/route_table.js b/okitweb/static/okit/view/designer/js/artefacts/route_table.js index 55c301952..d0653c4f4 100644 --- a/okitweb/static/okit/view/designer/js/artefacts/route_table.js +++ b/okitweb/static/okit/view/designer/js/artefacts/route_table.js @@ -180,6 +180,9 @@ class RouteTableView extends OkitDesignerArtefactView { } } $(jqId("network_entity_id" + rule_num)).val(route_rule.network_entity_id); + if (route_rule.target_type === 'service_gateways') { + route_rule.destination = me.getOkitJson().getServiceGateway(route_rule.network_entity_id).service_name; + } } else { $(jqId("destination_type_row" + rule_num)).removeClass('collapsed'); } @@ -195,6 +198,9 @@ class RouteTableView extends OkitDesignerArtefactView { route_rule.target_type = 'internet_gateways'; } $(jqId("target_type" + rule_num)).val(route_rule.target_type); + if (route_rule.target_type === 'service_gateways') { + route_rule.destination = this.getOkitJson().getServiceGateway(route_rule.network_entity_id).service_name; + } // Destination Type const destination_types_map = new Map([ @@ -248,6 +254,9 @@ class RouteTableView extends OkitDesignerArtefactView { .on("change", function() { route_rule['network_entity_id'] = this.options[this.selectedIndex].value; console.info('Changed Network Entity: ' + this.value); + if (route_rule.target_type === 'service_gateways') { + route_rule.destination = me.getOkitJson().getServiceGateway(route_rule.network_entity_id).service_name; + } displayOkitJson(); }); let target_type = $(jqId("target_type" + rule_num)).val(); @@ -281,6 +290,7 @@ class RouteTableView extends OkitDesignerArtefactView { // Check if we need to hide destination if (route_rule.target_type === 'service_gateways') { $(jqId("destination_row" + rule_num)).addClass('collapsed'); + route_rule.destination = me.getOkitJson().getServiceGateway(route_rule.network_entity_id).service_name; } } diff --git a/visualiser/generators/okitGenerator.py b/visualiser/generators/okitGenerator.py index 02d77e196..ff208f8d5 100644 --- a/visualiser/generators/okitGenerator.py +++ b/visualiser/generators/okitGenerator.py @@ -995,8 +995,7 @@ def renderRouteTable(self, route_table, index=0): # ------ Network End Point jinja2_route_rule["network_entity_id"] = self.formatJinja2IdReference(self.standardiseResourceName(self.id_name_map[route_rule["network_entity_id"]])) # ------ Destination - if route_rule["destination_type"] == 'CIDR_BLOCK': - jinja2_route_rule["destination"] = self.generateJinja2Variable('route_rule_{0:02d}_destination'.format(rule_number), route_rule["destination"], standardisedName) + jinja2_route_rule["destination"] = self.generateJinja2Variable('route_rule_{0:02d}_destination'.format(rule_number), route_rule["destination"], standardisedName) # ------ Destination Type jinja2_route_rule["destination_type"] = self.generateJinja2Variable('route_rule_{0:02d}_destination_type'.format(rule_number), route_rule["destination_type"], standardisedName) # ------ Description diff --git a/visualiser/templates/ansible/route_table.jinja2 b/visualiser/templates/ansible/route_table.jinja2 index d2b621315..09431ed5c 100644 --- a/visualiser/templates/ansible/route_table.jinja2 +++ b/visualiser/templates/ansible/route_table.jinja2 @@ -14,10 +14,10 @@ route_rules: {% for rule in route_rules %} - destination_type: "{{ rule.destination_type | safe }}" - {% if rule.destination is defined %} + {% if rule.destination_type == "CIDR_BLOCK" %} destination: "{{ rule.destination | safe }}" {% else %} - destination: "{{ '{{' }} (RegionServices.service[0] | map(attribute='cidr_block')) {{ '}}' }}" + destination: "{{ '{{' }} (RegionServices.services | selectattr('service_name', 'match', '{{ rule.destination }}') | map(attribute='cidr_block')) {{ '}}' }}" {% endif %} network_entity_id: "{{ rule.network_entity_id }}" description: "{{ rule.description | safe }}" diff --git a/visualiser/templates/terraform/route_table.jinja2 b/visualiser/templates/terraform/route_table.jinja2 index d4b6e6fc5..9dfa04c1a 100644 --- a/visualiser/templates/terraform/route_table.jinja2 +++ b/visualiser/templates/terraform/route_table.jinja2 @@ -14,10 +14,10 @@ resource "oci_core_route_table" "{{ resource_name }}" { {% for rule in route_rules %} route_rules { destination_type = {{ rule.destination_type | safe }} - {% if rule.destination is defined %} + {% if rule.destination_type == "CIDR_BLOCK" %} destination = {{ rule.destination | safe }} {% else %} - destination = data.oci_core_services.RegionServices.services[0]["cidr_block"] + destination = lookup([for x in data.oci_core_services.RegionServices.services: x if substr(x.name, 0, 3) == {{ rule.destination | safe }}][0], "cidr_block") {% endif %} network_entity_id = {{ rule.network_entity_id }} description = {{ rule.description | safe }} @@ -34,7 +34,7 @@ resource "oci_core_route_table" "{{ resource_name }}" { } {% if manage_default_resource_id is defined %} - locals { +locals { {{ resource_name }}_id = oci_core_default_route_table.{{ resource_name }}.id } {% else %} diff --git a/visualiser/templates/terraform/service_gateway.jinja2 b/visualiser/templates/terraform/service_gateway.jinja2 index a1a3fe01d..52c894741 100644 --- a/visualiser/templates/terraform/service_gateway.jinja2 +++ b/visualiser/templates/terraform/service_gateway.jinja2 @@ -4,14 +4,12 @@ locals { {{ resource_name }}ServiceId = lookup([for x in data.oci_core_services.RegionServices.services: x if substr(x.name, 0, 3) == {{ service_name | safe }}][0], "id") } - # ------ Create Service Gateway resource "oci_core_service_gateway" "{{ resource_name }}" { # Required compartment_id = {{ compartment_id }} vcn_id = {{ vcn_id }} services { - # service_id = data.oci_core_services.{{ resource_name }}Services.services[0]["id"] service_id = local.{{ resource_name }}ServiceId } # Optional From 11e52fbc5e15764f168096d2760d1271cf4c9658 Mon Sep 17 00:00:00 2001 From: Andrew Hopkinson Date: Fri, 18 Sep 2020 17:06:24 +0100 Subject: [PATCH 06/42] Hide Autonomous databases from service gateway when object storage only checked --- .../view/designer/js/artefacts/service_gateway.js | 12 ++++++++++++ .../okit/propertysheets/service_gateway.html | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/okitweb/static/okit/view/designer/js/artefacts/service_gateway.js b/okitweb/static/okit/view/designer/js/artefacts/service_gateway.js index 294acdc1b..8f1a634b2 100644 --- a/okitweb/static/okit/view/designer/js/artefacts/service_gateway.js +++ b/okitweb/static/okit/view/designer/js/artefacts/service_gateway.js @@ -154,6 +154,18 @@ class ServiceGatewayView extends OkitDesignerArtefactView { object_storage_bucket_select.append($('