Class AnkaMgmtCommunicator
java.lang.Object
com.veertu.ankaMgmtSdk.AnkaMgmtCommunicator
- Direct Known Subclasses:
AnkaMgmtClientCertAuthCommunicator,AnkaMgmtOpenIdCommunicator,AnkaMgmtUakCommunicator
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intprotected org.apache.http.client.CredentialsProviderprotected org.apache.http.impl.client.CloseableHttpClientprotected intprotected final intprotected URLprotected Stringprotected RoundRobinprotected booleanprotected final int -
Constructor Summary
ConstructorsConstructorDescriptionAnkaMgmtCommunicator(String mgmtURL, boolean skipTLSVerification) AnkaMgmtCommunicator(String mgmtUrl, boolean skipTLSVerification, String rootCA) AnkaMgmtCommunicator(String mgmtUrl, String rootCA) AnkaMgmtCommunicator(List<String> mgmtURLS, boolean skipTLSVerification, String rootCA) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddHeaders(org.apache.http.client.methods.HttpRequestBase request) protected org.json.JSONObjectdoRequest(AnkaMgmtCommunicator.RequestMethod method, String path, org.json.JSONObject requestBody) protected org.json.JSONObjectdoRequest(AnkaMgmtCommunicator.RequestMethod method, String path, org.json.JSONObject requestBody, int reqTimeout) intprotected org.apache.http.impl.client.CloseableHttpClientList<org.json.JSONObject> protected KeyStoreintgetNodes()getSaveImageStatus(String reqId) protected SSLContextgetSSLContext(KeyStore keystore) getTemplateTags(String templateId) protected org.apache.http.ssl.TrustStrategylist()protected org.apache.http.impl.client.CloseableHttpClientprotected org.apache.http.client.config.RequestConfigmakeRequestConfig(int reqTimeout, String host) protected StringBufferreadHttpEntity(org.apache.http.HttpEntity entity) voidrevertRegistryVM(String templateID) 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.HttpRequestBasesetBody(org.apache.http.client.methods.HttpEntityEnclosingRequestBase request, org.json.JSONObject requestBody) voidsetConnectionKeepAliveSeconds(int connectionKeepAliveSeconds) voidsetMaxConections(int maxConections) startVm(String templateId, String tag, String nameTemplate, String startUpScript, String groupId, int priority, String name, String externalId, int vcpu, int vram) status()booleanterminateVm(String sessionId) void
-
Field Details
-
timeout
protected final int timeout- See Also:
-
maxRetries
protected final int maxRetries- See Also:
-
mgmtUrl
-
skipTLSVerification
protected boolean skipTLSVerification -
rootCA
-
roundRobin
-
maxConnections
protected int maxConnections -
credentialsProvider
protected org.apache.http.client.CredentialsProvider credentialsProvider -
connectionKeepAliveSeconds
protected int connectionKeepAliveSeconds -
httpClient
protected transient org.apache.http.impl.client.CloseableHttpClient httpClient
-
-
Constructor Details
-
AnkaMgmtCommunicator
-
AnkaMgmtCommunicator
-
AnkaMgmtCommunicator
-
AnkaMgmtCommunicator
-
AnkaMgmtCommunicator
-
-
Method Details
-
getMaxConections
public int getMaxConections() -
setMaxConections
public void setMaxConections(int maxConections) -
getConnectionKeepAliveSeconds
public int getConnectionKeepAliveSeconds() -
setConnectionKeepAliveSeconds
public void setConnectionKeepAliveSeconds(int connectionKeepAliveSeconds) -
listTemplates
- Throws:
AnkaMgmtException
-
getTemplateTags
- Throws:
AnkaMgmtException
-
getNodeGroups
- Throws:
AnkaMgmtException
-
startVm
public String startVm(String templateId, String tag, String nameTemplate, String startUpScript, String groupId, int priority, String name, String externalId, int vcpu, int vram) throws AnkaMgmtException - Throws:
AnkaMgmtException
-
showVm
- Throws:
AnkaMgmtException
-
terminateVm
- Throws:
AnkaMgmtException
-
list
- Throws:
AnkaMgmtException
-
status
- Throws:
AnkaMgmtException
-
saveImage
-
getSaveImageStatus
- Throws:
AnkaMgmtException
-
revertRegistryVM
- Throws:
AnkaMgmtException
-
getImageRequests
- Throws:
AnkaMgmtException
-
updateVM
public void updateVM(String id, String name, String jenkinsNodeLink, String jobIdentifier) throws AnkaMgmtException - Throws:
AnkaMgmtException
-
getNodes
- Throws:
AnkaMgmtException
-
addHeaders
protected void addHeaders(org.apache.http.client.methods.HttpRequestBase request) throws AnkaMgmtException, ClientException - Throws:
AnkaMgmtExceptionClientException
-
doRequest
protected org.json.JSONObject doRequest(AnkaMgmtCommunicator.RequestMethod method, String path, org.json.JSONObject requestBody) throws IOException, AnkaMgmtException - Throws:
IOExceptionAnkaMgmtException
-
doRequest
protected org.json.JSONObject doRequest(AnkaMgmtCommunicator.RequestMethod method, String path, org.json.JSONObject requestBody, int reqTimeout) throws IOException, AnkaMgmtException - Throws:
IOExceptionAnkaMgmtException
-
readHttpEntity
- Throws:
IOException
-
getHttpClient
protected org.apache.http.impl.client.CloseableHttpClient getHttpClient() throws CertificateException, UnrecoverableKeyException, NoSuchAlgorithmException, KeyStoreException, KeyManagementException, IOException -
makeRequestConfig
protected org.apache.http.client.config.RequestConfig makeRequestConfig(int reqTimeout, String host) -
makeHttpClient
protected org.apache.http.impl.client.CloseableHttpClient makeHttpClient() throws KeyStoreException, NoSuchAlgorithmException, KeyManagementException, CertificateException, IOException, UnrecoverableKeyException -
getSSLContext
protected SSLContext getSSLContext(KeyStore keystore) throws KeyStoreException, NoSuchAlgorithmException, KeyManagementException, UnrecoverableKeyException -
getKeyStore
protected KeyStore getKeyStore() throws CertificateException, NoSuchAlgorithmException, KeyStoreException, IOException -
getTrustStrategy
protected org.apache.http.ssl.TrustStrategy getTrustStrategy() -
setBody
protected org.apache.http.client.methods.HttpRequestBase setBody(org.apache.http.client.methods.HttpEntityEnclosingRequestBase request, org.json.JSONObject requestBody) throws UnsupportedEncodingException - Throws:
UnsupportedEncodingException
-