Commit 515f14b
feat: add Azure NetworkLoadBalancerProbe adapter (#4402)
<!-- CURSOR_AGENT_PR_BODY_BEGIN -->
## Summary
Adds a new Azure adapter for Load Balancer Probes
(`NetworkLoadBalancerProbe`). Probes are child resources of Load
Balancers that define health check configurations for backend pool
members.
## Changes
- **Client interface**
(`sources/azure/clients/load-balancer-probes-client.go`): New
`LoadBalancerProbesClient` interface wrapping
`armnetwork.LoadBalancerProbesClient` with `Get` and `NewListPager`
methods
- **Mock**
(`sources/azure/shared/mocks/mock_load_balancer_probes_client.go`):
Generated mock for unit testing
- **Adapter** (`sources/azure/manual/network-load-balancer-probe.go`):
`SearchableWrapper` implementation with:
- `Get(scope, loadBalancerName, probeName)` - retrieves a specific probe
- `Search(scope, loadBalancerName)` - lists all probes under a load
balancer
- `SearchStream` - streaming variant of Search
- Health status mapping from provisioning state
- Linked items: parent LoadBalancer (GET), LoadBalancingRules (GET)
- **Registration** (`sources/azure/manual/adapters.go`): Registered in
both init and placeholder blocks
- **Unit tests**
(`sources/azure/manual/network-load-balancer-probe_test.go`):
Comprehensive tests including Get, Search, StaticTests, error handling,
empty name validation, nil name handling
- **Integration test**
(`sources/azure/integration-tests/network-load-balancer-probe_test.go`):
Full Setup/Run/Teardown test against live Azure APIs
## Bidirectional Links
The parent `NetworkLoadBalancer` adapter already links to probes via GET
(iterating `Properties.Probes`) and includes `NetworkLoadBalancerProbe`
in `PotentialLinks()`. The child probe adapter links back to the parent
via GET. Both directions are tested.
## Self-Review Checklist
- [x] **IAMPermissions**: Present, references
`Microsoft.Network/loadBalancers/probes/read`
- [x] **PredefinedRole**: Present, uses `Reader`
- [x] **LinkedItemQueries**: 2 link types verified (parent LoadBalancer
GET, LoadBalancingRules GET). No IP/DNS fields in Probe struct.
- [x] **PotentialLinks**: 2 types listed (`NetworkLoadBalancer`,
`NetworkLoadBalancerLoadBalancingRule`), matches LinkedItemQueries
- [x] **Unit tests**: All passing (Get, Get_WithInsufficientQueryParts,
Get_WithEmptyLoadBalancerName, Get_WithEmptyProbeName, Search,
Search_WithNilName, Search_InvalidQueryParts,
Search_WithEmptyLoadBalancerName, ErrorHandling_Get,
ErrorHandling_Search, Get_NoProperties, StaticTests)
- [x] **Integration test**: All sub-tests passing (Setup, Run/GetProbe,
Run/SearchProbes, Run/VerifyLinkedItems, Run/VerifyItemAttributes,
Teardown) against live Azure APIs
All checklist items passed. Ready for review.
<!-- CURSOR_AGENT_PR_BODY_END -->
<div><a
href="https://cursor.com/agents/bc-863ee979-1cff-4ba2-9947-c616fe0372ee"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-web-light.png"><img
alt="Open in Web" width="114" height="28"
src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a> <a
href="https://cursor.com/background-agent?bcId=bc-863ee979-1cff-4ba2-9947-c616fe0372ee"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img
alt="Open in Cursor" width="131" height="28"
src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a> </div>
---------
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Lionel Wilson <Lionel-Wilson@users.noreply.github.com>
GitOrigin-RevId: c44110ae2ba31335086570b41a867ca262fdde881 parent 79f33f1 commit 515f14b
6 files changed
Lines changed: 1293 additions & 0 deletions
File tree
- sources/azure
- clients
- integration-tests
- manual
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
0 commit comments