Documentation
¶
Overview ¶
Package resourcegraph serves Azure Resource Graph (armresourcegraph) REST requests against a *resourcediscovery.Engine.
Resource Graph queries use Kusto Query Language (KQL), a rich data-analytics grammar. This handler implements a documented subset that covers the queries real callers make for inventory/discovery:
Resources
| where type == 'microsoft.compute/virtualmachines'
| where type =~ 'microsoft.network/virtualnetworks'
| where resourceGroup == 'rg-prod'
| where location == 'eastus'
| where tags['env'] == 'prod'
| where tags.env == 'prod'
| project id, type, name (column selection: ignored, full
records returned)
| limit 100 (also: | take 100)
Unknown tokens and unsupported clauses are tolerated: the parser logs them away and continues with the constraints it did understand. Real Resource Graph would reject malformed queries; the stub favors returning some result over a 400 so SDK callers that probe with unknown queries don't blow up.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler serves Azure Resource Graph ARM-JSON requests.
func New ¶
func New(engine *resourcediscovery.Engine, subscriptionID string) *Handler
New returns a Resource Graph handler backed by engine. subscriptionID is validated against the request's subscriptions list (a request whose subscriptions field is set but does not include this ID returns an empty result rather than an error). If subscriptionID is empty, the engine's own AccountID is used — that's the same value the engine was built with when it constructed Azure-shaped resource IDs, so the two stay aligned without callers having to pass the ID twice.