Thread.sleep(5000);
}
}
assertTrue(jobStatus == JobStatusType.COMPLETEDWITHSUCCESS);
GetJobResultRequest jobResultRequest = new GetJobResultRequest();
jobResultRequest.setAuthToken(authToken);
jobResultRequest.setDomainId(jobArgs.getDomainId());
jobResultRequest.setJobName(jobName);
GetJobResultResponse jobResultResponse =
stub.GetJobResultRequest(jobResultRequest);
opStatus = jobResultResponse.getStatus();
JobResponseType jobResultList[] = jobResultResponse.getJobResponse();
for (int i = 0; i < jobResultList.length; i++) {
if (jobName.equals(jobResultList[i].getJobName())) {
jobStatus = jobResultList[i].getStatus();
String jobResult = jobResultList[i].getExplanation().toString();
System.out.println("JobName: " + j " jobResult: " + jobResult);
}
}
assertTrue(opStatus == StatusCodeType.Success);
} catch (Exception e) {
e.printStackTrace();
}
}
Import a List of Devices
This Job Service API code example imports a list of devices.
public void testImportDeviceRequest() {
try {
File importDeviceInput = new File( File.sep pathO
"/Input/" + "testImportDevice.txt");
BufferedReader reader =
new BufferedReader(new InputStreamReader(new
FileInputStream(importDeviceInput)));
ImportDeviceRequest importDeviceRequest = new ImportDeviceRequest();
String jobName = getUniqueJobId(import_device);
System.out.println("importDeviceRequest: jobName " + jobName);
JobRequestType jobRequest = getJobRequest(jobName, reader);
importDeviceRequest.setJobRequest(jobRequest);
importDeviceRequest.setAuthToken(authToken);
ImportDeviceResponse importResponse =
stub.ImportDeviceRequest(importDeviceRequest);
JobResponseType jobResponse = importResponse.getJobResponse();
StatusCodeType opStatus = importResponse.getStatus();
String jobID = jobResponse.getJobName();
String status = jobResponse.getStatus().toString();
System.out.println("JobName: " + jobID + " opStatus: " + op
" status: " + status);
assertTrue(opStatus == StatusCodeType.Success);
getJobResult(jobName, jobRequest.getJobArgs());
} catch (Exception e) {
e.printStackTrace();
Copyright © 2010, Juniper Networks, Inc.
112
Network and Security Manager 2010.4 API Guide
Содержание NETWORK AND SECURITY MANAGER 2010.4 - API GUIDE REV 1
Страница 6: ...Copyright 2010 Juniper Networks Inc vi...
Страница 10: ...Copyright 2010 Juniper Networks Inc x Network and Security Manager 2010 4 API Guide...
Страница 12: ...Copyright 2010 Juniper Networks Inc xii Network and Security Manager 2010 4 API Guide...
Страница 20: ...Copyright 2010 Juniper Networks Inc 2 Network and Security Manager 2010 4 API Guide...
Страница 24: ...Copyright 2010 Juniper Networks Inc 6 Network and Security Manager 2010 4 API Guide...
Страница 34: ...Copyright 2010 Juniper Networks Inc 16 Network and Security Manager 2010 4 API Guide...
Страница 58: ...Figure 10 IDP Rulebase Copyright 2010 Juniper Networks Inc 40 Network and Security Manager 2010 4 API Guide...
Страница 92: ...Copyright 2010 Juniper Networks Inc 74 Network and Security Manager 2010 4 API Guide...
Страница 98: ...Copyright 2010 Juniper Networks Inc 80 Network and Security Manager 2010 4 API Guide...
Страница 100: ...Copyright 2010 Juniper Networks Inc 82 Network and Security Manager 2010 4 API Guide...
Страница 112: ...Copyright 2010 Juniper Networks Inc 94 Network and Security Manager 2010 4 API Guide...
Страница 128: ...Copyright 2010 Juniper Networks Inc 110 Network and Security Manager 2010 4 API Guide...
Страница 138: ...Copyright 2010 Juniper Networks Inc 120 Network and Security Manager 2010 4 API Guide...
Страница 152: ...Copyright 2010 Juniper Networks Inc 134 Network and Security Manager 2010 4 API Guide...
Страница 165: ...PART 6 Index Index on page 149 147 Copyright 2010 Juniper Networks Inc...
Страница 166: ...Copyright 2010 Juniper Networks Inc 148 Network and Security Manager 2010 4 API Guide...