On 1/17/22 16:17, Mark Kanda wrote:

I agree except that I think this and StatsResults should be unions, even if it means running multiple query-stats commands.

IIUC, making StatsResults a union implies the filter is a required argument (currently it is optional - omitting it dumps all VM and VCPU stats). Just to confirm - we want the filter to be required?

Yeah, I think at least the "kind" (vcpu, vm, perhaps in the future block or net) should be mandatory. If the caller doesn't know of a "kind", chances are it won't be able to understand what object the stats refer to, for example the vcpu "id" here:

{ 'union': 'StatsResults',
   'base': { 'target': 'StatsTarget', stats: ['StatsResultsEntry'] },
   'discriminator': 'target',
   'data': { 'vcpu': ['id': 'int'] }
}

(which is another different between Daniel's proposal and mine; his just placed all vcpus into an array with no explicit id, if I understand correctly).

Paolo

Reply via email to