-
-
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.
feat: load UML from any remote http/https endpoint
- Loading branch information
Showing
5 changed files
with
211 additions
and
15 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
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
<mxfile host="multicloud-diagrams" agent="PIP package multicloud-diagrams. Generate resources in draw.io compatible format for Cloud infrastructure. Copyrights @ Roman Tsypuk 2023. MIT license." type="MultiCloud"> | ||
<diagram id="diagram_1" name="AWS components"> | ||
<mxGraphModel dx="1015" dy="661" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="1"> | ||
<root> | ||
<mxCell id="0"/> | ||
<mxCell id="1" parent="0"/> | ||
<mxCell id="vertex:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda" value="<b>Name</b>: producer-lambda<BR><b>ARN</b>: arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda<BR>-----------<BR><b>CodeSize</b>: 1234<BR><b>Handler</b>: main<BR><b>Layers</b>: 0<BR><b>Memory</b>: 128<BR><b>PackageType</b>: Zip<BR><b>Runtime</b>: go1.x<BR><b>Timeout</b>: 30<BR><b>TracingConfig</b>: {'Mode': 'Active'}<BR><b>Version</b>: $LATEST" style="verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;align=left;pointerEvents=1;shape=mxgraph.aws3.lambda_function;prIcon=server;fillColor=#F58534;gradientColor=none;html=1;" parent="1" vertex="1"> | ||
<mxGeometry width="69" height="72" as="geometry" x="590" y="654"/> | ||
</mxCell> | ||
<mxCell id="vertex:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:consumer-lambda" value="<b>Name</b>: consumer-lambda<BR><b>ARN</b>: arn:aws:lambda:eu-west-1:123456789012:function:consumer-lambda" style="verticalLabelPosition=bottom;verticalAlign=top;aspect=fixed;align=left;pointerEvents=1;shape=mxgraph.aws3.lambda_function;prIcon=server;fillColor=#F58534;gradientColor=none;html=1;" parent="1" vertex="1"> | ||
<mxGeometry width="69" height="72" as="geometry" x="1770" y="433"/> | ||
</mxCell> | ||
<mxCell id="vertex:dynamo:arn:aws:dynamodb:eu-west-1:123456789012:table/table1" value="<b>Name</b>: table1<BR><b>ARN</b>: arn:aws:dynamodb:eu-west-1:123456789012:table/table1" style="outlineConnect=0;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=left;html=1;shape=mxgraph.aws3.dynamo_db;fillColor=#2E73B8;gradientColor=none;" parent="1" vertex="1"> | ||
<mxGeometry width="72" height="81" as="geometry" x="1768.5" y="590"/> | ||
</mxCell> | ||
<mxCell id="vertex:sns:arn:aws:sns:eu-west-1:123456789012:internal.fifo" value="<b>Name</b>: internal<BR><b>ARN</b>: arn:aws:sns:eu-west-1:123456789012:internal.fifo<BR>-----------<BR><b>Owner</b>: 123456789<BR><b>SubscriptionsConfirmed</b>: 3<BR><b>SubscriptionsPending</b>: 0" style="sketch=0;outlineConnect=0;gradientColor=#FF4F8B;gradientDirection=north;fillColor=#BC1356;strokeColor=#ffffff;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=left;html=1;fontSize=12;fontStyle=0;aspect=fixed;shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.sns;" parent="1" vertex="1"> | ||
<mxGeometry width="78" height="78" as="geometry" x="900" y="540"/> | ||
</mxCell> | ||
<mxCell id="vertex:sqs:arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events.fifo" value="<b>Name</b>: events<BR><b>ARN</b>: arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events.fifo<BR>-----------<BR><b>DelaySeconds</b>: 0<BR><b>FifoQueue</b>: TRUE<BR><b>ReceiveMessageWaitTimeSeconds</b>: 0<BR><b>SqsManagedSseEnabled</b>: false<BR><b>VisibilityTimeout</b>: 30" style="sketch=0;outlineConnect=0;gradientColor=#FF4F8B;gradientDirection=north;fillColor=#BC1356;strokeColor=#ffffff;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=left;html=1;fontSize=12;fontStyle=0;aspect=fixed;shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.sqs;" parent="1" vertex="1"> | ||
<mxGeometry width="78" height="78" as="geometry" x="1380" y="430"/> | ||
</mxCell> | ||
<mxCell id="vertex:sqs:arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events2.fifo" value="<b>Name</b>: events2<BR><b>ARN</b>: arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events2.fifo" style="sketch=0;outlineConnect=0;gradientColor=#FF4F8B;gradientDirection=north;fillColor=#BC1356;strokeColor=#ffffff;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=left;html=1;fontSize=12;fontStyle=0;aspect=fixed;shape=mxgraph.aws4.resourceIcon;resIcon=mxgraph.aws4.sqs;" parent="1" vertex="1"> | ||
<mxGeometry width="78" height="78" as="geometry" x="1380" y="654"/> | ||
</mxCell> | ||
<mxCell id="vertex:s3:arn:aws:s3:::bucket_name/key_name" value="<b>Name</b>: key_name<BR><b>ARN</b>: arn:aws:s3:::bucket_name/key_name" style="outlineConnect=0;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=left;html=1;shape=mxgraph.aws3.bucket_with_objects;fillColor=#E05243;gradientColor=none;" parent="1" vertex="1"> | ||
<mxGeometry width="78" height="78" as="geometry" x="230" y="651"/> | ||
</mxCell> | ||
<mxCell id="edge:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda:to:sns:arn:aws:sns:eu-west-1:123456789012:internal.fifo" style="jettySize=auto;html=1;startArrow=none;endArrow=none;" parent="1" source="vertex:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda" target="vertex:sns:arn:aws:sns:eu-west-1:123456789012:internal.fifo" edge="2"> | ||
<mxGeometry as="geometry"/> | ||
</mxCell> | ||
<mxCell id="edge:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda:to:s3:arn:aws:s3:::bucket_name/key_name" style="jettySize=auto;html=1;startArrow=none;endArrow=none;" parent="1" source="vertex:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda" target="vertex:s3:arn:aws:s3:::bucket_name/key_name" edge="2"> | ||
<mxGeometry as="geometry"/> | ||
</mxCell> | ||
<mxCell id="edge:sns:arn:aws:sns:eu-west-1:123456789012:internal.fifo:to:sqs:arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events.fifo" style="jettySize=auto;html=1;startArrow=none;endArrow=none;" parent="1" source="vertex:sns:arn:aws:sns:eu-west-1:123456789012:internal.fifo" target="vertex:sqs:arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events.fifo" edge="2"> | ||
<mxGeometry as="geometry"/> | ||
</mxCell> | ||
<mxCell id="edge:sns:arn:aws:sns:eu-west-1:123456789012:internal.fifo:to:sqs:arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events2.fifo" style="jettySize=auto;html=1;startArrow=none;endArrow=none;" parent="1" source="vertex:sns:arn:aws:sns:eu-west-1:123456789012:internal.fifo" target="vertex:sqs:arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events2.fifo" edge="2"> | ||
<mxGeometry as="geometry"/> | ||
</mxCell> | ||
<mxCell id="edge:sqs:arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events.fifo:to:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:consumer-lambda" style="jettySize=auto;html=1;startArrow=none;endArrow=none;" parent="1" source="vertex:sqs:arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events.fifo" target="vertex:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:consumer-lambda" edge="2"> | ||
<mxGeometry as="geometry"/> | ||
</mxCell> | ||
<mxCell id="edge:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:consumer-lambda:to:dynamo:arn:aws:dynamodb:eu-west-1:123456789012:table/table1" style="jettySize=auto;html=1;startArrow=none;endArrow=none;" parent="1" source="vertex:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:consumer-lambda" target="vertex:dynamo:arn:aws:dynamodb:eu-west-1:123456789012:table/table1" edge="2"> | ||
<mxGeometry as="geometry"/> | ||
</mxCell> | ||
<mxCell id="2" parent="0" value="process"/> | ||
<mxCell id="3" parent="0" value="actors"/> | ||
<mxCell id="vertex:actor:5991ce42" value="<b>Name</b>: Donald" style="shape=umlActor;verticalLabelPosition=bottom;verticalAlign=top;html=1;outlineConnect=0;" parent="3" vertex="1"> | ||
<mxGeometry width="30" height="60" as="geometry"/> | ||
</mxCell> | ||
<mxCell id="edge_process_1:actor:5991ce42:to:s3:arn:aws:s3:::bucket_name/key_name" style="jettySize=auto;html=1;orthogonalLoop=1;edgeStyle=orthogonalEdgeStyle;curved=1;startArrow=oval;endArrow=classicThin;dashed=1;strokeColor=#FF3333;strokeWidth=3;fontSize=22;" parent="2" source="vertex:actor:5991ce42" target="vertex:s3:arn:aws:s3:::bucket_name/key_name" edge="2"> | ||
<mxGeometry as="geometry"/> | ||
</mxCell> | ||
<mxCell id="label_process_1:actor:5991ce42:to:s3:arn:aws:s3:::bucket_name/key_name" value="1: Put new file into S3 bucket<BR>Single line note on the left" style="edgeLabel;html=1;align=left;verticalAlign=middle;resizable=0;points=[];labelBackgroundColor=none;fontColor=#FF3333;fontStyle=0;fontSize=14;" parent="edge_process_1:actor:5991ce42:to:s3:arn:aws:s3:::bucket_name/key_name" vertex="1" connectable="0"> | ||
<mxGeometry relative="1" as="geometry"> | ||
<mxPoint as="offset"/> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="edge_process_2:s3:arn:aws:s3:::bucket_name/key_name:to:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda" style="jettySize=auto;html=1;orthogonalLoop=1;edgeStyle=orthogonalEdgeStyle;curved=1;startArrow=oval;endArrow=classicThin;dashed=1;strokeColor=#FF3333;strokeWidth=3;fontSize=22;" parent="2" source="vertex:s3:arn:aws:s3:::bucket_name/key_name" target="vertex:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda" edge="2"> | ||
<mxGeometry as="geometry"/> | ||
</mxCell> | ||
<mxCell id="label_process_2:s3:arn:aws:s3:::bucket_name/key_name:to:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda" value="2: LifeConfig Rule invokes lambda function" style="edgeLabel;html=1;align=left;verticalAlign=middle;resizable=0;points=[];labelBackgroundColor=none;fontColor=#FF3333;fontStyle=0;fontSize=14;" parent="edge_process_2:s3:arn:aws:s3:::bucket_name/key_name:to:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda" vertex="1" connectable="0"> | ||
<mxGeometry relative="1" as="geometry"> | ||
<mxPoint as="offset"/> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="edge_process_3:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda:to:sns:arn:aws:sns:eu-west-1:123456789012:internal.fifo" style="jettySize=auto;html=1;orthogonalLoop=1;edgeStyle=orthogonalEdgeStyle;curved=1;startArrow=oval;endArrow=classicThin;dashed=1;strokeColor=#FF3333;strokeWidth=3;fontSize=22;" parent="2" source="vertex:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda" target="vertex:sns:arn:aws:sns:eu-west-1:123456789012:internal.fifo" edge="2"> | ||
<mxGeometry as="geometry"/> | ||
</mxCell> | ||
<mxCell id="label_process_3:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda:to:sns:arn:aws:sns:eu-west-1:123456789012:internal.fifo" value="3: Send Event to SNS that file processing is finished<BR>multiline<BR>note<BR>added on the right" style="edgeLabel;html=1;align=left;verticalAlign=middle;resizable=0;points=[];labelBackgroundColor=none;fontColor=#FF3333;fontStyle=0;fontSize=14;" parent="edge_process_3:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:producer-lambda:to:sns:arn:aws:sns:eu-west-1:123456789012:internal.fifo" vertex="1" connectable="0"> | ||
<mxGeometry relative="1" as="geometry"> | ||
<mxPoint as="offset"/> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="edge_process_4:sns:arn:aws:sns:eu-west-1:123456789012:internal.fifo:to:sqs:arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events.fifo" style="jettySize=auto;html=1;orthogonalLoop=1;edgeStyle=orthogonalEdgeStyle;curved=1;startArrow=oval;endArrow=classicThin;dashed=1;strokeColor=#FF3333;strokeWidth=3;fontSize=22;" parent="2" source="vertex:sns:arn:aws:sns:eu-west-1:123456789012:internal.fifo" target="vertex:sqs:arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events.fifo" edge="2"> | ||
<mxGeometry as="geometry"/> | ||
</mxCell> | ||
<mxCell id="label_process_4:sns:arn:aws:sns:eu-west-1:123456789012:internal.fifo:to:sqs:arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events.fifo" value="4: Fanout Event to SQS" style="edgeLabel;html=1;align=left;verticalAlign=middle;resizable=0;points=[];labelBackgroundColor=none;fontColor=#FF3333;fontStyle=0;fontSize=14;" parent="edge_process_4:sns:arn:aws:sns:eu-west-1:123456789012:internal.fifo:to:sqs:arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events.fifo" vertex="1" connectable="0"> | ||
<mxGeometry relative="1" as="geometry"> | ||
<mxPoint as="offset"/> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="4" parent="0" value="load"/> | ||
<mxCell id="edge_load_1:sqs:arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events.fifo:to:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:consumer-lambda" style="jettySize=auto;html=1;orthogonalLoop=1;edgeStyle=orthogonalEdgeStyle;curved=1;startArrow=oval;endArrow=classicThin;dashed=1;strokeColor=#FF3333;strokeWidth=3;fontSize=22;" parent="4" source="vertex:sqs:arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events.fifo" target="vertex:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:consumer-lambda" edge="2"> | ||
<mxGeometry as="geometry"/> | ||
</mxCell> | ||
<mxCell id="label_load_1:sqs:arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events.fifo:to:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:consumer-lambda" value="1: poll message from SQS and invoke consumer lambda function" style="edgeLabel;html=1;align=left;verticalAlign=middle;resizable=0;points=[];labelBackgroundColor=none;fontColor=#FF3333;fontStyle=0;fontSize=14;" parent="edge_load_1:sqs:arn:aws:sqs:eu-west-1:123456789012:int-eu-live-events.fifo:to:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:consumer-lambda" vertex="1" connectable="0"> | ||
<mxGeometry relative="1" as="geometry"> | ||
<mxPoint as="offset"/> | ||
</mxGeometry> | ||
</mxCell> | ||
<mxCell id="edge_load_2:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:consumer-lambda:to:dynamo:arn:aws:dynamodb:eu-west-1:123456789012:table/table1" style="jettySize=auto;html=1;orthogonalLoop=1;edgeStyle=orthogonalEdgeStyle;curved=1;startArrow=oval;endArrow=classicThin;dashed=1;strokeColor=#FF3333;strokeWidth=3;fontSize=22;" parent="4" source="vertex:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:consumer-lambda" target="vertex:dynamo:arn:aws:dynamodb:eu-west-1:123456789012:table/table1" edge="2"> | ||
<mxGeometry as="geometry"/> | ||
</mxCell> | ||
<mxCell id="label_load_2:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:consumer-lambda:to:dynamo:arn:aws:dynamodb:eu-west-1:123456789012:table/table1" value="2: Update DynamoDB Table. Save image status." style="edgeLabel;html=1;align=left;verticalAlign=middle;resizable=0;points=[];labelBackgroundColor=none;fontColor=#FF3333;fontStyle=0;fontSize=14;" parent="edge_load_2:lambda_function:arn:aws:lambda:eu-west-1:123456789012:function:consumer-lambda:to:dynamo:arn:aws:dynamodb:eu-west-1:123456789012:table/table1" vertex="1" connectable="0"> | ||
<mxGeometry relative="1" as="geometry"> | ||
<mxPoint as="offset"/> | ||
</mxGeometry> | ||
</mxCell> | ||
</root> | ||
</mxGraphModel> | ||
</diagram> | ||
</mxfile> |
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,40 @@ | ||
from multicloud_diagrams import MultiCloudDiagrams | ||
from samples.samples.aws_service_end_2_end import prepare_end2end | ||
|
||
|
||
def main(): | ||
mcd = MultiCloudDiagrams() | ||
|
||
prefix = 'prod' | ||
prev_file = f'../output/output.{prefix}_plantuml.https.adr.drawio' | ||
|
||
mcd.read_coords_from_file(prev_file) | ||
prepare_end2end(mcd) | ||
mcd.read_uml_mappings('uml_mapping.yml') | ||
|
||
label_style = { | ||
'labelBackgroundColor': 'none', | ||
'fontColor': '#FF3333', | ||
'fontStyle': 0, | ||
'fontSize': 14 | ||
} | ||
style = { | ||
'orthogonalLoop': '1', | ||
'edgeStyle': 'orthogonalEdgeStyle', | ||
'curved': '1', | ||
'startArrow': 'oval', | ||
'endArrow': 'classicThin', | ||
'dashed': '1', | ||
'strokeColor': '#FF3333', | ||
'strokeWidth': '3', | ||
'fontSize': '22' | ||
} | ||
|
||
mcd.read_uml_from_http(md_http_endpoint="https://raw.githubusercontent.com/tsypuk/multicloud-diagrams/main/samples/samples/ADR.MD", start_line=11, base="process", edge_style=style, label_style=label_style) | ||
mcd.read_uml_from_http(md_http_endpoint="https://raw.githubusercontent.com/tsypuk/multicloud-diagrams/main/samples/samples/ADR.MD", start_line=37, base="load", edge_style=style, label_style=label_style) | ||
|
||
mcd.export_to_file(prev_file) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
Oops, something went wrong.