The curl params are malformed a bit:
Instead of
-d data='{"options":["LOB-Testing"]}'
Use
-d '{"options":["LOB-Testing"]}'
Or
--data '{"options":["LOB-Testing"]}'
From: [email protected] <[email protected]> On Behalf Of
Vivekanandan Muthukrishnan
Sent: Friday, July 26, 2019 2:41 PM
To: FREEMAN, BRIAN D <[email protected]>
Cc: [email protected]
Subject: Re: [onap-discuss] [VID] Creating new Owning Entity/lineOfBusiness
failed
Hi Brain,
I guess the HTTP header USER_ID is not being respected by VID. Below are the
updated CURL commands with USER_ID=demo and the REST API calls were successful
with a large HTML response. I am attaching herewith are the CRUL command
response HTML files for your reference.
I still see that VID UI is not able to list the new Project OR Line of
Business. I guess, once the Platform (Aarna-Blr) got persisted.
Please refer the VID screenshot and relevant log snippets below.
VID Deploy screenshot (Default values populated by Robot init)
[image.png]
VID Deploy Screen REST API Network Call from Browser
Requested URI :
https://vid.api.simpledemo.onap.org:30200/vid/category_parameterfamilyName=PARAMETER_STANDARDIZATION&r=0.8929088280267902<https://urldefense.proofpoint.com/v2/url?u=https-3A__vid.api.simpledemo.onap.org-3A30200_vid_category-5FparameterfamilyName-3DPARAMETER-5FSTANDARDIZATION-26r-3D0.8929088280267902&d=DwMFaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=NJAEHfQoLAqU6Mfo-WCvDEGsbs3O9RNyC3XFKZ7W_Pw&m=zYopCKQM5r_4c4KIHMstBHYrQKxW0H6GAXPU_MT7MMA&s=WWoDJ-6cDkA8zYtiFWgawtVkL3GFXAlNB7r_h32N7TE&e=>
Response
{"categoryParameters":{"lineOfBusiness":[{"id":"LOB-Demonstration","name":"LOB-Demonstration"}],"owningEntity":[{"id":"19f9f76f-bea1-452b-a2c3-6b5f0a7bd250","name":"OE-Demonstration"}],"project":[{"id":"Project-Demonstration","name":"Project-Demonstration"}],"platform":[{"id":"Aarna-Blr","name":"Aarna-Blr"},{"id":"Platform-Demonstration","name":"Platform-Demonstration"}]}}
# VID Tomcat log snippets
10.42.21.254 - - [26/Jul/2019:11:19:30 +0000] "GET /vid/healthCheck HTTP/1.1"
200 76
10.42.119.130 - - [26/Jul/2019:11:19:42 +0000] "GET
/vid/category_parameter?familyName=PARAMETER_STANDARDIZATION&r=0.8929088280267902
HTTP/1.1" 302 -
10.42.21.254 - - [26/Jul/2019:11:19:45 +0000] "GET /vid/healthCheck HTTP/1.1"
200 76
10.42.21.254 - - [26/Jul/2019:11:20:00 +0000] "GET /vid/healthCheck HTTP/1.1"
200 76
10.42.119.130 - - [26/Jul/2019:11:20:00 +0000] "POST
/vid/maintenance/category_parameter/lineOfBusiness HTTP/1.1" 200 46205
10.42.21.254 - - [26/Jul/2019:11:20:15 +0000] "GET /vid/healthCheck HTTP/1.1"
200 76
10.42.21.254 - - [26/Jul/2019:11:21:15 +0000] "GET /vid/healthCheck HTTP/1.1"
200 76
10.42.119.130 - - [26/Jul/2019:11:21:22 +0000] "POST
/vid/maintenance/category_parameter/platform HTTP/1.1" 200 46199
10.42.21.254 - - [26/Jul/2019:11:21:30 +0000] "GET /vid/healthCheck HTTP/1.1"
200 76
10.42.119.130 - - [26/Jul/2019:11:21:31 +0000] "POST
/vid/maintenance/category_parameter/project HTTP/1.1" 200 46198
10.42.119.130 - - [26/Jul/2019:11:21:41 +0000] "POST
/vid/maintenance/category_parameter/owningEntity HTTP/1.1" 200 46203
# VID CURL commands
export VID_REST_SVC_IP=$(kubectl get svc -n onap | grep vid | grep -v 'vid-' |
awk '{print $3}')
export VID_REST_SVC_PORT=8080
curl -L -v -X POST
"http://${VID_REST_SVC_IP}:${VID_REST_SVC_PORT}/vid/maintenance/category_parameter/lineOfBusiness"<https://urldefense.proofpoint.com/v2/url?u=http-3A__-24-257BVID-5FREST-5FSVC-5FIP-257D-3A-24-257BVID-5FREST-5FSVC-5FPORT-257D_vid_maintenance_category-5Fparameter_lineOfBusiness-2522&d=DwQFaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=NJAEHfQoLAqU6Mfo-WCvDEGsbs3O9RNyC3XFKZ7W_Pw&m=zYopCKQM5r_4c4KIHMstBHYrQKxW0H6GAXPU_MT7MMA&s=NXlZ7TUjzg9RHuJ-5PCB-7pxl33DaLKlmphOUSg6p6Q&e=>
\
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "USER_ID: demo" \
-H "X-FromAppId: robot-ete" \
-H "X-TransactionId: robot-ete-071f77ea-1fc9-4a34-bfe5-dce2b67ac408" \
-u demo:Kp8bJ4SXszM0WX \
-d data='{"options":["LOB-Testing"]}' > VID-LOB.log
curl -v -X POST
"http://${VID_REST_SVC_IP}:${VID_REST_SVC_PORT}/vid/maintenance/category_parameter/platform"<https://urldefense.proofpoint.com/v2/url?u=http-3A__-24-257BVID-5FREST-5FSVC-5FIP-257D-3A-24-257BVID-5FREST-5FSVC-5FPORT-257D_vid_maintenance_category-5Fparameter_platform-2522&d=DwQFaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=NJAEHfQoLAqU6Mfo-WCvDEGsbs3O9RNyC3XFKZ7W_Pw&m=zYopCKQM5r_4c4KIHMstBHYrQKxW0H6GAXPU_MT7MMA&s=AgkNYEExs0AafyV_-aI3WHJgjxcJIfUPJFjpCzxv78s&e=>
\
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "USER_ID: demo" \
-H "X-FromAppId: robot-ete" \
-H "X-TransactionId: robot-ete-071f77ea-1fc9-4a34-bfe5-dce2b67ac408" \
-u demo:Kp8bJ4SXszM0WX \
-d data='{"options":["Platform-Testing"]}' > VID-PLATFORM.log
curl -v -X POST
"http://${VID_REST_SVC_IP}:${VID_REST_SVC_PORT}/vid/maintenance/category_parameter/project"<https://urldefense.proofpoint.com/v2/url?u=http-3A__-24-257BVID-5FREST-5FSVC-5FIP-257D-3A-24-257BVID-5FREST-5FSVC-5FPORT-257D_vid_maintenance_category-5Fparameter_project-2522&d=DwQFaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=NJAEHfQoLAqU6Mfo-WCvDEGsbs3O9RNyC3XFKZ7W_Pw&m=zYopCKQM5r_4c4KIHMstBHYrQKxW0H6GAXPU_MT7MMA&s=gfFLeaq69YgsQoNcYVIaIQXW_Swgiw9_OBebpEWh4xE&e=>
\
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "USER_ID: demo" \
-H "X-FromAppId: robot-ete" \
-H "X-TransactionId: robot-ete-071f77ea-1fc9-4a34-bfe5-dce2b67ac408" \
-u demo:Kp8bJ4SXszM0WX \
-d data='{"options":["Project-Testing"]}' > VID-PROJECT.log
curl -v -X POST
"http://${VID_REST_SVC_IP}:${VID_REST_SVC_PORT}/vid/maintenance/category_parameter/owningEntity"<https://urldefense.proofpoint.com/v2/url?u=http-3A__-24-257BVID-5FREST-5FSVC-5FIP-257D-3A-24-257BVID-5FREST-5FSVC-5FPORT-257D_vid_maintenance_category-5Fparameter_owningEntity-2522&d=DwQFaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=NJAEHfQoLAqU6Mfo-WCvDEGsbs3O9RNyC3XFKZ7W_Pw&m=zYopCKQM5r_4c4KIHMstBHYrQKxW0H6GAXPU_MT7MMA&s=yuzl9a3Kd21iJ3fvvres-VoSAD5iqRsmASP8L0ANvo4&e=>
\
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "USER_ID: demo" \
-H "X-FromAppId: robot-ete" \
-H "X-TransactionId: robot-ete-071f77ea-1fc9-4a34-bfe5-dce2b67ac408" \
-u demo:Kp8bJ4SXszM0WX \
-d data='{"options":["OE-Testing"]}' > VID-OWNINGENTITY.log
# CURL Command HTTP Response Headers
< HTTP/1.1 200 OK
< Server: Apache-Coyote/1.1
< X-ECOMP-RequestID-echo: 513725f3-d0a5-4fe0-85b7-6f03422c6aa4
< Set-Cookie: JSESSIONID=6086062D9F8ABD7C6FEE7CED15E33506; Path=/vid; HttpOnly
< Content-Type: text/html;charset=ISO-8859-1
< Content-Language: en
< Content-Length: 46205
< Date: Fri, 26 Jul 2019 11:20:00 GMT
On Thu, Jul 25, 2019 at 11:47 PM FREEMAN, BRIAN D
<[email protected]<mailto:[email protected]>> wrote:
Check you USER_ID – it doesnt match your basic auth.
What response did you get back ?
Brian
From: [email protected]<mailto:[email protected]>
<[email protected]<mailto:[email protected]>> On Behalf Of
Vivekanandan Muthukrishnan
Sent: Thursday, July 25, 2019 2:12 PM
To: [email protected]<mailto:[email protected]>
Subject: [onap-discuss] [VID] Creating new Owning Entity/lineOfBusiness failed
Hi VID team,
I am trying to create new lineOfBusiness, project, Owning Entity. I tried with
the below REST calls and it is not working.
The REST API gets HTML response, I am not sure whether am i missing something
in the below REST calls.
Kindly note that i can see the default ones created by Robot init script. Can
we not add more of these types into VID? Is there any alternate ways to get
these details into VID? Could someone help me to create the below new resources
would be great.
Code snippets
export VID_REST_SVC_IP=$(kubectl get svc -n onap | grep vid | grep -v 'vid-' |
awk '{print $3}')
export VID_REST_SVC_PORT=8080
curl -L -v -X POST
"http://${VID_REST_SVC_IP}:${VID_REST_SVC_PORT}/vid/maintenance/category_parameter/lineOfBusiness"<https://urldefense.proofpoint.com/v2/url?u=http-3A__-24-257BVID-5FREST-5FSVC-5FIP-257D-3A-24-257BVID-5FREST-5FSVC-5FPORT-257D_vid_maintenance_category-5Fparameter_lineOfBusiness-2522&d=DwQFaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=e3d1ehx3DI5AoMgDmi2Fzw&m=IBSCXujVgG59sG-iGlyi3c3SP9Avrd27DK3_7tzLgtM&s=Fas-AxydtRC8uU2gSNwLWkWeb9CNIQtIHKPi89CL9bA&e=>
\
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "USER_ID: bdemo" \
-H "X-FromAppId: robot-ete" \
-H "X-TransactionId: robot-ete-071f77ea-1fc9-4a34-bfe5-dce2b67ac408" \
-u demo:Kp8bJ4SXszM0WX \
-d data='{"options":["LOB-Testing"]}'
# Followed Robot logs to insert a platform
curl -v -X POST
"http://${VID_REST_SVC_IP}:${VID_REST_SVC_PORT}/vid/maintenance/category_parameter/platform"<https://urldefense.proofpoint.com/v2/url?u=http-3A__-24-257BVID-5FREST-5FSVC-5FIP-257D-3A-24-257BVID-5FREST-5FSVC-5FPORT-257D_vid_maintenance_category-5Fparameter_platform-2522&d=DwQFaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=e3d1ehx3DI5AoMgDmi2Fzw&m=IBSCXujVgG59sG-iGlyi3c3SP9Avrd27DK3_7tzLgtM&s=9i3ntVqDnT8BZhE_3nsxnG7mULpd9_eZH8Pq4nJkDWk&e=>
\
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "USER_ID: bdemo" \
-H "X-FromAppId: robot-ete" \
-H "X-TransactionId: robot-ete-071f77ea-1fc9-4a34-bfe5-dce2b67ac408" \
-u demo:Kp8bJ4SXszM0WX \
-d data='{"options":["Platform-Testing"]}'
curl -v -X POST
"http://${VID_REST_SVC_IP}:${VID_REST_SVC_PORT}/vid/maintenance/category_parameter/project"<https://urldefense.proofpoint.com/v2/url?u=http-3A__-24-257BVID-5FREST-5FSVC-5FIP-257D-3A-24-257BVID-5FREST-5FSVC-5FPORT-257D_vid_maintenance_category-5Fparameter_project-2522&d=DwQFaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=e3d1ehx3DI5AoMgDmi2Fzw&m=IBSCXujVgG59sG-iGlyi3c3SP9Avrd27DK3_7tzLgtM&s=WFa4TimBfZ5gZrtk_sY3oX9zgaxcIBkhH-XjOdagKB0&e=>
\
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "USER_ID: bdemo" \
-H "X-FromAppId: robot-ete" \
-H "X-TransactionId: robot-ete-071f77ea-1fc9-4a34-bfe5-dce2b67ac408" \
-u demo:Kp8bJ4SXszM0WX \
-d data='{"options":["Project-Testing"]}'
curl -v -X POST
"http://${VID_REST_SVC_IP}:${VID_REST_SVC_PORT}/vid/maintenance/category_parameter/owningEntity"<https://urldefense.proofpoint.com/v2/url?u=http-3A__-24-257BVID-5FREST-5FSVC-5FIP-257D-3A-24-257BVID-5FREST-5FSVC-5FPORT-257D_vid_maintenance_category-5Fparameter_owningEntity-2522&d=DwQFaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=e3d1ehx3DI5AoMgDmi2Fzw&m=IBSCXujVgG59sG-iGlyi3c3SP9Avrd27DK3_7tzLgtM&s=MvlINfZeV1apIrYz_QdOCSlvGl595MxDC8cGjimJrJU&e=>
\
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "USER_ID: demo" \
-H "X-FromAppId: robot-ete" \
-H "X-TransactionId: robot-ete-071f77ea-1fc9-4a34-bfe5-dce2b67ac408" \
-u demo:Kp8bJ4SXszM0WX \
-d data='{"options":["OE-Testing"]}'
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#18332): https://lists.onap.org/g/onap-discuss/message/18332
Mute This Topic: https://lists.onap.org/mt/32601626/21656
Group Owner: [email protected]
Unsubscribe: https://lists.onap.org/g/onap-discuss/unsub
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-