VMware Cloud Community
Jay_Spell
Contributor
Contributor

Hopefully Simple Question - VcVmSnapshotFileInfo

Using a simple task as a learning exercise for VCO.  Looking to create a workflow that allows me to specify a cluster and finds all the snapshots older than a certain range in that cluster.  It's been an interesting, and humbling experience.  I expected the information to be simple to pull, but I've gone down a rabbit hole and at this point feel certain that I've missed something obvious.

At the moment I've been focusing in on some of the various objects that should pull snapshot information.  One object in particular would seem to be something that I could definitely use to pull the information but I'm not sure how to use it.

var myVcVmSnapshotFileInfo = new VcVmSnapshotFileInfo() ;

I would expect to be able to pass a snap to the object and get the information back, but the API explorer doesn't show that the object takes any arguments.  I've attempted to just pass a snapshot to the object but that gave me an error.  Any idea what I'm doing wrong here?

0 Kudos
1 Reply
iiliev
VMware Employee
VMware Employee

You should not instantiate this scripting object with 'new'. Instead, you should fetch it as a property or method invocation result on some existing object.

For example, to get the configuration of a virtual machine, you should not call

  var vmconfig = new VcVirtualMachineConfigInfo();

instead, you should call

  var vmconfig = vm.config;  // 'vm' is an existing object of type VcVirtualMachine

0 Kudos