I see tons of references to VirtualMachine, HostSystem, DataCenter classes (among many others) in the API Reference but they were never generated in the proxy code. I checked the wsdl's and xsd's for vim and vim25 and found no reference to those classes. I also checked the Java samples and there is no reference to them in there either.
I'm trying a simple example call to FindByIp to get a VirtualMachine object back. I turned on System.Net debugging to see if the SOAP response was sending back more information than just the type and Value in the ManagedObjectReference class and it's not.
Any ideas as to why these classes are missing from the API even though they are referenced throughout the API refrence docs?
THanks,
Dan
You'll want to use RetrievePropertiesEx. There's a whole section of the developer guide on how to build TraversalSpecs for property retrieval. It's a bit complex, but it does give a lot of micro-management of what objects and properties you want from the inventory.
They're technically ManagedEntity IIRC. However, I don't think they have ever been in the WSDL/SDK specifications. I think developers create their own subclasses of ManagedEntity and attach relevant functions.
When you look at the SOAP, the _this parameter could be any ManagedEntity. The SDK interface will throw back an exception when you try to call an operation on an unsupported Entity type.
The SDK toolkits each create the subclasses for the ManagedEntity types and associates the operations with them appropriately.
stumpr wrote:
They're technically ManagedEntity IIRC. However, I don't think they have ever been in the WSDL/SDK specifications. I think developers create their own subclasses of ManagedEntity and attach relevant functions.
When you look at the SOAP, the _this parameter could be any ManagedEntity. The SDK interface will throw back an exception when you try to call an operation on an unsupported Entity type.
The SDK toolkits each create the subclasses for the ManagedEntity types and associates the operations with them appropriately.
Are you saying there is an additional toolkit out there that has these classes or that I need to make them myself without any expectation of the api actually filling in the data I want? I don't understand why they reference classes in their documentation that don't actually exist.
They exist, just not as class constructs in the default WSDL. I'm not sure why its like that to be honest. When you get your ManagedEntity reference, you can discover its type through the type property. The allowed properties and methods are what is described in the SDK documentation, however, you can try an unsupported method or request an unsupported property. The SDK will throw back a SOAP fault indicating the error.
I'm not sure about the C# SDK, the scripting toolkits create a local version of the managed entity subclasses for convienance.
So let us use a concrete example. I want to get the properties of a vm whose IP address I know.
I call FindByIp(...) and get back a ManagedObjectReference(type=VirtualMachine, Value=vm-123). I can already do this.
Now if I want to get any information, say a populated VirtualMachineConfigInfo, how do I do that?
You'll want to use RetrievePropertiesEx. There's a whole section of the developer guide on how to build TraversalSpecs for property retrieval. It's a bit complex, but it does give a lot of micro-management of what objects and properties you want from the inventory.