vCO Workflow Script to Copy REST Operations from one REST Host to another REST Host

The following script enables REST Operations to be copied from one REST Host to another REST Host

 

 

 

var arrRESTOperations;
	arrRESTOperations = objRESTHostCLDLTM2C8A51.getOperations();

for ( var i = 0; i < arrRESTOperations.length; i++ )
{
	var strRESTOperation;
	strRESTOperation = arrRESTOperations[i];

	var objRESTOperation;
	objRESTOperation = objRESTHostSOURCE.getOperation(strRESTOperation);

	System.log(objRESTOperation.name);

	var objRESTOperationDESTINATION;
        objRESTOperationDESTINATION = objRESTHostDESTINATION.addOperation(objRESTOperation);

        RESTHostManager.updateHost(objRESTHostDESTINATION);
}

Leave a Reply