Skip to content

Commit

Permalink
Initial changes for publication, fix for vpc observability.
Browse files Browse the repository at this point in the history
  • Loading branch information
autobuild committed Nov 3, 2024
1 parent ec72ef5 commit 9e68f8c
Show file tree
Hide file tree
Showing 10 changed files with 354 additions and 9 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

Notable changes to this project:

## 1.0.29

### Features

- Added initial changes for implementation being published to drawio.

### Fixes

- Fixed incorrect check resulting in missing VPC error for Observability team.

## 1.0.28

### Features
Expand Down
2 changes: 2 additions & 0 deletions docs/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,14 @@
3. Package is installed to /Library/Frameworks/Python.framework/Versions/VERSION/pythonVERSION/site-packages/ibmdiagrams
4. Script is installed to /Library/Frameworks/Python.framework/Versions/VERSION/bin

<!--
## Build
1. cd ibmdiagrams
2. Update version number in pyproject.toml.
3. python -m build
4. Output is in dist
-->

## License

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "ibmdiagrams"
version = "1.0.28"
version = "1.0.29"
description = "Generate architecture diagrams following IBM Diagram Standard"
readme = "README.md"
requires-python = ">=3.11.0"
Expand Down
15 changes: 12 additions & 3 deletions src/ibmdiagrams.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: ibmdiagrams
Version: 1.0.28
Version: 1.0.29
Summary: Generate architecture diagrams following IBM Diagram Standard
Author-email: Jay Warfield <[email protected]>
Maintainer-email: Jay Warfield <[email protected]>
Expand Down Expand Up @@ -229,9 +229,18 @@ Requires-Dist: urllib3>=1.26.9

Generate architecture diagrams following [IBM Diagram Standard](https://www.ibm.com/design/language/infographics/technical-diagrams/design).

Input can be Python or Terraform.
Input is Python or Terraform with output to drawio file.

Output is a drawio file that can be opened and edited in drawio.
Python usage example:
- python cloud.py
- Output to cloud.drawio

Terraform usage example:
- ibmdiagrams -h
- ibmdiagrams cloud.tfstate
- Output to cloud.drawio

Refer to Guides for complete details.

Icons are from the [icons repo](https://github.com/IBM-Cloud/architecture-icons) for use in any drawio desktop.

Expand Down
4 changes: 4 additions & 0 deletions src/ibmdiagrams/ibmbase/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,10 @@ def buildGroupShape(self, groupid, properties):
if self.common.isStaticIcons() or self.common.isCatalogIcons():
shapenode = self.shapes.buildStaticShape(groupid, properties, x, y, width, height, meta, items)
items.append(shapenode)
elif self.common.isDrawioIcons():
shapenode = self.shapes.buildDrawioShape(groupid, properties, x, y, width, height, meta)
#items.append(shapenode)
items = items + shapenode
else:
shapenode = self.shapes.buildShape(groupid, properties, x, y, width, height, meta)
items.append(shapenode)
Expand Down
3 changes: 3 additions & 0 deletions src/ibmdiagrams/ibmbase/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ def setIconType(self, value):
def isBuiltinIcons(self):
return self.iconType == IconTypes.BUILTIN

def isDrawioIcons(self):
return self.iconType == IconTypes.DRAWIO

def isStaticIcons(self):
return self.iconType == IconTypes.STATIC

Expand Down
4 changes: 4 additions & 0 deletions src/ibmdiagrams/ibmbase/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class InputTypes(Enum):

class IconTypes(Enum):
BUILTIN = 'BUILTIN'
DRAWIO = 'DRAWIO'
CATALOG = 'CATALOG'
STATIC = 'STATIC'

Expand Down Expand Up @@ -222,6 +223,9 @@ def setIconType(self, value):
def isBuiltinIcons(self):
return self.iconType == IconTypes.BUILTIN

def isDrawioIcons(self):
return self.iconType == IconTypes.DRAWIO

def isStaticIcons(self):
return self.iconType == IconTypes.STATIC

Expand Down
4 changes: 4 additions & 0 deletions src/ibmdiagrams/ibmbase/shapes.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ def buildShape(self, id, properties, x, y, width, height, meta):
node = self.types.buildShape(id, properties, x, y, width, height, meta)
return node

def buildDrawioShape(self, id, properties, x, y, width, height, meta):
node = self.types.buildDrawioShape(id, properties, x, y, width, height, meta)
return node

def buildLink(self, id, label, source, target, startarrow, endarrow, startfill, endfill, linetype, linewidth, linecolor, fontname, fontsize, meta):
return self.types.buildLink(id, label, source, target, startarrow, endarrow, startfill, endfill, linetype, linewidth, linecolor, fontname, fontsize, meta)

Expand Down
10 changes: 5 additions & 5 deletions src/ibmdiagrams/ibmbase/terraform.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,10 @@ def loadTerraform(self):
subnets = instanceattributes["subnets"]
# TBD Duplicate VPCs with slzvsi, one with subnets, other with empty subnets, so skip empty subnets.
# No duplication VPCs with slzvpc (no VSIs), so keep empty subnets.
if not instanceInstances.empty:
if subnets == []:
#instancerow = {}
continue
#if not instanceInstances.empty:
# #@TEST if subnets == []:
# #@TEST #instancerow = {}
# #@TEST continue
instancerow = {"id": instanceid} | instanceattributes
tempvpcs[count] = instancerow
count += 1
Expand Down Expand Up @@ -756,7 +756,7 @@ def getReservedIPs(self):
return self.reservedIPs

def hasServices(self):
return not self.flowLogs.empty or not self.transitGateways.empty or not self.activityTrackers.empty or not self.keyManagement.empty or not self.objectBuckets.empty
return not self.flowLogs.empty or not self.transitGateways.empty or not self.activityTrackers.empty or not self.keyManagements.empty or not self.objectBuckets.empty

def hasFlowLogs(self):
return not self.flowLogs.empty
Expand Down
Loading

0 comments on commit 9e68f8c

Please sign in to comment.