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







原始邮件



发件人: <[email protected]>
收件人: <[email protected]> <[email protected]>傅锦华10108953
抄送人: <[email protected]>
日 期 :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: [email protected] 
[mailto:[email protected]] On Behalf Of [email protected]
 Sent: Thursday, August 31, 2017 9:25 AM
 To: Lando,Michael [email protected]
 Cc: [email protected]
 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 
 [email protected]


 


 


 


 


 


 



De : Lando,Michael [mailto:[email protected]] 
 Envoyé : mercredi 30 août 2017 21:33
 À : [email protected] ROBERT René IMT/OLN
 Cc : [email protected]
 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&T Network Application Development · NetCom  


Tel Aviv | Tampa | Atlanta | New Jersey |Chicago


···········································································


Office: +972 (3) 5451487


Mobile: +972 (54) 7833603


e-mail: [email protected]


 


 


From: [email protected] 
[mailto:[email protected]] On Behalf Of [email protected]
 Sent: Wednesday, August 30, 2017 6:17 AM
 To: [email protected]
 Cc: [email protected]
 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&passwd), 

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

 



 


 


发件人: <[email protected]>



收件人:袁虎10090474 <[email protected]>



抄送人: <[email protected]>



日 期 :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 
 [email protected]


 


 


 


De : [email protected] 
[mailto:[email protected]] De la part de [email protected]
 Envoyé : mardi 29 août 2017 10:32
 À : [email protected]
 Cc : [email protected]
 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 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.
_______________________________________________
onap-discuss mailing list
[email protected]
https://lists.onap.org/mailman/listinfo/onap-discuss

Reply via email to