Skip to content

feat(vapi): add VM compute policies status API - #4217

Merged
dougm merged 1 commit into
vmware:mainfrom
aniket-deole:aniketd/add-computepolicies-status-apis
Dec 1, 2026
Merged

dougm merged 1 commit into
vmware:mainfrom
aniket-deole:aniketd/add-computepolicies-status-apis

Conversation

@aniket-deole

@aniket-deole aniket-deole commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Description

Add a client for the com.vmware.vcenter.vm.compute.Policies vAPI service (POST /api/vcenter/vm/compute/policies?action=query), which reports the compliance of VMs with external compute policies.

  • vapi/vcenter/vm/compute/policies: new Manager with Query (single page) and QueryAll (follows markers across pages), plus FilterSpec, IterationSpec, QuerySpec, PolicyInfo and QueryResult types. Topology decodes vCenter's {"@enum": "..."} object form.
  • vim25/types: add VirtualMachineComputePolicyInfo and its array type (policyId, complianceStatus)
  • vim25/mo: add the VirtualMachine.computePolicies property.

Closes: NA

How Has This Been Tested?

Created VMs with policies, verified VMs return compute policies and the statuses are as expected.

Guidelines

Please read and follow the CONTRIBUTION guidelines of this project.

@aniket-deole
aniket-deole force-pushed the aniketd/add-computepolicies-status-apis branch from 172575c to a6b148c Compare November 25, 2026 17:38
Comment thread vim25/mo/mo.go Resolved
Comment thread vim25/types/unreleased.go Resolved
Add a client for the com.vmware.vcenter.vm.compute.Policies vAPI service
(POST /api/vcenter/vm/compute/policies?action=query), which reports the
compliance of VMs with compute policies.

- vapi/vcenter/vm/compute/policies: new Manager with Query (single page)
  and QueryAll (follows markers across pages), plus FilterSpec,
  IterationSpec, QuerySpec, PolicyInfo and QueryResult types. Topology
  decodes vCenter's {"@enum": "..."} object form.
- vim25/types: add VirtualMachineComputePolicyInfo and its array type
  (policyId, complianceStatus)
- vim25/mo: add the VirtualMachine.computePolicies property.

Signed-off-by: Aniket Deole <aniket.deole@broadcom.com>
@aniket-deole
aniket-deole force-pushed the aniketd/add-computepolicies-status-apis branch from a6b148c to 003283d Compare December 1, 2026 18:51

@dougm dougm left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm
I see govc tests are failing, but might be an existing problem?

@aniket-deole

Copy link
Copy Markdown
Contributor Author

lgtm I see govc tests are failing, but might be an existing problem?

Yes. govc-test has been failing for a while.

@dougm
dougm merged commit 6e73107 into vmware:main Dec 1, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants