Open APIs

 View Only
  • 1.  Resource Inventory Management (TMF369) : How to do filtering for indirect relationship

    TM Forum Member
    Posted Jun 22, 2022 06:49
    How to do filtering for indirect relationship
    example
    Network elements contains shelfs,shelfs contains cards,cards contains ports
    I want to filter ports specific to network element id.

    ------------------------------
    Arko Chakravarty
    VCT International
    ------------------------------


  • 2.  RE: Resource Inventory Management (TMF369) : How to do filtering for indirect relationship
    Best Answer

    TM Forum Member
    Posted Jun 23, 2022 05:54
    Arko,

    Where a Card contains Ports we may represent a Port as:

    {
       "id": "abcdef",
       "@type": "Port",
       "@baseType": "Resource",
       ...
       "resourceRelationship": [
          {
             "@type": "ResourceRelationship",
             "relationshipType": "contained",
             "resource": {
                "id": "uvwxyz"
                "@type": "ResourceRef",
                "@referredType": "Card",
                ...
             }
          }
       ]
    }​​

    In this case to query the resource inventory collection for Ports on a specific Card you could use:
    ​​​

    GET /resourceInventoryManagement/v4/resource?filter=resourceRelationship[?(@.resource.id='uvwxyz')]

    You could (also?) manage a "contains" relationship of the Card:

    {
       "id": "uvwxyz",
       "@type": "Card",
       "@baseType": "Resource",
       ...
       "resourceRelationship": [
          {
             "@type": "ResourceRelationship",
             "relationshipType": "contains",
             "resource": {
                "id": "abcdef"
                "@type": "ResourceRef",
                "@referredType": "Port",
                ...
             }
          },
          ...
       ]
    }​​


    If you want to get a partial representation of this Card containing just the related Ports:

    GET /resourceInventoryManagement/v4/resource/uvwxyz?fields=resourceRelationship[?(@.resource.@referredType='Port')]


    ------------------------------
    Vance Shipley
    SigScale
    ------------------------------



  • 3.  RE: Resource Inventory Management (TMF369) : How to do filtering for indirect relationship

    TM Forum Member
    Posted Jun 23, 2022 08:10
    Edited by Arko Chakravarty Jun 23, 2022 08:10
    Thank you for the response. But I want to know the query format to retrieve list of ports available under the network element within all the cards

    ------------------------------
    Arko Chakravarty
    VCT International
    ------------------------------



  • 4.  RE: Resource Inventory Management (TMF369) : How to do filtering for indirect relationship

    TM Forum Member
    Posted Jun 23, 2022 08:55
    Add the required relationships to the inventory and query them as I demonstarted.

    ------------------------------
    Vance Shipley
    SigScale
    ------------------------------