===== OAR 2 Perl REST API ===== ==== Jobs ==== * GET ''^/version\.*(yaml|json|html)*$'' * GET ''^/whoami\.*(yaml|json|html)*$'' * GET ''^/timezone\.*(yaml|json|html)*$'' * GET ''^/jobs(/details|/table)*\.*(yaml|json|html)*$'' * GET ''^/jobs/(\d+)(/details)*(\.yaml|\.json|\.html)*$'' * GET ''^/jobs/(\d+)/(resources|nodes)(\.yaml|\.json|\.html)*$'' * POST ''^/jobs/(array/|)(\d+)/(checkpoints|deletions|holds|rholds|resumptions|resubmissions)+/new(\.yaml|\.json|\.html)*$'' * POST ''^/jobs/(\d+)(\.yaml|\.json|\.html)*$'' * POSTDATA * method = delete | checkpoint | hold | resume * POST ''^/jobs/(\d+)/signals/(\d+)(\.yaml|\.json|\.html)*$'' * POST ''^/jobs\.*(yaml|json|html)*$'' * POSTDATA * resources * script_path * command * script * param_file * workdir * + any other option of oarsub * DELETE ''^/jobs/(\d+)(\.yaml|\.json|\.html)*$'' * GET ''^/jobs/(\d+)/stagein(.tar\.gz|.tgz)$'' * HEAD ''^/jobs/(\d+)/stagein(.tar\.gz|.tgz)$'' * POST ''^/jobs/(\d+)/stageout(.tar\.gz|.tgz)$'' * POST ''^/jobs/(\d+)/state(.*)$'' * POSTDATA * state = running | terminated | error ==== Resources ==== * GET ''^/resources(/full|/details|/[0-9]+)*\.*(yaml|json|html)*$'' * GET ''^/resources/nodes/([\w\.-]+?)(\.yaml|\.json|\.html)*$'' * GET ''^/resources(/[0-9]+)+/jobs(\.yaml|\.json|\.html)*$'' * GET ''^/resources/nodes/([-\.\w]+)/jobs(.*)$'' * GET ''^/resources/([A-za-z0-9]+)*/jobs\.*(yaml|json|html)*$'' * POST ''^/resources(\.yaml|\.json|\.html)*$'' * POSTDATA * HASH structure passed to IO::add_resources * POST ''{^/resources/(\d+)/state(\.yaml|\.json|\.html)*$'' * POSTDATA * state = job state * DELETE ''^/resources/([\w\.-]+?)(/\d)*(\.yaml|\.json|\.html)*$'' * POST ''^/resources/generate(\.yaml|\.json|\.html)*$'' * POSTDATA * properties * auto_offset ==== Accounting ==== * GET ''^/accounting(/[^\..]+)*\.*(yaml|json|html)*$'' ==== Admission rules ==== * GET ''^/admission_rules\.*(yaml|json|html)*$'' * GET ''^/admission_rules/(\d+)(\.yaml|\.json|\.html)*$'' * POST ''^/admission_rules(\.yaml|\.json|\.html)*$'' * POSTDATA * priority = int * enabled = YES | NO * rule = text * DELETE ''^/admission_rules/(\d+)(\.yaml|\.json|\.html)*$'' * POST ''^/admission_rules/(\d+)(\.yaml|\.json|\.html)*$'' * POSTDATA * method = delete ==== Configuration ==== * GET ''^/config\.*(yaml|json|html)*$'' * GET ''^/config/file\.*(yaml|json|html)*$'' * GET ''^/config/(\w+)\.*(yaml|json|html)*$'' * POST ''^/config/(\w+)\.*(yaml|json|html)*$'' * POSTDATA * value ==== Desktop computing ==== * GET ''^/desktop/agents(.*)$'' ==== Files ==== * GET ''^/media/ls/(.*)$'' * GET ''^/media/(.*)$'' * POST ''^/media/chmod/(.*)$'' * POSTDATA * mode * POST ''^/media/(.*)$'' * DELETE ''^/media/(.*)$'' ==== SQL queries ==== * GET ''^/select_all\.*(yaml|json|html)*$'' ==== Colmet ==== * GET ''^/colmet/job/(\d+)$'' ===== Howto write a REST API ===== * http://blog.mwaysolutions.com/2014/06/05/10-best-practices-for-better-restful-api/ * https://github.com/WhiteHouse/api-standards * http://blog.octo.com/en/design-a-rest-api/ * http://www.restapitutorial.com/resources.html * https://blog.philipphauer.de/restful-api-design-best-practices/ * https://stormpath.com/blog/fundamentals-rest-api-design * http://gaboesquivel.com/blog/2015/best-practices-for-designing-web-apis/ * https://geemus.gitbooks.io/http-api-design/content/en/index.html