Skip to content

Instantly share code, notes, and snippets.

@chelnak
Created September 15, 2015 21:17
Show Gist options
  • Select an option

  • Save chelnak/b66fbcb13be45e97f204 to your computer and use it in GitHub Desktop.

Select an option

Save chelnak/b66fbcb13be45e97f204 to your computer and use it in GitHub Desktop.
Get rest operation by name
//get REST operation by name
//Inputs:
//host = RESTHost - The rest host object
//operationName: String - The name of the rest operation
//Outputs:
//operation: RESTOperation - the rest operation object
var operationIds = host.getOperations();
for(var currentIndex in operationIds){
var currentOperation = host.getOperation(operationIds[currentIndex]);
System.log(currentOperation.name);
if(currentOperation.name == operationName){
operation = currentOperation;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment