public class RestApiUtils extends Object
| Constructor and Description |
|---|
RestApiUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
assertNotNull(PrintStream logger,
Object object,
String message)
Assert not null, if null, abort Jenkins job
|
static void |
assertNotNull(PrintStream logger,
Object object,
String message,
Object... args)
Assert not null, abort Jenkins job
|
static hudson.util.ListBoxModel |
buildConnectionIdItems(jenkins.model.Jenkins context,
String connectionId,
hudson.model.Item project) |
static hudson.util.ListBoxModel |
buildCredentialsIdItems(jenkins.model.Jenkins context,
String credentialsId,
hudson.model.Item project) |
static hudson.util.ListBoxModel |
buildIspwActionItems(jenkins.model.Jenkins context,
String ispwAction,
hudson.model.Item project) |
static String |
cleanContextPath(String contextPath)
Clean up the context path and replace unused query parameters
|
static boolean |
containsIgnoreCase(List<String> tokens,
String anotherToken) |
static ProgramList |
convertSetInfoResp(SetInfoResponse setInfoResp)
Convert SetInfoResponse object to a ProgramList object
|
static String |
fixCesContainerListResponseJson(String responseJson) |
static String |
fixCesTaskListResponseJson(String responseJson) |
static String |
fixWorkListResponseJson(String responseJson) |
static com.cloudbees.plugins.credentials.common.StandardCredentials |
getCesCredentials(String credentialsId,
hudson.model.Item item) |
static String |
getCesToken(String credentialsId,
hudson.model.Item item) |
static String |
getCesUrl(String connectionId,
PrintStream logger) |
static com.compuware.jenkins.common.configuration.HostConnection |
getHostConnection(String connectionId)
Get the host connection
|
static String |
getIspwHostLabel(String connectionId) |
static String |
getRuntimeConfig(String ispwRequestBody)
Get runtime configuration from request body
|
static String |
getSystemProperty(String key) |
static ArrayList<String> |
getVariables(String s)
Find all variables that match variable name
|
static boolean |
isIspwDebugMode() |
static String |
join(String delimiter,
String[] stringArray,
boolean appendEqualSign) |
static List<String> |
listAllParams(String contextPath)
List all parameters in the contextPath based on pairs of {}
|
static List<String> |
listQueryParams(String contextPath)
Found out what is the query parameter names based on pairs of {}
|
static boolean |
logMessageIfAny(PrintStream logger,
ResponseContentSupplier response,
boolean isError) |
static String |
maskToken(String token) |
static BasicAuthentication |
toBasicAuthentication(String flat) |
static ArrayList<HttpHeader> |
toHttpHeaders(String flat) |
public static ArrayList<HttpHeader> toHttpHeaders(String flat)
public static BasicAuthentication toBasicAuthentication(String flat)
public static boolean containsIgnoreCase(List<String> tokens, String anotherToken)
public static String fixCesContainerListResponseJson(String responseJson)
public static hudson.util.ListBoxModel buildConnectionIdItems(@AncestorInPath
jenkins.model.Jenkins context,
@QueryParameter
String connectionId,
@AncestorInPath
hudson.model.Item project)
public static com.compuware.jenkins.common.configuration.HostConnection getHostConnection(String connectionId)
connectionId - The connection IDpublic static String getCesUrl(String connectionId, PrintStream logger) throws hudson.AbortException
hudson.AbortExceptionpublic static com.cloudbees.plugins.credentials.common.StandardCredentials getCesCredentials(String credentialsId, hudson.model.Item item)
public static hudson.util.ListBoxModel buildCredentialsIdItems(@AncestorInPath
jenkins.model.Jenkins context,
@QueryParameter
String credentialsId,
@AncestorInPath
hudson.model.Item project)
public static hudson.util.ListBoxModel buildIspwActionItems(@AncestorInPath
jenkins.model.Jenkins context,
@QueryParameter
String ispwAction,
@AncestorInPath
hudson.model.Item project)
public static boolean logMessageIfAny(PrintStream logger, ResponseContentSupplier response, boolean isError)
public static boolean isIspwDebugMode()
public static void assertNotNull(PrintStream logger, Object object, String message, Object... args) throws hudson.AbortException
logger - the Jenkins logobject - the object to be testedmessage - the debug messageargs - the debug message argumentshudson.AbortException - abort exception if nullpublic static void assertNotNull(PrintStream logger, Object object, String message) throws hudson.AbortException
logger - the Jenkins logobject - the object to be testedmessage - debug message if nullhudson.AbortException - abort exception if nullpublic static List<String> listAllParams(String contextPath)
contextPath - the context pathpublic static List<String> listQueryParams(String contextPath)
contextPath - the context pathpublic static String cleanContextPath(String contextPath)
contextPath - the context pathpublic static ArrayList<String> getVariables(String s)
s - the string to extract the variables frompublic static ProgramList convertSetInfoResp(SetInfoResponse setInfoResp)
setInfoResp - the SetInfoResponse objectCopyright © 2016–2025. All rights reserved.