diff --git a/docs/analysis/additional-nodes/hybrid-extension.md b/docs/analysis/additional-nodes/hybrid-extension.md deleted file mode 100644 index f824b25..0000000 --- a/docs/analysis/additional-nodes/hybrid-extension.md +++ /dev/null @@ -1,38 +0,0 @@ -# HybridExtension - -Represents extensions installed on hybrid machines (not an ARM resource itself). - -**Labels:** `:HybridExtension` - -**Properties:** - -- `id` - Extension ID (primary key) -- `name` - Extension name -- `type` - Extension type -- `location` - Extension location -- `typeHandlerVersion` - Type handler version -- `autoUpgradeMinorVersion` - Auto upgrade minor version setting -- `enableAutomaticUpgrade` - Enable automatic upgrade setting -- `statusMessage` - Extension status message -- `provisioningState` - Provisioning state - -## Relationships - -### Incoming - -- **HybridMachine** → `HAS_EXTENSION` → HybridExtension - Parent hybrid machine - -## Examples - -```cypher -// Find all hybrid machine extensions -MATCH (hm:HybridMachine)-[:HAS_EXTENSION]->(ext:HybridExtension) -RETURN hm.displayName, ext.name, ext.type, ext.provisioningState -``` - -```cypher -// Find extensions with auto upgrade enabled -MATCH (ext:HybridExtension) -WHERE ext.enableAutomaticUpgrade = true -RETURN ext.name, ext.typeHandlerVersion -``` \ No newline at end of file diff --git a/docs/analysis/additional-nodes/hybrid-run-command-parameter.md b/docs/analysis/additional-nodes/hybrid-run-command-parameter.md new file mode 100644 index 0000000..c9ee907 --- /dev/null +++ b/docs/analysis/additional-nodes/hybrid-run-command-parameter.md @@ -0,0 +1,17 @@ +# HybridRunCommandParameter + +Represents a parameter for a hybrid machine run command. + +**Labels:** `:HybridRunCommandParameter` + +**Properties:** + +- `name` - Parameter name (composite key with `commandId`) +- `commandId` - Parent run command ID (composite key) +- `value` - Parameter value + +## Relationships + +### Incoming + +- **HybridRunCommand** → `HAS_PARAMETER` → **HybridRunCommandParameter** - Parent run command diff --git a/docs/analysis/additional-nodes/hybrid-run-command.md b/docs/analysis/additional-nodes/hybrid-run-command.md new file mode 100644 index 0000000..5999a08 --- /dev/null +++ b/docs/analysis/additional-nodes/hybrid-run-command.md @@ -0,0 +1,34 @@ +# HybridRunCommand + +Represents a run command resource associated with an Azure Arc-enabled hybrid machine. + +**Labels:** `:ArmResource:HybridRunCommand` + +**Properties:** + +- `id` - Run command resource ID (primary key) +- `asyncExecution` - Whether execution is asynchronous +- `runAsUser` - User context used to run the command +- `timeoutInSeconds` - Command timeout in seconds +- `treatFailureAsDeploymentFailure` - Failure handling behavior +- `script` - Script body +- `output` - Command output from the last execution + +## Relationships + +### Incoming + +- **HybridMachine** → `HAS_RUN_COMMAND` → **HybridRunCommand** - Parent hybrid machine + +### Outgoing + +- **HybridRunCommand** → `HAS_PARAMETER` → **HybridRunCommandParameter** - Parameters bound to the run command + +## Examples + +```cypher +// Find hybrid run commands and their parameters +MATCH (hm:HybridMachine)-[:HAS_RUN_COMMAND]->(cmd:HybridRunCommand) +OPTIONAL MATCH (cmd)-[:HAS_PARAMETER]->(p:HybridRunCommandParameter) +RETURN hm.displayName, cmd.id, collect(p.name) AS parameterNames +``` diff --git a/docs/analysis/additional-nodes/vm-extension.md b/docs/analysis/additional-nodes/vm-extension.md index 1bd6546..86bbb78 100644 --- a/docs/analysis/additional-nodes/vm-extension.md +++ b/docs/analysis/additional-nodes/vm-extension.md @@ -2,7 +2,7 @@ Represents an extension attached to an Azure virtual machine. -**Labels:** `:VMExtension` +**Labels:** `:ArmResource:VMExtension` **Properties:** diff --git a/docs/analysis/additional-nodes/vm-run-command-parameter.md b/docs/analysis/additional-nodes/vm-run-command-parameter.md index a187629..997f4b8 100644 --- a/docs/analysis/additional-nodes/vm-run-command-parameter.md +++ b/docs/analysis/additional-nodes/vm-run-command-parameter.md @@ -6,7 +6,8 @@ Represents a parameter for a virtual machine run command. **Properties:** -- `name` - Parameter name (primary key) +- `name` - Parameter name (composite key with `commandId`) +- `commandId` - Parent run command ID (composite key) - `value` - Parameter value ## Relationships diff --git a/docs/analysis/arm-nodes/hybridcompute/hybrid-extension.md b/docs/analysis/arm-nodes/hybridcompute/hybrid-extension.md index 5c9f22d..4f0cb3d 100644 --- a/docs/analysis/arm-nodes/hybridcompute/hybrid-extension.md +++ b/docs/analysis/arm-nodes/hybridcompute/hybrid-extension.md @@ -1,20 +1,41 @@ # HybridExtension -Represents extensions installed on hybrid machines (not an ARM resource itself). +Represents extensions installed on Azure Arc-enabled hybrid machines. -**Labels:** `:HybridExtension` +**Labels:** `:ArmResource:HybridExtension` **Properties:** -- `id` - Extension ID (primary key) +- `id` - Extension resource ID (primary key) - `name` - Extension name -- `type` - Extension type -- `location` - Extension location +- `type` - Resource type (`microsoft.hybridcompute/machines/extensions`) +- `location` - Resource location +- `extType` - Extension type (e.g. `CustomScriptExtension`) - `typeHandlerVersion` - Type handler version - `autoUpgradeMinorVersion` - Auto upgrade minor version - `enableAutomaticUpgrade` - Enable automatic upgrade -- `statusMessage` - Status message +- `statusMessage` - Extension status message - `provisioningState` - Provisioning state +- `publisher` - Extension publisher +- `settings` - Serialized extension settings (JSON) -**Relationships:** -- `HAS_EXTENSION` ← HybridMachine +## Relationships + +### Incoming + +- **HybridMachine** → `HAS_EXTENSION` → **HybridExtension** - Parent hybrid machine + +## Examples + +```cypher +// Find all hybrid machine extensions +MATCH (hm:HybridMachine)-[:HAS_EXTENSION]->(ext:HybridExtension) +RETURN hm.displayName, ext.name, ext.extType, ext.provisioningState +``` + +```cypher +// Find extensions with auto upgrade enabled +MATCH (ext:HybridExtension) +WHERE ext.enableAutomaticUpgrade = true +RETURN ext.name, ext.extType, ext.typeHandlerVersion +``` diff --git a/docs/analysis/arm-nodes/hybridcompute/hybrid-gateway.md b/docs/analysis/arm-nodes/hybridcompute/hybrid-gateway.md new file mode 100644 index 0000000..76ac94b --- /dev/null +++ b/docs/analysis/arm-nodes/hybridcompute/hybrid-gateway.md @@ -0,0 +1,23 @@ +# HybridGateway + +Represents an Azure Arc gateway resource used to connect hybrid machines to Azure through a managed endpoint. + +**Labels:** `:ArmResource:HybridGateway` + +**Properties:** + +- `id` - Gateway resource ID (primary key) +- `allowedFeatures` - Features allowed through the gateway +- `gatewayEndpoint` - Gateway endpoint URL +- `gatewayId` - Unique gateway identifier +- `gatewayType` - Type of gateway +- `lastUpdateTime` - Last update timestamp +- `provisioningState` - Provisioning state + +## Examples + +```cypher +// Find all hybrid gateways +MATCH (gw:HybridGateway) +RETURN gw.id, gw.gatewayType, gw.gatewayEndpoint, gw.provisioningState +``` diff --git a/docs/analysis/arm-nodes/hybridcompute/hybrid-private-link-scope.md b/docs/analysis/arm-nodes/hybridcompute/hybrid-private-link-scope.md new file mode 100644 index 0000000..71d222d --- /dev/null +++ b/docs/analysis/arm-nodes/hybridcompute/hybrid-private-link-scope.md @@ -0,0 +1,21 @@ +# HybridPrivateLinkScope + +Represents an Azure Arc private link scope resource used to connect hybrid machines over private endpoints. + +**Labels:** `:ArmResource:HybridPrivateLinkScope` + +**Properties:** + +- `id` - Private link scope resource ID (primary key) +- `privateLinkScopeId` - Unique private link scope identifier +- `provisioningState` - Provisioning state +- `publicNetworkAccess` - Public network access setting + +## Examples + +```cypher +// Find private link scopes with public access enabled +MATCH (pls:HybridPrivateLinkScope) +WHERE pls.publicNetworkAccess = "Enabled" +RETURN pls.id, pls.privateLinkScopeId +``` diff --git a/src/graph/config/azure/arm/compute/virtual_machine_extensions.tera.yaml b/src/graph/config/azure/arm/compute/virtual_machine_extensions.tera.yaml index 2337c3f..bde4215 100644 --- a/src/graph/config/azure/arm/compute/virtual_machine_extensions.tera.yaml +++ b/src/graph/config/azure/arm/compute/virtual_machine_extensions.tera.yaml @@ -7,7 +7,8 @@ properties: - "/properties" cypher: | UNWIND $batch AS row - MERGE (obj:{{ LABELS.VMExtension }} {id: toLower(row.id)}) + MERGE (obj:{{ LABELS.ArmResource }} {id: toLower(row.id)}) + SET obj:{{ LABELS.VMExtension }} SET obj += { autoUpgradeMinorVersion: row.properties.autoUpgradeMinorVersion, diff --git a/src/graph/config/azure/arm/compute/virtual_machine_run_commands.tera.yaml b/src/graph/config/azure/arm/compute/virtual_machine_run_commands.tera.yaml index fa59155..68b3138 100644 --- a/src/graph/config/azure/arm/compute/virtual_machine_run_commands.tera.yaml +++ b/src/graph/config/azure/arm/compute/virtual_machine_run_commands.tera.yaml @@ -5,6 +5,8 @@ resource_type: "microsoft.compute/virtualmachines/runcommands" properties: - "/id" - "/properties" +index_properties: + - "{{ LABELS.VMRunCommandParameter }}:name+commandId" cypher: | UNWIND $batch AS row MERGE (obj:{{ LABELS.ArmResource }} {id: toLower(row.id)}) @@ -27,7 +29,7 @@ cypher: | CALL { WITH obj, row UNWIND coalesce(row.properties.parameters, []) AS param - MERGE (p:{{ LABELS.VMRunCommandParameter }} {name: param.name}) + MERGE (p:{{ LABELS.VMRunCommandParameter }} {name: param.name, commandId: toLower(obj.id)}) SET p.value = param.value MERGE (obj)-[:{{ REL.HAS_PARAMETER }}]->(p) diff --git a/src/graph/config/azure/arm/compute/virtual_machines.tera.yaml b/src/graph/config/azure/arm/compute/virtual_machines.tera.yaml index 1868bd1..780d6a7 100644 --- a/src/graph/config/azure/arm/compute/virtual_machines.tera.yaml +++ b/src/graph/config/azure/arm/compute/virtual_machines.tera.yaml @@ -38,7 +38,8 @@ cypher: | WITH obj, row UNWIND coalesce(row.resources, []) AS resource WITH obj, resource WHERE toLower(resource.type) = "microsoft.compute/virtualmachines/extensions" - MERGE (e:{{ LABELS.VMExtension }} {id: toLower(resource.id)}) + MERGE (e:{{ LABELS.ArmResource }} {id: toLower(resource.id)}) + SET e:{{ LABELS.VMExtension }} SET e += { name: resource.name, type: toLower(resource.type), diff --git a/src/graph/config/azure/arm/hybridcompute/hybrid_machines.tera.yaml b/src/graph/config/azure/arm/hybridcompute/hybrid_machines.tera.yaml index d9a0f02..948cf8c 100644 --- a/src/graph/config/azure/arm/hybridcompute/hybrid_machines.tera.yaml +++ b/src/graph/config/azure/arm/hybridcompute/hybrid_machines.tera.yaml @@ -60,11 +60,13 @@ cypher: | WITH obj, row UNWIND coalesce(row.resources, []) AS resource WITH obj, resource WHERE toLower(resource.type) = "microsoft.hybridcompute/machines/extensions" - MERGE (e:{{ LABELS.HybridExtension }} {id: toLower(resource.id)}) + MERGE (e:{{ LABELS.ArmResource }} {id: toLower(resource.id)}) + SET e:{{ LABELS.HybridExtension }} SET e += { name: resource.name, type: resource.type, location: resource.location, + extType: resource.properties.type, typeHandlerVersion: resource.properties.typeHandlerVersion, autoUpgradeMinorVersion: resource.properties.autoUpgradeMinorVersion, enableAutomaticUpgrade: resource.properties.enableAutomaticUpgrade, diff --git a/src/graph/config/azure/arm/hybridcompute/hybrid_machines_extensions.tera.yaml b/src/graph/config/azure/arm/hybridcompute/hybrid_machines_extensions.tera.yaml new file mode 100644 index 0000000..220e894 --- /dev/null +++ b/src/graph/config/azure/arm/hybridcompute/hybrid_machines_extensions.tera.yaml @@ -0,0 +1,21 @@ +name: "Hybrid Machine Extensions" +label: "{{ LABELS.HybridExtension }}" +table_name: "resources" +resource_type: "microsoft.hybridcompute/machines/extensions" +properties: + - "/id" + - "/properties" +cypher: | + UNWIND $batch AS row + MERGE (obj:{{ LABELS.ArmResource }} {id: toLower(row.id)}) + SET obj:{{ LABELS.HybridExtension }} + + SET obj += { + extType: row.properties.type, + autoUpgradeMinorVersion: row.properties.autoUpgradeMinorVersion, + enableAutomaticUpgrade: row.properties.enableAutomaticUpgrade, + statusMessage: row.properties.instanceView.status.message, + provisioningState: row.properties.provisioningState, + publisher: row.properties.publisher, + settings: apoc.convert.toJson(row.properties.settings) + } \ No newline at end of file diff --git a/src/graph/config/azure/arm/hybridcompute/hybrid_machines_gateways.tera.yaml b/src/graph/config/azure/arm/hybridcompute/hybrid_machines_gateways.tera.yaml new file mode 100644 index 0000000..fbeeae4 --- /dev/null +++ b/src/graph/config/azure/arm/hybridcompute/hybrid_machines_gateways.tera.yaml @@ -0,0 +1,20 @@ +name: "Hybrid Machine Gateways" +label: "{{ LABELS.HybridGateway }}" +table_name: "resources" +resource_type: "microsoft.hybridcompute/gateways" +properties: + - "/id" + - "/properties" +cypher: | + UNWIND $batch AS row + MERGE (obj:{{ LABELS.ArmResource }} {id: toLower(row.id)}) + SET obj:{{ LABELS.HybridGateway }} + + SET obj += { + allowedFeatures: row.properties.allowedFeatures, + gatewayEndpoint: row.properties.gatewayEndpoint, + gatewayId: row.properties.gatewayId, + gatewayType: row.properties.gatewayType, + lastUpdateTime: row.properties.lastUpdateTime, + provisioningState: row.properties.provisioningState + } \ No newline at end of file diff --git a/src/graph/config/azure/arm/hybridcompute/hybrid_machines_run_command.tera.yaml b/src/graph/config/azure/arm/hybridcompute/hybrid_machines_run_command.tera.yaml new file mode 100644 index 0000000..ff531f2 --- /dev/null +++ b/src/graph/config/azure/arm/hybridcompute/hybrid_machines_run_command.tera.yaml @@ -0,0 +1,39 @@ +name: "Hybrid Machine Run Commands" +label: "{{ LABELS.HybridRunCommand }}" +table_name: "resources" +resource_type: "microsoft.compute/virtualmachines/runcommands" +properties: + - "/id" + - "/properties" +index_properties: + - "{{ LABELS.HybridRunCommandParameter }}:name+commandId" +cypher: | + UNWIND $batch AS row + MERGE (obj:{{ LABELS.ArmResource }} {id: toLower(row.id)}) + SET obj:{{ LABELS.HybridRunCommand }} + + SET obj += { + asyncExecution: row.properties.asyncExecution, + runAsUser: row.properties.runAsUser, + timeoutInSeconds: row.properties.timeoutInSeconds, + treatFailureAsDeploymentFailure: row.properties.treatFailureAsDeploymentFailure, + script: row.properties.source.script, + output: row.properties.instanceView.output + } + + WITH obj, row, split(toLower(obj.id), '/runcommands/')[0] AS vmId + MERGE (vm:{{ LABELS.ArmResource }} {id: toLower(vmId)}) + SET vm:{{ LABELS.HybridMachine }} + MERGE (vm)-[:{{ REL.HAS_RUN_COMMAND }}]->(obj) + + WITH obj, row + CALL { + WITH obj, row + UNWIND coalesce(row.properties.parameters, []) AS param + MERGE (p:{{ LABELS.HybridRunCommandParameter }} {name: param.name, commandId: toLower(obj.id)}) + SET p.value = param.value + + MERGE (obj)-[:{{ REL.HAS_PARAMETER }}]->(p) + RETURN count(*) AS _ + } + RETURN count(*) AS _ \ No newline at end of file diff --git a/src/graph/config/azure/arm/hybridcompute/private_link_scopes.tera.yaml b/src/graph/config/azure/arm/hybridcompute/private_link_scopes.tera.yaml new file mode 100644 index 0000000..c486dc8 --- /dev/null +++ b/src/graph/config/azure/arm/hybridcompute/private_link_scopes.tera.yaml @@ -0,0 +1,17 @@ +name: "Hybrid Private Link Scopes" +label: "{{ LABELS.HybridPrivateLinkScope }}" +table_name: "resources" +resource_type: "microsoft.hybridcompute/privatelinkscopes" +properties: + - "/id" + - "/properties" +cypher: | + UNWIND $batch AS row + MERGE (obj:{{ LABELS.ArmResource }} {id: toLower(row.id)}) + SET obj:{{ LABELS.HybridPrivateLinkScope }} + + SET obj += { + privateLinkScopeId: row.properties.privateLinkScopeId, + provisioningState: row.properties.provisioningState, + publicNetworkAccess: row.properties.publicNetworkAccess + } \ No newline at end of file diff --git a/src/graph/config/constants.yaml b/src/graph/config/constants.yaml index c8b9bda..1e0ca6d 100644 --- a/src/graph/config/constants.yaml +++ b/src/graph/config/constants.yaml @@ -130,7 +130,10 @@ LABELS: GalleryImageVersion: "GalleryImageVersion" GithubNetworkSettings: "GithubNetworkSettings" GrafanaDashboard: "GrafanaDashboard" + HybridGateway: "HybridGateway" HybridMachine: "HybridMachine" + HybridExtension: "HybridExtension" + HybridPrivateLinkScope: "HybridPrivateLinkScope" KeyVault: "KeyVault" KeyVaultSecret: "KeyVaultSecret" KeyVaultSecretValue: "KeyVaultSecretValue" @@ -203,8 +206,9 @@ LABELS: ExpressRouteCircuitPeering: "ExpressRouteCircuitPeering" FederatedIdentityCredential: "FederatedIdentityCredential" GraphAppRole: "GraphAppRole" - HybridExtension: "HybridExtension" HybridIPAddress: "HybridIPAddress" + HybridRunCommand: "HybridRunCommand" + HybridRunCommandParameter: "HybridRunCommandParameter" IPConfiguration: "IPConfiguration" NetAppAccountADDomain: "NetAppAccountADDomain" NetAppVolumeMount: "NetAppVolumeMount" diff --git a/zensical.toml b/zensical.toml index 99d6ea3..7f42748 100644 --- a/zensical.toml +++ b/zensical.toml @@ -151,9 +151,11 @@ nav = [ "analysis/arm-nodes/eventhub/eventhub-namespace.md", ] }, { "Hybrid Compute" = [ - "analysis/arm-nodes/hybridcompute/hybrid-machine.md", - "analysis/arm-nodes/hybridcompute/hybrid-ip-address.md", "analysis/arm-nodes/hybridcompute/hybrid-extension.md", + "analysis/arm-nodes/hybridcompute/hybrid-gateway.md", + "analysis/arm-nodes/hybridcompute/hybrid-ip-address.md", + "analysis/arm-nodes/hybridcompute/hybrid-machine.md", + "analysis/arm-nodes/hybridcompute/hybrid-private-link-scope.md", ] }, { "Identity" = [ "analysis/arm-nodes/identity/user-assigned-identity.md", @@ -257,8 +259,9 @@ nav = [ "analysis/additional-nodes/expressroute-circuit-peering.md", "analysis/additional-nodes/federated-identity-credential.md", "analysis/additional-nodes/graph-app-role.md", - "analysis/additional-nodes/hybrid-extension.md", "analysis/additional-nodes/hybrid-ip-address.md", + "analysis/additional-nodes/hybrid-run-command.md", + "analysis/additional-nodes/hybrid-run-command-parameter.md", "analysis/additional-nodes/ip-config.md", "analysis/additional-nodes/key-vault-certificate.md", "analysis/additional-nodes/key-vault-certificate-value.md",