From c0801c75bdf6d86e6ee489e75be6bf5553ee4c1b Mon Sep 17 00:00:00 2001 From: Giacomo Strangolino <giacomo.strangolino@elettra.eu> Date: Thu, 27 Jan 2022 16:08:07 +0000 Subject: [PATCH] Update README.md --- README.md | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 87 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8b6a492..4b13220 100644 --- a/README.md +++ b/README.md @@ -56,5 +56,91 @@ package is not installed system-wide ### request syntax -> curl -v http://woody.elettra.eu:9296 -d $'{"srcs":[{"src":"test/device/1/double_scalar"}]}' +#### Subscribe to the attribute configuration change event and cache the configuration + +Source *test/device/1/double_scalar* + +> curl http://woody.elettra.eu:9296 -d $'{"srcs":[{"src":"test/device/1/double_scalar"}]}' + +Three sources: + +> curl -v http://taeyang.elettra.eu:9296 -d $'{"srcs":[{"src":"test/device/1/double_scalar"},{"src":"test/device/1/long_scalar"},{"src":"test/device/1/short_scalar"}]}' + +The first source will be processed immediately, the others according to the + +``` +ca-tango-db-cache-mgr:subscribe-rate +``` + +option in the configuration file (subscribe rate per second: default: two subscriptions per second) + +##### Expected reply + +```json +{"msg":"ok","pos":0,"queue-cnt":3,"scheduled-cnt":3} +``` + +#### List the subscribed sources (method: "l") + +> curl -v http://taeyang.elettra.eu:9296 -d $'{"method":"l"}' + +##### Expected reply + +```json +{"srcs":[{"src":"test/device/1/double_scalar"},{"src":"test/device/1/long_scalar"},{"src":"test/device/1/short_scalar"}]} +``` + +#### Process immediately all the queued sources (method "p") + +If you want to subscribe immediately all the sources in the queue regardless the maximum rate per second +specified in the configuration: + +> curl http://taeyang.elettra.eu:9296 -d $'{"method":"p"}' + +##### Expected reply + +```json +{ + "count": 2, + "srcs": [ + { + "msg": "ok", + "src": "test/device/1/long_scalar" + }, + { + "msg": "ok", + "src": "test/device/1/short_scalar" + } + ] +} + +``` + +#### Unsubscribe a set of sources (method: "u") + +Unsubscribe *double_scalar* and *long_scalar* from *test/device/1*: + +> curl -v http://taeyang.elettra.eu:9296 -d $'{"method":"u", "srcs":[{"src":"test/device/1/double_scalar"},{"src":"test/device/1/long_scalar"}]}' + +#### Expected reply + +If the two sources were being monitored: + +```json +{"count":2,"method":"u","removed":2,"srcs":[{"msg":"ok","src":"test/device/1/double_scalar"},{"msg":"ok","src":"test/device/1/long_scalar"}]} +``` + +In case of error (let's remove the two sources above twice): + +```json +{"count":2,"method":"u","removed":0,"srcs":[{"msg":"attribute double_scalar not found (devicetest/device/1)","src":"test/device/1/double_scalar"},{"msg":"attribute long_scalar not found (devicetest/device/1)","src":"test/device/1/long_scalar"}]} +``` + +#### Read the saved configuration for a set of sources (method:"r") + +This method can be useful to measure the time it takes to retrieve the configuration from the cache. +It can be compared with the time taken to query the Tango Database directly to get the same piece of +information. + + -- GitLab