Udo Kohlmeyer created GEODE-1077:
------------------------------------

             Summary: Change Function REST API so that all arguments can be 
passed into the REST function call as JSON document
                 Key: GEODE-1077
                 URL: https://issues.apache.org/jira/browse/GEODE-1077
             Project: Geode
          Issue Type: Improvement
          Components: rest (dev)
            Reporter: Udo Kohlmeyer


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>.

{code:xml}
       [
  {
    "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"
      }
    ]
  }
]
{code}

But we could then expand the filter component even further
{code:xml}
[
  {
    "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"
      }
    ]
  }
]
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to