This example creates a local library with name AcmeLibrary , which is stored on the local file system where vCenter Server runs.

This example uses the steps that are described in the Create a Local Content Library procedure.

...
using vmware.content;
using vmware.content.library;
 
 
// Create a StorageBacking instance to back the library content on the local file system.
var libraryBacking = new StorageBacking();
libraryBacking.SetType(vmware.content.library.StorageBacking.Type.OTHER);
libraryBacking.SetStorageUri(new Uri("file:///tmp"));
libraryModel.SetStorageBackings(new List<StorageBacking>() { libraryBacking });
 
// Create a LibraryModel that represents a local library.
var libraryModel = new LibraryModel();
libraryModel.SetType(vmware.content.LibraryModel.LibraryType.LOCAL);
libraryModel.SetName("AcmeLibrary");
 
// Access the LocalLibrary service by using the vCloud Suite endpoint.
LocalLibrary localLibraryService = ServiceManager.VapiConnection.GetService<LocalLibrary>();
 
// Call the Create method of the LocalLibrary service
// passing the LibraryModel instance as an argument.
var libraryId = localLibraryService.Create(Guid.NewGuid().ToString(), libraryModel);