This shows you the differences between two versions of the page.
— | wiki:old:gsoc_2010_oaradmin_api [2013/07/10 22:55] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | **Student and mentor ;), please read carefully this page...** | ||
+ | |||
+ | Student: **Jean-Pierre POUTCHEU** | ||
+ | |||
+ | Mentor: Bruno Bzeznik | ||
+ | |||
+ | Co-Mentor: Olivier Richard | ||
+ | |||
+ | ---- | ||
+ | |||
+ | ===== Student: Things to do before starting ===== | ||
+ | * < | ||
+ | * < | ||
+ | * < | ||
+ | |||
+ | ===== Project Specification ===== | ||
+ | * < | ||
+ | * Then, integrate oaradmin as discussed (resources creation, admin rules edition, config file edition, prologue/ | ||
+ | (add details here) | ||
+ | * Take a look at Mason+mod_perl to optimize the API | ||
+ | ==== Pagination specifications ==== | ||
+ | * List of current jobs | ||
+ | < | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | |||
+ | * with pagination options | ||
+ | < | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | |||
+ | * hasmap data structure | ||
+ | < | ||
+ | items ==> jobs results (hashmap if structure = oar, table if structure = simple) | ||
+ | page ==> current page number in the results list, used in the next and previous links generation | ||
+ | limit ==> limit value (this value overwrite the value defined in the OAR file config) | ||
+ | | ||
+ | | ||
+ | ' | ||
+ | |||
+ | * struct methods : | ||
+ | < | ||
+ | struct_job_list(jobs, | ||
+ | struct_job_list_details(jobs, | ||
+ | ' | ||
+ | |||
+ | ==== Pagination specifications (Bruno version) ==== | ||
+ | === Every data structure returned by the API should be wrapped into this hash table: === | ||
+ | * In the case a collection is returned (array or hash): | ||
+ | < | ||
+ | items ==> query results (hashmap if structure = oar, table if structure = simple) | ||
+ | limit ==> limit value (this value overwrite the value defined in the OAR file config) | ||
+ | | ||
+ | total ==> total number of items | ||
+ | links ==> array of hash describing useful links: href => <uri> , rel => < | ||
+ | We know that we have a next page if : | ||
+ | (# of items) + offset < total | ||
+ | or if there' | ||
+ | |||
+ | * In the case a simple element is returned: | ||
+ | < | ||
+ | | ||
+ | | ||
+ | ... | ||
+ | links ==> array of hash describing useful links: href => <uri> , rel => < | ||
+ | |||
+ | === Specific case of the jobs uri (as an example of an uri that needs pagination): | ||
+ | * Uri | ||
+ | < | ||
+ | GET / | ||
+ | * Input parameters: | ||
+ | < | ||
+ | FROM: From unix timestamp | ||
+ | TO: To unix timestamp | ||
+ | STATE: List of possible states (ex: Running, | ||
+ | ID: the first id to be listed. Jobs are listed from this id until LIMIT is reached | ||
+ | LIMIT: if more than LIMIT jobs satisfy the query, stop when this LIMIT is reach</ | ||
+ | |||
+ | === input/ | ||
+ | * GET / | ||
+ | < | ||
+ | | ||
+ | - api_timestamp: | ||
+ | id: 11 | ||
+ | name: ~ | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | - href: /jobs/11 | ||
+ | rel: self | ||
+ | - href: / | ||
+ | rel: resources | ||
+ | - api_timestamp: | ||
+ | id: 12 | ||
+ | name: ~ | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | - href: /jobs/12 | ||
+ | rel: self | ||
+ | - href: / | ||
+ | rel: resources | ||
+ | | ||
+ | | ||
+ | | ||
+ | - href: / | ||
+ | rel: self | ||
+ | # Optional: | ||
+ | - href: / | ||
+ | rel: next</ | ||
+ | |||
+ | * GET / | ||
+ | < | ||
+ | | ||
+ | - api_timestamp: | ||
+ | id: 13 | ||
+ | name: ~ | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | - api_timestamp: | ||
+ | | ||
+ | - href: /jobs/13 | ||
+ | rel: self | ||
+ | - href: / | ||
+ | rel: resources | ||
+ | id: 14 | ||
+ | name: ~ | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | - href: /jobs/14 | ||
+ | rel: self | ||
+ | - href: / | ||
+ | rel: resources | ||
+ | | ||
+ | | ||
+ | | ||
+ | - href: / | ||
+ | rel: self | ||
+ | # Optional: | ||
+ | - href: / | ||
+ | rel: next | ||
+ | - href: / | ||
+ | rel: prev</ | ||
+ | |||
+ | * GET / | ||
+ | < | ||
+ | | ||
+ | - api_timestamp: | ||
+ | id: 15 | ||
+ | name: ~ | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | - href: /jobs/15 | ||
+ | rel: self | ||
+ | - href: / | ||
+ | rel: resources | ||
+ | | ||
+ | | ||
+ | | ||
+ | - href: / | ||
+ | rel: self | ||
+ | # Optional: | ||
+ | - href: / | ||
+ | rel: prev</ | ||
+ | === Default uri parameters === | ||
+ | * In oar.conf: | ||
+ | < | ||
+ | # Maximum default number of items | ||
+ | | ||
+ | # Default parameters for the /jobs uri | ||
+ | # if a "& | ||
+ | | ||
+ | |||
+ | ==== Oaradmin api specifications ==== | ||
+ | === Admission rules === | ||
+ | ;< | ||
+ | >//list admissions rules// | ||
+ | |||
+ | ;< | ||
+ | >//list the admission rule # | ||
+ | < | ||
+ | id: 1 | ||
+ | rule: | | ||
+ | code line 1 | ||
+ | code line 2 | ||
+ | | ||
+ | | ||
+ | - href ====== | ||
+ | rel=current</ | ||
+ | |||
+ | ;< | ||
+ | >// | ||
+ | < | ||
+ | # | ||
+ | rule: | | ||
+ | code line 1 | ||
+ | code line 2 | ||
+ | | ||
+ | |||
+ | ;< | ||
+ | >// | ||
+ | < | ||
+ | # | ||
+ | | ||
+ | rule: | | ||
+ | code line 1 | ||
+ | code line 2 | ||
+ | | ||
+ | |||
+ | ;< | ||
+ | >// | ||
+ | |||
+ | ;< | ||
+ | >// | ||
+ | < | ||
+ | # | ||
+ | method: delete</ | ||
+ | >//erase an admission rule// | ||
+ | < | ||
+ | # | ||
+ | rule: | | ||
+ | code line 1 | ||
+ | code line 2 | ||
+ | | ||
+ | |||
+ | === Resources creation === | ||
+ | * POST / | ||
+ | < | ||
+ | # | ||
+ | < | ||
+ | resources: '/ | ||
+ | properties: | ||
+ | memnode: 1024 | ||
+ | cpufreq: ' | ||
+ | cputype: ' | ||
+ | | ||
+ | * RESULT | ||
+ | < | ||
+ | < | ||
+ | - hostname : node1 | ||
+ | | ||
+ | - memnode : 1024 | ||
+ | | ||
+ | | ||
+ | .... | ||
+ | .... </ | ||
+ | | ||
+ | - hostname : node1 | ||
+ | properties : | ||
+ | cpu: 1 | ||
+ | core: 1 | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | - hostname : node1 | ||
+ | properties : | ||
+ | cpu: 1 | ||
+ | core: 2 | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | ... | ||
+ | links : | ||
+ | - rel : create | ||
+ | | ||
+ | url : /resources | ||
+ | - rel : self | ||
+ | | ||
+ | url : / | ||
+ | |||
+ | === Configuration variables (oar.conf) === | ||
+ | ; < | ||
+ | > Get all the configuration variables | ||
+ | < | ||
+ | # | ||
+ | DB_TYPE: ' | ||
+ | DB_HOSTNAME: | ||
+ | DB_PORT: ' | ||
+ | ...</ | ||
+ | |||
+ | ; < | ||
+ | > Get a variable | ||
+ | < | ||
+ | # Example query: | ||
+ | GET / | ||
+ | # output: | ||
+ | DB_TYPE: ' | ||
+ | api_timestamp: | ||
+ | links: | ||
+ | - rel: set | ||
+ | | ||
+ | url: / | ||
+ | - rel: self | ||
+ | | ||
+ | url: / | ||
+ | |||
+ | ; < | ||
+ | > Set a variable | ||
+ | < | ||
+ | # example QUERY | ||
+ | POST / | ||
+ | # example POSTDATA | ||
+ | value: " | ||
+ | |||
+ | ; < | ||
+ | > Set all the configuration variables | ||
+ | < | ||
+ | # example QUERY | ||
+ | POST / | ||
+ | # example POSTDATA | ||
+ | DB_TYPE: ' | ||
+ | DB_HOSTNAME: | ||
+ | DB_PORT: ' | ||
+ | ...</ | ||
+ | Do we make checks??? Mandatory variables; types; syntax;? | ||
+ | |||
+ | ===== Main Milestones ===== | ||
+ | ===== Tips ===== | ||
+ | ===== TODO list ===== | ||
+ | ==== Mentor ==== | ||
+ | ==== Student ==== | ||
+ | * OAR Admin specification (URLs, input/ | ||
+ | |||
+ | ===== Links to look at ===== | ||
+ | * http:// | ||
+ | * https:// | ||