public class AnkaMgmtCommunicator extends Object
Modifier and Type | Class and Description |
---|---|
protected static class |
AnkaMgmtCommunicator.RequestMethod |
Modifier and Type | Field and Description |
---|---|
protected int |
connectionKeepAliveSeconds |
protected org.apache.http.impl.client.CloseableHttpClient |
httpClient |
protected int |
maxConnections |
protected int |
maxRetries |
protected URL |
mgmtUrl |
protected String |
rootCA |
protected RoundRobin |
roundRobin |
protected boolean |
skipTLSVerification |
protected int |
timeout |
Constructor and Description |
---|
AnkaMgmtCommunicator(List<String> mgmtURLS,
boolean skipTLSVerification,
String rootCA) |
AnkaMgmtCommunicator(String url) |
AnkaMgmtCommunicator(String mgmtURL,
boolean skipTLSVerification) |
AnkaMgmtCommunicator(String mgmtUrl,
boolean skipTLSVerification,
String rootCA) |
AnkaMgmtCommunicator(String mgmtUrl,
String rootCA) |
Modifier and Type | Method and Description |
---|---|
protected void |
addHeaders(org.apache.http.client.methods.HttpRequestBase request) |
protected org.json.JSONObject |
doRequest(AnkaMgmtCommunicator.RequestMethod method,
String path,
org.json.JSONObject requestBody) |
protected org.json.JSONObject |
doRequest(AnkaMgmtCommunicator.RequestMethod method,
String path,
org.json.JSONObject requestBody,
int reqTimeout) |
int |
getConnectionKeepAliveSeconds() |
protected org.apache.http.impl.client.CloseableHttpClient |
getHttpClient() |
List<org.json.JSONObject> |
getImageRequests() |
protected KeyStore |
getKeyStore() |
int |
getMaxConections() |
List<NodeGroup> |
getNodeGroups() |
List<AnkaNode> |
getNodes() |
String |
getSaveImageStatus(String reqId) |
protected SSLContext |
getSSLContext(KeyStore keystore) |
List<String> |
getTemplateTags(String templateId) |
protected org.apache.http.ssl.TrustStrategy |
getTrustStrategy() |
List<AnkaVmInstance> |
list() |
List<AnkaVmTemplate> |
listTemplates() |
protected org.apache.http.impl.client.CloseableHttpClient |
makeHttpClient() |
protected org.apache.http.client.config.RequestConfig |
makeRequestConfig(int reqTimeout) |
void |
revertRegistryVM(String templateID) |
String |
saveImage(String instanceId,
String targetVMId,
String newTemplateName,
String tag,
String description,
Boolean suspend,
String shutdownScript,
Boolean revertBeforePush,
String revertTag,
Boolean doSuspendTest) |
protected org.apache.http.client.methods.HttpRequestBase |
setBody(org.apache.http.client.methods.HttpEntityEnclosingRequestBase request,
org.json.JSONObject requestBody) |
void |
setConnectionKeepAliveSeconds(int connectionKeepAliveSeconds) |
void |
setMaxConections(int maxConections) |
AnkaVmInstance |
showVm(String sessionId) |
String |
startVm(String templateId,
String tag,
String nameTemplate,
String startUpScript,
String groupId,
int priority,
String name,
String externalId) |
AnkaCloudStatus |
status() |
boolean |
terminateVm(String sessionId) |
void |
updateVM(String id,
String name,
String jenkinsNodeLink,
String jobIdentifier) |
protected URL mgmtUrl
protected final int timeout
protected final int maxRetries
protected boolean skipTLSVerification
protected String rootCA
protected transient RoundRobin roundRobin
protected int maxConnections
protected int connectionKeepAliveSeconds
protected transient org.apache.http.impl.client.CloseableHttpClient httpClient
public AnkaMgmtCommunicator(String url)
public AnkaMgmtCommunicator(String mgmtURL, boolean skipTLSVerification)
public AnkaMgmtCommunicator(String mgmtUrl, boolean skipTLSVerification, String rootCA)
public int getMaxConections()
public void setMaxConections(int maxConections)
public int getConnectionKeepAliveSeconds()
public void setConnectionKeepAliveSeconds(int connectionKeepAliveSeconds)
public List<AnkaVmTemplate> listTemplates() throws AnkaMgmtException
AnkaMgmtException
public List<String> getTemplateTags(String templateId) throws AnkaMgmtException
AnkaMgmtException
public List<NodeGroup> getNodeGroups() throws AnkaMgmtException
AnkaMgmtException
public String startVm(String templateId, String tag, String nameTemplate, String startUpScript, String groupId, int priority, String name, String externalId) throws AnkaMgmtException
AnkaMgmtException
public AnkaVmInstance showVm(String sessionId) throws AnkaMgmtException
AnkaMgmtException
public boolean terminateVm(String sessionId) throws AnkaMgmtException
AnkaMgmtException
public List<AnkaVmInstance> list() throws AnkaMgmtException
AnkaMgmtException
public AnkaCloudStatus status() throws AnkaMgmtException
AnkaMgmtException
public String saveImage(String instanceId, String targetVMId, String newTemplateName, String tag, String description, Boolean suspend, String shutdownScript, Boolean revertBeforePush, String revertTag, Boolean doSuspendTest) throws AnkaMgmtException
AnkaMgmtException
public String getSaveImageStatus(String reqId) throws AnkaMgmtException
AnkaMgmtException
public void revertRegistryVM(String templateID) throws AnkaMgmtException
AnkaMgmtException
public List<org.json.JSONObject> getImageRequests() throws AnkaMgmtException
AnkaMgmtException
public void updateVM(String id, String name, String jenkinsNodeLink, String jobIdentifier) throws AnkaMgmtException
AnkaMgmtException
public List<AnkaNode> getNodes() throws AnkaMgmtException
AnkaMgmtException
protected void addHeaders(org.apache.http.client.methods.HttpRequestBase request) throws AnkaMgmtException, ClientException
AnkaMgmtException
ClientException
protected org.json.JSONObject doRequest(AnkaMgmtCommunicator.RequestMethod method, String path, org.json.JSONObject requestBody) throws IOException, AnkaMgmtException
IOException
AnkaMgmtException
protected org.json.JSONObject doRequest(AnkaMgmtCommunicator.RequestMethod method, String path, org.json.JSONObject requestBody, int reqTimeout) throws IOException, AnkaMgmtException
IOException
AnkaMgmtException
protected org.apache.http.impl.client.CloseableHttpClient getHttpClient() throws CertificateException, UnrecoverableKeyException, NoSuchAlgorithmException, KeyStoreException, KeyManagementException, IOException
protected org.apache.http.client.config.RequestConfig makeRequestConfig(int reqTimeout)
protected org.apache.http.impl.client.CloseableHttpClient makeHttpClient() throws KeyStoreException, NoSuchAlgorithmException, KeyManagementException, CertificateException, IOException, UnrecoverableKeyException
protected SSLContext getSSLContext(KeyStore keystore) throws KeyStoreException, NoSuchAlgorithmException, KeyManagementException, UnrecoverableKeyException
protected KeyStore getKeyStore() throws CertificateException, NoSuchAlgorithmException, KeyStoreException, IOException
protected org.apache.http.ssl.TrustStrategy getTrustStrategy()
protected org.apache.http.client.methods.HttpRequestBase setBody(org.apache.http.client.methods.HttpEntityEnclosingRequestBase request, org.json.JSONObject requestBody) throws UnsupportedEncodingException
UnsupportedEncodingException
Copyright © 2016–2020. All rights reserved.