Skip to content

Commit

Permalink
feat: Add Azure assets to descendant objects
Browse files Browse the repository at this point in the history
  • Loading branch information
JonasBK committed Apr 15, 2023
1 parent bef3f97 commit 32ac28e
Show file tree
Hide file tree
Showing 4 changed files with 294 additions and 23 deletions.
74 changes: 69 additions & 5 deletions src/components/SearchContainer/Tabs/AZManagementGroupNodeData.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,32 +106,56 @@ const AZManagementGroupNodeData = ({}) => {

<hr></hr>

<CollapsibleSection header='DESCENDENT OBJECTS'>
<CollapsibleSection header='DESCENDANT OBJECTS'>
<div className={styles.itemlist}>
<Table>
<thead></thead>
<tbody className='searchable'>
<NodeCypherLink
property='Total Subscriptions'
property='Total Management Groups'
target={objectid}
baseQuery={
'MATCH p=(o:AZManagementGroup {objectid: $objectid})-[r:AZContains*1..]->(n:AZManagementGroup)'
}
distinct
/>
<NodeCypherLink
property='Total Subscription Objects'
target={objectid}
baseQuery={
'MATCH p=(o:AZManagementGroup {objectid: $objectid})-[r:AZContains*1..]->(n:AZSubscription)'
}
distinct
/>
<NodeCypherLink
property='Total Resource Groups'
property='Total Resource Group Objects'
target={objectid}
baseQuery={
'MATCH p=(o:AZManagementGroup {objectid: $objectid})-[r:AZContains*1..]->(n:AZResourceGroup)'
}
distinct
/>
<NodeCypherLink
property='Total VM Objects'
property='Total Automation Account Objects'
target={objectid}
baseQuery={
'MATCH p=(o:AZManagementGroup {objectid: $objectid})-[r:AZContains*1..]->(n:AZVM)'
'MATCH p=(o:AZManagementGroup {objectid: $objectid})-[r:AZContains*1..]->(n:AZAutomationAccount)'
}
distinct
/>
<NodeCypherLink
property='Total Container Registry Objects'
target={objectid}
baseQuery={
'MATCH p=(o:AZManagementGroup {objectid: $objectid})-[r:AZContains*1..]->(n:AZContainerRegistry)'
}
distinct
/>
<NodeCypherLink
property='Total Function App Objects'
target={objectid}
baseQuery={
'MATCH p=(o:AZManagementGroup {objectid: $objectid})-[r:AZContains*1..]->(n:AZFunctionApp)'
}
distinct
/>
Expand All @@ -143,6 +167,46 @@ const AZManagementGroupNodeData = ({}) => {
}
distinct
/>
<NodeCypherLink
property='Total Logic App Objects'
target={objectid}
baseQuery={
'MATCH p=(o:AZManagementGroup {objectid: $objectid})-[r:AZContains*1..]->(n:AZLogicApp)'
}
distinct
/>
<NodeCypherLink
property='Total Managed Cluster Objects'
target={objectid}
baseQuery={
'MATCH p=(o:AZManagementGroup {objectid: $objectid})-[r:AZContains*1..]->(n:AZManagedCluster)'
}
distinct
/>
<NodeCypherLink
property='Total VM Objects'
target={objectid}
baseQuery={
'MATCH p=(o:AZManagementGroup {objectid: $objectid})-[r:AZContains*1..]->(n:AZVM)'
}
distinct
/>
<NodeCypherLink
property='Total VM Scale Set Objects'
target={objectid}
baseQuery={
'MATCH p=(o:AZManagementGroup {objectid: $objectid})-[r:AZContains*1..]->(n:AZVMScaleSet)'
}
distinct
/>
<NodeCypherLink
property='Total Web App Objects'
target={objectid}
baseQuery={
'MATCH p=(o:AZManagementGroup {objectid: $objectid})-[r:AZContains*1..]->(n:AZWebApp)'
}
distinct
/>
</tbody>
</Table>
</div>
Expand Down
69 changes: 62 additions & 7 deletions src/components/SearchContainer/Tabs/AZResourceGroupNodeData.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -74,26 +74,81 @@ const AZResourceGroupNodeData = () => {

<hr></hr>

<CollapsibleSection header='DESCENDENT OBJECTS'>
<CollapsibleSection header='DESCENDANT OBJECTS'>
<div className={styles.itemlist}>
<Table>
<thead></thead>
<tbody className='searchable'>
<NodeCypherLink
property='Descendent VMs'
property='Total Automation Account Objects'
target={objectid}
baseQuery={
'MATCH p = (g:AZResourceGroup {objectid: $objectid})-[r:AZContains]->(n:AZVM)'
'MATCH p=(o:AZResourceGroup {objectid: $objectid})-[r:AZContains*1..]->(n:AZAutomationAccount)'
}
end={label}
distinct
/>
<NodeCypherLink
property='Descendent KeyVaults'
property='Total Container Registry Objects'
target={objectid}
baseQuery={
'MATCH p = (g:AZResourceGroup {objectid: $objectid})-[r:AZContains]->(n:AZKeyVault)'
'MATCH p=(o:AZResourceGroup {objectid: $objectid})-[r:AZContains*1..]->(n:AZContainerRegistry)'
}
distinct
/>
<NodeCypherLink
property='Total Function App Objects'
target={objectid}
baseQuery={
'MATCH p=(o:AZResourceGroup {objectid: $objectid})-[r:AZContains*1..]->(n:AZFunctionApp)'
}
distinct
/>
<NodeCypherLink
property='Total Key Vault Objects'
target={objectid}
baseQuery={
'MATCH p=(o:AZResourceGroup {objectid: $objectid})-[r:AZContains*1..]->(n:AZKeyVault)'
}
distinct
/>
<NodeCypherLink
property='Total Logic App Objects'
target={objectid}
baseQuery={
'MATCH p=(o:AZResourceGroup {objectid: $objectid})-[r:AZContains*1..]->(n:AZLogicApp)'
}
distinct
/>
<NodeCypherLink
property='Total Managed Cluster Objects'
target={objectid}
baseQuery={
'MATCH p=(o:AZResourceGroup {objectid: $objectid})-[r:AZContains*1..]->(n:AZManagedCluster)'
}
distinct
/>
<NodeCypherLink
property='Total VM Objects'
target={objectid}
baseQuery={
'MATCH p=(o:AZResourceGroup {objectid: $objectid})-[r:AZContains*1..]->(n:AZVM)'
}
distinct
/>
<NodeCypherLink
property='Total VM Scale Set Objects'
target={objectid}
baseQuery={
'MATCH p=(o:AZResourceGroup {objectid: $objectid})-[r:AZContains*1..]->(n:AZVMScaleSet)'
}
distinct
/>
<NodeCypherLink
property='Total Web App Objects'
target={objectid}
baseQuery={
'MATCH p=(o:AZResourceGroup {objectid: $objectid})-[r:AZContains*1..]->(n:AZWebApp)'
}
end={label}
distinct
/>
</tbody>
Expand Down
66 changes: 61 additions & 5 deletions src/components/SearchContainer/Tabs/AZSubscriptionNodeData.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,24 +104,40 @@ const AZSubscriptionNodeData = () => {

<hr></hr>

<CollapsibleSection header='DESCENDENT OBJECTS'>
<CollapsibleSection header='DESCENDANT OBJECTS'>
<div className={styles.itemlist}>
<Table>
<thead></thead>
<tbody className='searchable'>
<NodeCypherLink
property='Total VM Objects'
property='Total Resource Group Objects'
target={objectid}
baseQuery={
'MATCH p=(o:AZSubscription {objectid: $objectid})-[r:AZContains*1..]->(n:AZVM)'
'MATCH p=(o:AZSubscription {objectid: $objectid})-[r:AZContains*1..]->(n:AZResourceGroup)'
}
distinct
/>
<NodeCypherLink
property='Total Resource Group Objects'
property='Total Automation Account Objects'
target={objectid}
baseQuery={
'MATCH p=(o:AZSubscription {objectid: $objectid})-[r:AZContains*1..]->(n:AZResourceGroup)'
'MATCH p=(o:AZSubscription {objectid: $objectid})-[r:AZContains*1..]->(n:AZAutomationAccount)'
}
distinct
/>
<NodeCypherLink
property='Total Container Registry Objects'
target={objectid}
baseQuery={
'MATCH p=(o:AZSubscription {objectid: $objectid})-[r:AZContains*1..]->(n:AZContainerRegistry)'
}
distinct
/>
<NodeCypherLink
property='Total Function App Objects'
target={objectid}
baseQuery={
'MATCH p=(o:AZSubscription {objectid: $objectid})-[r:AZContains*1..]->(n:AZFunctionApp)'
}
distinct
/>
Expand All @@ -133,6 +149,46 @@ const AZSubscriptionNodeData = () => {
}
distinct
/>
<NodeCypherLink
property='Total Logic App Objects'
target={objectid}
baseQuery={
'MATCH p=(o:AZSubscription {objectid: $objectid})-[r:AZContains*1..]->(n:AZLogicApp)'
}
distinct
/>
<NodeCypherLink
property='Total Managed Cluster Objects'
target={objectid}
baseQuery={
'MATCH p=(o:AZSubscription {objectid: $objectid})-[r:AZContains*1..]->(n:AZManagedCluster)'
}
distinct
/>
<NodeCypherLink
property='Total VM Objects'
target={objectid}
baseQuery={
'MATCH p=(o:AZSubscription {objectid: $objectid})-[r:AZContains*1..]->(n:AZVM)'
}
distinct
/>
<NodeCypherLink
property='Total VM Scale Set Objects'
target={objectid}
baseQuery={
'MATCH p=(o:AZSubscription {objectid: $objectid})-[r:AZContains*1..]->(n:AZVMScaleSet)'
}
distinct
/>
<NodeCypherLink
property='Total Web App Objects'
target={objectid}
baseQuery={
'MATCH p=(o:AZSubscription {objectid: $objectid})-[r:AZContains*1..]->(n:AZWebApp)'
}
distinct
/>
</tbody>
</Table>
</div>
Expand Down
Loading

0 comments on commit 32ac28e

Please sign in to comment.