All Implemented Interfaces:
ExtensionPoint, Describable<JsonSource>, Serializable

public class RemoteSource extends JsonSource
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:
  • Constructor Details

    • RemoteSource

      @DataBoundConstructor public RemoteSource(String url)
      Constructs a new remote JSON source.
      Parameters:
      url - the remote URL to fetch the JSON from
  • Method Details

    • getUrl

      public String getUrl()
    • loadJson

      public String loadJson() throws IOException, InterruptedException
      Fetches the JSON content from the configured remote URL using Java's HttpClient.

      Automatically honors the Jenkins global proxy configuration if set. If the HTTP response returns a status code of 400 or higher, an IOException is thrown.

      Specified by:
      loadJson in class JsonSource
      Returns:
      the raw JSON response body as a string
      Throws:
      IOException - if the HTTP request fails or the status code indicates an error
      InterruptedException - if the request is interrupted