feat: add network update and report APIs; surface network_id on clusters and VMs#110
Merged
jdewinne merged 3 commits intoApr 28, 2026
Merged
Conversation
Adds updateNetwork() supporting policy ("open"/"airgap") and
collect_report changes via PUT /network/{id}/update. createCluster,
createVM, and their poll/get helpers now return network_id so callers
can drive network updates without an extra lookup.
GET /network/{id}/report returns raw NetworkEventData[]; optional
`after` Date narrows to events newer than that timestamp (RFC3339).
GET /network/{id}/report/summary returns aggregated stats with top
domains and destinations. Mirrors the upstream Go SDK split.
mikhailswift
approved these changes
Apr 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
updateNetwork(api, networkId, { policy?, collectReport? })—PUT /network/{id}/update. Supports policy valuesopen/airgapand togglingcollect_report. Always sendspolicy, includescollect_reportonly when explicitly set, mirroring the upstream Go vendor client.getNetworkReport(api, networkId, after?: Date)—GET /network/{id}/report. Returns rawNetworkEventData[]. OptionalafterDate narrows to events newer than that timestamp (encoded as RFC3339).getNetworkReportSummary(api, networkId)—GET /network/{id}/report/summary. Returns aggregated stats with top domains/destinations. Two separate functions instead of a boolean flag — distinct return types, no narrowing at call sites, room for per-mode params (e.g.,afteron events).network_idonClusterandVM, populated fromcreateCluster/createClusterWithLicense/getClusterDetailsandcreateVM/getVMDetails, so callers can drive network updates without an extra lookup.Test plan
npm run build(clean)npx jest src/networks.spec.ts src/clusters.spec.ts src/vms.spec.ts— 30/30 passnetworks.spec.tscovers: policy-only update, collect-report-only, both fields,StatusErroron non-200; report event listing,afterquery param, empty events default, summary parsing with domains/destinations/sources, summary error body, and 4xx StatusError paths