To use this function add it to the class library file named vCenterVAPIService.ts
GitHub Repository: https://github.com/SimonSparksUK/Orchestrator
Filename: vCenterVAPIService.ts
Function ContentLibraryItemGetPathToFileISO
publicContentLibraryItemGetPathToFileISO(objVAPIClient:VAPIClient,strContentLibraryName:string,strContentLibraryItemName:string):{objVAPIContentLibraryModel:com_vmware_content_library__model,objVAPIContentLibraryItemModel:com_vmware_content_library_item__model,objVAPIContentLibraryStorageBacking:com_vmware_content_library_storage__backing}{
letobjVAPIContentLibraryModel:com_vmware_content_library__model=this.ContentLibraryGet(objVAPIClient,strContentLibraryName);
letarrVAPIContentLibraryStorageBacking:com_vmware_content_library_storage__backing[]=objVAPIContentLibraryModel.storage_backings;
arrVAPIContentLibraryStorageBacking=arrVAPIContentLibraryStorageBacking.filter((objVAPIContentLibraryStorageBacking:com_vmware_content_library_storage__backing):boolean=>{
returnobjVAPIContentLibraryStorageBacking.type===com_vmware_content_library_storage__backing_type.DATASTORE;
});
letobjVAPIContentLibraryStorageBacking:com_vmware_content_library_storage__backing=arrVAPIContentLibraryStorageBacking[0];
letarrVAPIContentLibraryItemModel:com_vmware_content_library_item__model[]=this.ContentLibraryItemListByType(objVAPIClient,objVAPIContentLibraryModel,"iso");
letobjVAPIContentLibraryItemModel:com_vmware_content_library_item__model=arrVAPIContentLibraryItemModel.find((objVAPIContentLibraryItemModel:com_vmware_content_library_item__model):boolean=>{
returnobjVAPIContentLibraryItemModel.name==strContentLibraryItemName;
});
objVAPIClient.close();
return{
objVAPIContentLibraryModel,
objVAPIContentLibraryItemModel,
objVAPIContentLibraryStorageBacking
};
}Discover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
