Open APIs

 View Only
  • 1.  Resource Inventory Management (TMF369) : How to filter according to resourceRelationship object

    TM Forum Member
    Posted Jun 20, 2022 06:14
    Hi 
    Can any one please tell me how to filter according to id present in resource relationship entity. Example I need to get all resource object which has  resourceRelationship.resource.@type="pole"

    "resourceRelationship": [{
    "relationshipType": "contains",
    "resource": {
    "id": "44",
    "href": "https://host:port/geographicSiteManagement/v4/",
    "@type":"pole"
    }

    }
    ],

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


  • 2.  RE: Resource Inventory Management (TMF369) : How to filter according to resourceRelationship object

    TM Forum Member
    Posted Jun 20, 2022 09:52
    Hi Arko
    I take it you are querying the Resource Inventory (TMF639) using GET with no ID.
    The query string would look something like this: ?resourceRelationship.resource.@type=pole
    But please check TMF630 (design guidelines) for exact syntax of the query string.

    P.S. in general we recommend that class names (type names) use camel case with initial capital letter, so Pole would be more appropriate than pole (this aligns with conventions in languages such as Java, C++, etc.).

    ------------------------------
    Jonathan Goldberg
    Amdocs Management Limited
    Any opinions and statements made by me on this forum are purely personal, and do not necessarily reflect the position of the TM Forum or my employer.
    ------------------------------



  • 3.  RE: Resource Inventory Management (TMF369) : How to filter according to resourceRelationship object

    TM Forum Member
    Posted Jun 21, 2022 05:49
    Edited by Vance Shipley Jun 21, 2022 05:51
    On Jun 20, 2022 06:13 @Arko Chakravarty wrote:
    > Can any one please tell me how to filter according to id present in resource relationship entity.

    TMF630 Part 6 JSON Path Extensions provides the necessary query syntax:

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

    Note that in a resourceRelationship object the resource attribute value type is ResourceRefOrValue which is to say that it is either an embedded Resource object or a ResourceRef object providing a reference to a Resource object.  In the former case your example (resource.@type="pole") would be correct however in the latter, more likely, case the @type attribute is ResourceRef (unless polymorphic) and what you really want is resource.@referredType="pole".

    Also @Jonathan Goldberg's advice on class names applies so in my canonical example above I used Pole).

    ​​

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



  • 4.  RE: Resource Inventory Management (TMF369) : How to filter according to resourceRelationship object

    TM Forum Member
    Posted Jun 22, 2022 06:46
    Can you please help me.
    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
    ------------------------------



  • 5.  RE: Resource Inventory Management (TMF369) : How to filter according to resourceRelationship object

    TM Forum Member
    Posted Jun 23, 2022 06:09
    I believe that @Vance Shipley has answered this question on your other post here.​

    ------------------------------
    Jonathan Goldberg
    Amdocs Management Limited
    Any opinions and statements made by me on this forum are purely personal, and do not necessarily reflect the position of the TM Forum or my employer.
    ------------------------------