Confirmed users, Bureaucrats and Sysops emeriti
1,737
edits
mNo edit summary |
|||
| Line 1: | Line 1: | ||
* ''' | We'll be using the [http://bitbucket.org/jespern/django-piston/wiki/Documentation#piston-documentation django-piston] library as a foundation so requests correspond to what piston defines. | ||
* | |||
* | * ''GET'' == ''READ'' | ||
* ''' | * ''POST'' == ''CREATE'' | ||
* ''PUT'' == ''UPDATE'' | |||
* ''DELETE'' == ''REMOVE'' | |||
PUT and POST accept JSON and multipart JSON + Files (depending on the URL it's submitting to). All URLs should send ''Accept: application/json'' headers. | |||
* '''OPTIONS''' | * '''OPTIONS''' | ||
** | ** If we have the opportunity (and maybe piston already does this?) but every URL should return a list of what it can accept with OPTIONS. | ||
<span style="color:red">open questions are in red</span> | <span style="color:red">open questions are in red</span> | ||
| Line 26: | Line 25: | ||
<tr> | <tr> | ||
<td> </td> | <td> </td> | ||
<td>Creates a new add-on with provided data (json+files)</td> | |||
<td></td> | <td></td> | ||
<td> </td> | <td> </td> | ||
</tr> | </tr> | ||
| Line 41: | Line 40: | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td style="background-color: #beb">Display add-on details ([https://services.addons.mozilla.org/en-US/firefox/api/1.5/addon/1865 done])</td> | <td style="background-color: #beb">Display add-on details ([https://services.addons.mozilla.org/en-US/firefox/api/1.5/addon/1865 done])</td> | ||
<td>Update the add-on details</td> | |||
<td>(<span style="color:red">In theory we should replace everything about the add-on, but that's a scary thought.</span>)</td> | <td>(<span style="color:red">In theory we should replace everything about the add-on, but that's a scary thought.</span>)</td> | ||
<td>Remove the add-on. (<span style="color:red">also scary</span>)</td> | <td>Remove the add-on. (<span style="color:red">also scary</span>)</td> | ||
</tr> | </tr> | ||
| Line 104: | Line 103: | ||
<tr> | <tr> | ||
<td> </td> | <td> </td> | ||
<td>Creates a new version. 301s to version detail page.</td> | |||
<td> </td> | <td> </td> | ||
<td> </td> | <td> </td> | ||
</tr> | </tr> | ||
| Line 120: | Line 119: | ||
<tr> | <tr> | ||
<td>Returns version details</td> | <td>Returns version details</td> | ||
<td>Updates the version details+file</td> | |||
<td>Replaces the version details+file</td> | <td>Replaces the version details+file</td> | ||
<td>Removes the version</td> | <td>Removes the version</td> | ||
</tr> | </tr> | ||
| Line 146: | Line 145: | ||
<tr> | <tr> | ||
<td> </td> | <td> </td> | ||
<td>Returns an .xpi file from submitted data.</td> | |||
<td> </td> | <td> </td> | ||
<td> </td> | <td> </td> | ||
</tr> | </tr> | ||
| Line 162: | Line 161: | ||
<tr> | <tr> | ||
<td> </td> | <td> </td> | ||
<td>Validates the uploaded file and returns the results.</td> | |||
<td> </td> | <td> </td> | ||
<td> </td> | <td> </td> | ||
</tr> | </tr> | ||
</table> | </table> | ||
* <span style="color:red">TODO: Contributions stuff (backend isn't determined yet)</span> | * <span style="color:red">TODO: Contributions stuff (backend isn't determined yet)</span> | ||
* Acknowledge HATEOAS | * Acknowledge HATEOAS | ||
| Line 176: | Line 172: | ||
== Notes == | == Notes == | ||
==== Offline Processing ==== | ==== Offline Processing ==== | ||
We'll handle offline processing by exposing the queue via the API and UUIDs. An example is probably the best explanation: | |||
# POST /api/addons | # POST /api/addons | ||
| Line 189: | Line 185: | ||
* http://bitbucket.org/jespern/django-piston/wiki/Documentation#piston-documentation | * http://bitbucket.org/jespern/django-piston/wiki/Documentation#piston-documentation | ||
* http://github.com/fastsoft/djata#readme | * http://github.com/fastsoft/djata#readme | ||
* http://code.google.com/p/django-rest-interface/ | * http://code.google.com/p/django-rest-interface/ (too simple) | ||