Layer7 API Management

 View Only
  • 1.  set, get and delete cluster properties through assertion

    Posted May 27, 2020 01:56 AM
    I am looking for the assertion which will allow me to store the value in one policy and get the same value in another policy. This is needed because I am using policy backed IDP where in my policy fragment, call to REST api is returning a json with few params. I want to get those param values into the main policy where OTK user authentication  assertion is called. Since it is policy backed idp and I can not get rest response in the main policy.

    One thing I believe is storing and fetching values from cluster properties but I am not aware about the assertion which will allow me to create and delete the cluster property through policy flow. Please suggest.

    ------------------------------
    Technology Lead
    Infosys Limited
    ------------------------------


  • 2.  RE: set, get and delete cluster properties through assertion

    Broadcom Employee
    Posted May 27, 2020 10:16 AM
    Edited by Barry Stern May 27, 2020 10:18 AM
    I would not recommend use of cluster properties for this.

    If these policies are part of the same service request you can do this using the "Export Variables from Fragment" assertion.   you can then reference the exported variables as
    ${request.shared.<variableName>}

    another option is to store the information to cache and look it up from cache.





  • 3.  RE: set, get and delete cluster properties through assertion
    Best Answer

    Broadcom Employee
    Posted May 27, 2020 05:55 PM
    There is no way to store cluster wide properties from policy. One *could* call restman to do this, but I don't think that is the correct approach. If everything is in one Gateway then you can probably use the cache for this purpose. If this is across a cluster, then using the cache is no longer a viable option and you would need to leverage a database connection (plus the cache) to maintain state like this. Note that the values will likely need a clean-up call at some point to remove stale values from the database, unless they are always referenced using the same key that is continually overwritten.

    ------------------------------
    Jay MacDonald - Adoption Architect - Broadcom API Management (Layer 7)
    ------------------------------



  • 4.  RE: set, get and delete cluster properties through assertion

    Posted Jun 04, 2020 07:31 AM
    Edited by Philippe Brand Jun 04, 2020 07:34 AM
    We are using "Accumulate data in memory to buffer" assertion to achieve this.
    We have a global message policy "message-completed" that builds json data for metrics, store it into this buffer.
    Then we have a scheduled task which, every minute, extract data from this buffer (emptying it), and sends it to Splunk.
    It is then completly asynchronous, e.g. we can have multiple data injected into the buffer during this timeframe, and every minute parse all results.

    Otherwise, you cas request tacical "remote cache" assertion and use "Memcached" for example, to share among cluster.