Re: APPC -> RE: [onap-discuss] #appc Unable to execute stop lcm operation from APPC #appc


Marco Platania
 

Alexis,

 

Are you using CDT? What is your setup? I ran this fine in the past from Postman:

 

{

  "input": {

    "common-header": {

      "timestamp": "{{serverDate}}",

      "api-ver": "2.05",

      "originator-id": "{{orginatorId}}",

      "request-id": "Postman",

      "sub-request-id": "Postman",

      "flags": {

        "mode": "NORMAL",

        "force": "TRUE",

        "ttl": 36000

      }

    },

    "action": "Restart",

    "action-identifiers": {

      "vnf-id": "{{vnf-id}}",

      "vserver-id":"{{vserver-id}}"

    },

    "payload": "{\"vm-id\":\"{{vm-id}}\"}"

  }

}

 

I have a pre-request script like this:

 

// Get the current DateTime

var moment = require('moment');

var date = new Date().toISOString();

var newdate = moment(date).subtract(80, 'minutes').toISOString();

var serverDate = moment(newdate).format('YYYY-MM-DDTHH:mm:ss.SS');

pm.globals.set("serverDate", serverDate+'Z');

 

//Get UUID

var uuid = require('uuid');

var orginatorId = uuid.v4();

pm.globals.set("orginatorId",orginatorId);

 

//Set IDs and payload values

pm.globals.set("vm-id","http://x.y.z.com:8774/v2/3f2aaef74ecb4b19b35e26d0849fe9a2/servers/e7f1db09-ff78-44fc-b256-69095c5556fb");

pm.globals.set("vserver-id","e7f1db09-ff78-44fc-b256-69095c5556fb");

pm.globals.set("vnf-id","17044ef4-e7f3-46a1-af03-e2aa562f23ac");

 

Marco

 

From: <onap-discuss@...> on behalf of Alexis de Talhouet <adetalhouet89@...>
Reply-To: "onap-discuss@..." <onap-discuss@...>, "adetalhouet89@..." <adetalhouet89@...>
Date: Thursday, May 16, 2019 at 11:03 AM
To: BRIAN FREEMAN <bf1936@...>
Cc: onap-discuss <onap-discuss@...>, "alphonse.steve.siani.djissitchi@..." <alphonse.steve.siani.djissitchi@...>, "CHO, TAKAMUNE" <tc012c@...>
Subject: Re: APPC -> RE: [onap-discuss] #appc Unable to execute stop lcm operation from APPC

 

Yes, agreed. Using Casablanca 3.0.1-ONAP version of APPC



On May 16, 2019, at 11:01 AM, FREEMAN, BRIAN D <bf1936@...> wrote:

 

Alexis,

 

Agree you shouldnt have to tweak the DG. Seems like the decoding before calling the DG isnt firing quite right for some reason in your Casablanca instance.

 

Brian

 

 

From: Alexis de Talhouët <adetalhouet89@...> 
Sent: Thursday, May 16, 2019 10:59 AM
To: FREEMAN, BRIAN D <bf1936@...>
Cc: onap-discuss <onap-discuss@...>; alphonse.steve.siani.djissitchi@...; CHO, TAKAMUNE <tc012c@...>
Subject: Re: APPC -> RE: [onap-discuss] #appc Unable to execute stop lcm operation from APPC

 

Taka, I understand you ran testing, I would need to look into that. Also, note, I’m using Casablanca.

 

Attribute (input.common-header.api-ver), value (2.00)

Attribute (input.action-identifiers.service-instance-id), value ()

Attribute (input.action-identifiers.vserver-id), value (c82153dc-8d84-4e69-9673-5e0a60030779)

Attribute (input.common-header.sub-request-id), value ()

Attribute (input.common-header.request-id), value (873aacdf-1d85-4e07-8deb-7815776bbd35)

Attribute (input.common-header.timestamp), value (2019-05-16T14:00:43.177Z)

Attribute (currentGraph), value (SvcLogicGraph [module=APPC, rpc=VM_Start, mode=sync, version=2.0.0, md5sum=1cd3041dc9487e5abf527ee778af1bdc])

Attribute (input.action-identifiers.vnf-id), value (VNF_demo_steve)

Attribute (input.action-identifiers.vnfc-name), value ()

Attribute (input.action), value (Start)

Attribute (input.action-identifiers.vf-module-id), value ()

Attribute (input.common-header.originator-id), value (appc)

Attribute (isBwcMode), value (false)

 

 

It looks like `input.payload`, which is a JSON, isn’t converted to SLI ctx. `vm-id` that is looked for

 

2019-05-16 14:00:45,820 | DEBUG | ppc-dispatcher-6 | ExecuteNodeExecutor              | 222 - org.onap.ccsdk.sli.core.sli-provider - 0.3.3 | Parameter org.onap.appc.instance.url = (atom<CONTEXT_VAR> (variable-term vm-id)) resolves to

 

 isn’t within the context at all. I tweaked the DG to run a jsonStringToCtx using `input.payload` and then it worked. I also had to change vm-id to the output of jsonStringToCtx.vm-id…

 

But if there is a recipe I missed, I’d love to hear about it.

 

Thanks,

Alexis

 

Join onap-discuss@lists.onap.org to automatically receive all group messages.