Aerospike HTTP Servlet Example

This is an example web page that uses AJAX to get and set keys in the Aerospike database. It communicates with the sample Aerospike tomcat servlet, which is assumed to be installed at http://localhost:8080/aerospike/client. The servlet provides a simple REST interface to the database.

The REST interface identifies keys by the namespace/set/keyname triple, so the URL http://localhost:8080/aerospike/client/test/myset/mykey refers to the key 'mykey' in the set 'myset' in the 'test' namespace. A GET operation on this URL will return all the bins in the key as well as the current generation of the key. A POST operation on this key will set the value of the key, and requires one or more 'value' parameters. If the namespace is set up to be multi-bin, the user should use the 'bin' parameter to specify the bin name. So, for instance, a POST the URL above with the data 'bin=mybin&value=value1&bin=mybin2&value=value2' will set the value of 'mybin' to 'value1' and the value of 'mybin2' to 'value2'

Parameters

Database Host   
Database Port   
Namespace   
Set   
Key   
Bins (comma delimited list)   
Values (comma delimited list)   
Generation (for CAS operations)   
Expiration   
Modification Type:    Std   ArithmeticAdd   Append   Prepend

  

Result: