Skip to content
Snippets Groups Projects
Commit f7853de9 authored by Giacomo Strangolino's avatar Giacomo Strangolino
Browse files
parents 3c7452f6 c0801c75
No related branches found
No related tags found
No related merge requests found
...@@ -56,5 +56,91 @@ package is not installed system-wide ...@@ -56,5 +56,91 @@ package is not installed system-wide
### request syntax ### 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.
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment