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 a REST Host with Credentials
Function: RESTHostCreateWithCredentials
publicRESTHostCreateWithCredentials(strName:string,strUrl:string,strUsername:string,strPassword:string):RESTHost{
letarrAuthenticationParams:string[]= ["Shared Session",strUsername,strPassword];
letobjRESTAuthentication:RESTAuthentication=RESTAuthenticationManager.createAuthentication("Basic",arrAuthenticationParams);
letobjRESTHost:RESTHost=newRESTHost(strName);
objRESTHost.url=strUrl;
objRESTHost.connectionTimeout=30.0;
objRESTHost.operationTimeout=60.0;
objRESTHost.authentication=objRESTAuthentication;
objRESTHost=RESTHostManager.addHost(objRESTHost);
returnobjRESTHost;
}Discover more from Cloud Build Tools
Subscribe to get the latest posts sent to your email.
