Skip to main content
Jump to: navigation, search

Difference between revisions of "Orion/Server API/Site Configuration API"

(Created page)
 
Line 1: Line 1:
 
TODO
 
TODO
<!--
+
 
The Git API is a web server API for browsing and manipulating Git repositories.
+
The Site Configuration API is a web server API for creating, editing, starting and stopping site configurations.
  
 
== Actions ==
 
== Actions ==
  
=== Getting status for a git project ===
+
=== Getting all site configurations ===
  
 
{{Orion/ServerAPI
 
{{Orion/ServerAPI
 
| method = GET
 
| method = GET
 
| overview = To retrieve the working tree status of a project, send a GET request to the git status location.
 
| overview = To retrieve the working tree status of a project, send a GET request to the git status location.
| reqhead = /git/status/file/MyProj/
+
| reqhead = /site
 
| resphead = 200 OK
 
| resphead = 200 OK
 
   Content-Type: text/plain
 
   Content-Type: text/plain
Line 19: Line 19:
 
}}
 
}}
  
Progress in being tracked on [https://bugs.eclipse.org/bugs/show_bug.cgi?id=337212 bug 337212].
+
Progress in being tracked on [https://bugs.eclipse.org/bugs/show_bug.cgi?id=335789 Bug 335789].
  
=== Getting a diff ===
+
=== Getting a site configuration by Id ===
  
 
{{Orion/ServerAPI
 
{{Orion/ServerAPI
 
| method = GET
 
| method = GET
 
| overview = To retrieve changes between selected commits, commit and working tree, and so on. Send a GET request to the git diff location.
 
| overview = To retrieve changes between selected commits, commit and working tree, and so on. Send a GET request to the git diff location.
| reqhead = /git/diff/file/MyProj/
+
| reqhead = /site/siteConfigurationId
 
| resphead = 200 OK
 
| resphead = 200 OK
 
   Content-Type: text/plain
 
   Content-Type: text/plain
Line 35: Line 35:
 
}}
 
}}
  
=== Getting a file content from index ===
+
=== Creating a site configuration ===
  
 
{{Orion/ServerAPI
 
{{Orion/ServerAPI
| method = GET
+
| overview = Overview
| overview = To retrieve file content kept in index. Send a GET request to the git index location.
+
| method = POST
| reqhead = /git/index/file/MyProj/file.txt
+
| reqhead = /site HTTP/1.1
| resphead = 200 OK
+
Orion-Version: 1.0
  Content-Type: text/plain
+
Content-Length: 48
  Content-Length: 22
+
Content-Type: application/json
| respbody =   
+
Slug: myfolder
   This is the contents
+
| reqbody = {
| explain = TBD.
+
   "Name" : "myfolder",
 +
   "Directory" : "true"
 +
}
 +
| resphead = 201 OK
 +
| respbody = {
 +
"Name" : "myfolder",
 +
"Location" : "http://example.com/file/MyProj/myfolder",
 +
"ETag" : "35fd43td3",
 +
"LocalTimeStamp" : "01234345009837",
 +
"Directory" : "true"
 +
"Attributes" : {
 +
"ReadOnly" : "false",
 +
"Executable" : "true"
 +
}
 +
}
 +
| explain = See [[EclipseWeb/Server_API/File_API#Notes_on_POST_method|Notes on POST method]] for further details.
 
}}
 
}}
  
Line 79: Line 94:
 
| Location of Git Index resource
 
| Location of Git Index resource
 
|}
 
|}
 
-->
 

Revision as of 12:56, 28 February 2011

TODO

The Site Configuration API is a web server API for creating, editing, starting and stopping site configurations.

Actions

Getting all site configurations

Overview
To retrieve the working tree status of a project, send a GET request to the git status location.
HTTP Method
GET
Example Request
GET /site

  
Example Response
HTTP/1.1 200 OK
 Content-Type: text/plain
 Content-Length: 22

TBD
Detailed Explanation
TBD.


Progress in being tracked on Bug 335789.

Getting a site configuration by Id

Overview
To retrieve changes between selected commits, commit and working tree, and so on. Send a GET request to the git diff location.
HTTP Method
GET
Example Request
GET /site/siteConfigurationId

  
Example Response
HTTP/1.1 200 OK
 Content-Type: text/plain
 Content-Length: 22

TBD
Detailed Explanation
TBD.


Creating a site configuration

Overview
Overview
HTTP Method
POST
Example Request
POST /site HTTP/1.1
Orion-Version: 1.0
Content-Length: 48
Content-Type: application/json
Slug: myfolder

{
 "Name" : "myfolder",
 "Directory" : "true"
}  
Example Response
HTTP/1.1 201 OK

{
"Name" : "myfolder",
"Location" : "http://example.com/file/MyProj/myfolder",
"ETag" : "35fd43td3",
"LocalTimeStamp" : "01234345009837",
"Directory" : "true"
"Attributes" : {
"ReadOnly" : "false",
"Executable" : "true"
}
}
Detailed Explanation
See Notes on POST method for further details.


Progress is being tracked on bug 337212.

Other operations

TBD, see bug 336116

JSON representations

File representation extension

The JSON representation for files and directories used by file API may be extended as follows: Required fields are shown in bold. A client cannot rely on the existence of non-required attribute in a file representation from a given Orion server.

Field Data type Value
Git.DiffLocation URI Location of Git Diff resource
Git.StatusLocation URI Location of Git Status resource
Git.IndexLocation URI Location of Git Index resource

Back to the top