Skip to content

Commit eac3b28

Browse files
feat(graph): add multiple Hybrid nodes and parity with virtual machines (#21)
1 parent 8ace416 commit eac3b28

18 files changed

Lines changed: 245 additions & 56 deletions

docs/analysis/additional-nodes/hybrid-extension.md

Lines changed: 0 additions & 38 deletions
This file was deleted.
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# HybridRunCommandParameter
2+
3+
Represents a parameter for a hybrid machine run command.
4+
5+
**Labels:** `:HybridRunCommandParameter`
6+
7+
**Properties:**
8+
9+
- `name` - Parameter name (composite key with `commandId`)
10+
- `commandId` - Parent run command ID (composite key)
11+
- `value` - Parameter value
12+
13+
## Relationships
14+
15+
### Incoming
16+
17+
- **HybridRunCommand**`HAS_PARAMETER`**HybridRunCommandParameter** - Parent run command
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# HybridRunCommand
2+
3+
Represents a run command resource associated with an Azure Arc-enabled hybrid machine.
4+
5+
**Labels:** `:ArmResource:HybridRunCommand`
6+
7+
**Properties:**
8+
9+
- `id` - Run command resource ID (primary key)
10+
- `asyncExecution` - Whether execution is asynchronous
11+
- `runAsUser` - User context used to run the command
12+
- `timeoutInSeconds` - Command timeout in seconds
13+
- `treatFailureAsDeploymentFailure` - Failure handling behavior
14+
- `script` - Script body
15+
- `output` - Command output from the last execution
16+
17+
## Relationships
18+
19+
### Incoming
20+
21+
- **HybridMachine**`HAS_RUN_COMMAND`**HybridRunCommand** - Parent hybrid machine
22+
23+
### Outgoing
24+
25+
- **HybridRunCommand**`HAS_PARAMETER`**HybridRunCommandParameter** - Parameters bound to the run command
26+
27+
## Examples
28+
29+
```cypher
30+
// Find hybrid run commands and their parameters
31+
MATCH (hm:HybridMachine)-[:HAS_RUN_COMMAND]->(cmd:HybridRunCommand)
32+
OPTIONAL MATCH (cmd)-[:HAS_PARAMETER]->(p:HybridRunCommandParameter)
33+
RETURN hm.displayName, cmd.id, collect(p.name) AS parameterNames
34+
```

docs/analysis/additional-nodes/vm-extension.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Represents an extension attached to an Azure virtual machine.
44

5-
**Labels:** `:VMExtension`
5+
**Labels:** `:ArmResource:VMExtension`
66

77
**Properties:**
88

docs/analysis/additional-nodes/vm-run-command-parameter.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ Represents a parameter for a virtual machine run command.
66

77
**Properties:**
88

9-
- `name` - Parameter name (primary key)
9+
- `name` - Parameter name (composite key with `commandId`)
10+
- `commandId` - Parent run command ID (composite key)
1011
- `value` - Parameter value
1112

1213
## Relationships
Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,41 @@
11
# HybridExtension
22

3-
Represents extensions installed on hybrid machines (not an ARM resource itself).
3+
Represents extensions installed on Azure Arc-enabled hybrid machines.
44

5-
**Labels:** `:HybridExtension`
5+
**Labels:** `:ArmResource:HybridExtension`
66

77
**Properties:**
88

9-
- `id` - Extension ID (primary key)
9+
- `id` - Extension resource ID (primary key)
1010
- `name` - Extension name
11-
- `type` - Extension type
12-
- `location` - Extension location
11+
- `type` - Resource type (`microsoft.hybridcompute/machines/extensions`)
12+
- `location` - Resource location
13+
- `extType` - Extension type (e.g. `CustomScriptExtension`)
1314
- `typeHandlerVersion` - Type handler version
1415
- `autoUpgradeMinorVersion` - Auto upgrade minor version
1516
- `enableAutomaticUpgrade` - Enable automatic upgrade
16-
- `statusMessage` - Status message
17+
- `statusMessage` - Extension status message
1718
- `provisioningState` - Provisioning state
19+
- `publisher` - Extension publisher
20+
- `settings` - Serialized extension settings (JSON)
1821

19-
**Relationships:**
20-
- `HAS_EXTENSION` ← HybridMachine
22+
## Relationships
23+
24+
### Incoming
25+
26+
- **HybridMachine**`HAS_EXTENSION`**HybridExtension** - Parent hybrid machine
27+
28+
## Examples
29+
30+
```cypher
31+
// Find all hybrid machine extensions
32+
MATCH (hm:HybridMachine)-[:HAS_EXTENSION]->(ext:HybridExtension)
33+
RETURN hm.displayName, ext.name, ext.extType, ext.provisioningState
34+
```
35+
36+
```cypher
37+
// Find extensions with auto upgrade enabled
38+
MATCH (ext:HybridExtension)
39+
WHERE ext.enableAutomaticUpgrade = true
40+
RETURN ext.name, ext.extType, ext.typeHandlerVersion
41+
```
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# HybridGateway
2+
3+
Represents an Azure Arc gateway resource used to connect hybrid machines to Azure through a managed endpoint.
4+
5+
**Labels:** `:ArmResource:HybridGateway`
6+
7+
**Properties:**
8+
9+
- `id` - Gateway resource ID (primary key)
10+
- `allowedFeatures` - Features allowed through the gateway
11+
- `gatewayEndpoint` - Gateway endpoint URL
12+
- `gatewayId` - Unique gateway identifier
13+
- `gatewayType` - Type of gateway
14+
- `lastUpdateTime` - Last update timestamp
15+
- `provisioningState` - Provisioning state
16+
17+
## Examples
18+
19+
```cypher
20+
// Find all hybrid gateways
21+
MATCH (gw:HybridGateway)
22+
RETURN gw.id, gw.gatewayType, gw.gatewayEndpoint, gw.provisioningState
23+
```
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# HybridPrivateLinkScope
2+
3+
Represents an Azure Arc private link scope resource used to connect hybrid machines over private endpoints.
4+
5+
**Labels:** `:ArmResource:HybridPrivateLinkScope`
6+
7+
**Properties:**
8+
9+
- `id` - Private link scope resource ID (primary key)
10+
- `privateLinkScopeId` - Unique private link scope identifier
11+
- `provisioningState` - Provisioning state
12+
- `publicNetworkAccess` - Public network access setting
13+
14+
## Examples
15+
16+
```cypher
17+
// Find private link scopes with public access enabled
18+
MATCH (pls:HybridPrivateLinkScope)
19+
WHERE pls.publicNetworkAccess = "Enabled"
20+
RETURN pls.id, pls.privateLinkScopeId
21+
```

src/graph/config/azure/arm/compute/virtual_machine_extensions.tera.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ properties:
77
- "/properties"
88
cypher: |
99
UNWIND $batch AS row
10-
MERGE (obj:{{ LABELS.VMExtension }} {id: toLower(row.id)})
10+
MERGE (obj:{{ LABELS.ArmResource }} {id: toLower(row.id)})
11+
SET obj:{{ LABELS.VMExtension }}
1112
1213
SET obj += {
1314
autoUpgradeMinorVersion: row.properties.autoUpgradeMinorVersion,

src/graph/config/azure/arm/compute/virtual_machine_run_commands.tera.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ resource_type: "microsoft.compute/virtualmachines/runcommands"
55
properties:
66
- "/id"
77
- "/properties"
8+
index_properties:
9+
- "{{ LABELS.VMRunCommandParameter }}:name+commandId"
810
cypher: |
911
UNWIND $batch AS row
1012
MERGE (obj:{{ LABELS.ArmResource }} {id: toLower(row.id)})
@@ -27,7 +29,7 @@ cypher: |
2729
CALL {
2830
WITH obj, row
2931
UNWIND coalesce(row.properties.parameters, []) AS param
30-
MERGE (p:{{ LABELS.VMRunCommandParameter }} {name: param.name})
32+
MERGE (p:{{ LABELS.VMRunCommandParameter }} {name: param.name, commandId: toLower(obj.id)})
3133
SET p.value = param.value
3234
3335
MERGE (obj)-[:{{ REL.HAS_PARAMETER }}]->(p)

0 commit comments

Comments
 (0)