cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2726
Views
0
Helpful
1
Replies

Service re-deploy dry-run throws error

sm000x
Level 1
Level 1

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

1 Accepted Solution

Accepted Solutions

sm000x
Level 1
Level 1

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

View solution in original post

1 Reply 1

sm000x
Level 1
Level 1

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

Polls
AI-powered tools for network troubleshooting are likely to be part of everyone’s workflow sooner or later. What is the single biggest challenge or concern you see with adopting these tools in your organization?