diff options
author | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2013-08-14 13:50:56 +0200 |
---|---|---|
committer | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2014-05-07 02:58:48 +0200 |
commit | 592d37d72f85037ce41ea58f9f930e608ec338f8 (patch) | |
tree | 7616c258d8925e4f1b5bb739e81053ec717e1dee /config | |
parent | ce1773461b71a40afb406f4148b32aad11b52a57 (diff) | |
download | ecs2-592d37d72f85037ce41ea58f9f930e608ec338f8.tar.gz ecs2-592d37d72f85037ce41ea58f9f930e608ec338f8.zip |
New resource /sys/configs
Every participant could GET and POST to this resource.
A GET might show this:
curl ... -H 'Content-Type: application/json' \
-X GET https://ecs.host.com/sys/configs
{
"participant_events": "true",
"resource_events": {
"/campusconnect/glossaries": true,
"/campusconnect/course_urls": true,
"/campusconnect/course_members": true,
"/campusconnect/wikis": true,
"/campusconnect/directory_trees": true,
"/campusconnect/learningmodules": true,
"/campusconnect/groups": true,
"/campusconnect/categories": true,
"/campusconnect/courselinks": true,
"/campusconnect/organisation_units": true,
"/campusconnect/files": true,
"/campusconnect/terms": true,
"/campusconnect/courses": true,
"/sys/auths": false
},
"selfrouting": "false"
}
Only if participant_events and the appropriate resource_events are true,
you will get an event.
It's also possible to set the two attributes participant_events and
selfrouting. Just make a POST such as:
curl ... -H 'Content-Type: application/json' -X -X POST \
-d '{"participant_events":true}' https://ecs.host.com/sys/configs
or
curl ... -H 'Content-Type: application/json' -X -X POST \
-d '{"selfrouting":false}' https://ecs.host.com/sys/configs
or
curl ... -H 'Content-Type: application/json' -X -X POST \
-d '{"selfrouting":false, "participant_events":true}' \
https://ecs.host.com/sys/configs
As you see, just set the attribute you want to set and make a POST.
You don't have to provide a receiver header, because the receiver is
implicitely the ECS.
Diffstat (limited to 'config')
-rw-r--r-- | config/routes.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/config/routes.rb b/config/routes.rb index ff8114c..eeae969 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -32,6 +32,8 @@ ActionController::Routing::Routes.draw do |map| :only => [:index] map.resources :events, :path_prefix => '/sys', :name_prefix => 'sys_', :only => [:index], :collection => { :fifo => [:get, :post] } + map.resources :configs, :path_prefix => '/sys', :name_prefix => 'sys_', + :only => [:index, :create] begin Ressource.all.each do |r| |