Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Orion/Server API/Site Configuration API"
< Orion | Server API
(added work in progress) |
|||
Line 1: | Line 1: | ||
− | {{warning|Work in progress|This scenario has not been fully implemented yet.}} | + | {{warning|Work in progress|This scenario has not been fully implemented yet. Progress is being tracked in [https://bugs.eclipse.org/bugs/show_bug.cgi?id=337212 bug 337212].}} |
The Site Configuration API is a web server API for creating, editing, starting and stopping site configurations. | The Site Configuration API is a web server API for creating, editing, starting and stopping site configurations. | ||
− | == Actions == | + | == CRUD Actions == |
=== Getting all site configurations === | === Getting all site configurations === | ||
Line 21: | Line 21: | ||
Progress in being tracked on [https://bugs.eclipse.org/bugs/show_bug.cgi?id=335789 Bug 335789]. | Progress in being tracked on [https://bugs.eclipse.org/bugs/show_bug.cgi?id=335789 Bug 335789]. | ||
− | === Getting a site configuration | + | === Getting a single site configuration === |
{{Orion/ServerAPI | {{Orion/ServerAPI | ||
Line 64: | Line 64: | ||
}} | }} | ||
+ | === Editing a site configuration === | ||
− | + | {{Orion/ServerAPI | |
+ | | overview = The contents of an existing file can be replaced with a simple PUT to the file resource's [[#location|location]]. | ||
+ | | method = PUT | ||
+ | | reqhead = /file/MyProj/myfile.txt HTTP/1.1 | ||
+ | Orion-Version: 1.0 | ||
+ | If-Match: "35fd43td2" | ||
+ | Content-Type: text/plain | ||
+ | | reqbody = This is the new contents | ||
+ | | resphead = HTTP/1.1 200 OK | ||
+ | Content-Type: application/json | ||
+ | Content-Length: 132 | ||
+ | ETag: "35fd43td3" | ||
+ | | respbody = { | ||
+ | "Name" : "myfile.txt", | ||
+ | "Location" : "http://example.com/file/MyProj/myfile.txt", | ||
+ | "ETag" : "35fd43td3", | ||
+ | "Directory" : "false", | ||
+ | "LocalTimeStamp" : "01234345009837", | ||
+ | "Charset" : "UTF-8", | ||
+ | "ContentType" : "text/plain", | ||
+ | "Attributes" : { | ||
+ | "ReadOnly" : "false", | ||
+ | "Executable" : "true" | ||
+ | } | ||
+ | } | ||
+ | | explain = Note that changing the contents of a non-existing file is not permitted. Files are created via POST operations rather than a PUT. It is recommended that file changes be accompanied by the ETag of the resource state that was modified in the If-Match header. This prevents overwriting changes made by other clients since the resource was last retrieved. A 412 response indicates that an attempt was made to change a file that has been modified since it was last retrieved. | ||
+ | }} | ||
− | == | + | === Deleting a site configuration === |
− | + | ||
− | = | + | {{Orion/ServerAPI |
+ | | overview = To delete a file or directory, send DELETE to the resource's [[#location|location]]. | ||
+ | | method = DELETE | ||
+ | | reqhead = /file/myfile.txt HTTP/1.1 | ||
+ | Orion-Version = 1.0 | ||
+ | If-Match: 980sdfhsdf8f | ||
+ | | resphead = 204 OK | ||
+ | | explain = Use of the If-Match header is recommended to avoid deleting contents that have been modified by another party since the file was last retrieved. Deleting a non-existent resource succeeds with no effect (returns 204 OK). | ||
+ | }} | ||
− | |||
− | + | == Other Actions == | |
− | {| | + | === Starting a site configuration === |
− | |- align="center" style="background: | + | |
− | ! Field | + | === Stopping a site configuration === |
− | ! Data type | + | |
+ | = JSON representations = | ||
+ | |||
+ | == Site configuration == | ||
+ | {| border="1" cellspacing=0 style="text-align: center; width:90%" | ||
+ | |- width="100%" align="center" style="background:#ccccff; padding: 0 5px 0 5px;" | | ||
+ | ! Field | ||
+ | ! Data type | ||
! Value | ! Value | ||
|- | |- | ||
− | | | + | | Id |
− | | | + | | string |
− | | Location of | + | | Globally unique id of the site configuration. |
+ | |- | ||
+ | | Location | ||
+ | | string | ||
+ | | The URL of this site configuration resource | ||
+ | |- | ||
+ | | Name | ||
+ | | string | ||
+ | | The URL where the started site configuration can be accessed. | ||
+ | |- | ||
+ | | Workspace | ||
+ | | string | ||
+ | | The Id of the Workspace that the site configuration is associated to. | ||
+ | |- | ||
+ | | Mappings | ||
+ | | Array of Mappings | ||
+ | | The URL where the started site configuration can be accessed. | ||
+ | |} | ||
+ | |||
+ | == A Mapping == | ||
+ | |||
+ | |||
+ | == List of site configurations == | ||
+ | |||
+ | == Hosting Status == | ||
+ | If present, the HotingStatus object within the JSON representation of the site configuration may support the following values: | ||
+ | |||
+ | {| border="1" cellspacing=0 style="text-align: center; width:90%" | ||
+ | |- width="100%" align="center" style="background:#ccccff; padding: 0 5px 0 5px;" | | ||
+ | ! Field | ||
+ | ! Data type | ||
+ | ! Value | ||
|- | |- | ||
− | | | + | | Status |
− | | | + | | string |
− | | | + | | started | stopped |
|- | |- | ||
− | | | + | | URL |
− | | | + | | string |
− | | | + | | The URL where the started site configuration can be accessed. |
|} | |} |
Revision as of 13:07, 28 February 2011
The Site Configuration API is a web server API for creating, editing, starting and stopping site configurations.
CRUD 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 single site configuration
- 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.
Editing a site configuration
- Overview
- The contents of an existing file can be replaced with a simple PUT to the file resource's location.
- HTTP Method
- PUT
- Example Request
PUT /file/MyProj/myfile.txt HTTP/1.1
Orion-Version: 1.0
If-Match: "35fd43td2"
Content-Type: text/plain
This is the new contents
- Example Response
HTTP/1.1 HTTP/1.1 200 OK Content-Type: application/json Content-Length: 132 ETag: "35fd43td3" { "Name" : "myfile.txt", "Location" : "http://example.com/file/MyProj/myfile.txt", "ETag" : "35fd43td3", "Directory" : "false", "LocalTimeStamp" : "01234345009837", "Charset" : "UTF-8", "ContentType" : "text/plain", "Attributes" : { "ReadOnly" : "false", "Executable" : "true" } }
- Detailed Explanation
- Note that changing the contents of a non-existing file is not permitted. Files are created via POST operations rather than a PUT. It is recommended that file changes be accompanied by the ETag of the resource state that was modified in the If-Match header. This prevents overwriting changes made by other clients since the resource was last retrieved. A 412 response indicates that an attempt was made to change a file that has been modified since it was last retrieved.
Deleting a site configuration
- Overview
- To delete a file or directory, send DELETE to the resource's location.
- HTTP Method
- DELETE
- Example Request
DELETE /file/myfile.txt HTTP/1.1
Orion-Version = 1.0
If-Match: 980sdfhsdf8f
- Example Response
HTTP/1.1 204 OK
- Detailed Explanation
- Use of the If-Match header is recommended to avoid deleting contents that have been modified by another party since the file was last retrieved. Deleting a non-existent resource succeeds with no effect (returns 204 OK).
Other Actions
Starting a site configuration
Stopping a site configuration
JSON representations
Site configuration
Field | Data type | Value |
---|---|---|
Id | string | Globally unique id of the site configuration. |
Location | string | The URL of this site configuration resource |
Name | string | The URL where the started site configuration can be accessed. |
Workspace | string | The Id of the Workspace that the site configuration is associated to. |
Mappings | Array of Mappings | The URL where the started site configuration can be accessed. |
A Mapping
List of site configurations
Hosting Status
If present, the HotingStatus object within the JSON representation of the site configuration may support the following values:
Field | Data type | Value |
---|---|---|
Status | string | stopped |
URL | string | The URL where the started site configuration can be accessed. |