Function: Copy REST Operations from one REST Host to another REST Host

by Simon Sparks · 5 August 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 Copy REST Operations from one REST Host to another REST Host

Function: RESTHostCopyOperations

public RESTHostCopyOperations(objRESTHostSource: RESTHost, objRESTHostDestination: RESTHost): void {
    let arrRESTOperationName:string[] = objRESTHostSource.getOperations();

    arrRESTOperationName.forEach((strRESTOperationName:string):void => { 
        let objRESTOperation:RESTOperation = objRESTHostSource.getOperation(strRESTOperationName);

        this.objLogger.info(strRESTOperationName);

        objRESTHostDestination.addOperation(objRESTOperation);

        RESTHostManager.updateHost(objRESTHostDestination);
    });
}

Discover more from Cloud Build Tools

Subscribe to get the latest posts sent to your email.

You may also like