[onap-discuss] 答复: Re:  Re: [SDC] Access sdc api failed.

2017-08-31 Thread yuan.hu1
Hi Michael,




I have some questions.

Q1: How is the value of'authorization'generated? Can it be fixed to 'Basic 
YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU='?

Q2: How do I download the Tosca CSAR package using rest API? May I access the 
API of 
'http://{sdc_be_ip}:8080/sdc/v1/catalog/resources/a7090bf8-b0f4-4925-9a68-f53000821fde/toscaModel'
 to download the Tosca CSAR package?





Thanks,


Yuan Hu







原始邮件



发件人: 
收件人:  傅锦华10108953
抄送人: 
日 期 :2017年09月01日 00:26
主 题 :Re: [onap-discuss] Re:  [SDC] Access sdc api failed.







Robert,


 


It seems your password is wrong. Try:


windriver yang$ curl -X GET http://sdc:8080/sdc/v1/catalog/resources -H 
"authorization: Basic 
YWFpOktwOGJKNFNYc3pNMFdYbGhhazNlSGxjc2UyZ0F3ODR2YW9HR21KdlV5MlU=" -H 
"x-ecomp-instanceid:AAI"


[{"uuid":"a7090bf8-b0f4-4925-9a68-f53000821fde","invariantUUID":"df44abc8-eb14-4f07-a6fa-3e42521a0a30","name":"ContrailPort","version":"2.0","toscaModelURL":"/sdc/v1/catalog/resources/a7090bf8-b0f4-4925-9a68-f53000821fde/toscaModel","category":"Generic","subCategory":"Network
  
Elements","resourceType":"CP","lifecycleState":"CERTIFIED","lastUpdaterUserId":"jh0003"},{"uuid":"438bde39-77bf-48b2-9298-df934786b2e6","invariantUUID":"3606a911-ae3f-472d-a113-8508df40d739","name":"NeutronPort","version":"2.0","toscaModelURL":"/sdc/v1/catalog/resources/438bde39-77bf-48b2-9298-df934786b2e6/toscaModel","category":"Generic","subCategory":"Network….


 


Thanks,


-Yang


 



From: onap-discuss-boun...@lists.onap.org 
[mailto:onap-discuss-boun...@lists.onap.org] On Behalf Of rene.rob...@orange.com
 Sent: Thursday, August 31, 2017 9:25 AM
 To: Lando,Michael fu.jin...@zte.com.cn
 Cc: onap-discuss@lists.onap.org
 Subject: Re: [onap-discuss]  Re: [SDC] Access sdc api failed.




 


Hi Michael,


 


Trying to test SDC “external” API, what’s wrong with that :


 


curl -X GET \


  http://{{server_ip}}:8080/sdc/v1/catalog/resources \


  -H 'authorization: Basic QUFJOkFBSQ==' \


  -H 'x-ecomp-instanceid: AAI'


 


It doesn’t work.


 


I am using existing default “aai” consumer.


 


I have some doubt about :


http versus https ?


port : 8080 ?


aai consumer


value for x-ecomp-instanceid


 


 


 





 


René Robert 
 ORANGE/IMT/OLN/CNC/NCA/SINA 


 


Fixe : +33 2 96 07 39 29 
 Mobile : +33 6 74 78 68 43 
 rene.rob...@orange.com


 


 


 


 


 


 



De : Lando,Michael [mailto:ml6...@intl.att.com] 
 Envoyé : mercredi 30 août 2017 21:33
 À : fu.jin...@zte.com.cn ROBERT René IMT/OLN
 Cc : onap-discuss@lists.onap.org
 Objet : RE: [onap-discuss]  Re: [SDC] Access sdc api failed.




 


Hi,


 


As described before SDC has two sets of API’s:


Internal:


 


Internal API’s use a header called user_id to check if the user is provisioned 
in the system and if his role allows him to execute  this API.


The internal API’s are provided to the SDC UI and should not be used by 
external components.


 


External:


 


This is a set of API’s provide to external component access to the SDC catalog 
this API’s are protected by basic authentication.


In order to use them you will first need to create a consumer in the system.


After one is created you will add the user and password to the request as a 
basic authentication header.


Please take a look here on how to generate the consumer and input him into the 
system: https://wiki.onap.org/display/DW/Consumer+creation


LINK to sdc external API’s:


https://wiki.onap.org/display/DW/SDC+API


 


Now in your case option 1 is missing the USER_ID header


And option two you did not create a consumer in the system.


 


Hope this helps


 


 


 


BR,


 


Michael Lando


Opensource & Frontend Team Lead, SDC


AT Network Application Development · NetCom  


Tel Aviv | Tampa | Atlanta | New Jersey |Chicago


···


Office: +972 (3) 5451487


Mobile: +972 (54) 7833603


e-mail: ml6...@intl.att.com


 


 


From: onap-discuss-boun...@lists.onap.org 
[mailto:onap-discuss-boun...@lists.onap.org] On Behalf Of fu.jin...@zte.com.cn
 Sent: Wednesday, August 30, 2017 6:17 AM
 To: rene.rob...@orange.com
 Cc: onap-discuss@lists.onap.org
 Subject: [onap-discuss]  Re: [SDC] Access sdc api failed.


 

Hi Rene,

Can you give me more details about the rest call for sdc catalog, such as 
Header info, Auth info(user), 

I just use GET 
http://10.74.148.219:8080/sdc2/rest/v1/catalog/resources/fc006225-1364-43f2-a905-3ef08f211ea0,
 but  got the following msg:

status=403,resp_body={

  "requestError": {

"serviceException": {

  "messageId": "SVC4002",

  "text": "Error: Missing information.",

  "variables": []

}

  }

}

Is there something need to be added to the request header?

And I have another question, I have downloaded the 
SDC_Catalog_External_API_AID_v1.1.0.docx from wikipage of sdc, In 

[onap-discuss] 答复: Re:  Re: [SDC] Access sdc api failed.

2017-08-31 Thread zhang.maopeng1
hi micheal




Thanks for your sharing. 

   

   In the wiki:https://wiki.onap.org/display/DW/Consumer+creation 

The following users are predefined:

appc

vid

dcae

aai

sdnc

mso




   could you add the vfc as the predefined in R1?

   Thanks




BR

Maopeng




原始邮件



发件人: 
收件人:傅锦华10108953 
抄送人: 
日 期 :2017年08月31日 03:34
主 题 :Re: [onap-discuss] Re:  [SDC] Access sdc api failed.







Hi,


 


As described before SDC has two sets of API’s:


Internal:


 


Internal API’s use a header called user_id to check if the user is provisioned 
in the system and if his role allows him to execute this  API.


The internal API’s are provided to the SDC UI and should not be used by 
external components.


 


External:


 


This is a set of API’s provide to external component access to the SDC catalog 
this API’s are protected by basic authentication.


In order to use them you will first need to create a consumer in the system.


After one is created you will add the user and password to the request as a 
basic authentication header.


Please take a look here on how to generate the consumer and input him into the 
system: https://wiki.onap.org/display/DW/Consumer+creation


LINK to sdc external API’s:


https://wiki.onap.org/display/DW/SDC+API


 


Now in your case option 1 is missing the USER_ID header


And option two you did not create a consumer in the system.


 


Hope this helps


 


 


 


BR,


 


Michael Lando


Opensource & Frontend Team Lead, SDC


AT Network Application Development · NetCom  


Tel Aviv | Tampa | Atlanta | New Jersey |Chicago


···


Office: +972 (3) 5451487


Mobile: +972 (54) 7833603


e-mail: ml6...@intl.att.com


 


 


From: onap-discuss-boun...@lists.onap.org 
[mailto:onap-discuss-boun...@lists.onap.org] On Behalf Of fu.jin...@zte.com.cn
 Sent: Wednesday, August 30, 2017 6:17 AM
 To: rene.rob...@orange.com
 Cc: onap-discuss@lists.onap.org
 Subject: [onap-discuss]  Re: [SDC] Access sdc api failed.


 

Hi Rene,

Can you give me more details about the rest call for sdc catalog, such as 
Header info, Auth info(user), 

I just use GET 
http://10.74.148.219:8080/sdc2/rest/v1/catalog/resources/fc006225-1364-43f2-a905-3ef08f211ea0,
 but  got the following msg:

status=403,resp_body={

  "requestError": {

"serviceException": {

  "messageId": "SVC4002",

  "text": "Error: Missing information.",

  "variables": []

}

  }

}

Is there something need to be added to the request header?

And I have another question, I have downloaded the 
SDC_Catalog_External_API_AID_v1.1.0.docx from wikipage of sdc, In the document,

I see the rest api for get list of resoures or services which is different from 
your sample, should I use your sample or ref the api document?

6.1.2 Request (GET)

https://{serverRoot}/sdc/v1/catalog/{assetType}

 

Thanks,

Jinhua

 



 


 


发件人: 



收件人:袁虎10090474 



抄送人: 



日 期 :2017年08月29日 20:26



主 题 :Re: [onap-discuss] [SDC] Access sdc api failed.




 


Hi,


 


Try that kind of uri to get a resource by its name :


 


GET {{your SDC server 
IP}}/8080/sdc2/rest/v1/catalog/resources/resourceName/vEPC/resourceVersion/1.1


 


Or this uri to get a resource by its unique id :


 


GET {{your SDC server 
IP}}/8080/sdc2/rest/v1/catalog/resources/b5c6cc2c-30c8-4212-8b42-75d2875e8f9f


 


I do not think that exist an uri to get all resources. Trying your uri, I have 
the same response than you.


 


Best regards.


 


 





 


René Robert 
 rene.rob...@orange.com


 


 


 


De : onap-discuss-boun...@lists.onap.org 
[mailto:onap-discuss-boun...@lists.onap.org] De la part de yuan@zte.com.cn
 Envoyé : mardi 29 août 2017 10:32
 À : ml6...@intl.att.com
 Cc : onap-discuss@lists.onap.org
 Objet : [onap-discuss] [SDC] Access sdc api failed.


 

Hi Michael,

 

I'm trying to get the existing resources of sdc used the SDC Catalog External 
API.

But its returns some error message.

Do you know the reason for the failure? And how to resolve this problem?

 

Request Url (GET):

http://{sdc_ip}:8080/sdc/v1/catalog/resources 

 

Login User Id:

cs0008 or gv0001

 

Request Body:

N/A

 

Response:

{

"requestError": {

"policyException": {

"messageId": "POL5003",

"text": "Error: Not authorized to use the API.",

"variables": []

}

}

}

 


Thanks,


Yuan Hu




_
  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