Supported Operations

The plugin follows the standard discovery-plugin CLI contract.

Command

Purpose

info

Emits plugin metadata (id, version, description, contact).

schema

Emits the JSON schema for the configuration.

uischema

Emits UI rendering hints (field order, password widget, help text).

test

Validates the config and verifies connectivity/auth (v4 clusters, v3 fallback).

scan

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

/api/clustermgmt/v4.3/config/clusters

v4

List managed clusters

/api/nutanix/v3/clusters/list

v3

Fallback cluster listing

Per cluster

API endpoint

Scope

Asset (s) produced

TLS handshake (cluster external IP → PC URL)

cluster

cert (tls-server-certificate)

/api/clustermgmt/v4.3/config/clusters/{id}/ssl-certificate

cluster

cert (ssl-certificate + ssl-ca-chain)

/api/clustermgmt/v4.3/config/clusters/{id}/certificates

cluster

cert (managed-certificate, paginated)

/api/clustermgmt/v4.3/config/clusters/{id}/certificate-authorities

cluster

cert (certificate-authority)

/api/clustermgmt/v4.3/config/clusters/{id}/csrs (+ /download)

cluster

secret (pending CSR, with PEM)

/api/clustermgmt/v4.2/config/clusters/{id}/snmp/users

cluster

secret (SNMPv3 auth/priv keys)

Prism Central scope (Security v4.1)

API endpoint

Asset (s) produced

/api/security/v4.1/config/key-management-servers

cert (KMIP client + CA from certPem/caPem), secret (cloud KMS metadata)

/api/security/v4.1/config/credentials

secret (credential configuration metadata)

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 the info/schemacommands (no external dependencies).
  • nutanix_pc_integration_test.go — in-process httptest TLS server exercising test and scan end 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 ./...