Hi Tao,

I notice in this log, the body is different because it does not show the 
“xmlns” like before, but you did add the “in-maint” as suggested:

{
    "link-name": "gongjielinkss",
    "link-type": "cross-link",
    "operational-status": "up",
    "in-maint": "false",
    "relationship-list": [{
            "related-to": "p-interface",
            "related-link": 
"/aai/v14/network/pnfs/pnf/13f51197-4bf7-33a7-8e3b-e8129547ee9e/p-interfaces/p-interface/nodeId-13f51197-4bf7-33a7-8e3b-e8129547ee9e-ltpId-5d807c73-a6b9-3b3a-8e57-86ecaf11e0a5"
        }, {
            "related-to": "p-interface",
            "related-link": 
"/aai/v14/network/pnfs/pnf/pnfgong1/p-interfaces/p-interface/tpgong1"
        }, {
            "related-to": "ext-aai-network",
            "related-link": 
"/aai/v14/network/ext-aai-networks/ext-aai-network/cuolds1548812848236"
        }
    ]
}

Sorry I did not notice it before, but it looks like the “relationship-list” 
format is not quite right. The “relationship-list” field is a JSON object that 
contains a “relationship” field as a JSON array, which contains the JSON object 
references like this (the full detail when you GET the logical-link back again 
is more than the minimum you need to PUT in):

  "relationship-list": {
    "relationship": [
      {
        "related-to": "p-interface",
        "relationship-label": "tosca.relationships.network.LinksTo",
        "related-link": 
"/aai/v14/network/pnfs/pnf/10.10.10.10/p-interfaces/p-interface/nodeId-10.10.10.10-ltpId-45",
        "relationship-data": [
          {
            "relationship-key": "pnf.pnf-name",
            "relationship-value": "10.10.10.10"
          },
          {
            "relationship-key": "p-interface.interface-name",
            "relationship-value": "nodeId-10.10.10.10-ltpId-45"
          }
        ],
        "related-to-property": [
          {
            "property-key": "p-interface.prov-status"
          }
        ]
      },
      {
        "related-to": "p-interface",
        "relationship-label": "tosca.relationships.network.LinksTo",
        "related-link": 
"/aai/v14/network/pnfs/pnf/12.12.12.12/p-interfaces/p-interface/nodeId-12.12.12.12-ltpId-3",
        "relationship-data": [
          {
            "relationship-key": "pnf.pnf-name",
            "relationship-value": "12.12.12.12"
          },
          {
            "relationship-key": "p-interface.interface-name",
            "relationship-value": "nodeId-12.12.12.12-ltpId-3"
          }
        ],
        "related-to-property": [
          {
            "property-key": "p-interface.prov-status"
          }
        ]
      },
      {
        "related-to": "ext-aai-network",
        "relationship-label": "org.onap.relationships.inventory.BelongsTo",
        "related-link": "/aai/v14/network/ext-aai-networks/ext-aai-network/VDF",
        "relationship-data": [
          {
            "relationship-key": "ext-aai-network.aai-id",
            "relationship-value": "VDF"
          }
        ]
      }
    ]

For future debugging, it would help to:


-        Log the URL used in the REST API call to create the logical-link

-        Log more details from the “Bad Request” response body because it has 
more information that can help debug the problem. Even though you get the same 
response code, the body detail will be different.

To do manual testing, you can use the request body in curl or Postman to create 
the logical-link object in AAI, then it should show that the data is OK.
I would typically put the request body into a file like 
“data-logical-link.json” and then use a curl command like this:

curl --verbose --silent --insecure --user AAI:AAI --header 'Accept: 
application/json' --header 'X-TransactionId: testaai' --header 'Content-Type: 
application/json' --header 'X-FromAppId: AAI' --upload-file 
data-logical-link.json 
https://{{aaiHost}}:{{aaiPort}}/aai/v14/network/logical-links/logical-link/gongjielinkss

It should respond with something like this:

> Expect: 100-continue
>
< HTTP/1.1 100 Continue
} [676 bytes data]
* We are completely uploaded and fine
< HTTP/1.1 201 Created

This shows it is working OK, or it will show the Bad Request error otherwise.


Keong


From: shentao [mailto:[email protected]]
Sent: Wednesday, 30 January 2019 18:27
To: Keong Lim <[email protected]>
Cc: [email protected]; 'onap-discuss' <[email protected]>
Subject: 答复: Network Link Creation Error of Calling AAI

Hi Keong

I modified UUI source for calling AAI logical-link creation based on API docs.
But the same error has happened as attachment log file.
Do I need to check AAI log.

Best regards,
Tao



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

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

Reply via email to