Function: vCenter VAPI Plugin Content Library Item Get ID By Name

by Simon Sparks · 29 March 2026

To use this function add it to the class library file named vCenterVAPIService.ts

GitHub Repository: https://github.com/SimonSparksUK/Orchestrator

Filename: vCenterVAPIService.ts

Public Function: ContentLibraryItemGetIDByName

publicContentLibraryItemGetIDByName(strTemplateName:string):string{

letobjVMwareContentLibraryItem:com_vmware_content_library_item=newcom_vmware_content_library_item(this.objVAPIClient);

letobjVMwareContentLibraryItemFindSpec:com_vmware_content_library_item_find__spec=newcom_vmware_content_library_item_find__spec();
objVMwareContentLibraryItemFindSpec.name=strTemplateName;

letarrVMwareContentLibraryItemID:string[]=objVMwareContentLibraryItem.find(objVMwareContentLibraryItemFindSpec);

letstrVMwareContentLibraryItemID:string=arrVMwareContentLibraryItemID.shift();

returnstrVMwareContentLibraryItemID;
}
TypeScript

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like