public class AnkaMgmtCommunicator extends Object
Modifier and Type | Class and Description |
---|---|
protected static class |
AnkaMgmtCommunicator.RequestMethod |
Modifier and Type | Field and Description |
---|---|
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 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) |
List<org.json.JSONObject> |
getImageRequests() |
List<NodeGroup> |
getNodeGroups() |
String |
getSaveImageStatus(String reqId) |
List<String> |
getTemplateTags(String templateId) |
protected org.apache.http.ssl.TrustStrategy |
getTrustStartegy() |
List<AnkaVmSession> |
list() |
List<AnkaVmTemplate> |
listTemplates() |
protected org.apache.http.impl.client.CloseableHttpClient |
makeHttpClient(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) |
protected void |
setTLSVerificationIfDefined(SSLContext sslContext,
org.apache.http.impl.client.HttpClientBuilder builder) |
AnkaVmSession |
showVm(String sessionId) |
String |
startVm(String templateId,
String tag,
String nameTemplate,
String startUpScript,
String groupId,
int priority) |
AnkaCloudStatus |
status() |
boolean |
terminateVm(String sessionId) |
protected URL mgmtUrl
protected final int timeout
protected final int maxRetries
protected boolean skipTLSVerification
protected String rootCA
protected transient RoundRobin roundRobin
public AnkaMgmtCommunicator(String url)
public AnkaMgmtCommunicator(String mgmtURL, boolean skipTLSVerification)
public AnkaMgmtCommunicator(String mgmtUrl, boolean skipTLSVerification, String rootCA)
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) throws AnkaMgmtException
AnkaMgmtException
public AnkaVmSession showVm(String sessionId) throws AnkaMgmtException
AnkaMgmtException
public boolean terminateVm(String sessionId) throws AnkaMgmtException
AnkaMgmtException
public List<AnkaVmSession> 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
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 makeHttpClient(int reqTimeout) throws KeyStoreException, NoSuchAlgorithmException, KeyManagementException, CertificateException, IOException, UnrecoverableKeyException
protected void setTLSVerificationIfDefined(SSLContext sslContext, org.apache.http.impl.client.HttpClientBuilder builder)
protected org.apache.http.ssl.TrustStrategy getTrustStartegy()
protected org.apache.http.client.methods.HttpRequestBase setBody(org.apache.http.client.methods.HttpEntityEnclosingRequestBase request, org.json.JSONObject requestBody) throws UnsupportedEncodingException
UnsupportedEncodingException
Copyright © 2016–2019. All rights reserved.