How do I submit requests to the ContextStoreRest interface if access through external ReST client is blocked?

Last Updated : Jun 29, 2018 |

If customer's network blocks access for ReST clients, such as Postman (for Google Chrome) or the live API built in to ContextStoreRest itself (http://<IP_ADDRESS> /services/ContextStoreRest/), submit CURL requests from command line on a computer which has tunnel/proxy access to the environment.

Note:

When you submit the CURL requests from command line, Context Store does not display a status code. An error message or the data requested is displayed.

Create a context

Use the following command to create a context:

curl -H "Content-Type: application/json" -X POST -d '{"contextId":"DemoContext1","groupId":"demo","data":{"key1_name":"value1_data","key2_name":"value2_data","key3_name":"value3_data"}}' http://<IP_ADDRESS> /services/ContextStoreRest/cs/contexts/

For secured clusters, use the following command to create a context:

curl -H "Content-Type: application/json" -X POST -d '{"contextId":"DemoContext1","groupId":"demo","data":{"key1_name":"value1_data","key2_name":"value2_data","key3_name":"value3_data"}}' https:<IP_ADDRESS> /services/ContextStoreRest/cs/contexts/ -k

Retrieve a context

Use the following command to retrieve a context:

curl http://<IP_ADDRESS> /services/ContextStoreRest/cs/contexts/DemoContext1/

For secured clusters, use the following command to retrieve a context:

curl https://<IP_ADDRESS> /services/ContextStoreRest/cs/contexts/DemoContext1/ -k