as an option for RPC operations
* added xml input option for rpcs, put and post methods
Change-Id: I1f73bcb7d1127e4b4324d779aec40907ca627073
Signed-off-by: Jan Hajnar <jhajnar@cisco.com>
(cherry picked from commit
e57d9461b79dedd8ef9edf8f249b066540fd0e9d)
payload.setParamType("body");
payload.setType("(" + rpcDefn.getQName().getLocalName() + ")input");
operationSpec.setParameters(Collections.singletonList(payload));
payload.setParamType("body");
payload.setType("(" + rpcDefn.getQName().getLocalName() + ")input");
operationSpec.setParameters(Collections.singletonList(payload));
+ operationSpec.setConsumes(OperationBuilder.CONSUMES_PUT_POST);
}
rpc.setOperations(Arrays.asList(operationSpec));
}
rpc.setOperations(Arrays.asList(operationSpec));
public static final String OPERATIONAL = "(operational)";
public static final String CONFIG = "(config)";
public static final String OPERATIONAL = "(operational)";
public static final String CONFIG = "(config)";
+ public static final List<String> CONSUMES_PUT_POST = new ArrayList<>();
+ static {
+ CONSUMES_PUT_POST.add("application/json");
+ CONSUMES_PUT_POST.add("application/xml");
+ }
+
public static class Get {
protected Operation spec;
public static class Get {
protected Operation spec;
spec = new Operation();
spec.setType(CONFIG + nodeName);
spec.setNotes(description);
spec = new Operation();
spec.setType(CONFIG + nodeName);
spec.setNotes(description);
+ spec.setConsumes(CONSUMES_PUT_POST);
}
public Put pathParams(List<Parameter> params) {
}
public Put pathParams(List<Parameter> params) {
super(nodeName, description);
this.dataNodeContainer = dataNodeContainer;
spec.setType(CONFIG + nodeName + METHOD_NAME);
super(nodeName, description);
this.dataNodeContainer = dataNodeContainer;
spec.setType(CONFIG + nodeName + METHOD_NAME);
+ spec.setConsumes(CONSUMES_PUT_POST);