Class RemoteSource
java.lang.Object
hudson.model.AbstractDescribableImpl<JsonSource>
com.github.cyanbaz.jenkins.plugins.jsonparameter.JsonSource
com.github.cyanbaz.jenkins.plugins.jsonparameter.RemoteSource
- All Implemented Interfaces:
ExtensionPoint,Describable<JsonSource>,Serializable
A
JsonSource implementation that retrieves JSON content from a remote HTTP(S) endpoint.
Supports Jenkins proxy configuration automatically via ProxyConfiguration.
The configured URL must return a valid JSON response body. This source type is intended
for scenarios where external services expose data for dynamic parameterization.
- Author:
- Caner Yanbaz
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classDescriptor for theRemoteSource, used to display this option in the Jenkins UI dropdown.Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetUrl()loadJson()Fetches the JSON content from the configured remote URL using Java'sHttpClient.Methods inherited from class com.github.cyanbaz.jenkins.plugins.jsonparameter.JsonSource
loadOptionsMethods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
Constructor Details
-
RemoteSource
Constructs a new remote JSON source.- Parameters:
url- the remote URL to fetch the JSON from
-
-
Method Details
-
getUrl
-
loadJson
Fetches the JSON content from the configured remote URL using Java'sHttpClient.Automatically honors the Jenkins global proxy configuration if set. If the HTTP response returns a status code of 400 or higher, an
IOExceptionis thrown.- Specified by:
loadJsonin classJsonSource- Returns:
- the raw JSON response body as a string
- Throws:
IOException- if the HTTP request fails or the status code indicates an errorInterruptedException- if the request is interrupted
-