Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: updated regions POST

...

APIStatus CodeResponse Body

Endpoint: http://locator:7070/management/experimental/regions

Method: POST

Headers: Authorization

Permission Required: DATA:MANAGE


Code Block
languageyml
titleSample Request
{
	"name": "regionA",
	"type": "REPLICATE"
}


Types supported by this Rest API is defined in RegionType:

Code Block
languagejava
titleRequest Body
public enum RegionType {
  PARTITION,
  PARTITION_REDUNDANT,
  PARTITION_PERSISTENT,
  PARTITION_REDUNDANT_PERSISTENT,
  PARTITION_OVERFLOW,
  PARTITION_REDUNDANT_OVERFLOW,
  PARTITION_PERSISTENT_OVERFLOW,
  PARTITION_REDUNDANT_PERSISTENT_OVERFLOW,
  PARTITION_HEAP_LRU,
  PARTITION_REDUNDANT_HEAP_LRU,

  PARTITION_PROXY,
  PARTITION_PROXY_REDUNDANT,

  REPLICATE,
  REPLICATE_PERSISTENT,
  REPLICATE_OVERFLOW,
  REPLICATE_PERSISTENT_OVERFLOW,
  REPLICATE_HEAP_LRU,

  REPLICATE_PROXY
}


200201


Code Block
languageyml
titleSuccess Response
{
	"memberStatuses": [{
		"memberName": "server-2",
		"success": true,
		"message": "Region successfully created."
	}, {
		"memberName": "server-3",
		"success": true,
		"message": "Region successfully created."
	}],
	"statusCode": "OK",
	"statusMessage": "Successfully updated config for group2cluster",
	"uri": "/management/experimental/regions/disJoint",
	"result": []
}


409


Code Block
languageyml
titleName conflict
{
   "memberStatusesstatusMessage" : { },
  "statusCode" : "ENTITY_EXISTS"Member(s) server-2 already has this element created.",
   "statusMessagestatusCode" : "cache element Foo already exists.",ENTITY_EXISTS"
}


400


Code Block
languageyml
titleError Response - missing required parameter
{
  "memberStatuses" : { },
  "statusCode" : "ILLEGAL_ARGUMENT",
  "statusMessage" : "Nameid ofcannot thebe regionnull has to be specified.or blank",
}


Code Block
languageyml
titleError Response - invalid parameter
{
  "memberStatusesstatusCode" : { }"ILLEGAL_ARGUMENT",
  "statusCodestatusMessage" : "ILLEGAL_ARGUMENT",
  "statusMessage" : "Region names may not begin with a double-underscore: __Foo__",
Region names may not begin with a double-underscore: __Foo",
}

Given an unknown input attribute, for example: foobar in: 

curl -d '{"name":"replicate2","type":"REPLICATE","foobar":"value"}' -H 'Content-Type: application/json' http://localhost:7070/management/experimental/regions

the output is:

{

   "statusCode" : "ILLEGAL_ARGUMENT",

   "statusMessage" : "JSON parse error: Unrecognized field \"foobar\" (class org.apache.geode.cache.configuration.RegionConfig), not marked as ignorable; nested exception is com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field \"foobar\" (class org.apache.geode.cache.configuration.RegionConfig), not marked as ignorable (9 known properties: \"indexes\", \"groups\", \"type\", \"regionAttributes\", \"customRegionElements\", \"regions\", \"entries\", \"name\", \"group\"])\n at [Source: (PushbackInputStream); line: 1, column: 59] (through reference chain: org.apache.geode.cache.configuration.RegionConfig[\"foobar\"])"

}


401


Code Block
languageyml
titleError Response - unauthenticated
{
  "memberStatuses" : { },
  "statusCode" : "UNAUTHENTICATED",
  "statusMessage" : "Authentication error. Please check your credentials",
}


403


Code Block
languageyml
titleError Response - not authorized
{
  "memberStatuses" : { },
  "statusCode" : "UNAUTHORIZED",
  "statusMessage" : "user not authorized for DATA:MANAGE",
}


500


Code Block
languageyml
titleError Response
{
  "memberStatuses" : { },
  "statusCode" : "ERROR",
  "statusMessage" : "cluster persistence service is not running",
}


...