JBoss.orgCommunity Documentation
The S-RAMP Atom API protocol binding does not dictate the format of the API endpoints. Clients must request the /servicedocument and then inspect the workspaces found therein. However, the Overlord implementation’s endpoints conform to the notional syntax described in the S-RAMP specification’s foundation document. The following table lists the endpoints available in the Overlord implementation:
Endpoint | Name |
---|---|
GET /s-ramp/servicedocument | |
POST /s-ramp/{model}/{type} | |
PUT /s-ramp/{model}/{type}/{uuid} | |
PUT /s-ramp/{model}/{type}/{uuid}/media | |
GET /s-ramp/{model}/{type}/{uuid} | |
GET /s-ramp/{model}/{type}/{uuid}/media | |
DELETE /s-ramp/{model}/{type}/{uuid} | |
GET /s-ramp/{model} | |
GET /s-ramp/{model}/{type} | |
GET /s-ramp | |
POST /s-ramp | |
POST /s-ramp | |
POST /s-ramp/ontology | |
GET /s-ramp/ontology | |
PUT /s-ramp/ontology/{uuid} | |
GET /s-ramp/ontology/{uuid} | |
DELETE /s-ramp/ontology/{uuid} | |
GET /s-ramp/audit/artifact/{artifactUuid} | |
GET /s-ramp/audit/user/{username} | |
POST /s-ramp/audit/artifact/{artifactUuid} | |
GET /s-ramp/audit/artifact/{artifactUuid}/{auditEntryUuid} |
/s-ramp/servicedocument
Retrieves the service document.
HTTP Method | Request | Response |
---|---|---|
GET | N/A | Atom Service Document |
The service document contains a workspace for each of the S-RAMP data models supported by the server.
Example Response
HTTP/1.1 200 OK <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <app:service xmlns:atom="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app"> <app:workspace> <atom:title>Core Model</atom:title> <app:collection href="http://example.org/s-ramp/core"> <atom:title>Core Model Objects</atom:title> <app:accept>application/zip</app:accept> <app:categories fixed="yes"> <atom:category label="Document" scheme="urn:x-s-ramp:v1:type" term="Document"/> <atom:category label="XML Document" scheme="urn:x-s-ramp:v1:type" term="XmlDocument"/> </app:categories> </app:collection> <app:collection href="http://example.org/s-ramp/core/Document"> <atom:title>Documents</atom:title> <app:accept>application/octet-stream</app:accept> <app:categories fixed="yes"> <atom:category label="Document" scheme="urn:x-s-ramp:v1:type" term="Document"/> </app:categories> </app:collection> <app:collection href="http://example.org/s-ramp/core/XmlDocument"> <atom:title>XML Documents</atom:title> <app:accept>application/xml</app:accept> <app:categories fixed="yes"> <atom:category label="XML Document" scheme="urn:x-s-ramp:v1:type" term="XmlDocument"/> </app:categories> </app:collection> </app:workspace> </app:service>
The above example only includes the Core data model and thus the service document has a single workspace. The full service document would have multiple workspaces - one for each data model supported by the server.
Publishes a new artifact into the repository.
There are three ways this endpoint can be invoked, depending on the type of artifact being published:
/s-ramp/{model}/{type}
HTTP Method | Request | Response |
---|---|---|
POST | Binary File | Atom Entry |
Publishing a document style artifact is simply a matter of POSTing the binary content of the document to the appropriate endpoint.
Example Request
POST /s-ramp/core/Document HTTP/1.1 This is a simple text document, uploaded as an artifact into S-RAMP.
Example Response
HTTP/1.1 200 OK <?xml version="1.0" encoding="UTF-8" standalone="no"?> <atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:s-ramp="http://docs.oasis-open.org/s-ramp/ns/s-ramp-v1.0" xmlns:xlink="http://www.w3.org/1999/xlink" s-ramp:derived="false"> <atom:title>test.txt</atom:title> <atom:link href="http://example.org/s-ramp/core/Document/05778de3-be85-4696-b5dc-d889a27f1f6e/media" rel="alternate" type="text/plain" /> <atom:link href="http://example.org/s-ramp/core/Document/05778de3-be85-4696-b5dc-d889a27f1f6e" rel="self" type="application/atom+xml;type="entry"" /> <atom:link href="http://example.org/s-ramp/core/Document/05778de3-be85-4696-b5dc-d889a27f1f6e/media" rel="edit-media" type="application/atom+xml;type="entry"" /> <atom:link href="http://example.org/s-ramp/core/Document/05778de3-be85-4696-b5dc-d889a27f1f6e" rel="edit" type="application/atom+xml;type="entry"" /> <atom:category label="Document" scheme="x-s-ramp:2010:type" term="Document" /> <atom:category label="Document" scheme="x-s-ramp:2010:model" term="core" /> <atom:updated>2013-05-14T13:43:09.708-04:00</atom:updated> <atom:id>05778de3-be85-4696-b5dc-d889a27f1f6e</atom:id> <atom:published>2013-05-14T13:43:09.708-04:00</atom:published> <atom:author> <atom:name>ewittman</atom:name> </atom:author> <atom:content src="http://example.org/s-ramp/core/Document/05778de3-be85-4696-b5dc-d889a27f1f6e/media" type="text" /> <s-ramp:artifact> <s-ramp:Document artifactType="Document" contentSize="69" contentType="text/plain" createdBy="<anonymous>" createdTimestamp="2013-05-14T13:43:09.708-04:00" lastModifiedBy="<anonymous>" lastModifiedTimestamp="2013-05-14T13:43:09.708-04:00" name="test.txt" uuid="05778de3-be85-4696-b5dc-d889a27f1f6e" /> </s-ramp:artifact> </atom:entry>
/s-ramp/{model}/{type}
HTTP Method | Request | Response |
---|---|---|
POST | Atom Entry | Atom Entry |
Publishing a non-document style artifact requires an Atom Entry (which contains an s-ramp:artifact child element) to be POSTed to the appropriate endpoint. The appropriate endpoint is based on the desired artifact model and type.
Example Request
POST /s-ramp/ext/MyArtifact HTTP/1.1 <?xml version="1.0" encoding="UTF-8" standalone="no"?> <atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:s-ramp="http://docs.oasis-open.org/s-ramp/ns/s-ramp-v1.0" xmlns:xlink="http://www.w3.org/1999/xlink" s-ramp:derived="false"> <atom:title>Example Artifact</atom:title> <s-ramp:artifact> <s-ramp:ExtendedArtifactType extendedType="MyArtifact" artifactType="ExtendedArtifactType" name="My Artifact One" /> </s-ramp:artifact> </atom:entry>
Example Response
HTTP/1.1 200 OK <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <atom:entry xmlns:s-ramp="http://docs.oasis-open.org/s-ramp/ns/s-ramp-v1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:atom="http://www.w3.org/2005/Atom" s-ramp:derived="false" s-ramp:extendedType="MavenPom"> <atom:title>pom.xml</atom:title> <atom:link href="http://example.org/s-ramp/ext/MavenPom/5f4cbf1e-cafb-4479-8867-fc5df5f21867/media" rel="alternate" type="application/xml" /> <atom:link href="http://example.org/s-ramp/ext/MavenPom/5f4cbf1e-cafb-4479-8867-fc5df5f21867" rel="self" type="application/atom+xml;type="entry"" /> <atom:link href="http://example.org/s-ramp/ext/MavenPom/5f4cbf1e-cafb-4479-8867-fc5df5f21867/media" rel="edit-media" type="application/atom+xml;type="entry"" /> <atom:link href="http://example.org/s-ramp/ext/MavenPom/5f4cbf1e-cafb-4479-8867-fc5df5f21867" rel="edit" type="application/atom+xml;type="entry"" /> <atom:category label="Extended Document" scheme="x-s-ramp:2010:type" term="MavenPom" /> <atom:category label="Extended Document" scheme="x-s-ramp:2010:model" term="ext" /> <atom:updated>2013-05-14T13:49:20.645-04:00</atom:updated> <atom:id>5f4cbf1e-cafb-4479-8867-fc5df5f21867</atom:id> <atom:published>2013-05-14T13:49:20.645-04:00</atom:published> <atom:author> <atom:name>ewittman</atom:name> </atom:author> <atom:content type="application/xml" src="http://example.org/s-ramp/ext/MavenPom/5f4cbf1e-cafb-4479-8867-fc5df5f21867/media" /> <s-ramp:artifact> <s-ramp:ExtendedDocument extendedType="MavenPom" contentType="application/xml" contentSize="4748" artifactType="ExtendedDocument" name="pom.xml" createdBy="<anonymous>" uuid="5f4cbf1e-cafb-4479-8867-fc5df5f21867" createdTimestamp="2013-05-14T13:49:20.645-04:00" lastModifiedTimestamp="2013-05-14T13:49:20.645-04:00" lastModifiedBy="<anonymous>" s-ramp:contentType="application/xml" s-ramp:contentSize="4748" /> </s-ramp:artifact> </atom:entry>
/s-ramp/{model}/{type}
HTTP Method | Request | Response |
---|---|---|
POST | Multipart/Related | Atom Entry |
Sometimes it is convenient to publish an artifact and update its meta-data in a single request. This can be done by POSTing a multipart/related request to the server at the appropriate endpoint. The first part in the request must be an Atom Entry (containing the meta-data being set), while the second part must be the binary content. The appropriate endpoint is based on the desired artifact model and type.
Example Request
POST /s-ramp/core/Document HTTP/1.1 Content-Type: multipart/related;boundary="===============1605871705=="; type="application/atom+xml" MIME-Version: 1.0 --===============1605871705== Content-Type: application/atom+xml; charset="utf-8" MIME-Version: 1.0 <?xml version="1.0"?> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:s-ramp="http://docs.oasis-open.org/s-ramp/ns/s-ramp-v1.0"> <title type="text">myfile.txt</title> <summary type="text">The description of my text file.</summary> <category term="Document" label="Document" scheme="urn:x-s-ramp:2013urn:x-s-ramp:2013:type" /> <s-ramp:artifact xmlns:s-ramp="http://docs.oasis-open.org/s-ramp/ns/s-ramp-v1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <s-ramp:Document name="myfile.txt" version="1.0" description="The description of my text file." > <s-ramp:classifiedBy> http://example.org/ontologies/regions.owl/Maine </s-ramp:classifiedBy> <s-ramp:property> <propertyName>foo</propertyName> <propertyValue>pity him</propertyValue> </s-ramp:property> </s-ramp:Document> </s-ramp:artifact> </entry> --===============1605871705== Content-Type: application/xml MIME-Version: 1.0 This is a simple text document, uploaded as an artifact into S-RAMP. --===============1605871705==--
Example Response
HTTP/1.1 200 OK <?xml version="1.0" encoding="UTF-8" standalone="no"?> <atom:entry xmlns:atom="http://www.w3.org/2005/Atom" xmlns:s-ramp="http://docs.oasis-open.org/s-ramp/ns/s-ramp-v1.0" xmlns:xlink="http://www.w3.org/1999/xlink" s-ramp:derived="false"> <atom:title>test.txt</atom:title> <atom:link href="http://example.org/s-ramp/core/Document/05778de3-be85-4696-b5dc-d889a27f1f6e/media" rel="alternate" type="text/plain" /> <atom:link href="http://example.org/s-ramp/core/Document/05778de3-be85-4696-b5dc-d889a27f1f6e" rel="self" type="application/atom+xml;type="entry"" /> <atom:link href="http://example.org/s-ramp/core/Document/05778de3-be85-4696-b5dc-d889a27f1f6e/media" rel="edit-media" type="application/atom+xml;type="entry"" /> <atom:link href="http://example.org/s-ramp/core/Document/05778de3-be85-4696-b5dc-d889a27f1f6e" rel="edit" type="application/atom+xml;type="entry"" /> <atom:category label="Document" scheme="x-s-ramp:2010:type" term="Document" /> <atom:category label="Document" scheme="x-s-ramp:2010:model" term="core" /> <atom:updated>2013-05-14T13:43:09.708-04:00</atom:updated> <atom:id>05778de3-be85-4696-b5dc-d889a27f1f6e</atom:id> <atom:published>2013-05-14T13:43:09.708-04:00</atom:published> <atom:author> <atom:name>ewittman</atom:name> </atom:author> <atom:content src="http://example.org/s-ramp/core/Document/05778de3-be85-4696-b5dc-d889a27f1f6e/media" type="text" /> <s-ramp:artifact> <s-ramp:Document artifactType="Document" contentSize="69" contentType="text/plain" name="myfile.txt" uuid="05778de3-be85-4696-b5dc-d889a27f1f6e"> description="The description of my text file." version="1.0" createdBy="<anonymous>" createdTimestamp="2013-05-14T13:43:09.708-04:00" lastModifiedBy="<anonymous>" lastModifiedTimestamp="2013-05-14T13:43:09.708-04:00" <s-ramp:classifiedBy> http://example.org/ontologies/regions.owl/Maine </s-ramp:classifiedBy> <s-ramp:property> <propertyName>foo</propertyName> <propertyValue>pity him</propertyValue> </s-ramp:property> </s-ramp:Document> </s-ramp:artifact> </atom:entry>
/s-ramp/{model}/{type}/{uuid}
Updates an artifact’s meta data.
HTTP Method | Request | Response |
---|---|---|
PUT | Atom Entry | N/A |
This endpoint is used to update a single artifact’s meta data, including core properties, custom properties, classifiers, and relationships. Typically the client should first retrieve the artifact (e.g. by invoking the Get Artifact endpoint), make changes to the artifact, then issue a PUT request to the Update Artifact endpoint.
Example Request
PUT /s-ramp/core/Document/098da465-2eae-49b7-8857-eb447f03ac02 HTTP/1.1 <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <atom:entry xmlns:s-ramp="http://docs.oasis-open.org/s-ramp/ns/s-ramp-v1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:atom="http://www.w3.org/2005/Atom"> <atom:title>pom.xml</atom:title> <atom:updated>2013-05-15T08:12:01.985-04:00</atom:updated> <atom:id>098da465-2eae-49b7-8857-eb447f03ac02</atom:id> <atom:published>2013-05-15T08:12:01.985-04:00</atom:published> <atom:author> <atom:name>ewittman</atom:name> </atom:author> <atom:summary>Sample description of my document.</atom:summary> <s-ramp:artifact> <s-ramp:Document contentType="text/plain" contentSize="4748" artifactType="Document" name="myfile.txt" description="Sample description of my document." createdBy="ewittman" uuid="098da465-2eae-49b7-8857-eb447f03ac02" createdTimestamp="2013-05-15T08:12:01.985-04:00" lastModifiedTimestamp="2013-05-15T08:12:01.985-04:00" lastModifiedBy="ewittman"> <s-ramp:property> <s-ramp:propertyName>foo</s-ramp:propertyName> <s-ramp:propertyValue>bar</s-ramp:propertyValue> </s-ramp:property> </s-ramp:Document> </s-ramp:artifact> </atom:entry>