Class RestFunctions

java.lang.Object
flexagon.fd.services.groovy.functions.BaseFunctions
flexagon.fd.services.groovy.functions.RestFunctions

public class RestFunctions extends BaseFunctions
Utility functions used for making REST calls
Since:
5.4
  • Field Details

  • Constructor Details

    • RestFunctions

      public RestFunctions(LogFunctions pLogFunctions)
  • Method Details

    • forward

      public int forward(String pUrl, Object pPayload) throws FlexCheckedException
      Forwards a FlexDeploy Event via a POST request to another url, essentially making it a webhook. No authentication will be used as is normal for a webhook. If you need to forward with authentication or a different method you can use getClient().
      Parameters:
      pUrl - The url to forward the request to.
      pPayload - The payload to forward, typically just the EVENT variable.
      Returns:
      the response code of the REST call
      Throws:
      FlexCheckedException - if the request fails
    • getClient

      public FlexRESTClient getClient()
      Returns a FlexRESTClient object which can be configured to make REST calls.
      Returns:
      FlexRESTClient
    • getGroovyKey

      public String getGroovyKey()
      Specified by:
      getGroovyKey in class BaseFunctions
    • cleanup

      public void cleanup()
      Specified by:
      cleanup in class BaseFunctions