09-29-2025 05:54 AM
Hi,
I want to to a service re-deploy with dry-run.
Here is my code:
==================
maapi = ConnectionManager.getNewMaapi();
th = ConnectionManager.openMaapiWrite(maapi);
ConfXMLParam[] out = null;
ConfNamespace ncsNs = ConfNamespace.findNamespaceFromPrefix("ncs");
String path = "/ncs:services/nso-dnn-list{\"Subaru of America Inc | Subaru of America Inc\" sm000x-subaru-gen3-preprod-ota.com UPF zauk65acupf01}/re-deploy";
ConfXMLParam[] inp = new ConfXMLParam[] {
new ConfXMLParamStart(ncsNs, "dry-run"),
new ConfXMLParamValue(ncsNs, "outformat", new ConfBuf("cli")),
new ConfXMLParamStop(ncsNs, "dry-run")
};
out = maapi.requestAction(inp, path);
========================
And my nso-dnn-lidt is defined in yang:
module Dnn {
yang-version 1.1;
namespace "http://com/xyz/Dnn";
prefix Dnn;
:
:
augment /ncs:services {
list nso-dnn-list {
uses ncs:service-data;
ncs:servicepoint "dnn-service-point";
key "customer_id service_instance_id service_type device_name";
:
:
}
However, the code
out = maapi.requestAction(inp, path);
throws error:
/ncs:services/Dnn:nso-dnn-list{\"Subaru of America Inc | Subaru of America Inc\" sm000x-subaru-gen3-preprod-ota.com UPF zauk65acupf01}/re-deploy: bad element: dry-run.
Accordinng to tailf-ncs-services.yang
tailf:action re-deploy {
:
:
input {
container dry-run {
presence "";
leaf outformat {
type outformat3;
}
}
:
:
What did I do wrong?
Can anyone help?
THX
sm000x
Solved! Go to Solution.
09-29-2025 12:27 PM
I find what was wrong. The code:
ConfNamespace ncsNs = ConfNamespace.findNamespaceFromPrefix("ncs");
was wrong. I should have used
ConfNamespace ncsNs = ConfNamespace.findNamespaceFromPrefix("Dnn");
Because "list nso-dnn-list" is defined inside module Dnn (prefix Dnn).
Thank you all
sm000x
09-29-2025 12:27 PM
I find what was wrong. The code:
ConfNamespace ncsNs = ConfNamespace.findNamespaceFromPrefix("ncs");
was wrong. I should have used
ConfNamespace ncsNs = ConfNamespace.findNamespaceFromPrefix("Dnn");
Because "list nso-dnn-list" is defined inside module Dnn (prefix Dnn).
Thank you all
sm000x
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide