ObjectIdOrNameType objIdOrName = new ObjectIdOrNameType();
objIdOrName.setObjectName("rb_test100_130q6f9fs");
objectId.setObjectIdOrName(objIdOrName);
//creates an object of UpdateObjectViewType
UpdateObjectViewType updateObject = new UpdateObjectViewType();
updateObject.setObjectIdentifier(new ObjectIdentifierType[]
{objectId});
modifyCmd.setUpdateObject(updateObject);
NodeModificationType nodeModificationType = new NodeModificationType();
PathValueType pathValueType = new PathValueType();
nodeModificationType.setUpdateNode(pathValueType);
//changes the first service in the service collection to the service
specified
pathValueType.setXpath("./rules_collection/rules[1]/service_collection/service[1]");
pathValueType.setValue(this.createOpaqueDataType
("<service>&0.service.15</service>"));
updateObject.setObjectModification(new ObjectModificationType());
updateObject.getObjectModification().addModification(nodeModificationType);
request.addCommand(modifyCmd);
//invokes the service
ModifyObjectViewResponse response =
DataCentricServiceTest.stub.ModifyObjectViewRequest(request);
print(response);
assertTrue(response.getStatus() == StatusCodeType.Success);
}catch (Exception e) {
e.printStackTrace();
}
}
Delete a Policy
The following Data Centric Service API code sample deletes the NSM policy and
associated rules.
public void testDeleteNsmpolicyObject() {
try {
System.out.println("Running testDeleteNsmpolicyObject()");
ModifyObjectViewRequest request = new ModifyObjectViewRequest();
request.setAuthToken(DataCentricServiceTest.authToken);
//creates an object of ModifyViewCommandType
ModifyViewCommandType modifyCmd = new ModifyViewCommandType();
DeleteObjectViewType deleteObject = new DeleteObjectViewType();
//specifies the rulebase to be deleted
ObjectIdentifierType objectId = new ObjectIdentifierType();
objectId.setCategory("rb_firewall");
objectId.setDomainId(new UnsignedShort("1"));
ObjectIdOrNameType objIdOrName = new ObjectIdOrNameType();
objIdOrName.setObjectName("rb_test100_130q6f9fs");
Copyright © 2010, Juniper Networks, Inc.
100
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...