Class RestValueService
java.lang.Object
io.jenkins.plugins.restlistparam.logic.RestValueService
-
Method Summary
Modifier and TypeMethodDescriptionstatic FormValidation
doBasicValidation
(String restEndpoint, com.cloudbees.plugins.credentials.common.StandardCredentials credentials) A basic validation method usable for configuration validationstatic 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 aResultContainer
capsuling a optional String error message and a list of parsed string values.
-
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 aResultContainer
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 endpointcredentials
- The credentials required to access said endpointmimeType
- The MIME type of the expected REST/Web responsecacheTime
- Time for how long the REST response gets cached for in minutesvalueExpression
- The Json-Path or xPath expression to filter the valuesdisplayExpression
- The Json-Path or xPath expression to filter the display valuesfilter
- additional regex filter on any parsed valuesorder
- Set aValueOrder
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 endpointcredentials
- The credentials required to access said endpoint- Returns:
- A
FormValidation
to be used in the Jenkins configuration UI
-