mirror of
https://github.com/Fishwaldo/rundeck-api-java-client.git
synced 2025-07-18 19:08:21 +00:00
add support for nodes (resources)
This commit is contained in:
parent
d6b6ec3405
commit
28c3eb20ae
23 changed files with 623 additions and 52 deletions
|
@ -41,7 +41,7 @@ import org.apache.http.protocol.HTTP;
|
|||
import org.apache.http.util.EntityUtils;
|
||||
import org.dom4j.Document;
|
||||
import org.rundeck.api.RundeckApiException.RundeckApiLoginException;
|
||||
import org.rundeck.api.parser.NodeParser;
|
||||
import org.rundeck.api.parser.XmlNodeParser;
|
||||
import org.rundeck.api.parser.ParserHelper;
|
||||
import org.rundeck.api.util.AssertUtil;
|
||||
|
||||
|
@ -110,7 +110,7 @@ class ApiCall {
|
|||
* @throws RundeckApiException in case of error when calling the API
|
||||
* @throws RundeckApiLoginException if the login fails
|
||||
*/
|
||||
public <T> T get(ApiPathBuilder apiPath, NodeParser<T> parser) throws RundeckApiException, RundeckApiLoginException {
|
||||
public <T> T get(ApiPathBuilder apiPath, XmlNodeParser<T> parser) throws RundeckApiException, RundeckApiLoginException {
|
||||
String apiUrl = client.getUrl() + RundeckClient.API_ENDPOINT + apiPath;
|
||||
|
||||
HttpClient httpClient = instantiateHttpClient();
|
||||
|
@ -134,7 +134,7 @@ class ApiCall {
|
|||
|
||||
// read and parse the response
|
||||
Document xmlDocument = ParserHelper.loadDocument(response);
|
||||
T result = parser.parseNode(xmlDocument);
|
||||
T result = parser.parseXmlNode(xmlDocument);
|
||||
|
||||
// release the connection
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue