The API will return a list of all the batch instances with the status given in the input parameter. Only the list of batches will be returned that are accessible by the particular authenticated user.

Request Method: GET

Input Parameters:

Input Parameter Values Descriptions
status This values can be  NEW, LOCKED,READY,ERROR, FINISHED,ASSIGNED, RUNNING, READY_FOR_REVIEW,

READY_FOR_VALIDATION, RESTARTED, DELETED, TRANSFERRED, RESTART_IN_PROGRESS

This parameter is used for specifying the batch instance status for which batch instance list to be fetched.

 

Web Service URL: http://{serverName}:{port}/dcma/rest/BatchInstanceList/{status}

Checklist:-

Batches must have status provided in the list above.

 

Sample client code using apache commons http client:-

private static void getBatchInstanceList() {
		HttpClient client = new HttpClient();
		String url = "http://localhost:8080/dcma/rest/BatchInstanceList/ERROR";
		GetMethod getMethod = new GetMethod(url);
		int statusCode;
		try {
			statusCode = client.executeMethod(getMethod);
			if (statusCode == 200) {
				System.out.println("Web service executed successfully.");
				String responseBody = getMethod.getResponseBodyAsString();
				System.out.println(statusCode + " *** " + responseBody);
			} else if (statusCode == 403) {
				System.out.println("Invalid username/password.");
			} else {
				System.out.println(getMethod.getResponseBodyAsString());
			}
		} catch (HttpException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		} finally {
			if (getMethod != null) {
				getMethod.releaseConnection();
			}
		}
	}

Was this article helpful to you?

Engineering