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.

...
using vmware.content;
using vmware.content.library;
 
// 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 });