To use this function add it to the class library file named OrchestratorPluginVCFAService.ts
GitHub Repository: https://github.com/SimonSparksUK/Orchestrator
Filename: OrchestratorPluginVCFAService.ts
Public Function: VcfaCatalogItemGetByName
publicVcfaCatalogItemGetByName(objVCFAHost:VCFAHost,strCatalogItemName:string):any{
letstrPath:string=`/catalog/api/items?search=${strCatalogItemName}`;
letstrReturn:string=this.VcfaGenericRestClient(objVCFAHost,"GET",strPath);
letobjReturn:any=JSON.parse(strReturn);
letarrCatalogItem:any[]=objReturn.content;
letobjCatalogItem:any=arrCatalogItem.find((objCatalogItem:any):boolean=>{
returnobjCatalogItem.name===strCatalogItemName;
});
returnobjCatalogItem;
}TypeScriptDiscover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
