Class TowerConnector
java.lang.Object
org.jenkinsci.plugins.ansible_tower.util.TowerConnector
- All Implemented Interfaces:
Serializable,AutoCloseable
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTowerConnector(String url, String username, String password) TowerConnector(String url, String username, String password, String oauthToken, Boolean trustAllCerts, Boolean debug) TowerConnector(String url, String username, String password, String oauthToken, Boolean trustAllCerts, Boolean debug, String apiBasePath) TowerConnector(String url, String username, String password, String oauthToken, Boolean trustAllCerts, Boolean debug, String apiBasePath, int readTimeoutSeconds) TowerConnector(String url, String username, String password, String oauthToken, Boolean trustAllCerts, Boolean debug, String apiBasePath, TowerHttpTimeouts httpTimeouts) -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidcheckTemplateType(String templateType) voidclose()convertPotentialStringToID(String idToCheck, String api_endpoint) net.sf.json.JSONObjectgetJobTemplate(String jobTemplate, String templateType) getLogEvents(long jobID, String templateType) getMethodName(int methodId) getProjectSyncURL(long syncID) getURL()voidbooleanisJobCommpleted(long jobID, String templateType) Deprecated.Use isJobCompletedbooleanisJobCompleted(long jobID, String templateType) booleanisJobFailed(long jobID, String templateType) launchTemplate(long jobTemplate, String extraVars, String limit, String jobTags, String skipJobTags, String jobType, String inventory, String credential, String scmBranch, String templateType) org.apache.http.HttpResponsemakeRequest(int requestType, String endpoint, net.sf.json.JSONObject body, boolean noAuth) net.sf.json.JSONObjectrawLookupByString(String idToCheck, String api_endpoint) voidresolveJobTemplate(String jobTemplate, String templateType) voidsetConsole(PrintStream console) voidsetDebug(boolean debug) voidsetGetFullLogs(boolean getFullLogs) voidsetGetWorkflowChildLogs(boolean importChildWorkflowLogs) voidsetRemoveColor(boolean removeColor) voidsetTrustAllCerts(boolean trustAllCerts) Changes the certificate policy for subsequent requests made by this connector.longsubmitTemplate(long jobTemplate, String extraVars, String limit, String jobTags, String skipJobTags, String jobType, String inventory, String credential, String scmBranch, String templateType) void
-
Field Details
-
GET
public static final int GET- See Also:
-
POST
public static final int POST- See Also:
-
PATCH
public static final int PATCH- See Also:
-
JOB_TEMPLATE_TYPE
- See Also:
-
WORKFLOW_TEMPLATE_TYPE
- See Also:
-
AUTO_TEMPLATE_TYPE
- See Also:
-
API_BASE_PATH_LEGACY
- See Also:
-
API_BASE_PATH_AAP_CONTROLLER
- See Also:
-
API_GATEWAY_TOKEN_ENDPOINT
- See Also:
-
DEFAULT_READ_TIMEOUT_SECONDS
public static final int DEFAULT_READ_TIMEOUT_SECONDS- See Also:
-
MAX_READ_TIMEOUT_SECONDS
public static final int MAX_READ_TIMEOUT_SECONDS- See Also:
-
-
Constructor Details
-
TowerConnector
-
TowerConnector
-
TowerConnector
-
TowerConnector
-
TowerConnector
-
-
Method Details
-
getOutcome
-
setTrustAllCerts
public void setTrustAllCerts(boolean trustAllCerts) Changes the certificate policy for subsequent requests made by this connector. -
setDebug
public void setDebug(boolean debug) -
setConsole
-
setRemoveColor
public void setRemoveColor(boolean removeColor) -
setGetWorkflowChildLogs
public void setGetWorkflowChildLogs(boolean importChildWorkflowLogs) -
setGetFullLogs
public void setGetFullLogs(boolean getFullLogs) -
getJenkinsExports
-
getFailureMessage
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
makeRequest
public org.apache.http.HttpResponse makeRequest(int requestType, String endpoint, net.sf.json.JSONObject body, boolean noAuth) throws AnsibleTowerException - Throws:
AnsibleTowerException
-
getURL
-
getVersion
- Throws:
AnsibleTowerException
-
testConnection
- Throws:
AnsibleTowerException
-
convertPotentialStringToID
public String convertPotentialStringToID(String idToCheck, String api_endpoint) throws AnsibleTowerException, AnsibleTowerItemDoesNotExist -
rawLookupByString
public net.sf.json.JSONObject rawLookupByString(String idToCheck, String api_endpoint) throws AnsibleTowerException, AnsibleTowerItemDoesNotExist -
resolveJobTemplate
public TowerConnector.ResolvedTemplate resolveJobTemplate(String jobTemplate, String templateType) throws AnsibleTowerException - Throws:
AnsibleTowerException
-
getJobTemplate
public net.sf.json.JSONObject getJobTemplate(String jobTemplate, String templateType) throws AnsibleTowerException - Throws:
AnsibleTowerException
-
submitTemplate
public long submitTemplate(long jobTemplate, String extraVars, String limit, String jobTags, String skipJobTags, String jobType, String inventory, String credential, String scmBranch, String templateType) throws AnsibleTowerException - Throws:
AnsibleTowerException
-
launchTemplate
public TowerJob launchTemplate(long jobTemplate, String extraVars, String limit, String jobTags, String skipJobTags, String jobType, String inventory, String credential, String scmBranch, String templateType) throws AnsibleTowerException - Throws:
AnsibleTowerException
-
checkTemplateType
- Throws:
AnsibleTowerException
-
isJobCompleted
- Throws:
AnsibleTowerException
-
cancelJob
- Throws:
AnsibleTowerException
-
isJobCommpleted
@Deprecated public boolean isJobCommpleted(long jobID, String templateType) throws AnsibleTowerException Deprecated.Use isJobCompleted- Throws:
AnsibleTowerException
-
getLogEvents
- Throws:
AnsibleTowerException
-
logLine
- Throws:
AnsibleTowerException
-
isJobFailed
- Throws:
AnsibleTowerException
-
getJobURL
-
getProjectSyncURL
-
releaseToken
public void releaseToken() -
getMethodName
-