This file is written as durable context (à la CLAUDE.md) so a future session can get oriented
here immediately without re-deriving the repo structure from scratch.
vmware/alb-sdk is the multi-language SDK + API surface for the NSX Advanced Load Balancer
(Avi Vantage) Controller REST API. It ships four independent, mostly-generated deliverables from
one underlying API spec:
| Dir | Language / artifact | Package |
|---|---|---|
go/ |
Go SDK | github.com/vmware/alb-sdk |
python/ |
Python SDK (avisdk on PyPI) |
python/avi/sdk |
java/ |
Java SDK (Maven, pom.xml) |
com.vmware.avi.sdk |
swagger/ |
Per-object OpenAPI/Swagger specs + bundled Swagger-UI viewer | one .json+.yaml pair per API object |
docs/ |
Per-object API reference (167+ object dirs) | plain docs, mirrors swagger/ |
mibs/ |
SNMP MIBs for controller monitoring | — |
This is upstream of vmware/terraform-provider-avi — the Terraform provider's go.mod pins
an exact commit of this repo and imports go/clients, go/models, go/session directly. If a
Terraform-provider bug looks like "the API client is misbehaving," the root cause is usually here,
not in the provider.
Git history is dominated by paired commits: Updated assets for swagger → Updated assets for python / ...for go / ...for java, each followed by a jenkins_sync_<version>_<lang> merge
(e.g. 3f4dbd39e → 7eb21fc32 → c09f6bad4 → merges #3506/#3507/#3508 in that order for
32.1.2). That ordering is the actual pipeline:
Avi Controller API spec → swagger/*.json,*.yaml → go/clients+models, python bindings, java bindings, docs/
Practical implication: swagger/, go/clients/*_client.go, go/models/*.go, most of
python/avi/sdk/ model-ish code, java/src/com/vmware/avi/sdk/model/, and docs/** are
regenerated per Avi Controller release from an internal Jenkins job — there is no generator script
checked into this repo itself. Treat hand-edits to those as temporary unless mirrored upstream
in the spec; they're the first suspect when something "reverts itself" between releases. The
genuinely hand-maintained logic lives in:
go/session/avisession.go(+ its_test.go) — auth/session/transport, not object-specific.python/avi/sdk/avi_api.py,csp_avi_api.py,saml_avi_api.py,avi_sdk.py— session/auth layers (basic, VMware Cloud CSP, SAML) and the legacyavi_sdk.pyshim.java/src/com/vmware/avi/sdk/non-modelcode (session/client plumbing).python/avi/sdk/utils/,python/avi/sdk/samples/,go/examples/,java/examples/— hand-written helpers/samples.
go/session/avisession.go—AviSession: connection/auth/session-cache/CSRF handling. Auth modes are composed via functional options:SetPassword,SetAuthToken,SetRefreshAuthTokenCallback(V2),SetTenant,SetVersion,SetProxyURL,SetInsecure,SetTransport,SetClient,SetControllerStatusCheckLimits,DisableControllerStatusCheckOnFailure. Also handles CSP access-token fetch (getCSPAccessToken) and multipart file upload (PostMultipartFileObjectRequest,PostMultipartWafAppSignatureObjectRequest).go/clients/avi_client.go—AviClientstruct: one field + one generated*<Object>Clientper API object (169 client files ingo/clients/), all wrapping the sharedAviSession.go/models/— 1524 generated Go structs, one (or a few) per API object/sub-object, used to (un)marshal REST payloads.go/examples/— runnable samples (create_vs.go,metrics_collection.go);go/examples/test/has the Go integration tests driven by the rootMakefile.go/fmt_lint_check.sh— formatting/lint check for the Go tree.
Build/test (from repo root, via Makefile):
make compile # go build clients+models+examples, go vet
make fmt # go fmt clients, models, examples
make test_clients # requires AVI_CONTROLLER/AVI_USERNAME/AVI_PASSWORD/AVI_TENANT/AVI_VERSION env vars
make test_avisession # go test ./go/session/.AVI_CONTROLLER defaults to localhost:8080// in the Makefile, in which case it auto-starts
go/examples/web_service.py as a mock backend for test_clients.
avi_api.py(1183 lines) — coreApiSession(extendsrequests.Session), the primary hand-maintained entry point most integrations use.csp_avi_api.py— VMware Cloud CSP-token auth variant.saml_avi_api.py— SAML auth variant.avi_sdk.py— thin/legacy wrapper.utils/— helper utilities (includeswaf_policy/helpers).samples/— per-integration examples:aws,gcp,apic,heat,vra,autoscale,init_system,cust_scripts,certs.test/— pytest suite (test/fixtures/for fixtures).- Packaged via
setup.pyasavisdk(version injected at release time viacreate_release.sh, excludesmigrationtools,sdk.samples.autoscale,sdk.testfrom the built package).
java/pom.xml— Maven project,com.vmware.avi.sdk.java/src/com/vmware/avi/sdk/model/— generated model classes (mirrorsgo/models/swagger/).java/src/com/vmware/avi/sdk/(non-model) — hand-maintained session/client code.java/test/com/vmware/...— JUnit tests.java/examples/— runnable samples.- Recently migrated from Java 8 → Java 17 (see commit
457c08c86, "Upgraded java version in java sdk from java 8 to 17") — if a Java build breaks, check the JDK version first.
swagger/*.json+swagger/*.yaml— one OpenAPI/Swagger definition pair per Avi API object (e.g.Pool.json/Pool.yaml,ActionGroupConfig.json/.yaml, ...). These are the actual upstream source-of-truth artifacts thatgo/,python/,java/, anddocs/all get generated from/kept in sync with.swagger/{js,css,lib,img}etc. — a bundled Swagger-UI distribution for browsing the spec locally (openswagger/index.html).docs/<ObjectName>/— 167+ per-object reference doc directories, kept in lockstep withswagger/.
AVI_VERSION(Makefile default18.2.9) selects the controller API version the SDK targets;go/session.SetVersion/ provider-sideavi_versiondo the same at runtime. Version skew between the SDK build, the Avi Controller, and thealb-sdkcommit pinned by a downstream consumer (e.g. terraform-provider-avi'sgo.mod) is a common root cause for "field not found" / "unexpected API response" bugs — check all three before assuming a code bug.create_release.sh— cuts a release (injects the Python package version, etc.)..github/workflows/release.ymlis the only workflow in this repo; Go/Python/Java/Swagger sync and test runs otherwise happen through the internal Jenkins pipeline referenced by thejenkins_sync_*merge commits, driven by the rootMakefilefor Go.- Per the original
README.md: AVI migration tools (ACT) are released as a separate, standalone artifact starting 30.2.x — not bundled in this SDK's package anymore.
CODEOWNERS:@apalsule @parimanur @shardullatkarown the whole repo by default.CONTRIBUTING.mdrequires a signed Developer Certificate of Origin (DCO), separate from terraform-provider-avi's CLA process.- License: root
LICENSEfile, but individual Go/Python/Java source headers say "SPDX-License-Identifier: Apache License 2.0" — check file headers rather than assuming one license for the whole tree.
- Bug in a specific object's fields/behavior → check
swagger/<Object>.{json,yaml}first (source of truth), then confirmgo/models/,python,java,docs/<Object>/all agree with it — disagreement across languages usually means a sync job partially ran. - Bug in auth/session/retry/proxy handling →
go/session/avisession.go(Go) oravi_api.py/csp_avi_api.py/saml_avi_api.py(Python) — these are hand-maintained, not generated, so fixes here are durable. - Downstream consumer (e.g. terraform-provider-avi) misbehaving after a bump → diff the pinned
alb-sdkcommit/version against the Avi Controller version actually being targeted. - Java-specific build failures → confirm JDK 17 toolchain (recent migration from Java 8).
(kept for quick navigation — see each for installation/usage specifics)