This example shows how to define where the library content is stored.
For more information about storing the contents of a local library, see Content Library Storage.
Note: For related code samples, see the
vSphere Automation SDK .NET samples at GitHub.
... // Create a StorageBacking instance of datastore type. var libraryBacking = new StorageBacking(); libraryBacking.SetType(vmware.content.library.StorageBacking.Type.DATASTORE); // Provide the datastore ID. libraryBacking.SetDatastoreId("datastore-123"); // Create a LibraryModel that represents a local library backed on a datastore. var libraryModel = new LibraryModel(); libraryModel.SetName("AcmeLibrary"); libraryModel.SetStorageBackings(new List<StorageBacking>() { libraryBacking });