Documentation
¶
Overview ¶
Package cloudasset serves the GCP Cloud Asset Inventory v1 REST API against a *resourcediscovery.Engine.
Filter syntax (documented subset of the real Cloud Asset filter expression):
service:storage.googleapis.com service:compute.googleapis.com assetType:storage.googleapis.com/Bucket location:us-east1 location:us-central1 labels.env:prod tags.env:prod
Multiple terms are whitespace-separated and AND-composed. Unknown keys are tolerated and ignored (matches Cloud Asset's permissive behavior for unknown fields). Contradictory terms (two distinct services in the same query, or two values for the same label) flip ForceEmpty so the handler short-circuits to an empty result — a single resource cannot belong to two services or hold two values for one label, so the real API would also return zero rows.
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 Cloud Asset Inventory v1 REST requests.
func New ¶
func New(engine *resourcediscovery.Engine, projectID string) *Handler
New returns a Cloud Asset handler backed by engine. projectID is used for feed-name validation and asset scoping; if empty, the engine's own AccountID (which holds the GCP project ID for GCP engines) is used so callers don't have to repeat it.