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

Contents of /trunk/Src/web/eiffel-cloud/modules/es_cloud/webapi/es_cloud_root_webapi_handler.e

Parent Directory Parent Directory | Revision Log Revision Log


Revision 103675 - (show annotations)
Tue Nov 12 12:35:53 2019 UTC (2 months, 1 week ago) by jfiat
File size: 1491 byte(s)
Added webapi to access the plans.
1 note
2 description: "Summary description for {ES_CLOUD_ROOT_WEBAPI_HANDLER}."
3 date: "$Date$"
4 revision: "$Revision$"
5
6 class
7 ES_CLOUD_ROOT_WEBAPI_HANDLER
8
9 inherit
10 ES_CLOUD_WEBAPI_HANDLER
11 redefine
12 report_version_missing_error
13 end
14
15 create
16 make
17
18 feature -- Execution
19
20 execute (a_version: READABLE_STRING_GENERAL; req: WSF_REQUEST; res: WSF_RESPONSE)
21 -- Execute handler for `req' and respond in `res'.
22 local
23 rep: like new_response
24 l_user: ES_CLOUD_USER
25 do
26 rep := new_response (req, res)
27 if attached api.user as u then
28 create l_user.make (u)
29 add_cloud_user_links_to (a_version, l_user, rep)
30 rep.add_link ("es:account", Void, cloud_user_link (a_version, l_user))
31 rep.add_link ("es:installations", Void, cloud_user_installations_link (a_version, l_user))
32 add_user_links_to (u, rep)
33 else
34 rep.add_link ("es:account", Void, cloud_link (a_version) + "/account/")
35 end
36 rep.add_link ("es:plans", Void, cloud_plans_link (a_version))
37 rep.add_self (req.request_uri)
38 rep.execute
39 end
40
41 report_version_missing_error (req: WSF_REQUEST; res: WSF_RESPONSE)
42 local
43 r: like new_error_response
44 do
45 r := new_error_response ("Missing {version} parameter", req, res)
46 r.set_redirection (api.absolute_url (api.webapi_path ("/cloud/v1/"), Void))
47 r.execute
48 end
49
50 note
51 copyright: "2011-2017, Jocelyn Fiat, Javier Velilla, Eiffel Software and others"
52 license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"
53 end
54

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.23