To use this function add it to the class library file named OrchestratorService.ts
GitHub Repository: https://github.com/SimonSparksUK/Orchestrator
Filename: OrchestratorService.ts
Description: Orchestrator Function to add REST Operations to REST Hosts
Function RESTOperationCreate
publicRESTOperationCreate(objProperties:Properties,arrRESTHost:RESTHost[]):void{
letarrKey:string[]=objProperties.keys;
arrRESTHost.forEach((objRESTHost:RESTHost):void=>{
arrKey.forEach((strKey:string):void=>{
letarrKey:string[]=strKey.split('-');
letstrMethod:string=arrKey[0].toUpperCase();
letstrTemplateURL:string=objProperties.get(strKey);
letobjRESTOperation:RESTOperation=newRESTOperation(strKey);
//@ts-ignore
objRESTOperation.method=strMethod;
//@ts-ignore
objRESTOperation.urlTemplate=strTemplateURL;
//@ts-ignore
objRESTOperation.defaultContentType="application/json";
objRESTOperation=objRESTHost.addOperation(objRESTOperation);
});
RESTHostManager.updateHost(objRESTHost);
});
}Discover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
