So it seems SDNC is using REST plugin provided by CCSDK 
(org.onap.ccsdk.sli.plugins.restapicall.RestapiCallNode) but APPC is using its 
own REST plugin (org.onap.appc.adapter.rest.RestAdapter) not sure why?
BTW, as APPC is based on CCSDK, it’s plugins/adapters will be available to be 
used in APPC too, so you might try out using CCSDK’s RestapiCallNode if it 
serves your purpose and if there is no mandate to use RestAdapter in APPC for 
some reason which I am not aware of.

From: [email protected] [mailto:[email protected]]
Sent: 17 December 2018 20:54
To: [email protected]; Gaurav agrawal <[email protected]>
Subject: RE: [onap-discuss] [APPC] [CCSDK] RestAdapter plugin : howto handle 
response from a commonGet

Hello Gaurav

Thank you for for your time on my question

There is no org.openecomp.rest.agent.result.message.cpe_ids[1] in DG context 
memory
Only org.openecomp.rest.agent.result.message

It make me feel that this RestAdapter is not processing the response as a json 
structure to be send to context memory.

I am using APPC on a Beijing release. I will make a try on Casablanca later.


For information, the same kind of DG is working well on SDNC but the Rest 
plugin is not the same.

Rene


De : [email protected]<mailto:[email protected]> 
[mailto:[email protected]] De la part de Gaurav Agrawal
Envoyé : lundi 17 décembre 2018 14:12
À : [email protected]<mailto:[email protected]>; ROBERT 
René TGI/OLN
Objet : Re: [onap-discuss] [APPC] [CCSDK] RestAdapter plugin : howto handle 
response from a commonGet

Hi Rene,

Can you kindly check whether there is a parameter with name 
org.openecomp.rest.agent.result.message.cpe_ids[1] in DG context memory by 
directly setting its to response1 as ideally RestApiCallNode creates parameters 
for every node in a given input JSON.

In case the parameter exists then try setting the parameter using “.” operator 
to specifically mention recursive copy and creation of parameters in context 
memory.
Use
<parameter name='response.' 
value='`$org.openecomp.rest.agent.result.message.`'/>
Instead of:
<parameter name='response' value='`$org.openecomp.rest.agent.result.message`'/>

Thanks and Regards,
Gaurav

From: [email protected]<mailto:[email protected]> 
[mailto:[email protected]] On Behalf Of Rene Robert
Sent: 17 December 2018 16:26
To: [email protected]<mailto:[email protected]>
Subject: [onap-discuss] [APPC] [CCSDK] RestAdapter plugin : howto handle 
response from a commonGet

Hi,

Trying to use the RestAdapter plugin in a Directed Graph for APPC, I manage to 
launch a GET toward a Rest API.
I do not understand how to process the response in order to be able to complete 
that response with additional data before sending a PUT.

Here is my main piece of my Directed Graph definition (very simple):

<execute plugin='org.onap.appc.adapter.rest.RestAdapter' method='commonGet' >
    <parameter name='org.onap.appc.instance.URI' value="`$url`" />

I tried to add a “SET” node in the Directed Graph :

<set>
<parameter name='response' value='`$org.openecomp.rest.agent.result.message`'/>
<parameter name='response1' value='`$response.cpe_ids[1]`'/>


Then, once activated, I send a POST to run the Directed Graph.

curl -X POST \
  
http://appc.api.simpledemo.onap.org:30230/restconf/operations/SLI-API:execute-graph
 \
  -H 'accept: application/json' \
  -H 'authorization: Basic YWRtaW46YWRtaW4=' \
  -H 'cache-control: no-cache' \
  -H 'content-type: application/json' \
  -H 'x-fromappid: API client' \
  -H 'x-transactionid: 0a3f6713-ba96-4971-a6f8-c2da85a3176e' \
  -d '{
            "input": {
                        "mode": "sync",
                        "module-name": "TEST_API",
                        "rpc-name": "list_cpe",
                        "sli-parameter": [{
                                   "parameter-name": "TEST_API_url",
                                   "string-value": 
"http://172.20.10.232:5002/v1.0/cpe";
                        }]
            }
}'


The response is not what I expected: response1 is still empty.

{
    "output": {
        "response-code": "0",
        "ack-final-indicator": "Y",
        "context-memory-json": "{
\"response\": \"{\n  \"cpe_ids\": [\n    \"cpe1\",\n    \" cpe2\",\n    \" 
cpe3\",\n    \" cpe4\",\n    \" cpe5\",\n    \" cpe6\",\n    \" cpe7\"\n  
]\n}\n\"\" ,
\"error_code\": \"200\",
\"org.openecomp.rest.result.code\": \"200\",
\"org.openecomp.rest.agent.result.message\": \"{\n  \"cpe_ids\": [\n    
\"cpe1\",\n    \" cpe2\",\n    \" cpe3\",\n    \" cpe4\",\n    \" cpe5\",\n    
\" cpe6\",\n    \" cpe7\"\n  ]\n}\n\",
\"input.module-name\": \"TEST_API\",
\"SvcLogic.status\": \"success\",
\"message\": \"SUCCESS\",
\"error-message\": \"{\n  \"cpe_ids\": [\n   \"cpe1\",\n    \" cpe2\",\n    \" 
cpe3\",\n    \" cpe4\",\n    \" cpe5\",\n    \" cpe6\",\n    \" cpe7\"\n  
]\n}\n\",
\"response-code\": \"200\",\"org.openecomp.rest.agent.result.code\": \"200\",
\"TEST_API_url\": 
\"http://172.20.10.232:5002/v1.0/cpe\<http://172.20.10.232:5002/v1.0/cpe/>",
\"currentGraph\": \"SvcLogicGraph [module=TEST_API, rpc=list_cpe, mode=sync, 
version=1, md5sum=671c34d0a2de93d7de7a2dd141802207]\",
\"response1\": \"\",\"input.mode\": \"sync\",\"input.rpc-name\": \"list_cpe\"}",
        "response-message": "{\n  \"cpe1\",\n    \" cpe2\",\n    \" cpe3\",\n   
 \" cpe4\",\n    \" cpe5\",\n    \" cpe6\",\n    \" cpe7\"\n  ]\n}\n\""
    }
}




_________________________________________________________________________________________________________________________



Ce message et ses pieces jointes peuvent contenir des informations 
confidentielles ou privilegiees et ne doivent donc

pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce 
message par erreur, veuillez le signaler

a l'expediteur et le detruire ainsi que les pieces jointes. Les messages 
electroniques etant susceptibles d'alteration,

Orange decline toute responsabilite si ce message a ete altere, deforme ou 
falsifie. Merci.



This message and its attachments may contain confidential or privileged 
information that may be protected by law;

they should not be distributed, used or copied without authorisation.

If you have received this email in error, please notify the sender and delete 
this message and its attachments.

As emails may be altered, Orange is not liable for messages that have been 
modified, changed or falsified.

Thank you.


_________________________________________________________________________________________________________________________



Ce message et ses pieces jointes peuvent contenir des informations 
confidentielles ou privilegiees et ne doivent donc

pas etre diffuses, exploites ou copies sans autorisation. Si vous avez recu ce 
message par erreur, veuillez le signaler

a l'expediteur et le detruire ainsi que les pieces jointes. Les messages 
electroniques etant susceptibles d'alteration,

Orange decline toute responsabilite si ce message a ete altere, deforme ou 
falsifie. Merci.



This message and its attachments may contain confidential or privileged 
information that may be protected by law;

they should not be distributed, used or copied without authorisation.

If you have received this email in error, please notify the sender and delete 
this message and its attachments.

As emails may be altered, Orange is not liable for messages that have been 
modified, changed or falsified.

Thank you.

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#14559): https://lists.onap.org/g/onap-discuss/message/14559
Mute This Topic: https://lists.onap.org/mt/28780530/21656
Group Owner: [email protected]
Unsubscribe: https://lists.onap.org/g/onap-discuss/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to