Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-1077

Change Function REST API so that all arguments can be passed into the REST function call as JSON document

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • rest (dev)

    Description

      Currently the Function REST API requires that all arguments, except the function arguments, are specified on the URL. This will work for groups,regions and members but this does not scale for filters.
      As filter keys can be non-string based and could be in the thousands, this method will not work.
      I think that all Function params should be able be included in the JSON document that is sent to the function. This will allow the user to provide higher volumes of keys and non-String based keys.
      In order for this to work, the current JSON document needs to be "formalised" into a proper data object, which will lend itself to be better transformed from JSON to the relevant arguments. Currently the transformer is limited to String only.
      Where as groups,members and filters can all be String[]/List<String>.

             [
        {
          "onGroups":[
            "group1",
            "group2"
          ],
          "filter":[
            "key1",
            "key2"
          ],
          "onRegions":[
            "accounts",
            "orders"
          ],
          "arguments":[
            {
              "@type":"double",
              "@value":210
            },
            {
              "@type":"com.gemstone.gemfire.web.rest.domain.Item",
              "itemNo":"599",
              "description":"Part X Free on Bumper Offer",
              "quantity":"2",
              "unitprice":"5",
              "totalprice":"10.00"
            }
          ]
        }
      ]
      

      But we could then expand the filter component even further

      [
        {
          "filter":[
            {
              "@type":"com.gemstone.gemfire.domain.CustomKey",
              "itemNo":{
                "@type":"double",
                "@value":"112"
              },
              "department":"Sales"
            },
            {
              "@type":"com.gemstone.gemfire.domain.CustomKey",
              "itemNo":{
                "@type":"double",
                "@value":"334"
              },
              "department":"Sales"
            }
          ]
        }
      ]
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            ukohlmeyer Udo Kohlmeyer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: