Hi Thiriloshini,

On Sat, Feb 16, 2019 at 09:53 AM, 
[email protected] wrote:
> I see that link-name is the only required field which should be in the form
> hostnameA_p-connection_nameA_hostnameZ+p_connection-nameZ. I do not see any
> attribute to specify the endpoint. Is the link established by breaking-down
> the link-name ?
> Can you please help me understand how links are established in AAI.

The "endpoints" are the in the relationship-list. After you have created your 2 
pnf objects, each with p-interface sub-object, remember the URL path of the 
p-interfaces so you can create the physical-link including the 
relationship-list to the p-interfaces like example below.

Note that the relationship does include more information which can be 
automatically filled in by the server using defaults from the EdgeRule 
configuration, for example the relationship-label only needs to be specified on 
create if there are multiple EdgeRules with different labels, otherwise the 
default EdgeRule will be used for that pair of object classes.

{
    "link-name": "physical-link-1",
    "speed-value": "some value 1",
    "speed-units": "some value 2",
    "circuit-id": "some value 3",
    "dual-mode": "some value 4",
    "management-option": "some value 5",
    "service-provider-name": "some value 6",
    "service-provider-bandwidth-up-value": "some value 7",
    "service-provider-bandwidth-up-units": "some value 8",
    "service-provider-bandwidth-down-value": "some value 9",
    "service-provider-bandwidth-down-units": "some value10",
    "resource-version": "",
    "relationship-list": {
      "relationship": [
      {
        "related-to": "p-interface",
        "related-link": 
"/aai/v14/network/pnfs/pnf/some-pnf-1/p-interfaces/p-interface/some-interface-1"
      },
      {
        "related-to": "p-interface",
        "related-link": 
"aai/v14/network/pnfs/pnf/some-pnf-2/p-interfaces/p-interface/some-interface-2"
      }
      ]
    }
}

> 2.      I would also like to understand a little on relationship.
> a.      If I have p-interfaces for PNF, I am assuming that deleting the pnf
> would delete the p-interfaces associated with it. Does it happen by default or
> should I specify the relation for it to happen ?

The EdgeRule for pnf-to-p-interface relationship specifies that when the pnf is 
deleted, the p-interface is also automatically deleted.
The p-interface can also be independently deleted without affecting the pnf 
that contains it.

> b.      For physical-links, I  understand that if a p-interface is deleted,
> the physical-link corresponding to those p-interface will be deleted only if
> we specify the relationship. Please correct me if am wrong.

The EdgeRule for p-interface-to-physical-link relationship specifies that when 
the p-interface is deleted, the physical-link is also automatically deleted.
The physical-link can also be independently deleted without affecting the 
p-interfaces that relate to it.

> Can you also please help me understand what goes inside a relationship-data
> (The key and value) and the use of it.
> 
> {
> "related-to" : "p-interface",
> "related-link" :
> "/network/pnfs/pnf/{pnf-name}/p-interfaces/p-interface/{interface-name}"
> "relationship-data": [
>                {
>                "relationship-key": <key>
>                "relationship-value": <value>
>                }
> ]
> 
> }


In the relationship-data, the relationship-key and relationship-value are used 
internally to query the object and identify it (the key is the name of the 
class and name of the unique key attribute). The equivalent value is already 
encoded into the relationship-link attribute, so it is optional to specify on 
create, but you can see it when you get the object back again, for example:

  "relationship-list": {
    "relationship": [
      {
        "related-to": "p-interface",
        "relationship-label": "tosca.relationships.network.LinksTo",
        "related-link": 
"/aai/v14/network/pnfs/pnf/some-pnf-1/p-interfaces/p-interface/some-interface-1",
        "relationship-data": [
          {
            "relationship-key": "pnf.pnf-name",
            "relationship-value": "some-pnf-1"
          },
          {
            "relationship-key": "p-interface.interface-name",
            "relationship-value": "some-interface-1"
          }
        ],
        "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/some-pnf-2/p-interfaces/p-interface/some-interface-2",
        "relationship-data": [
          {
            "relationship-key": "pnf.pnf-name",
            "relationship-value": "some-pnf-2"
          },
          {
            "relationship-key": "p-interface.interface-name",
            "relationship-value": "some-interface-2"
          }
        ],
        "related-to-property": [
          {
            "property-key": "p-interface.prov-status"
          }
        ]
      }
    ]
  }


Keong

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

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

Reply via email to