Skip to content

Commit

Permalink
feat: add aws xray service
Browse files Browse the repository at this point in the history
  • Loading branch information
tsypuk committed May 14, 2024
1 parent b252ac6 commit c180295
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
7 changes: 7 additions & 0 deletions multicloud_diagrams/providers/aws.json
Original file line number Diff line number Diff line change
Expand Up @@ -263,5 +263,12 @@
"height": "78",
"version": "0.3.40",
"desc": "AWS Exchange"
},
"xray": {
"style": "outlineConnect=0;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=left;html=1;shape=mxgraph.aws3.x_ray;fillColor=#759C3E;gradientColor=none;",
"width": "76.5",
"height": "85.5",
"version": "0.3.41",
"desc": "AWS Xray"
}
}
45 changes: 45 additions & 0 deletions tests/aws/test_xray.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
from multicloud_diagrams import MultiCloudDiagrams
from utils.templating import TestRendering


class TestAWSVertexInIsolation(TestRendering):

def test_eks(self):
# docs
self.node_type = 'xray'

# given
mcd = MultiCloudDiagrams()

# when
xray_service_arn = 'arn:aws:xray:us-west-1:123456789012:service/xray/tracing'
xray_service_name = 'End-to-End-Tracing'
metadata = {
"serviceName": "service-xray",
"clusterArn": "arn:aws:xray:eu-west-1:123456789012:service/tracing",
"serviceRegistries": "arn:aws:xray:eu-west-1:123456789012:service/srv-t",
"status": "ACTIVE",
"includeFragments": "true",
"sampling": 25,
"platformVersion": "LATEST",
"platformFamily": "Linux",
}
mcd.add_vertex(node_id=xray_service_arn, node_name=xray_service_name, node_type='xray', metadata=metadata)

# then
expected = {'id': 'vertex:xray:arn:aws:xray:us-west-1:123456789012:service/xray/tracing',
'parent': '1',
'style': 'outlineConnect=0;dashed=0;verticalLabelPosition=bottom;verticalAlign=top;align=left;html=1;shape=mxgraph.aws3.x_ray;fillColor=#759C3E;gradientColor=none;',
'value': '<b>Name</b>: End-to-End-Tracing<BR><b>ARN</b>: '
'arn:aws:xray:us-west-1:123456789012:service/xray/tracing<BR>-----------<BR><b>serviceName</b>: '
'service-xray<BR><b>clusterArn</b>: '
'arn:aws:xray:eu-west-1:123456789012:service/tracing<BR><b>serviceRegistries</b>: '
'arn:aws:xray:eu-west-1:123456789012:service/srv-t<BR><b>status</b>: '
'ACTIVE<BR><b>includeFragments</b>: true<BR><b>sampling</b>: '
'25<BR><b>platformVersion</b>: LATEST<BR><b>platformFamily</b>: '
'Linux',
'vertex': '1'}
self.verify_resource(expected, mcd.mx_file, 'xray', self.node_type)

# docs
self.mcd = mcd

0 comments on commit c180295

Please sign in to comment.