cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
613
Views
0
Helpful
4
Replies

service re-deploy error while service reconciliation

previousqna
Level 5
Level 5

Hi Expert,

 

 

While doing the service reconciliation, I am trying to re-deploy the service. If I invoke the re-deploy action with reconcile parameter, it is working fine but if I want to get dry-run output by passing “dry-run” parameter in addition, I am getting error “Too many values”.

 

 

Any idea about it?

 

 

 

try {

 

ConfXMLParam[] params = new ConfXMLParam[4];

 

params[0] = new ConfXMLParamStart(getPrefix(), "reconcile");

 

params[1] = new ConfXMLParamLeaf(getPrefix(), "keep-non-service-config");

 

params[2] = new ConfXMLParamStop(getPrefix(), "reconcile");

 

params[3] = new ConfXMLParamLeaf(getPrefix(), "dry-run");

 

String servicePath = createServicePath(serviceName, keyValues) + "re-deploy";

 

ConfXMLParam[] reDeployParamsOut = maapi.requestAction(params, servicePath);

4 Replies 4

previousqna
Level 5
Level 5

Hello,
take a look in tailf-ncs-services.yang
Here you will see the action re-deploy modeled as:
tailf:action re-deploy {
      tailf:info "Run/Dryrun the service logic again";
....
      input {
        container dry-run {
          presence "";
          leaf outformat {
            type outformat3;
          }
        }
....
The dry-run node is a presence container, not a leaf, thus the following should work:ConfXMLParam[] params = new ConfXMLParam[5];
params[0] = new ConfXMLParamStart(getPrefix(), "reconcile");
params[1] = new ConfXMLParamLeaf(getPrefix(), "keep-non-service-config");
params[2] = new ConfXMLParamStop(getPrefix(), "reconcile");
params[3] = new ConfXMLParamStart(getPrefix(), "dry-run");
params[4] = new ConfXMLParamStop(getPrefix(), "dry-run");
String servicePath = createServicePath(serviceName, keyValues) + "re-deploy";
ConfXMLParam[] reDeployParamsOut = maapi.requestAction(params, servicePath);

Thanks! I have tried this way also but still same error. Please see the code tried by me:

 

 

ConfXMLParam[] params = new ConfXMLParam[5];

 

//ConfXMLParam[] params = new ConfXMLParam[6];

 

LOGGER.info("defined params:");

 

params[0] = new ConfXMLParamStart(getPrefix(), "reconcile");

 

LOGGER.info("Param started");

 

params[1] = new ConfXMLParamLeaf(getPrefix(), "keep-non-service-config");

 

LOGGER.info("Discard non service config");

 

params[2] = new ConfXMLParamStop(getPrefix(), "reconcile");

 

LOGGER.info("Param stoped");

 

params[3] = new ConfXMLParamStart(getPrefix(), "dry-run");

 

params[4] = new ConfXMLParamStop(getPrefix(), "dry-run");

 

String servicePath = createServicePath(serviceName, keyValues) + "re-deploy";

 

LOGGER.info("Re-deploy service path for requestAction: " + servicePath);

 

ConfXMLParam[] reDeployParamsOut = maapi.requestAction(params, servicePath);

 

 

 

In debug mode values for params and service path are:

 

 

Params -> [{[1481125183|reconcile], START}, {[1481125183|keep-non-service-config], LEAF}, {[1481125183|reconcile], STOP}, {[1481125183|dry-run], START}, {[1481125183|dry-run], STOP}]

 

Service path -> /services/l2vpn-p2p{1894730020:1004400020}/re-deploy

 

Error -> com.tailf.maapi.MaapiException: Too many values

Hi,
my bad. You have to follow the order of the parameters in YANG.
ConfXMLParam[] params = new ConfXMLParam[5];params[0] = new ConfXMLParamStart(getPrefix(), "dry-run");
params[1] = new ConfXMLParamStop(getPrefix(), "dry-run");
params[2] = new ConfXMLParamStart(getPrefix(), "reconcile");
params[3] = new ConfXMLParamLeaf(getPrefix(), "keep-non-service-config");params[4] = new ConfXMLParamStop(getPrefix(), "reconcile");String servicePath = createServicePath(serviceName, keyValues) + "re-deploy";ConfXMLParam[] reDeployParamsOut = maapi.requestAction(params, servicePath);

Thanks a lot! It worked J