Class RestValueService

java.lang.Object
io.jenkins.plugins.restlistparam.logic.RestValueService

public class RestValueService extends Object
  • Method Details

    • get

      public static ResultContainer<List<ValueItem>> get(String restEndpoint, com.cloudbees.plugins.credentials.common.StandardCredentials credentials, MimeType mimeType, Integer cacheTime, String valueExpression, String displayExpression, String filter, ValueOrder order)
      Returns a ResultContainer capsuling a optional String error message and a list of parsed string values.

      This method uses its parameters to query a REST/Web endpoint to receive a MimeType response, which then gets parsed with a supported Path expression to extract a list of string values.

      Parameters:
      restEndpoint - A http/https web address to the REST/Web endpoint
      credentials - The credentials required to access said endpoint
      mimeType - The MIME type of the expected REST/Web response
      cacheTime - Time for how long the REST response gets cached for in minutes
      valueExpression - The Json-Path or xPath expression to filter the values
      displayExpression - The Json-Path or xPath expression to filter the display values
      filter - additional regex filter on any parsed values
      order - Set a ValueOrder to optionally reorder the values
      Returns:
      A ResultContainer that capsules either the desired values or a user friendly error message.
    • doBasicValidation

      public static FormValidation doBasicValidation(String restEndpoint, com.cloudbees.plugins.credentials.common.StandardCredentials credentials)
      A basic validation method usable for configuration validation
      Parameters:
      restEndpoint - A http/https web address to the REST/Web endpoint
      credentials - The credentials required to access said endpoint
      Returns:
      A FormValidation to be used in the Jenkins configuration UI