/[eiffelstudio]/trunk/Src/web/eiffel-cloud/modules/es_cloud/webapi/es_cloud_module_webapi.e
ViewVC logotype

Annotation of /trunk/Src/web/eiffel-cloud/modules/es_cloud/webapi/es_cloud_module_webapi.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 103604 - (hide annotations)
Thu Oct 17 17:29:07 2019 UTC (4 months ago) by jfiat
File size: 2150 byte(s)
Updated cloud account solution.
- New support for concurrent sessions
- Various bug fixes
- Enable cloud account by default
1 jfiat 100805 note
2     description: "Summary description for {ES_CLOUD_MODULE}."
3     date: "$Date$"
4     revision: "$Revision$"
5    
6     class
7     ES_CLOUD_MODULE_WEBAPI
8    
9     inherit
10     CMS_MODULE_WEBAPI [ES_CLOUD_MODULE]
11     redefine
12     setup_hooks
13     end
14    
15     CMS_HOOK_WEBAPI_RESPONSE_ALTER
16    
17     CMS_HOOK_AUTO_REGISTER
18    
19     create
20     make
21    
22     feature {NONE} -- Router/administration
23    
24     setup_webapi_router (a_router: WSF_ROUTER; a_api: CMS_API)
25     -- <Precursor>
26     local
27     l_root: ES_CLOUD_ROOT_WEBAPI_HANDLER
28     l_account: ES_CLOUD_ACCOUNT_WEBAPI_HANDLER
29     do
30     if attached module.es_cloud_api as l_mod_api then
31     create l_root.make (l_mod_api)
32     a_router.handle ("/cloud", l_root, a_router.methods_get)
33     -- FIXME: switch earlier for version. Using WSF_ROUTING_HANDLER.
34     a_router.handle ("/cloud/{version}/", l_root, a_router.methods_get)
35     create l_account.make (l_mod_api)
36     a_router.handle ("/cloud/{version}/account/", l_account, a_router.methods_get)
37     a_router.handle ("/cloud/{version}/account/{uid}", l_account, a_router.methods_get)
38     a_router.handle ("/cloud/{version}/account/{uid}/installations", create {ES_CLOUD_INSTALLATIONS_WEBAPI_HANDLER}.make (l_mod_api), a_router.methods_get_post)
39     a_router.handle ("/cloud/{version}/account/{uid}/installations/{installation_id}", create {ES_CLOUD_INSTALLATIONS_WEBAPI_HANDLER}.make (l_mod_api), a_router.methods_get_put_delete)
40 jfiat 103604 a_router.handle ("/cloud/{version}/account/{uid}/installations/{installation_id}/session/{session_id}", create {ES_CLOUD_INSTALLATIONS_WEBAPI_HANDLER}.make (l_mod_api), a_router.methods_get)
41 jfiat 100805 end
42     end
43    
44     feature -- Hooks configuration
45    
46     setup_hooks (a_hooks: CMS_HOOK_CORE_MANAGER)
47     -- Module hooks configuration.
48     do
49     a_hooks.subscribe_to_webapi_response_alter_hook (Current)
50     end
51    
52     feature -- Hook
53    
54     webapi_response_alter (rep: WEBAPI_RESPONSE)
55     do
56     if
57     attached {HM_WEBAPI_RESPONSE} rep as hm and then
58     rep.is_root
59     then
60     hm.add_link ("es:cloud", Void, rep.api.webapi_path ("cloud"))
61     end
62     end
63    
64     note
65     copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
66     license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
67     end

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.23