CHAPTER 12
Using APIs for Job Management
These examples show how the Job Service API is used to manage jobs.
•
Get a Job Result on page 111
•
Import a List of Devices on page 112
•
Update a List of Devices on page 113
•
Get a Configuration Summary on page 113
•
Get a Running Configuration on page 114
•
Get the Delta Configuration on page 115
•
Cancel a Job Request on page 115
Get a Job Result
This Job Service API code sample gets status information about current jobs.
public void getJobResult(String jobName, JobArgsType jobArgs) {
try {
StatusCodeType opStatus = StatusCodeType.Failure;
GetJobStatusRequest jobStatusRequest = new GetJobStatusRequest();
jobStatusRequest.setAuthToken(authToken);
jobStatusRequest.setDomainId(jobArgs.getDomainId());
jobStatusRequest.setJobName(jobName);
JobStatusType jobStatus = null;
while (true) {
GetJobStatusResponse jobStatusResponse =
stub.GetJobStatusRequest(jobStatusRequest);
opStatus = jobStatusResponse.getStatus();
JobResponseType jobResponseList[] = jobStatusResponse.getJobStatus();
for (int i = 0; i< jobResponseList.length; i++) {
if (jobName.equals(jobResponseList[i].getJobName())) {
jobStatus = jobResponseList[i].getStatus();
System.out.println("JobName: " + j " opStatus: " +
op " jobStatus: " + jobStatus.toString());
}
}
assertTrue(opStatus == StatusCodeType.Success);
if ((jobStatus == JobStatusType.COMPLETEDWITHSUCCESS) ||
(jobStatus == JobStatusType.COMPLETEDWITHFAILURE)) {
break;
} else {
111
Copyright © 2010, Juniper Networks, Inc.
Содержание 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...