Hi Jimmy,

This is working. Thank You for the help. ☺

Regards,
Shubhada
From: FORSYTH, JAMES <[email protected]>
Sent: Tuesday, July 3, 2018 1:00 AM
To: Shubhada Ramkrishna Vaze <[email protected]>; 
[email protected]
Subject: Re: [onap-discuss] [aai] Trouble in creating service instance with 
some metadata

Hi, Shubhada,

When you do the PUT it should be unwrapped – the whole contents of the file 
should be:

{
                                "global-customer-id": "Demonstration",
                                "service-instance-id": 
"0aa1c4f0-5e0c-4888-9999-ab4fa3d22bf6",
                                "service-instance-name": 
"Techm_ServiceInstance_4",
                                "service-type": "vFW",
                                "metadata":{
                                   "metadatum": [
                                                   {

                                                                "metaname": " 
someName ",
                                                                "metaval": " 
someVal"
                                                   }
                                    ]

                   }
}

Thanks,
jimmy

From: Shubhada Ramkrishna Vaze 
<[email protected]<mailto:[email protected]>>
Date: Monday, July 2, 2018 at 5:14 AM
To: "FORSYTH, JAMES" <[email protected]<mailto:[email protected]>>, 
"[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Subject: RE: [onap-discuss] [aai] Trouble in creating service instance with 
some metadata

Hi Jimmy ,

Thanks, I was trying with wrong payload.
Now I tried creating new service instance with below payload. Service instance 
is created but when I try to get service instance details with depth query 
parameter, I am not getting metadata back.

The observation is if I create service instance, add metadata later and then 
try to get details, I get metadata back.

API Used:
PUT  
<AAI_IP>/aai/v11/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vFW
 /service-instances/service-instance/0aa1c4f0-5e0c-4888-9999-ab4fa3d22bf6
Body:
{
                "service-instance": [{
                                "global-customer-id": "Demonstration",
                                "service-instance-id": 
"0aa1c4f0-5e0c-4888-9999-ab4fa3d22bf6",
                                "service-instance-name": 
"Techm_ServiceInstance_4",
                                "service-type": "vFW",
                                "metadata":{
                                   "metadatum": [
                                                   {

                                                                "metaname": " 
someName ",
                                                                "metaval": " 
someVal"
                                                   }
                                    ]

                   }
                }]
}

GET 
<AAI_IP>/aai/v11/business/customers/customer/Demonstration/service-subscriptions/service-subscription/vFW
 
/service-instances/service-instance/0aa1c4f0-5e0c-4888-9999-ab4fa3d22bf6?depth=1
Response:
{
    "service-instance-id": "0aa1c4f0-5e0c-4888-9999-ab4fa3d22bf6",
    "resource-version": "1530516163518"
}


Thanks & Regards,
Shubhada
From: FORSYTH, JAMES <[email protected]<mailto:[email protected]>>
Sent: Friday, June 29, 2018 7:02 PM
To: Shubhada Ramkrishna Vaze 
<[email protected]<mailto:[email protected]>>; 
[email protected]<mailto:[email protected]>
Subject: Re: [onap-discuss] [aai] Trouble in creating service instance with 
some metadata

Hi, Shubhada,

Two things – 1) this is how the metadata block should look.


   "metadata": {

        "metadatum": [

            {

                "metaname": "example-metaname-val-23573",

                "metaval": "example-metaval-val-72274"

            }

        ]

    },

2) make sure you set the depth query parameter.  In this case, GET 
/business/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{service-instance-id}?depth=1

Depth=1 means give me the object at this level and its immediate descendants.

Thanks,
jimmy


From: <[email protected]<mailto:[email protected]>> on 
behalf of Shubhada 
<[email protected]<mailto:[email protected]>>
Date: Friday, June 29, 2018 at 3:05 AM
To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Subject: [onap-discuss] [aai] Trouble in creating service instance with some 
metadata

Hi,

We are trying to create a new service instance with some metadata by invoking 
AAI API. The instance gets created. But when we try to get service instance 
details, we are not getting metadata back.

Can anyone please suggest if anything is wrong in below PUT API ? Thanks in 
Advance.

API used: PUT 
/business/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{service-instance-id}
Body:
{
    "service-instance": [
        {
                                                
"global-customer-id":"TechM_Cust",
                                                "service-instance-id": 
"0aa1c4f0-5e0c-8888-8882-ab4fa3d22bf6",
                                                "service-instance-name": 
"Techm_vFW_ServiceInstance_2",
                                                "service-type":"vFW",
                                                "metadatum":{
                                                [
                                                                {
                                                                                
"metaname":"someName",
                                                                                
"metaval":"someValue"
                                                                }
                                                ]
                                                }
        }
    ]
}

GET 
/business/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}/service-instances/service-instance/{service-instance-id}


Regards,
Shubhada
============================================================================================================================
Disclaimer:  This message and the information contained herein is proprietary 
and confidential and subject to the Tech Mahindra policy statement, you may 
review the policy at 
http://www.techmahindra.com/Disclaimer.html<https://urldefense.proofpoint.com/v2/url?u=http-3A__www.techmahindra.com_Disclaimer.html&d=DwMFAg&c=LFYZ-o9_HUMeMTSQicvjIg&r=Oej6QUk5p2KdqNEWySpOHA&m=sNYUkBudvbshNAGI-Z2od2Ix3uFRxye2fbmdCrH1sZ0&s=R0HYLbREIYP-ztwUBDGi6wwyOWUpR6L9WxGVVTfBR78&e=>
 externally 
http://tim.techmahindra.com/tim/disclaimer.html<https://urldefense.proofpoint.com/v2/url?u=http-3A__tim.techmahindra.com_tim_disclaimer.html&d=DwMFAg&c=LFYZ-o9_HUMeMTSQicvjIg&r=Oej6QUk5p2KdqNEWySpOHA&m=sNYUkBudvbshNAGI-Z2od2Ix3uFRxye2fbmdCrH1sZ0&s=Lk5wga6lRUO41kQBt4nsGMSzfWyDSuFIW5Z60WqS1Hg&e=>
 internally within TechMahindra.
============================================================================================================================


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

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

Reply via email to