Orion RESTful git API

507 views

Published on

Presented @ Eclipse Demo Camp 2011 in Krakow

Published in: Business, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
507
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Orion RESTful git API

  1. 1. Orion: RESTful git APITomasz ŻarnaEclipse PlatformWorkspace/Orion, IBM
  2. 2. Orion: RESTful git API | Copyright © IBM Corp., 2011. All rights reserved. Source code in this presentation is made available underthe EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.RESTREST explained in 5 steps:● Give every "thing" an ID● Link "things" to each other● Use standard methods● Allow multiple representations● Communicate statelessly
  3. 3. Orion: RESTful git API | Copyright © IBM Corp., 2011. All rights reserved. Source code in this presentation is made available underthe EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.REST (cntd)Advantages● universal support (programming languages, OSes, servers)● proven scalability i.e. Wide Wide Web● real machine-2-machine integration● support for XML and other formatsSome HTTP features:● standardized verbs and response codes● content negotiation● redirection● caching● compression
  4. 4. Orion: RESTful git API | Copyright © IBM Corp., 2011. All rights reserved. Source code in this presentation is made available underthe EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Server● Jetty 6.1.x / javax.servlet 2.5● org.eclipse.equinox.http.registry.servlets / OSGi HttpService○ class○ alias
  5. 5. Orion: RESTful git API | Copyright © IBM Corp., 2011. All rights reserved. Source code in this presentation is made available underthe EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.REST API: GETGET /gitapi/commit/master/file/a/?page=1HTTP/1.1 200 OK{"Children" : [{"AuthorName" : "Tomasz Zarna","Children" : [{ }],"ContentLocation" : "/gitapi/commit/6d34f45b/file/a/?parts=body","Message" : "Fix for bug 345325","Location" : "/gitapi/commit/6d34f45b/file/a/","Time" : 1304073355000,"DiffLocation" : "/gitapi/diff/6d34f45b/file/a/",},{ ... }}
  6. 6. Orion: RESTful git API | Copyright © IBM Corp., 2011. All rights reserved. Source code in this presentation is made available underthe EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.REST API: POSTPOST /gitapi/clone/{"GitUrl" : "git://github.com/eclipse/orion.server.git","Path" : "/file/a/"}HTTP/1.1 201 CREATED{"Id" : "IOOD6ph8ABASBcDqmXX87w","Location" : "/task/id/IOOD6ph8ABASBcDqmXX87w","Message" : "Cloning git://github.com/eclipse/orion.server.git...","PercentComplete" : 0,"Running" : true}GET {Location}
  7. 7. Orion: RESTful git API | Copyright © IBM Corp., 2011. All rights reserved. Source code in this presentation is made available underthe EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.REST API: PUTPUT /gitapi/commit/6d34f45b/file/a/{"TagName" : "v20110611"}HTTP/1.1 200 OK{"AuthorName" : "Tomasz Zarna","Children" : [{ "v20110523", "v20110611"}],"ContentLocation" : "/gitapi/commit/6d34f45b/file/a/?parts=body","Message" : "Fix for bug 345325","Location" : "/gitapi/commit/6d34f45b/file/a/","Time" : 1304073355000,"DiffLocation" : "/gitapi/diff/6d34f45b/file/a/"}
  8. 8. Orion: RESTful git API | Copyright © IBM Corp., 2011. All rights reserved. Source code in this presentation is made available underthe EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.REST API: DELETEDELETE /gitapi/remote/{remoteName}/file/{id}HTTP/1.1 200 OK
  9. 9. Orion: RESTful git API | Copyright © IBM Corp., 2011. All rights reserved. Source code in this presentation is made available underthe EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.git commandsgit-add git-commit git-mv git-show pack-pack-refs git-count-objectgit-am git-describe git-notes git-stash git-prune git-difftoolgit-archive git-diff git-pull git-status git-reflog git-fsckgit-bisect git-fetch git-push git-submodule git-relink git-get-tar-commit-idgit-branch git-format-patch git-rebase git-tag git-remote git-helpgit-bundle git-gc git-reset git-config git-repack git-merge-treegit-checkout git-grep git-rebase git-fast-export git-replace git-rereregit-cherry-pick git-init git-revert git-fast-import git-annotate git-rev-parsegit-clean git-log git-rm gt-filter-branch git-blame git-verify-taggit-clone git-merge git-shortlog git-mergetool git-cherry git-whatchanged
  10. 10. Orion: RESTful git API | Copyright © IBM Corp., 2011. All rights reserved. Source code in this presentation is made available underthe EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Testing● JUnit + HttpUnit● EclEmma coverage 84%
  11. 11. Orion: RESTful git API | Copyright © IBM Corp., 2011. All rights reserved. Source code in this presentation is made available underthe EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Testing● JUnit + HttpUnit● EclEmma coverage 84%
  12. 12. Orion: RESTful git API | Copyright © IBM Corp., 2011. All rights reserved. Source code in this presentation is made available underthe EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Thats all folks
  13. 13. Orion: RESTful git API| Copyright © IBM Corp., 2011. All rights reserved. Source code in this presentation is made available underthe EPL, v1.0, remainder of the presentation is licensed under Creative Commons Att. Nc Nd 2.5 license.Legal Notice● IBM and the IBM logo are trademarks or registeredtrademarks of IBM Corporation, in the United States, othercountries or both.● Java and all Java-based marks, among others, aretrademarks or registered trademarks of Sun Microsystemsin the United States, other countries or both.● Eclipse and the Eclipse logo are trademarks of EclipseFoundation, Inc.● Porky Pig image is in the public domain, see http://commons.wikimedia.org/wiki/File:Thats_all_folks_cl%C3%A0ssic_-Daffy_Comando_1943_-_amb_porky.png● Other company, product and service names may betrademarks or service marks of others.

×