Supported Operations
The plugin follows the standard discovery-plugin CLI contract.
Command | Purpose |
|---|---|
| Emits plugin metadata (id, version, description, contact). |
| Emits the JSON schema for the configuration. |
| Emits UI rendering hints (field order, password widget, help text). |
| Validates the config and verifies connectivity/auth (v4 clusters, v3 fallback). |
| Discovers clusters, runs all discovery routines, emits scan + state records. |
./nutanix-pc-plugin info
./nutanix-pc-plugin schema
./nutanix-pc-plugin uischema
./nutanix-pc-plugin test --inputfile input.json --outputfile test-result.json
./nutanix-pc-plugin scan --inputfile input.json --outputfile scan-result.json
APIs Scanned
Cluster discovery
API endpoint | API | Purpose |
|---|---|---|
| v4 | List managed clusters |
| v3 | Fallback cluster listing |
Per cluster
API endpoint | Scope | Asset (s) produced |
|---|---|---|
TLS handshake (cluster external IP → PC URL) | cluster |
|
| cluster |
|
| cluster |
|
| cluster |
|
| cluster |
|
| cluster |
|
Prism Central scope (Security v4.1)
API endpoint | Asset (s) produced |
|---|---|
|
|
|
|
API version constants live in api_endpoints.go; update them when Nutanix releases newer Cluster Management or Security API versions.
Output
All results are written as newline-separated JSON documents (one per line). Each scan document is a formatter-produced asset record; a final state document carries lastScanDate. Certificate assets include a cert_pem field (base64 DER body, no embedded newlines) from which PEM-intrinsic metadata (subject, issuer, validity, serial) is derived rather than duplicated in extra.
Full vs Incremental Scans
The plugin defines a State with lastScanDate, which is emitted at the end of every scan. The Nutanix v3/v4 certificate APIs do not provide reliable last-modified filtering across all asset types, so every scan performs a full reconciliation of the environment's cryptographic assets to guarantee inventory accuracy.
Building
make build # build the plugin binary
make test # run unit + integration tests
make docker # build the plugin container image
Testing
nutanix_pc_unit_test.go— unit tests for config validation, URL/PEM helpers, endpoint builders, and theinfo/schemacommands (no external dependencies).nutanix_pc_integration_test.go— in-processhttptestTLS server exercisingtestandscanend to end across all v3/v4 routines, plus an env-gated live test (NUTANIX_PC_URL,NUTANIX_PC_USER,NUTANIX_PC_PASSWORD).
go test ./... # unit + mock integration tests
NUTANIX_PC_URL=https://pc:9440 NUTANIX_PC_USER=admin NUTANIX_PC_PASSWORD=... \
go test -run TestIntegrationLiveServer ./...