@SuppressWarnings("unchecked") public <T> T executeCreateObject(final T newObject, final String path, final Map<String, String> parameters) throws CloudstackRESTException { s_logger.debug("Executing create object on " + path); final CloseableHttpResponse response = createAndExecuteRequest(HttpMethods.POST, path, parameters, Optional.fromNullable(gson.toJson(newObject))); return (T) readResponseBody(response, newObject.getClass()); }
public <T> T executeRetrieveObject(final Type returnObjectType, final String path, final Map<String, String> parameters) throws CloudstackRESTException { s_logger.debug("Executing retrieve object on " + path); final CloseableHttpResponse response = createAndExecuteRequest(HttpMethods.GET, path, parameters, ABSENT); return readResponseBody(response, returnObjectType); }
public <T> void executeUpdateObject(final T newObject, final String path, final Map<String, String> parameters) throws CloudstackRESTException { s_logger.debug("Executing update object on " + path); client.closeResponse(createAndExecuteRequest(HttpMethods.PUT, path, parameters, Optional.fromNullable(gson.toJson(newObject)))); }
public void executeDeleteObject(final String path) throws CloudstackRESTException { s_logger.debug("Executing delete object on " + path); client.closeResponse(createAndExecuteRequest(HttpMethods.DELETE, path, new HashMap<String, String>(), ABSENT)); }
public void executeDeleteObject(final String path) throws CosmicRESTException { s_logger.debug("Executing delete object on " + path); client.closeResponse(createAndExecuteRequest(HttpMethods.DELETE, path, new HashMap<>(), ABSENT)); }
public <T> T executeRetrieveObject(final Type returnObjectType, final String path, final Map<String, String> parameters) throws CosmicRESTException { s_logger.debug("Executing retrieve object on " + path); final CloseableHttpResponse response = createAndExecuteRequest(HttpMethods.GET, path, parameters, ABSENT); return readResponseBody(response, returnObjectType); }
public <T> T executeCreateObject(final T newObject, final String path, final Map<String, String> parameters) throws CosmicRESTException { s_logger.debug("Executing create object on " + path); final CloseableHttpResponse response = createAndExecuteRequest(HttpMethods.POST, path, parameters, Optional.fromNullable(gson.toJson(newObject))); return (T) readResponseBody(response, newObject.getClass()); }
public <T> void executeUpdateObject(final T newObject, final String path, final Map<String, String> parameters) throws CosmicRESTException { s_logger.debug("Executing update object on " + path); client.closeResponse(createAndExecuteRequest(HttpMethods.PUT, path, parameters, Optional.fromNullable(gson.toJson(newObject)))); }