Difference between revisions of "PC² REST services"

From PC2wiki
Jump to: navigation, search
m (small markup fixes)
m (See also: rename cat)
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[CCS]] REST service were added to pc2 as a way to provide contest data.
+
On the [[Event Feed module]] REST service provide contest data.
  
 
[https://en.wikipedia.org/wiki/Representational_state_transfer REST] services are in version 9.3.2 and later versions of pc2.
 
[https://en.wikipedia.org/wiki/Representational_state_transfer REST] services are in version 9.3.2 and later versions of pc2.
Line 8: Line 8:
 
# Start Server  
 
# Start Server  
 
# Start Admin  
 
# Start Admin  
# Generate [[FEEDER]] Account
+
# [[Generate Accounts|Generate]] one [[FEEDER]] Account
 
# Start [[Event Feed module]]
 
# Start [[Event Feed module]]
 
## Login: <tt>feeder1</tt>
 
## Login: <tt>feeder1</tt>
Line 30: Line 30:
  
 
<tt>
 
<tt>
[{"id":39,"name":"team39","nationality":"null","affliliation":"null","group":"null"},{"id":38,"name":"team38","nationality":"null","affliliation":"null","group":"null"},{"id":37,"name":"team37","nationality":"null","affliliation":"null","group":"null"},{"id":36,"name":"team36","nationality":"null","affliliation":"null","group":"null"},{"id":35,"name":"team35","nationality":"null","affliliation":"null","group":"null"},{"id":34,"name":"team34","nationality":"null","affliliation":"null","group":"null"},{"id":33,"name":"team33","nationality":"null","affliliation":"null","group":"null"},{"id":32,"name":"team32","nationality":"null","affliliation":"null","group":"null"},{"id":31,"name":"team31","nationality":"null","affliliation":"null","group":"null"},{"id":30,"name":"team30","nationality":"null","affliliation":"null","group":"null"},{"id":9,"name":"Darren Takemoto/Gabe Thompson/Nickolus Clayton","nationality":"USA","affliliation":"Darren Takemoto/Gabe Thompson/Nickolus Clayton","group":"Open Division"},{"id":8,"name":"Isaac Lozano/Thierry Rutaganira/Kenny Ko","nationality":"USA","affliliation":"Isaac Lozano/Thierry Rutaganira/Kenny Ko","group":"Open Division"},{"id":7,"name":"Mathew Helmund/Sayd Mateen/Hasib Habibi","nationality":"USA","affliliation":"Mathew Helmund/Sayd Mateen/Hasib Habibi","group":"Open Division"},{"id":6,"name":"Connor Elison/Tom Solem/Oscar Solorzano","nationality":"USA","affliliation":"Connor Elison/Tom Solem/Oscar Solorzano","group":"Open Division"},{"id":5,"name":"Farhana Akter/Sharmaine Caoile/Katherine Amita","nationality":"USA","affliliation":"Farhana Akter/Sharmaine Caoile/Katherine Amita","group":"Open Division"},{"id":4,"name":"Kameryn Taylor/Mike Schmid/Samson Chua","nationality":"USA","affliliation":"Kameryn Taylor/Mike Schmid/Samson Chua","group":"Open Division"},{"id":3,"name":"Randy Scroggins/Alejandro Pena/Tyler Hamm","nationality":"USA","affliliation":"Randy Scroggins/Alejandro Pena/Tyler Hamm","group":"Open Division"},{"id":2,"name":"J Austin Dolve/Ezekiel Dohmen/Austin Purcell","nationality":"USA","affliliation":"J Austin Dolve/Ezekiel Dohmen/Austin Purcell","group":"Open Division"},{"id":29,"name":"team29","nationality":"null","affliliation":"null","group":"null"},{"id":1,"name":"Will Kinderman/Tiffany Wong/Justin Aquine","nationality":"USA","affliliation":"Will Kinderman/Tiffany Wong/Justin Aquine","group":"Open Division"},
+
[{"id":39,"name":"team39","nationality":"null","affliliation":"null","group":"null"},
 +
{"id":38,"name":"team38","nationality":"null","affliliation":"null","group":"null"},
 +
{"id":37,"name":"team37","nationality":"null","affliliation":"null","group":"null"},
 +
{"id":36,"name":"team36","nationality":"null","affliliation":"null","group":"null"},
 +
{"id":35,"name":"team35","nationality":"null","affliliation":"null","group":"null"},
 +
{"id":34,"name":"team34","nationality":"null","affliliation":"null","group":"null"},
 +
{"id":33,"name":"team33","nationality":"null","affliliation":"null","group":"null"},
 +
{"id":32,"name":"team32","nationality":"null","affliliation":"null","group":"null"},
 +
{"id":31,"name":"team31","nationality":"null","affliliation":"null","group":"null"},
 +
{"id":30,"name":"team30","nationality":"null","affliliation":"null","group":"null"},
 +
{"id":9,"name":"Team D","nationality":"USA","affliliation":"TeamX D","group":"Open Division"},
 +
{"id":8,"name":"Team I","nationality":"USA","affliliation":"TeamX I","group":"Open Division"},
 +
{"id":7,"name":"Team M","nationality":"USA","affliliation":"TeamX M","group":"Open Division"},
 +
{"id":6,"name":"Team C","nationality":"USA","affliliation":"TeamX C","group":"Open Division"},
 +
{"id":5,"name":"Team F","nationality":"USA","affliliation":"TeamX F","group":"Open Division"},
 +
{"id":4,"name":"Team K","nationality":"USA","affliliation":"TeamX K","group":"Open Division"},
 +
{"id":3,"name":"Team R","nationality":"USA","affliliation":"TeamX R","group":"Open Division"},
 +
{"id":2,"name":"Team J","nationality":"USA","affliliation":"TeamX J","group":"Open Division"},
 +
{"id":29,"name":"team29","nationality":"null","affliliation":"null","group":"null"},
 +
{"id":1,"name":"Team W","nationality":"USA","affliliation":"TeamX W","group":"Open Division"},
 
</tt>
 
</tt>
  
Line 68: Line 87:
 
=See Also=
 
=See Also=
  
[[Category:CCS|CCS]]
+
* [[Event Feed module]]
 +
 
 +
Draft CCS specs:
 +
* [https://clics.ecs.baylor.edu/index.php/Draft_2014_REST_interface_for_source_code_fetching  Draft 2014 REST interface for source code fetching]
 +
* [https://clics.ecs.baylor.edu/index.php/Draft_CCS_REST_interface  Draft CCS REST interface]
 +
 
 +
[[Category:CLICS]]
 
[[Category:REST|REST]]
 
[[Category:REST|REST]]
 
[[Category:Version 9.3]]
 
[[Category:Version 9.3]]
 
[[Category:Import and Export]]
 
[[Category:Import and Export]]

Latest revision as of 10:10, 3 December 2016

On the Event Feed module REST service provide contest data.

REST services are in version 9.3.2 and later versions of pc2.

Starting REST Services

Steps:

  1. Start Server
  2. Start Admin
  3. Generate one FEEDER Account
  4. Start Event Feed module
    1. Login: feeder1
    2. Password: feeder1
  5. Select Web Services tab
  6. Click Start button

The status title should change to "Web Server is running..."

REST Services

All REST services produce JSON output.

teams

Fetch data use this URL in a browser:

https://localhost:50443/teams


Sample output:

[{"id":39,"name":"team39","nationality":"null","affliliation":"null","group":"null"}, {"id":38,"name":"team38","nationality":"null","affliliation":"null","group":"null"}, {"id":37,"name":"team37","nationality":"null","affliliation":"null","group":"null"}, {"id":36,"name":"team36","nationality":"null","affliliation":"null","group":"null"}, {"id":35,"name":"team35","nationality":"null","affliliation":"null","group":"null"}, {"id":34,"name":"team34","nationality":"null","affliliation":"null","group":"null"}, {"id":33,"name":"team33","nationality":"null","affliliation":"null","group":"null"}, {"id":32,"name":"team32","nationality":"null","affliliation":"null","group":"null"}, {"id":31,"name":"team31","nationality":"null","affliliation":"null","group":"null"}, {"id":30,"name":"team30","nationality":"null","affliliation":"null","group":"null"}, {"id":9,"name":"Team D","nationality":"USA","affliliation":"TeamX D","group":"Open Division"}, {"id":8,"name":"Team I","nationality":"USA","affliliation":"TeamX I","group":"Open Division"}, {"id":7,"name":"Team M","nationality":"USA","affliliation":"TeamX M","group":"Open Division"}, {"id":6,"name":"Team C","nationality":"USA","affliliation":"TeamX C","group":"Open Division"}, {"id":5,"name":"Team F","nationality":"USA","affliliation":"TeamX F","group":"Open Division"}, {"id":4,"name":"Team K","nationality":"USA","affliliation":"TeamX K","group":"Open Division"}, {"id":3,"name":"Team R","nationality":"USA","affliliation":"TeamX R","group":"Open Division"}, {"id":2,"name":"Team J","nationality":"USA","affliliation":"TeamX J","group":"Open Division"}, {"id":29,"name":"team29","nationality":"null","affliliation":"null","group":"null"}, {"id":1,"name":"Team W","nationality":"USA","affliliation":"TeamX W","group":"Open Division"},

problems

Fetch data use this URL

https://localhost:50443/problems

Sample output:

[{"id":1,"label":"A","short_name":"A-tortoise","name":"The Tortoise and the Hare","rgb":"null","color":"fixme!"},{"id":2,"label":"B","short_name":"B-buoys","name":"Space Buoys","rgb":"null","color":"fixme!"},{"id":3,"label":"C","short_name":"C-friends","name":"Friends","rgb":"null","color":"fixme!"},{"id":4,"label":"D","short_name":"D-glumpsort","name":"Glump Sort","rgb":"null","color":"fixme!"},{"id":5,"label":"E","short_name":"E-flag","name":"Make a Flag","rgb":"null","color":"fixme!"},{"id":6,"label":"F","short_name":"F-flattener","name":"The Flattener","rgb":"null","color":"fixme!"},{"id":7,"label":"G","short_name":"G-mountain","name":"Mountain Climbing","rgb":"null","color":"fixme!"}]

languages

Fetch data use this URL

https://localhost:50443/languages

Sample output

[{"id":1,"name":"Java"},{"id":2,"name":"C++"},{"id":3,"name":"C"},{"id":4,"name":"Python"},{"id":5,"name":"Python 3"}]

scoreboard

Fetch data use this URL

https://localhost:50443/scoreboard

Sample output

[{"rank":1,"team":9,"score":{"num_solved":5,"total_time":665},"problems":[{"label":"A","num_judged":2,"num_pending":0,"solved":true,"time":18,"first_to_solve":true},{"label":"B","num_judged":1,"num_pending":0,"solved":true,"time":125,"first_to_solve":false},{"label":"C","num_judged":1,"num_pending":0,"solved":true,"time":100,"first_to_solve":true},{"label":"D","num_judged":1,"num_pending":0,"solved":true,"time":167,"first_to_solve":false},{"label":"E","num_judged":0,"num_pending":0,"solved":false},{"label":"F","num_judged":2,"num_pending":0,"solved":true,"time":235,"first_to_solve":false},{"label":"G","num_judged":0,"num_pending":0,"solved":false}]},{"rank":2,"team":16,"score":{"num_solved":5,"total_time":832},"problems":[{"label":"A","num_judged":2,"num_pending":0,"solved":true,"time":19,"first_to_solve":false},{"label":"B","num_judged":3,"num_pending":0,"solved":true,"time":105,"first_to_solve":false},{"label":"C","num_judged":3,"num_pending":0,"solved":true,"time":197,"first_to_solve":false},{"label":"D","num_judged":1,"num_pending":0,"solved":true,"time":223,"first_to_solve":false},{"label":"E","num_judged":0,"num_pending":0,"solved":false},{"label":"F","num_judged":1,"num_pending":0,"solved":true,"time":188,"first_to_solve":false},{"label":"G","num_judged":0,"num_pending":0,"solved":false}]},{"rank":3,"team":8,"score":{"num_solved":4,"total_time":485},"problems":[{"label":"A","num_judged":1,"num_pending":0,"solved":true,"time":21,"first_to_solve":false},{"label":"B","num_judged":2,"num_pending":0,"solved":true,"time":35,"first_to_solve":true},{"label":"C","num_judged":0,"num_pending":0,"solved":false},{"label":"D","num_judged":0,"num_pending":0,"solved":false},{"label":"E","num_judged":2,"num_pending":0,"solved":true,"time":186,"first_to_solve":true},{"label":"F","num_judged":3,"num_pending":0,"solved":true,"time":183,"first_to_solve":true},{"label":"G","num_judged":0,"num_pending":0,"solved":false}]},{"rank":4,"team":4,"score":{"num_solved":4,"total_time":519},"problems":[{"label":"A","num_judged":1,"num_pending":0,"solved":true,"time":29,"first_to_solve":false}]

See Also

Draft CCS specs: