Orchestrator Workflow Action to Add a REST Host with Credentials

by Simon Sparks · 1 May 2025

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

public RESTHostCreateWithCredentials(strName: string, strUrl: string, strUsername: string, strPassword: string): RESTHost {

    let arrAuthenticationParams: string[] = ["Shared Session", strUsername, strPassword];

    let objRESTAuthentication: RESTAuthentication = RESTAuthenticationManager.createAuthentication("Basic", arrAuthenticationParams);

    let objRESTHost: RESTHost = new RESTHost(strName);
    objRESTHost.url = strUrl;
    objRESTHost.connectionTimeout = 30.0;
    objRESTHost.operationTimeout = 60.0;
    objRESTHost.authentication = objRESTAuthentication;

    objRESTHost = RESTHostManager.addHost(objRESTHost);

    return objRESTHost;
}

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like