How to figure out the parameters to Qubes API calls?

The list of API calls is documeted at: Admin API | Qubes OS (Note: Depending on your screen resolution/setup, it is not necessarily obvious that the calls table can scroll horizontally to reveal more columns)

Some of the calls are straightforward like:
admin.vm.CreateDisposable template

But other things are not as obvious, like:

  • admin.vm.List dom0|<vm>
  • admin.vm.feature.CheckWithNetvm vm

For example, admin.vm.List is vague about what list its going to show up in (maybe it’s the upper right hand “blue cube” list of running qubes? maybe list of available qubes? qvm-ls out put?) (I also suspect this list is related to which qubes your current vm is the guivm for)

I’d like a way to read about details on what things like those do so I can write policies using them. Web searches have not yielded anything (I thought they would at least direct me to comments in source code somewhere, but no)

Anyway, if anyone has any info on this, it would be appreciated.

You can download all sources and grep through them:

Or if you have a github account you can search the string in the source code of the organization. Without logging in github won’t search inside the source code.

1 Like

For R4.2, the relevant source code is available in dom0 at /usr/lib/python3.11/site-packages/qubes/api/admin.py or online at qubes-core-admin/qubes/api/admin.py at release4.2 · QubesOS/qubes-core-admin · GitHub