Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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
}


201


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 configuration for cluster.",
	"uri": "/management/experimental/regions/regionA"
}


409


Code Block
languageyml
titleName conflict
{
   "statusMessage" : "RegionConfigRegion 'regionA' already exists on member(s) server-2.",
   "statusCode" : "ENTITY_EXISTS"
}


400


Code Block
languageyml
titleError Response - empty required parameter
{
  "statusCode" : "ILLEGAL_ARGUMENT",
  "statusMessage" : "RegionConfigRegion identifier is required.",
}


Code Block
languageyml
titleError Response - invalid parameter
{
  "statusCode" : "ILLEGAL_ARGUMENT",
  "statusMessage" : "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.RegionConfigRegion), not marked as ignorable; nested exception is com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field \"foobar\" (class org.apache.geode.cache.configuration.RegionConfigRegion), 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.RegionConfigRegion[\"foobar\"])"

}


401


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


403


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


500


Code Block
languageyml
titleError Response
{
  "statusCode" : "ERROR",
  "statusMessage" : "Cluster configuration service is not running.",
}


...

APIStatus CodeResponse Body

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

Method: GET

Headers: Authorization



200


Code Block
languagejs
themeEclipse
titleSuccess Response
{
	"statusCode": "OK",
	"result": [{
		"config": {
			"groups": ["group2"],
			"regionAttributes": {
				"dataPolicy": "PARTITION",
				"concurrencyChecksEnabled": true
			},
			"name": "Foo",
			"type": "PARTITION",
			"uri": "/management/experimental/regions/Foo"
		},
		"runtimeInfo": [{
			"entryCount": 0
		}]
	}]
}


401


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


403


Code Block
languageyml
titleError Response
{
  "statusCode" : "UNAUTHORIZED",
  "statusMessage" : "User not authorized for DATA:MANAGE.",
}


404


Code Block
languagejs
titleNot Found Response
{
     "statusCode": "ENTITY_NOT_FOUND",
     "statusMessage": "RegionConfigRegion 'Foo' does not exist."
}



Delete Region

APIStatus CodeResponse Body

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

Method: DELETE

Headers: Authorization



200


Code Block
languageyml
titleSuccess Response
{
	"memberStatuses": [{
		"memberName": "server-1",
		"success": true,
		"message": "Region successfully deleted."
	}, {
		"memberName": "server-3",
		"success": true,
		"message": "Region successfully deleted."
	}],
	"statusCode": "OK",
	"statusMessage": "Successfully removed configuration for [cluster]."
}


404


Code Block
languageyml
titleNot Found Response
{
     "statusCode":"ENTITY_NOT_FOUND",
     "statusMessage":"RegionConfigRegion 'Foo' does not exist."
}


401


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


403


Code Block
languageyml
titleError Response
{
  "statusCode" : "UNAUTHORIZED",
  "statusMessage" : "User not authorized for DATA:MANAGE.",
}


500


Code Block
languageyml
titleError Response
{
    "statusCode" : "ERROR",
    "statusMessage": "Failed to delete on all members."
}


...

APIStatus CodeResponse Body

Endpoint: http://locator:7070/management/experimental/members/server-1

Method: GET

Headers: Authorization

Permission Required: CLUSTER:READ

200


Code Block
languageyml
titleSuccess Response
{
	"statusCode": "OK",
	"result": {
        "config" : {
            "id" : "server-1",
            "uri" : "/management/experimental/members/server-1",
        },
		"runtimeInfo": [{
			"memberName": "server-1",
			"id": "10.10.10.10(locator-0:4317:locator)<ec><v0>:41001",
			"workingDirPath": "/Users/user/projects/geode/vm0",
			"logFilePath": "/Users/user/projects/geode/vm0",
			"statArchiveFilePath": "/Users/user/projects/geode/vm0",
			"locators": "10.10.10.10[64759]",
			"heapUsage": 209,
			"maxHeapSize": 480,
			"initHeapSize": 512,
			"cacheXmlFilePath": "/Users/user/projects/geode/vm0",
			"host": "10.10.10.10",
			"processId": 4317,
			"locatorPort": 64759,
			"httpServicePort": 22500,
			"httpServiceBindAddress": "localhost",
			"clientCount": 0,
			"cpuUsage": 0.0,
			"webSSL": false,
			"coordinator": true,
			"secured": false,
			"server": false,
            "status": "online"
		}]
	}
}


Endpoint: http://locator:7070/management/experimental/members/Non-Existent

Method: GET

Headers: Authorization

Permission Required: CLUSTER:READ

404


Code Block
languageyml
titleNot Found Response
{
   "statusCode" : "ENTITY_NOT_FOUND",
   "statusMessage" : "MemberConfigMember 'Non-Existent' does not exist."
}


...