|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jenkinsci.plugins.skytap.SkytapUtils
public class SkytapUtils
| Constructor Summary | |
|---|---|
SkytapUtils()
|
|
| Method Summary | |
|---|---|
static org.apache.http.client.methods.HttpDelete |
buildHttpDeleteRequest(String requestUrl,
String AuthToken)
This method returns an http delete request object, given a url and the encoded Skytap authorization token. |
static org.apache.http.client.methods.HttpGet |
buildHttpGetRequest(String requestUrl,
String AuthToken)
This method packages an http get request object, given a url and the encoded Skytap authorization token. |
static org.apache.http.client.methods.HttpPost |
buildHttpPostRequest(String requestUrl,
String AuthToken)
This method packages an http post request object, given a url and the encoded Skytap authorization token. |
static org.apache.http.client.methods.HttpPut |
buildHttpPutRequest(String requestUrl,
String AuthToken)
This method returns an http put request object, given a url and the encoded Skytap authorization token. |
static void |
checkResponseForErrors(String response)
Utility method to extract errors, if any, from the Skytap json response, and throw an exception which can be handled by the caller. |
static String |
convertFileNameToFullPath(hudson.model.AbstractBuild build,
String savefile)
Prepends the workspace path to a save file name as a default if user has not provided a full path. |
static String |
executeHttpDeleteRequest(org.apache.http.client.methods.HttpDelete hd)
Utility method used to execute an http delete. |
static String |
executeHttpRequest(org.apache.http.client.methods.HttpRequestBase hr)
Utility method to execute any type of http request (except delete), to catch any exceptions thrown and return the response string. |
static String |
expandEnvVars(hudson.model.AbstractBuild build,
String targetString)
This method is used to enable Jenkins variable expansion. |
static String |
getAuthCredentials(hudson.model.AbstractBuild build)
Retrieves user id and auth key from the project build environment, encodes and returns encoded credential string to the user. |
static com.google.gson.JsonObject |
getJsonObjectFromFile(String filepath)
This is a utility method used to get the json object in json file used for configs, templates, etc. |
static String |
getNetworkIdFromName(String confId,
String netName,
String authCredential)
Executes a Skytap API call in order to get the network id of the network whose name was provided by the user. |
static String |
getRuntimeId(String usersId,
String usersFile)
This method is used to obtain an id. |
static String |
getValueFromJsonResponseBody(String jsonRespBody,
String key)
This is a utility method to help retrieve a json element from the response body. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SkytapUtils()
| Method Detail |
|---|
public static String expandEnvVars(hudson.model.AbstractBuild build,
String targetString)
build - targetString -
public static com.google.gson.JsonObject getJsonObjectFromFile(String filepath)
filepath -
public static String getValueFromJsonResponseBody(String jsonRespBody,
String key)
jsonRespBody -
public static String getAuthCredentials(hudson.model.AbstractBuild build)
AbstractBuild -
public static org.apache.http.client.methods.HttpGet buildHttpGetRequest(String requestUrl,
String AuthToken)
requestUrl - AuthToken -
public static org.apache.http.client.methods.HttpPost buildHttpPostRequest(String requestUrl,
String AuthToken)
requestUrl - AuthToken -
public static org.apache.http.client.methods.HttpPut buildHttpPutRequest(String requestUrl,
String AuthToken)
requestUrl - AuthToken -
public static org.apache.http.client.methods.HttpDelete buildHttpDeleteRequest(String requestUrl,
String AuthToken)
requestUrl - AuthToken -
public static String executeHttpRequest(org.apache.http.client.methods.HttpRequestBase hr)
throws SkytapException
hr -
SkytapException
IOException
org.apache.http.ParseExceptionpublic static String executeHttpDeleteRequest(org.apache.http.client.methods.HttpDelete hd)
hd -
public static void checkResponseForErrors(String response)
throws SkytapException
response -
SkytapException
public static String getRuntimeId(String usersId,
String usersFile)
throws FileNotFoundException
confId -
FileNotFoundException
public static String convertFileNameToFullPath(hudson.model.AbstractBuild build,
String savefile)
build - savefile -
public static String getNetworkIdFromName(String confId,
String netName,
String authCredential)
throws SkytapException
confId - netName -
SkytapException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||