Skip to content
This repository has been archived by the owner on Mar 24, 2022. It is now read-only.

Apache Geode REST API Spring Boot Micro-service written in Kotlin (supports Pivotal Cloud Cache (PCC) and Pivotal GemFire)

License

Notifications You must be signed in to change notification settings

vmware-archive/dataTx-geode-rest-kotlin-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DataTx Apache Geode Kotlin REST API

This is an Spring Boot based app written in Kotlin that provides the following Apache Geode features

  • POST region with region key and value to put data into a region
  • GET region name and key to read
  • Query against Apache Geode Regions

Latest Features

  • Uses pure PDX instances without dependencies on having Java Classes in CLASSPATH
  • Queries PDX (select * from /region) or Core Java datatypes (select field1, field2 from /region)
  • Supports region CRUD operations
  • Authentication endpoint with configurable username/password
  • Swagger test UI
  • Uses Spring Data Geode

Startup

When starting the application you must provide the ENVironment

  • spring_data_gemfire_pool_locators=host1[port],host2[port] (comma separated)
  • spring_security_user_name=Authentication user
  • spring_security_user_password=Authentication password
  • spring_data_gemfire_name =Client Name

Example

export spring_data_gemfire_pool_locators=localhost[10334]
export spring_security_user_name=admin
export spring_security_user_password=admin
export spring_data_gemfire_name=GEODE_REST_CLIENT

Secured Apache Geode Authentication

When connecting to a Apache Geode cluster with security enabled, set the following spring properties. Note that is can be different then the spring_security_user_name/spring_security_user_password properties.

spring.data.gemfire.security.username=...
spring.data.gemfire.security.password=...

REST Region Service

The URL http://root/region prefix exposes a REST interface to preform READ/WRITE operations on a Apache Geode region.

POST region

Put a key/value entry into a given region.

NOTE The value is expected to be a JSON string

Format

http://<root>/region/<regionName>/<key>

POST BODY
	<value>

Example

HTTP POST

http://host/region/Test/hello

RESPONSE

{ "name" : "world"}

GET region

Get a region value based on a given key

Format

http://<root>/region/<regionName>/<key>

Example

HTTP GET

http://localhost:8080/region/Test/hello

RESPONSE

{ "name" : "world"}

Query

Perform a Apache Geode http://host:port/query

  • Note the select assumes the results of PdxInstances

HTTP POST

http://localhost:8080/query

select * from /region 

Appending a number the limit the number of results returned.

http://host:port/query/limitNumber

HTTP POST

http://localhost:8080/query/10

select * from /region 

About

Apache Geode REST API Spring Boot Micro-service written in Kotlin (supports Pivotal Cloud Cache (PCC) and Pivotal GemFire)

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published