Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
5HT committed Feb 5, 2024
1 parent 851fcf8 commit fd67ccb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions include/site.hrl
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
incidents = [] :: list(#incident{}),
maintenance = [] :: list(#maintenance{}),
state = open,
date = {2015,1,1},
terminationDate = {2015,1,1}
date = [],
terminationDate = []
}).

-endif.
6 changes: 3 additions & 3 deletions lib/up_rest.ex
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ defmodule UP.HTTP do
get "/subscription" do get3(conn,auth(conn),"subscription",[],"lst") end
get "/subscription/:id" do get3(conn,auth(conn),"subscription",id,"get") end
put "/subscription/:id" do put3(conn,auth(conn),"subscription",id,"put") end
get "/maintenanc" do get3(conn,auth(conn),"maintenanc",[],"lst") end
put "/maintenanc/:id" do put3(conn,auth(conn),"maintenanc",id,"put") end
get "/maintenanc/:id" do get3(conn,auth(conn),"maintenanc",id,"get") end
get "/maintenance" do get3(conn,auth(conn),"maintenance",[],"lst") end
put "/maintenance/:id" do put3(conn,auth(conn),"maintenance",id,"put") end
get "/maintenance/:id" do get3(conn,auth(conn),"maintenance",id,"get") end
get "/component" do get3(conn,auth(conn),"component",[],"lst") end
get "/component/:id" do get3(conn,auth(conn),"component",id,"get") end
put "/component/:id" do put3(conn,auth(conn),"component",id,"put") end
Expand Down
9 changes: 9 additions & 0 deletions suite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,12 @@ curl -H "Auth: secret" -X GET "http://localhost:5010/account"
curl -H "Auth: 01707135870515017000" -X PUT "http://localhost:5010/subscription/01707135870515049000" -d @priv/subscription.json ; echo
curl -H "Auth: 01707135870515017000" -X PUT "http://localhost:5010/subscription/01707135870515049000" -d @priv/subscription.json ; echo
curl -H "Auth: 01707135870515017000" -X GET "http://localhost:5010/subscription"
curl -H "Auth: 01707135870515017000" -X PUT "http://localhost:5010/site/01707135870515049000" -d @priv/site.json ; echo
curl -H "Auth: 01707135870515017000" -X PUT "http://localhost:5010/site/01707135870515049000" -d @priv/site.json ; echo
curl -H "Auth: 01707135870515017000" -X GET "http://localhost:5010/site"
curl -H "Auth: 01707135870515017000" -X PUT "http://localhost:5010/incident/01707135870515049000" -d @priv/incident.json ; echo
curl -H "Auth: 01707135870515017000" -X PUT "http://localhost:5010/incident/01707135870515049000" -d @priv/incident.json ; echo
curl -H "Auth: 01707135870515017000" -X GET "http://localhost:5010/incident"
curl -H "Auth: 01707135870515017000" -X PUT "http://localhost:5010/maintenance/01707135870515049000" -d @priv/maintenance.json ; echo
curl -H "Auth: 01707135870515017000" -X PUT "http://localhost:5010/maintenance/01707135870515049000" -d @priv/maintenance.json ; echo
curl -H "Auth: 01707135870515017000" -X GET "http://localhost:5010/maintenance"

0 comments on commit fd67ccb

Please sign in to comment.