Artificer REST API Endpoints
----------------------------

The intent of the S-RAMP specification is to outline the data model and protocol designed to define how a repository
should store and manipulate artifacts. The foundation document defines the former, while various protocol binding
documents define the latter. Version 1 of the S-RAMP specification includes a single, Atom based protocol binding.

The S-RAMP specification does not dictate the format of the Atom REST endpoints.  Instead, the 
client is expected to query a xref:api-get-service-document[service document endpoint] and inspect it to find the
various relevant endpoints.  The specification does present a notional format, but implementations are not required
to follow it.  This Guide will give examples based on the spec's notional format, as well as Artificer-specific
extensions.  But it bears repeating that for any given server implementation, a client should first query the
xref:api-get-service-document[Atom service document].

However, the Atom Binding document does outline the inputs, outputs, and REST verbs that must be
used for each of the supported operations.  In general, the Atom API data models are used to wrap
custom S-RAMP specific XML structures.  Atom Entry documents are used when dealing with individual
artifacts, while Atom Feed documents are used when dealing with lists of documents.

The following table lists the endpoints available in the Artificer implementation:

[width="100%",options="header"]
|=============================
|Endpoint                                    |Name
|GET /s-ramp/servicedocument                 |xref:api-get-service-document[Get Service Document]
|POST /s-ramp/\{model}/\{type}               |xref:api-publish-artifact[Publish Artifact]
|PUT /s-ramp/\{model}/\{type}/\{uuid}        |xref:api-update-artifact[Update Artifact]
|GET /s-ramp/\{model}/\{type}/\{uuid}        |xref:api-get-artifact[Get Artifact]
|GET /s-ramp/\{model}/\{type}/\{uuid}/media  |xref:api-get-artifact-content[Get Artifact Content]
|DELETE /s-ramp/\{model}/\{type}/\{uuid}     |xref:api-delete-artifact[Delete Artifact]
|GET /s-ramp/\{model}                        |xref:api-get-artifact-feed-by-model[Get Artifact Feed (by model)]
|GET /s-ramp/\{model}/\{type}                |xref:api-get-artifact-feed-by-type[Get Artifact Feed (by type)]
|GET /s-ramp                                 |xref:api-query[Query]
|POST /s-ramp                                |xref:api-query-1[Query]
|POST /s-ramp                                |xref:api-batch-processing[Batch Processing]
|POST /s-ramp/query                          |xref:api-create-storedquery[Create Stored Query]
|PUT /s-ramp/query/{queryName}               |xref:api-update-storedquery[Update Stored Query]
|GET /s-ramp/query                           |xref:api-list-storedqueries[List Stored Queries]
|GET /s-ramp/query/{queryName}               |xref:api-get-storedquery[Get Stored Query]
|GET /s-ramp/query/{queryName}/results       |xref:api-execute-storedquery[Execute Stored Query]
|DELETE /s-ramp/query/{queryName}            |xref:api-delete-storedquery[Delete Stored Query]
|POST /s-ramp/ontology                       |xref:api-add-ontology[Add Ontology]
|GET /s-ramp/ontology                        |xref:api-list-ontologies[List Ontologies]
|PUT /s-ramp/ontology/\{uuid}                |xref:api-update-ontology[Update Ontology]
|GET /s-ramp/ontology/\{uuid}                |xref:api-get-ontology[Get Ontology]
|DELETE /s-ramp/ontology/\{uuid}             |xref:api-delete-ontology[Delete Ontology]
|GET /s-ramp/audit/artifact/\{artifactUuid}  |xref:api-get-artifact-audit-history[Get Artifact Audit History]
|GET /s-ramp/audit/user/\{username}          |xref:api-get-user-audit-history[Get User Audit History]
|POST /s-ramp/audit/artifact/\{artifactUuid} |xref:api-add-artifact-audit-entry[Add Artifact Audit Entry]
|GET /s-ramp/audit/artifact/\{artifactUuid}/\{auditEntryUuid} |xref:api-get-artifact-audit-entry[Get Artifact Audit Entry]
|=============================

[[api-get-service-document]]
API: Get Service Document
~~~~~~~~~~~~~~~~~~~~~~~~~
----
  /s-ramp/servicedocument
----
Retrieves the service document.

[width="50%",options="header"]
|=============================
|#HTTP Method# |#Request#     |#Response#
|GET           |N/A           |Atom Service Document
|=============================

The resulting service document will contain a set of workspaces representing the artifact 
collections supported by the server, along with endpoints indicating how to manipulate them.

'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:2013:type" term="Document"/>
                <atom:category label="XML Document" scheme="urn:x-s-ramp:2013: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:2013: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:2013:type" term="XmlDocument"/>
            </app:categories>
        </app:collection>
    </app:workspace>
</app:service>
----
TIP: 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.

Artifacts
~~~~~~~~~

[[api-publish-artifact]]
API: Publish Artifact
^^^^^^^^^^^^^^^^^^^^^
Publishes a new artifact into the repository.  There are two basic types of artifacts from the protocol standpoint:
document style artifacts (those artifacts that are based on files/binary content) and logical (direct instantiation)
artifacts. In the case of a document-style artifact, the client must POST the binary content to the correct Atom
Endpoint. In the case of a direct artifact (no document content) the client must POST an Atom Entry containing an S-RAMP
artifact XML entity to the appropriate endpoint. The server will respond with an Atom Entry containing the full meta
data of the newly created artifact (if successful).

There are three ways this endpoint can be invoked, depending on the type of artifact being published:

* Document Style Artifact
* Non-Document Style Artifact
* Document Style Artifact with Meta Data

Publish a Document Style Artifact
+++++++++++++++++++++++++++++++++
----
  /s-ramp/{model}/{type}
----

[width="50%",options="header"]
|=============================
|#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=&quot;entry&quot;" />
  <atom:link
    href="http://example.org/s-ramp/core/Document/05778de3-be85-4696-b5dc-d889a27f1f6e/media"
    rel="edit-media" type="application/atom+xml;type=&quot;entry&quot;" />
  <atom:link href="http://example.org/s-ramp/core/Document/05778de3-be85-4696-b5dc-d889a27f1f6e"
    rel="edit" type="application/atom+xml;type=&quot;entry&quot;" />
  <atom:category label="Document" scheme="x-s-ramp:2013:type" term="Document" />
  <atom:category label="Document" scheme="x-s-ramp:2013: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="eric" createdTimestamp="2013-05-14T13:43:09.708-04:00" lastModifiedBy="eric"
      lastModifiedTimestamp="2013-05-14T13:43:09.708-04:00" name="test.txt" uuid="05778de3-be85-4696-b5dc-d889a27f1f6e" />
  </s-ramp:artifact>
</atom:entry>
----

Publish a Non-Document Style Artifact
+++++++++++++++++++++++++++++++++++++
----
  /s-ramp/{model}/{type}
----

[width="50%",options="header"]
|=============================
|#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=&quot;entry&quot;" />
  <atom:link href="http://example.org/s-ramp/ext/MavenPom/5f4cbf1e-cafb-4479-8867-fc5df5f21867/media"
    rel="edit-media" type="application/atom+xml;type=&quot;entry&quot;" />
  <atom:link href="http://example.org/s-ramp/ext/MavenPom/5f4cbf1e-cafb-4479-8867-fc5df5f21867" rel="edit"
    type="application/atom+xml;type=&quot;entry&quot;" />
  <atom:category label="Extended Document" scheme="x-s-ramp:2013:type" term="MavenPom" />
  <atom:category label="Extended Document" scheme="x-s-ramp:2013: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="eric"
      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="eric"
      s-ramp:contentType="application/xml" s-ramp:contentSize="4748" />
  </s-ramp:artifact>
</atom:entry>
----


Publish a Document Style Artifact with Meta-Data
++++++++++++++++++++++++++++++++++++++++++++++++
----
  /s-ramp/{model}/{type}
----

[width="50%",options="header"]
|=============================
|#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=&quot;entry&quot;" />
  <atom:link
    href="http://example.org/s-ramp/core/Document/05778de3-be85-4696-b5dc-d889a27f1f6e/media"
    rel="edit-media" type="application/atom+xml;type=&quot;entry&quot;" />
  <atom:link href="http://example.org/s-ramp/core/Document/05778de3-be85-4696-b5dc-d889a27f1f6e"
    rel="edit" type="application/atom+xml;type=&quot;entry&quot;" />
  <atom:category label="Document" scheme="x-s-ramp:2013:type" term="Document" />
  <atom:category label="Document" scheme="x-s-ramp:2013: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="eric" createdTimestamp="2013-05-14T13:43:09.708-04:00" 
      lastModifiedBy="eric" 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>
----


[[api-update-artifact]]
API: Update Artifact
^^^^^^^^^^^^^^^^^^^^
----
  /s-ramp/{model}/{type}/{uuid}
----
Updates an artifact's meta data.

[width="50%",options="header"]
|=============================
|#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>
----


[[api-get-artifact]]
API: Get Artifact
^^^^^^^^^^^^^^^^^
----
  /s-ramp/{model}/{type}/{uuid}
----
Retrieves an artifact's meta data.

[width="50%",options="header"]
|=============================
|#HTTP Method# |#Request#     |#Response#
|GET           |N/A           |Atom Entry (full)
|=============================

This endpoint is used to retrieve the full meta-data for a single artifact in the
repository.  The data is returned wrapped up in an Atom Entry document.  The Atom Entry
will contain an extended XML element containing the S-RAMP artifact data.

'Example Request'
----
PUT /s-ramp/xsd/ComplexTypeDeclaration/0104e848-fe91-4d93-a307-fb69ec9fd638 HTTP/1.1
----

'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="true">
<atom:title>submitOrderResponseType</atom:title>
<atom:link href="http://localhost:8080/artificer-server/s-ramp/xsd/ComplexTypeDeclaration/0104e848-fe91-4d93-a307-fb69ec9fd638" rel="self" type="application/atom+xml;type=&quot;entry&quot;"/>
<atom:link href="http://localhost:8080/artificer-server/s-ramp/xsd/ComplexTypeDeclaration/0104e848-fe91-4d93-a307-fb69ec9fd638/media" rel="edit-media" type="application/atom+xml;type=&quot;entry&quot;"/>
<atom:link href="http://localhost:8080/artificer-server/s-ramp/xsd/ComplexTypeDeclaration/0104e848-fe91-4d93-a307-fb69ec9fd638" rel="edit" type="application/atom+xml;type=&quot;entry&quot;"/>
<atom:category label="XML Schema Complex Type Declaration" scheme="x-s-ramp:2013:type" term="ComplexTypeDeclaration"/>
<atom:category label="XML Schema Complex Type Declaration" scheme="x-s-ramp:2013:model" term="xsd"/>
<atom:updated>2013-07-22T12:19:23.554-04:00</atom:updated>
<atom:id>0104e848-fe91-4d93-a307-fb69ec9fd638</atom:id>
<atom:published>2013-07-22T12:19:22.630-04:00</atom:published>
<atom:author>
<atom:name>eric</atom:name>
</atom:author>
<s-ramp:artifact>
<s-ramp:ComplexTypeDeclaration artifactType="ComplexTypeDeclaration" createdBy="eric" createdTimestamp="2013-07-22T12:19:22.630-04:00" lastModifiedBy="eric" lastModifiedTimestamp="2013-07-22T12:19:23.554-04:00" name="submitOrderResponseType" namespace="urn:switchyard-quickstart-demo:multiapp:1.0" uuid="0104e848-fe91-4d93-a307-fb69ec9fd638">
<s-ramp:relatedDocument artifactType="XsdDocument">fe7b72ec-5ad9-436c-b7aa-0391da5cc972</s-ramp:relatedDocument>
</s-ramp:ComplexTypeDeclaration>
</s-ramp:artifact>
</atom:entry>
----


[[api-get-artifact-content]]
API: Get Artifact Content
^^^^^^^^^^^^^^^^^^^^^^^^^
----
  /s-ramp/{model}/{type}/{uuid}/media
----
Retrieves an artifact's content.

[width="50%",options="header"]
|=============================
|#HTTP Method# |#Request#     |#Response#
|GET           |N/A           |Binary artifact content
|=============================

This endpoint is used to retrieve the full content of a single artifact in the
repository.  If the artifact is not a Document style artifact, this call will
fail.  Otherwise it will return the full artifact content.  For example, if the
artifact is a PdfDocument, then this call will return the PDF file.

'Example Request'
----
GET /s-ramp/core/Document/0f6f9b6b-9952-4059-ab70-7ee3442ddcf0/media HTTP/1.1
----

'Example Response'
----
HTTP/1.1 200 OK

Artifact/file content returned here.
----


[[api-delete-artifact]]
API: Delete Artifact
^^^^^^^^^^^^^^^^^^^^
----
  /s-ramp/{model}/{type}/{uuid}
----
Deletes an artifact.

[width="50%",options="header"]
|=============================
|#HTTP Method# |#Request#     |#Response#
|DELETE        |N/A           |N/A
|=============================

This endpoint is used to delete a single artifact from the repository.  If the
artifact does not exist or is a derived artifact, then this will fail.  This
might also fail if other artifacts have relationships with it.  Otherwise this
artifact (and all of its derived artifacts) will be deleted.

'Example Request'
----
DELETE /s-ramp/core/Document/0f6f9b6b-9952-4059-ab70-7ee3442ddcf0 HTTP/1.1
----


Queries
^^^^^^^

Performing an S-RAMP query is a matter of issueing a GET or POST to the S-RAMP query endpoint. In addition, full feeds
are available for all Artifact Models and Artifact Types. In both cases, the response is an Atom Feed where each Entry
provides summary information about an artifact in the respository. To retrieve full details about a given entry in the
feed (custom properties, classifiers, relationships), the client must issue an additional GET. Only a subset of the
core properties, such as name and description, are mapped to the Atom Entry in a feed.

[[api-get-artifact-feed-by-model]]
API: Get Artifact Feed (by model)
+++++++++++++++++++++++++++++++++
----
  /s-ramp/{model}
----
Retrieves an Atom feed of all artifacts in a given model.

[width="50%",options="header"]
|=============================
|#HTTP Method# |#Request#     |#Response#
|GET           |N/A           |Atom Feed
|=============================

This endpoint is used to retrieve an Atom feed of all artifacts in a single
S-RAMP model.  The feed contains Atom summary Entries - one for each artifact
in the feed.  Standard paging options apply.

'Example Request'
----
GET /s-ramp/core HTTP/1.1
----

'Example Response'
----
HTTP/1.1 200 OK

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<atom:feed xmlns:atom="http://www.w3.org/2005/Atom" xmlns:s-ramp="http://docs.oasis-open.org/s-ramp/ns/s-ramp-v1.0"
  s-ramp:itemsPerPage="100" s-ramp:provider="Artificer" s-ramp:startIndex="0" s-ramp:totalResults="5">
  <atom:title>S-RAMP Feed</atom:title>
  <atom:subtitle>Ad Hoc query feed</atom:subtitle>
  <atom:updated>2013-07-22T12:50:16.605-04:00</atom:updated>
  <atom:id>1647967f-a6f4-4e9c-82d3-ac422fb152f3</atom:id>
  <atom:author>
    <atom:name>anonymous</atom:name>
  </atom:author>
  <atom:entry s-ramp:derived="false">
    <atom:title>sramp.sh</atom:title>
    <atom:link href="http://localhost:8080/s-ramp/core/Document/0f6f9b6b-9952-4059-ab70-7ee3442ddcf0/media"
      rel="alternate" type="application/x-sh" />
    <atom:link href="http://localhost:8080/s-ramp/core/Document/0f6f9b6b-9952-4059-ab70-7ee3442ddcf0"
      rel="self" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/Document/0f6f9b6b-9952-4059-ab70-7ee3442ddcf0/media"
      rel="edit-media" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/Document/0f6f9b6b-9952-4059-ab70-7ee3442ddcf0"
      rel="edit" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:category label="Document" scheme="x-s-ramp:2013:type" term="Document" />
    <atom:category label="Document" scheme="x-s-ramp:2013:model" term="core" />
    <atom:updated>2013-07-22T12:22:01.953-04:00</atom:updated>
    <atom:id>0f6f9b6b-9952-4059-ab70-7ee3442ddcf0</atom:id>
    <atom:published>2013-07-22T12:21:49.499-04:00</atom:published>
    <atom:author>
      <atom:name>eric</atom:name>
    </atom:author>
    <atom:content src="http://localhost:8080/s-ramp/core/Document/0f6f9b6b-9952-4059-ab70-7ee3442ddcf0/media"
      type="application/x-sh" />
  </atom:entry>
  <atom:entry s-ramp:derived="false">
    <atom:title>beans.xml</atom:title>
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/20474032-9536-4cef-812c-4fea432fdebd/media"
      rel="alternate" type="application/xml" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/20474032-9536-4cef-812c-4fea432fdebd"
      rel="self" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/20474032-9536-4cef-812c-4fea432fdebd/media"
      rel="edit-media" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/20474032-9536-4cef-812c-4fea432fdebd"
      rel="edit" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:category label="XML Document" scheme="x-s-ramp:2013:type" term="XmlDocument" />
    <atom:category label="XML Document" scheme="x-s-ramp:2013:model" term="core" />
    <atom:updated>2013-07-22T12:19:27.660-04:00</atom:updated>
    <atom:id>20474032-9536-4cef-812c-4fea432fdebd</atom:id>
    <atom:published>2013-07-22T12:19:27.644-04:00</atom:published>
    <atom:author>
      <atom:name>eric</atom:name>
    </atom:author>
    <atom:content src="http://localhost:8080/s-ramp/core/XmlDocument/20474032-9536-4cef-812c-4fea432fdebd/media"
      type="application/xml" />
  </atom:entry>
  <atom:entry s-ramp:derived="false">
    <atom:title>forge.xml</atom:title>
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/2c21a9d3-0d09-41d8-8783-f3e795d8690d/media"
      rel="alternate" type="application/xml" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/2c21a9d3-0d09-41d8-8783-f3e795d8690d"
      rel="self" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/2c21a9d3-0d09-41d8-8783-f3e795d8690d/media"
      rel="edit-media" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/2c21a9d3-0d09-41d8-8783-f3e795d8690d"
      rel="edit" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:category label="XML Document" scheme="x-s-ramp:2013:type" term="XmlDocument" />
    <atom:category label="XML Document" scheme="x-s-ramp:2013:model" term="core" />
    <atom:updated>2013-07-22T12:19:25.576-04:00</atom:updated>
    <atom:id>2c21a9d3-0d09-41d8-8783-f3e795d8690d</atom:id>
    <atom:published>2013-07-22T12:19:25.555-04:00</atom:published>
    <atom:author>
      <atom:name>eric</atom:name>
    </atom:author>
    <atom:content src="http://localhost:8080/s-ramp/core/XmlDocument/2c21a9d3-0d09-41d8-8783-f3e795d8690d/media"
      type="application/xml" />
  </atom:entry>
  <atom:entry s-ramp:derived="false">
    <atom:title>route.xml</atom:title>
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/5b653bfe-4f58-451e-b738-394e61c0c5f9/media"
      rel="alternate" type="application/xml" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/5b653bfe-4f58-451e-b738-394e61c0c5f9"
      rel="self" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/5b653bfe-4f58-451e-b738-394e61c0c5f9/media"
      rel="edit-media" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/5b653bfe-4f58-451e-b738-394e61c0c5f9"
      rel="edit" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:category label="XML Document" scheme="x-s-ramp:2013:type" term="XmlDocument" />
    <atom:category label="XML Document" scheme="x-s-ramp:2013:model" term="core" />
    <atom:updated>2013-07-22T12:19:25.602-04:00</atom:updated>
    <atom:id>5b653bfe-4f58-451e-b738-394e61c0c5f9</atom:id>
    <atom:published>2013-07-22T12:19:25.577-04:00</atom:published>
    <atom:author>
      <atom:name>eric</atom:name>
    </atom:author>
    <atom:content src="http://localhost:8080/s-ramp/core/XmlDocument/5b653bfe-4f58-451e-b738-394e61c0c5f9/media"
      type="application/xml" />
  </atom:entry>
  <atom:entry s-ramp:derived="false">
    <atom:title>beans.xml</atom:title>
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/a3f9d4d7-0f95-4219-85f6-84df445ef270/media"
      rel="alternate" type="application/xml" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/a3f9d4d7-0f95-4219-85f6-84df445ef270"
      rel="self" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/a3f9d4d7-0f95-4219-85f6-84df445ef270/media"
      rel="edit-media" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/a3f9d4d7-0f95-4219-85f6-84df445ef270"
      rel="edit" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:category label="XML Document" scheme="x-s-ramp:2013:type" term="XmlDocument" />
    <atom:category label="XML Document" scheme="x-s-ramp:2013:model" term="core" />
    <atom:updated>2013-07-22T12:19:21.498-04:00</atom:updated>
    <atom:id>a3f9d4d7-0f95-4219-85f6-84df445ef270</atom:id>
    <atom:published>2013-07-22T12:19:21.376-04:00</atom:published>
    <atom:author>
      <atom:name>eric</atom:name>
    </atom:author>
    <atom:content src="http://localhost:8080/s-ramp/core/XmlDocument/a3f9d4d7-0f95-4219-85f6-84df445ef270/media"
      type="application/xml" />
  </atom:entry>
</atom:feed>
----


[[api-get-artifact-feed-by-type]]
API: Get Artifact Feed (by type)
++++++++++++++++++++++++++++++++
----
  /s-ramp/{model}/{type}
----
Retrieves an Atom feed of all artifacts of a specific type.

[width="50%",options="header"]
|=============================
|#HTTP Method# |#Request#     |#Response#
|GET           |N/A           |Atom Feed
|=============================

This endpoint is used to retrieve an Atom feed of all artifacts of a specific
S-RAMP type.  The feed contains Atom summary Entries - one for each artifact
in the feed.  Standard paging options (as query params) apply.

'Example Request'
----
GET /s-ramp/core/Document HTTP/1.1
----

'Example Response'
----
HTTP/1.1 200 OK

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<atom:feed xmlns:atom="http://www.w3.org/2005/Atom" xmlns:s-ramp="http://docs.oasis-open.org/s-ramp/ns/s-ramp-v1.0"
  s-ramp:itemsPerPage="100" s-ramp:provider="Artificer" s-ramp:startIndex="0" s-ramp:totalResults="5">
  <atom:title>S-RAMP Feed</atom:title>
  <atom:subtitle>Ad Hoc query feed</atom:subtitle>
  <atom:updated>2013-07-22T12:50:16.605-04:00</atom:updated>
  <atom:id>1647967f-a6f4-4e9c-82d3-ac422fb152f3</atom:id>
  <atom:author>
    <atom:name>anonymous</atom:name>
  </atom:author>
  <atom:entry s-ramp:derived="false">
    <atom:title>sramp.sh</atom:title>
    <atom:link href="http://localhost:8080/s-ramp/core/Document/0f6f9b6b-9952-4059-ab70-7ee3442ddcf0/media"
      rel="alternate" type="application/x-sh" />
    <atom:link href="http://localhost:8080/s-ramp/core/Document/0f6f9b6b-9952-4059-ab70-7ee3442ddcf0"
      rel="self" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/Document/0f6f9b6b-9952-4059-ab70-7ee3442ddcf0/media"
      rel="edit-media" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/Document/0f6f9b6b-9952-4059-ab70-7ee3442ddcf0"
      rel="edit" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:category label="Document" scheme="x-s-ramp:2013:type" term="Document" />
    <atom:category label="Document" scheme="x-s-ramp:2013:model" term="core" />
    <atom:updated>2013-07-22T12:22:01.953-04:00</atom:updated>
    <atom:id>0f6f9b6b-9952-4059-ab70-7ee3442ddcf0</atom:id>
    <atom:published>2013-07-22T12:21:49.499-04:00</atom:published>
    <atom:author>
      <atom:name>eric</atom:name>
    </atom:author>
    <atom:content src="http://localhost:8080/s-ramp/core/Document/0f6f9b6b-9952-4059-ab70-7ee3442ddcf0/media"
      type="application/x-sh" />
  </atom:entry>
  <atom:entry s-ramp:derived="false">
    <atom:title>beans.xml</atom:title>
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/20474032-9536-4cef-812c-4fea432fdebd/media"
      rel="alternate" type="application/xml" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/20474032-9536-4cef-812c-4fea432fdebd"
      rel="self" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/20474032-9536-4cef-812c-4fea432fdebd/media"
      rel="edit-media" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/20474032-9536-4cef-812c-4fea432fdebd"
      rel="edit" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:category label="XML Document" scheme="x-s-ramp:2013:type" term="XmlDocument" />
    <atom:category label="XML Document" scheme="x-s-ramp:2013:model" term="core" />
    <atom:updated>2013-07-22T12:19:27.660-04:00</atom:updated>
    <atom:id>20474032-9536-4cef-812c-4fea432fdebd</atom:id>
    <atom:published>2013-07-22T12:19:27.644-04:00</atom:published>
    <atom:author>
      <atom:name>eric</atom:name>
    </atom:author>
    <atom:content src="http://localhost:8080/s-ramp/core/XmlDocument/20474032-9536-4cef-812c-4fea432fdebd/media"
      type="application/xml" />
  </atom:entry>
  <atom:entry s-ramp:derived="false">
    <atom:title>forge.xml</atom:title>
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/2c21a9d3-0d09-41d8-8783-f3e795d8690d/media"
      rel="alternate" type="application/xml" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/2c21a9d3-0d09-41d8-8783-f3e795d8690d"
      rel="self" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/2c21a9d3-0d09-41d8-8783-f3e795d8690d/media"
      rel="edit-media" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/2c21a9d3-0d09-41d8-8783-f3e795d8690d"
      rel="edit" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:category label="XML Document" scheme="x-s-ramp:2013:type" term="XmlDocument" />
    <atom:category label="XML Document" scheme="x-s-ramp:2013:model" term="core" />
    <atom:updated>2013-07-22T12:19:25.576-04:00</atom:updated>
    <atom:id>2c21a9d3-0d09-41d8-8783-f3e795d8690d</atom:id>
    <atom:published>2013-07-22T12:19:25.555-04:00</atom:published>
    <atom:author>
      <atom:name>eric</atom:name>
    </atom:author>
    <atom:content src="http://localhost:8080/s-ramp/core/XmlDocument/2c21a9d3-0d09-41d8-8783-f3e795d8690d/media"
      type="application/xml" />
  </atom:entry>
  <atom:entry s-ramp:derived="false">
    <atom:title>route.xml</atom:title>
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/5b653bfe-4f58-451e-b738-394e61c0c5f9/media"
      rel="alternate" type="application/xml" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/5b653bfe-4f58-451e-b738-394e61c0c5f9"
      rel="self" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/5b653bfe-4f58-451e-b738-394e61c0c5f9/media"
      rel="edit-media" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/5b653bfe-4f58-451e-b738-394e61c0c5f9"
      rel="edit" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:category label="XML Document" scheme="x-s-ramp:2013:type" term="XmlDocument" />
    <atom:category label="XML Document" scheme="x-s-ramp:2013:model" term="core" />
    <atom:updated>2013-07-22T12:19:25.602-04:00</atom:updated>
    <atom:id>5b653bfe-4f58-451e-b738-394e61c0c5f9</atom:id>
    <atom:published>2013-07-22T12:19:25.577-04:00</atom:published>
    <atom:author>
      <atom:name>eric</atom:name>
    </atom:author>
    <atom:content src="http://localhost:8080/s-ramp/core/XmlDocument/5b653bfe-4f58-451e-b738-394e61c0c5f9/media"
      type="application/xml" />
  </atom:entry>
  <atom:entry s-ramp:derived="false">
    <atom:title>beans.xml</atom:title>
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/a3f9d4d7-0f95-4219-85f6-84df445ef270/media"
      rel="alternate" type="application/xml" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/a3f9d4d7-0f95-4219-85f6-84df445ef270"
      rel="self" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/a3f9d4d7-0f95-4219-85f6-84df445ef270/media"
      rel="edit-media" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/a3f9d4d7-0f95-4219-85f6-84df445ef270"
      rel="edit" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:category label="XML Document" scheme="x-s-ramp:2013:type" term="XmlDocument" />
    <atom:category label="XML Document" scheme="x-s-ramp:2013:model" term="core" />
    <atom:updated>2013-07-22T12:19:21.498-04:00</atom:updated>
    <atom:id>a3f9d4d7-0f95-4219-85f6-84df445ef270</atom:id>
    <atom:published>2013-07-22T12:19:21.376-04:00</atom:published>
    <atom:author>
      <atom:name>eric</atom:name>
    </atom:author>
    <atom:content src="http://localhost:8080/s-ramp/core/XmlDocument/a3f9d4d7-0f95-4219-85f6-84df445ef270/media"
      type="application/xml" />
  </atom:entry>
</atom:feed>
----

[[api-query]]
API: Query (GET)
++++++++++++++++
----
  /s-ramp
----
Performs an S-RAMP query and returns an Atom feed containing the matching artifacts.

[width="50%",options="header"]
|=============================
|#HTTP Method# |#Request#     |#Response#
|GET           |N/A           |Atom Feed
|=============================

This endpoint is used to perform an S-RAMP query and return an Atom Feed of the 
results.  Ordering and paging is supported.  The query and other parameters are
passed as query params in the request.  The feed contains Atom summary Entries - 
one for each artifact in the feed.

'Example Request'
----
GET /s-ramp?query=/s-ramp/core/Document HTTP/1.1
----

'Example Response'
----
HTTP/1.1 200 OK

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<atom:feed xmlns:atom="http://www.w3.org/2005/Atom" xmlns:s-ramp="http://docs.oasis-open.org/s-ramp/ns/s-ramp-v1.0"
  s-ramp:itemsPerPage="100" s-ramp:provider="Artificer" s-ramp:startIndex="0" s-ramp:totalResults="5">
  <atom:title>S-RAMP Feed</atom:title>
  <atom:subtitle>Ad Hoc query feed</atom:subtitle>
  <atom:updated>2013-07-22T12:50:16.605-04:00</atom:updated>
  <atom:id>1647967f-a6f4-4e9c-82d3-ac422fb152f3</atom:id>
  <atom:author>
    <atom:name>anonymous</atom:name>
  </atom:author>
  <atom:entry s-ramp:derived="false">
    <atom:title>sramp.sh</atom:title>
    <atom:link href="http://localhost:8080/s-ramp/core/Document/0f6f9b6b-9952-4059-ab70-7ee3442ddcf0/media"
      rel="alternate" type="application/x-sh" />
    <atom:link href="http://localhost:8080/s-ramp/core/Document/0f6f9b6b-9952-4059-ab70-7ee3442ddcf0"
      rel="self" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/Document/0f6f9b6b-9952-4059-ab70-7ee3442ddcf0/media"
      rel="edit-media" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/Document/0f6f9b6b-9952-4059-ab70-7ee3442ddcf0"
      rel="edit" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:category label="Document" scheme="x-s-ramp:2013:type" term="Document" />
    <atom:category label="Document" scheme="x-s-ramp:2013:model" term="core" />
    <atom:updated>2013-07-22T12:22:01.953-04:00</atom:updated>
    <atom:id>0f6f9b6b-9952-4059-ab70-7ee3442ddcf0</atom:id>
    <atom:published>2013-07-22T12:21:49.499-04:00</atom:published>
    <atom:author>
      <atom:name>eric</atom:name>
    </atom:author>
    <atom:content src="http://localhost:8080/s-ramp/core/Document/0f6f9b6b-9952-4059-ab70-7ee3442ddcf0/media"
      type="application/x-sh" />
  </atom:entry>
  <atom:entry s-ramp:derived="false">
    <atom:title>beans.xml</atom:title>
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/20474032-9536-4cef-812c-4fea432fdebd/media"
      rel="alternate" type="application/xml" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/20474032-9536-4cef-812c-4fea432fdebd"
      rel="self" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/20474032-9536-4cef-812c-4fea432fdebd/media"
      rel="edit-media" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/20474032-9536-4cef-812c-4fea432fdebd"
      rel="edit" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:category label="XML Document" scheme="x-s-ramp:2013:type" term="XmlDocument" />
    <atom:category label="XML Document" scheme="x-s-ramp:2013:model" term="core" />
    <atom:updated>2013-07-22T12:19:27.660-04:00</atom:updated>
    <atom:id>20474032-9536-4cef-812c-4fea432fdebd</atom:id>
    <atom:published>2013-07-22T12:19:27.644-04:00</atom:published>
    <atom:author>
      <atom:name>eric</atom:name>
    </atom:author>
    <atom:content src="http://localhost:8080/s-ramp/core/XmlDocument/20474032-9536-4cef-812c-4fea432fdebd/media"
      type="application/xml" />
  </atom:entry>
  <atom:entry s-ramp:derived="false">
    <atom:title>forge.xml</atom:title>
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/2c21a9d3-0d09-41d8-8783-f3e795d8690d/media"
      rel="alternate" type="application/xml" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/2c21a9d3-0d09-41d8-8783-f3e795d8690d"
      rel="self" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/2c21a9d3-0d09-41d8-8783-f3e795d8690d/media"
      rel="edit-media" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/2c21a9d3-0d09-41d8-8783-f3e795d8690d"
      rel="edit" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:category label="XML Document" scheme="x-s-ramp:2013:type" term="XmlDocument" />
    <atom:category label="XML Document" scheme="x-s-ramp:2013:model" term="core" />
    <atom:updated>2013-07-22T12:19:25.576-04:00</atom:updated>
    <atom:id>2c21a9d3-0d09-41d8-8783-f3e795d8690d</atom:id>
    <atom:published>2013-07-22T12:19:25.555-04:00</atom:published>
    <atom:author>
      <atom:name>eric</atom:name>
    </atom:author>
    <atom:content src="http://localhost:8080/s-ramp/core/XmlDocument/2c21a9d3-0d09-41d8-8783-f3e795d8690d/media"
      type="application/xml" />
  </atom:entry>
  <atom:entry s-ramp:derived="false">
    <atom:title>route.xml</atom:title>
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/5b653bfe-4f58-451e-b738-394e61c0c5f9/media"
      rel="alternate" type="application/xml" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/5b653bfe-4f58-451e-b738-394e61c0c5f9"
      rel="self" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/5b653bfe-4f58-451e-b738-394e61c0c5f9/media"
      rel="edit-media" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/5b653bfe-4f58-451e-b738-394e61c0c5f9"
      rel="edit" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:category label="XML Document" scheme="x-s-ramp:2013:type" term="XmlDocument" />
    <atom:category label="XML Document" scheme="x-s-ramp:2013:model" term="core" />
    <atom:updated>2013-07-22T12:19:25.602-04:00</atom:updated>
    <atom:id>5b653bfe-4f58-451e-b738-394e61c0c5f9</atom:id>
    <atom:published>2013-07-22T12:19:25.577-04:00</atom:published>
    <atom:author>
      <atom:name>eric</atom:name>
    </atom:author>
    <atom:content src="http://localhost:8080/s-ramp/core/XmlDocument/5b653bfe-4f58-451e-b738-394e61c0c5f9/media"
      type="application/xml" />
  </atom:entry>
  <atom:entry s-ramp:derived="false">
    <atom:title>beans.xml</atom:title>
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/a3f9d4d7-0f95-4219-85f6-84df445ef270/media"
      rel="alternate" type="application/xml" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/a3f9d4d7-0f95-4219-85f6-84df445ef270"
      rel="self" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/a3f9d4d7-0f95-4219-85f6-84df445ef270/media"
      rel="edit-media" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/a3f9d4d7-0f95-4219-85f6-84df445ef270"
      rel="edit" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:category label="XML Document" scheme="x-s-ramp:2013:type" term="XmlDocument" />
    <atom:category label="XML Document" scheme="x-s-ramp:2013:model" term="core" />
    <atom:updated>2013-07-22T12:19:21.498-04:00</atom:updated>
    <atom:id>a3f9d4d7-0f95-4219-85f6-84df445ef270</atom:id>
    <atom:published>2013-07-22T12:19:21.376-04:00</atom:published>
    <atom:author>
      <atom:name>eric</atom:name>
    </atom:author>
    <atom:content src="http://localhost:8080/s-ramp/core/XmlDocument/a3f9d4d7-0f95-4219-85f6-84df445ef270/media"
      type="application/xml" />
  </atom:entry>
</atom:feed>
----


[[api-query-1]]
API: Query (POST)
+++++++++++++++++
----
  /s-ramp
----
Performs an S-RAMP query and returns an Atom feed containing the matching artifacts.

[width="50%",options="header"]
|=============================
|#HTTP Method# |#Request#     |#Response#
|POST          |FormData      |Atom Feed
|=============================

This endpoint is used to perform an S-RAMP query and return an Atom Feed of the 
results.  Ordering and paging is supported.  The query and other parameters are
passed as form data params in the request body.  The feed contains Atom summary 
Entries - one for each artifact in the feed.

'Example Request'
----
POST /s-ramp HTTP/1.1

--ac709f11-bfc5-48df-8918-e58b254d0490
Content-Disposition: form-data; name="query"
Content-Type: text/plain

core/Document
--ac709f11-bfc5-48df-8918-e58b254d0490
Content-Disposition: form-data; name="startIndex"
Content-Type: text/plain

0
--ac709f11-bfc5-48df-8918-e58b254d0490
Content-Disposition: form-data; name="count"
Content-Type: text/plain

100
--ac709f11-bfc5-48df-8918-e58b254d0490
Content-Disposition: form-data; name="orderBy"
Content-Type: text/plain

uuid
--ac709f11-bfc5-48df-8918-e58b254d0490
Content-Disposition: form-data; name="ascending"
Content-Type: text/plain

true
--ac709f11-bfc5-48df-8918-e58b254d0490--
----

'Example Response'
----
HTTP/1.1 200 OK

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<atom:feed xmlns:atom="http://www.w3.org/2005/Atom" xmlns:s-ramp="http://docs.oasis-open.org/s-ramp/ns/s-ramp-v1.0"
  s-ramp:itemsPerPage="100" s-ramp:provider="Artificer" s-ramp:startIndex="0" s-ramp:totalResults="5">
  <atom:title>S-RAMP Feed</atom:title>
  <atom:subtitle>Ad Hoc query feed</atom:subtitle>
  <atom:updated>2013-07-22T12:50:16.605-04:00</atom:updated>
  <atom:id>1647967f-a6f4-4e9c-82d3-ac422fb152f3</atom:id>
  <atom:author>
    <atom:name>anonymous</atom:name>
  </atom:author>
  <atom:entry s-ramp:derived="false">
    <atom:title>sramp.sh</atom:title>
    <atom:link href="http://localhost:8080/s-ramp/core/Document/0f6f9b6b-9952-4059-ab70-7ee3442ddcf0/media"
      rel="alternate" type="application/x-sh" />
    <atom:link href="http://localhost:8080/s-ramp/core/Document/0f6f9b6b-9952-4059-ab70-7ee3442ddcf0"
      rel="self" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/Document/0f6f9b6b-9952-4059-ab70-7ee3442ddcf0/media"
      rel="edit-media" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/Document/0f6f9b6b-9952-4059-ab70-7ee3442ddcf0"
      rel="edit" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:category label="Document" scheme="x-s-ramp:2013:type" term="Document" />
    <atom:category label="Document" scheme="x-s-ramp:2013:model" term="core" />
    <atom:updated>2013-07-22T12:22:01.953-04:00</atom:updated>
    <atom:id>0f6f9b6b-9952-4059-ab70-7ee3442ddcf0</atom:id>
    <atom:published>2013-07-22T12:21:49.499-04:00</atom:published>
    <atom:author>
      <atom:name>eric</atom:name>
    </atom:author>
    <atom:content src="http://localhost:8080/s-ramp/core/Document/0f6f9b6b-9952-4059-ab70-7ee3442ddcf0/media"
      type="application/x-sh" />
  </atom:entry>
  <atom:entry s-ramp:derived="false">
    <atom:title>beans.xml</atom:title>
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/20474032-9536-4cef-812c-4fea432fdebd/media"
      rel="alternate" type="application/xml" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/20474032-9536-4cef-812c-4fea432fdebd"
      rel="self" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/20474032-9536-4cef-812c-4fea432fdebd/media"
      rel="edit-media" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/20474032-9536-4cef-812c-4fea432fdebd"
      rel="edit" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:category label="XML Document" scheme="x-s-ramp:2013:type" term="XmlDocument" />
    <atom:category label="XML Document" scheme="x-s-ramp:2013:model" term="core" />
    <atom:updated>2013-07-22T12:19:27.660-04:00</atom:updated>
    <atom:id>20474032-9536-4cef-812c-4fea432fdebd</atom:id>
    <atom:published>2013-07-22T12:19:27.644-04:00</atom:published>
    <atom:author>
      <atom:name>eric</atom:name>
    </atom:author>
    <atom:content src="http://localhost:8080/s-ramp/core/XmlDocument/20474032-9536-4cef-812c-4fea432fdebd/media"
      type="application/xml" />
  </atom:entry>
  <atom:entry s-ramp:derived="false">
    <atom:title>forge.xml</atom:title>
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/2c21a9d3-0d09-41d8-8783-f3e795d8690d/media"
      rel="alternate" type="application/xml" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/2c21a9d3-0d09-41d8-8783-f3e795d8690d"
      rel="self" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/2c21a9d3-0d09-41d8-8783-f3e795d8690d/media"
      rel="edit-media" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/2c21a9d3-0d09-41d8-8783-f3e795d8690d"
      rel="edit" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:category label="XML Document" scheme="x-s-ramp:2013:type" term="XmlDocument" />
    <atom:category label="XML Document" scheme="x-s-ramp:2013:model" term="core" />
    <atom:updated>2013-07-22T12:19:25.576-04:00</atom:updated>
    <atom:id>2c21a9d3-0d09-41d8-8783-f3e795d8690d</atom:id>
    <atom:published>2013-07-22T12:19:25.555-04:00</atom:published>
    <atom:author>
      <atom:name>eric</atom:name>
    </atom:author>
    <atom:content src="http://localhost:8080/s-ramp/core/XmlDocument/2c21a9d3-0d09-41d8-8783-f3e795d8690d/media"
      type="application/xml" />
  </atom:entry>
  <atom:entry s-ramp:derived="false">
    <atom:title>route.xml</atom:title>
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/5b653bfe-4f58-451e-b738-394e61c0c5f9/media"
      rel="alternate" type="application/xml" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/5b653bfe-4f58-451e-b738-394e61c0c5f9"
      rel="self" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/5b653bfe-4f58-451e-b738-394e61c0c5f9/media"
      rel="edit-media" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/5b653bfe-4f58-451e-b738-394e61c0c5f9"
      rel="edit" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:category label="XML Document" scheme="x-s-ramp:2013:type" term="XmlDocument" />
    <atom:category label="XML Document" scheme="x-s-ramp:2013:model" term="core" />
    <atom:updated>2013-07-22T12:19:25.602-04:00</atom:updated>
    <atom:id>5b653bfe-4f58-451e-b738-394e61c0c5f9</atom:id>
    <atom:published>2013-07-22T12:19:25.577-04:00</atom:published>
    <atom:author>
      <atom:name>eric</atom:name>
    </atom:author>
    <atom:content src="http://localhost:8080/s-ramp/core/XmlDocument/5b653bfe-4f58-451e-b738-394e61c0c5f9/media"
      type="application/xml" />
  </atom:entry>
  <atom:entry s-ramp:derived="false">
    <atom:title>beans.xml</atom:title>
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/a3f9d4d7-0f95-4219-85f6-84df445ef270/media"
      rel="alternate" type="application/xml" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/a3f9d4d7-0f95-4219-85f6-84df445ef270"
      rel="self" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/a3f9d4d7-0f95-4219-85f6-84df445ef270/media"
      rel="edit-media" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link href="http://localhost:8080/s-ramp/core/XmlDocument/a3f9d4d7-0f95-4219-85f6-84df445ef270"
      rel="edit" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:category label="XML Document" scheme="x-s-ramp:2013:type" term="XmlDocument" />
    <atom:category label="XML Document" scheme="x-s-ramp:2013:model" term="core" />
    <atom:updated>2013-07-22T12:19:21.498-04:00</atom:updated>
    <atom:id>a3f9d4d7-0f95-4219-85f6-84df445ef270</atom:id>
    <atom:published>2013-07-22T12:19:21.376-04:00</atom:published>
    <atom:author>
      <atom:name>eric</atom:name>
    </atom:author>
    <atom:content src="http://localhost:8080/s-ramp/core/XmlDocument/a3f9d4d7-0f95-4219-85f6-84df445ef270/media"
      type="application/xml" />
  </atom:entry>
</atom:feed>
----


[[api-batch-processing]]
API: Batch Processing
+++++++++++++++++++++
----
  /s-ramp
----
Performs an S-RAMP query and returns an Atom feed containing the matching artifacts.

[width="50%",options="header"]
|=============================
|#HTTP Method# |#Request#            |#Response#
|POST          |multipart/form-data  |Atom Feed
|=============================

This endpoint is used to perform an S-RAMP query and return an Atom Feed of the 
results.  Ordering and paging is supported.  The query and other parameters are
passed as form data params in the request body.  The feed contains Atom summary 
Entries - one for each artifact in the feed.

'Example Request'
----
POST XX_TBD_XX HTTP/1.1
----

'Example Response'
----
HTTP/1.1 200 OK

XX_TBD_XX
----


Stored Queries
^^^^^^^^^^^^^^

S-RAMP queries can be utilized through the "stored query" concept.  The query is persisted within the S-RAMP repository
and can be repeatedly executed by name.

[[api-create-storedquery]]
API: Create Stored Query
++++++++++++++++++++++++
----
  /s-ramp/query
----
Creates a new stored query in the repository.  The body of the request must be the stored query, wrapped as an Atom
Entry.  The response is also an Atom Entry containing additional, server-generated meta-data.

[width="50%",options="header"]
|=============================
|#HTTP Method# |#Request#            |#Response#
|POST          |Atom Entry           |Atom Entry
|=============================

'Example Request'
----
POST /s-ramp/query 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">
  <s-ramp:storedQueryData>
    <s-ramp:queryName>FooQuery</s-ramp:queryName>
    <s-ramp:queryString>/s-ramp/ext/FooType</s-ramp:queryString>
    <s-ramp:propertyName>importantProperty1</s-ramp:propertyName>
    <s-ramp:propertyName>importantProperty2</s-ramp:propertyName>
  </s-ramp:storedQueryData>
</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">
  <atom:title>Stored Query: FooQuery</atom:title>
  <atom:link href="http://localhost:9093/artificer-server/s-ramp/query/FooQuery"
    rel="self" type="application/atom+xml;type=&quot;entry&quot;" />
  <atom:link href="http://localhost:9093/artificer-server/s-ramp/query/FooQuery"
    rel="edit" type="application/atom+xml;type=&quot;entry&quot;" />
  <atom:link
    href="http://localhost:9093/artificer-server/s-ramp/query/FooQuery/results"
    rel="urn:x-s-ramp:2013:query:results" type="application/atom+xml;type=&quot;feed&quot;" />
  <atom:category label="Stored Query Entry" scheme="urn:x-s-ramp:2013:type"
    term="query" />
  <atom:id>urn:uuid:FooQuery</atom:id>
  <atom:content>Stored Query Entry</atom:content>
  <s-ramp:storedQueryData>
    <s-ramp:queryName>FooQuery</s-ramp:queryName>
    <s-ramp:queryString>/s-ramp/ext/FooType</s-ramp:queryString>
    <s-ramp:propertyName>importantProperty1</s-ramp:propertyName>
    <s-ramp:propertyName>importantProperty2</s-ramp:propertyName>
  </s-ramp:storedQueryData>
</atom:entry>
----

[[api-update-storedquery]]
API: Update Stored Query
++++++++++++++++++++++++
----
  /s-ramp/query/{queryName}
----
Updates the given stored query in the repository.  The body of the request is the same Atom Entry as in
xref:api-create-storedquery[Create Stored Query].

[width="50%",options="header"]
|=============================
|#HTTP Method# |#Request#            |#Response#
|PUT           |Atom Entry           |N/A
|=============================

[[api-list-storedquery]]
API: List Stored Queries
++++++++++++++++++++++++
----
  /s-ramp/query
----
Retrieves all stored queries from the repository.

[width="50%",options="header"]
|=============================
|#HTTP Method# |#Request#            |#Response#
|GET           |N/A                  |Atom Feed
|=============================

'Example Response'
----
HTTP/1.1 200 OK

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<atom:feed 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>S-RAMP stored queries feed</atom:title>
  <atom:updated>2014-09-25T16:45:10.133-04:00</atom:updated>
  <atom:entry>
    <atom:title>Stored Query: FooQuery</atom:title>
    <atom:link
      href="http://localhost:9093/artificer-server/s-ramp/query/FooQuery"
      rel="self" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link
      href="http://localhost:9093/artificer-server/s-ramp/query/FooQuery"
      rel="edit" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link
      href="http://localhost:9093/artificer-server/s-ramp/query/FooQuery/results"
      rel="urn:x-s-ramp:2013:query:results" type="application/atom+xml;type=&quot;feed&quot;" />
    <atom:category label="Stored Query Entry" scheme="urn:x-s-ramp:2013:type"
      term="query" />
    <atom:id>urn:uuid:FooQuery</atom:id>
    <atom:content>Stored Query Entry</atom:content>
    <s-ramp:storedQueryData>
      <s-ramp:queryName>FooQuery</s-ramp:queryName>
      <s-ramp:queryString>/s-ramp/ext/FooType</s-ramp:queryString>
      <s-ramp:propertyName>importantProperty1</s-ramp:propertyName>
      <s-ramp:propertyName>importantProperty2</s-ramp:propertyName>
    </s-ramp:storedQueryData>
  </atom:entry>
  <atom:entry>
    <atom:title>Stored Query: FooQuery2</atom:title>
    <atom:link
      href="http://localhost:9093/artificer-server/s-ramp/query/FooQuery2"
      rel="self" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link
      href="http://localhost:9093/artificer-server/s-ramp/query/FooQuery2"
      rel="edit" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link
      href="http://localhost:9093/artificer-server/s-ramp/query/FooQuery2/results"
      rel="urn:x-s-ramp:2013:query:results" type="application/atom+xml;type=&quot;feed&quot;" />
    <atom:category label="Stored Query Entry" scheme="urn:x-s-ramp:2013:type"
      term="query" />
    <atom:id>urn:uuid:FooQuery2</atom:id>
    <atom:content>Stored Query Entry</atom:content>
    <s-ramp:storedQueryData>
      <s-ramp:queryName>FooQuery2</s-ramp:queryName>
      <s-ramp:queryString>/s-ramp/ext/FooType</s-ramp:queryString>
    </s-ramp:storedQueryData>
  </atom:entry>
</atom:feed>
----

[[api-get-storedquery]]
API: Get Stored Query
+++++++++++++++++++++
----
  /s-ramp/query/{queryName}
----
Retrieves the given stored query from the repository.

[width="50%",options="header"]
|=============================
|#HTTP Method# |#Request#            |#Response#
|GET           |N/A                  |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">
  <atom:title>Stored Query: FooQuery</atom:title>
  <atom:link href="http://localhost:9093/artificer-server/s-ramp/query/FooQuery"
    rel="self" type="application/atom+xml;type=&quot;entry&quot;" />
  <atom:link href="http://localhost:9093/artificer-server/s-ramp/query/FooQuery"
    rel="edit" type="application/atom+xml;type=&quot;entry&quot;" />
  <atom:link
    href="http://localhost:9093/artificer-server/s-ramp/query/FooQuery/results"
    rel="urn:x-s-ramp:2013:query:results" type="application/atom+xml;type=&quot;feed&quot;" />
  <atom:category label="Stored Query Entry" scheme="urn:x-s-ramp:2013:type"
    term="query" />
  <atom:id>urn:uuid:FooQuery</atom:id>
  <atom:content>Stored Query Entry</atom:content>
  <s-ramp:storedQueryData>
    <s-ramp:queryName>FooQuery</s-ramp:queryName>
    <s-ramp:queryString>/s-ramp/ext/FooType</s-ramp:queryString>
    <s-ramp:propertyName>importantProperty1</s-ramp:propertyName>
    <s-ramp:propertyName>importantProperty2</s-ramp:propertyName>
  </s-ramp:storedQueryData>
</atom:entry>
----

[[api-execute-storedquery]]
API: Execute Stored Query
+++++++++++++++++++++++++
----
  /s-ramp/query/{queryName}/results
----
Similar to a normal, ad-hoc xref:api-query[Query], this returns an Atom Feed of artifact entries.

[width="50%",options="header"]
|=============================
|#HTTP Method# |#Request#            |#Response#
|GET           |N/A                  |Atom Feed
|=============================

'Example Request'
----
GET /artificer-server/s-ramp/query/FooQuery/results?startIndex=0&count=20&orderBy=name&ascending=true HTTP/1.1
----

Note that the paging and ordering parameters are optional and have reasonable defaults (defaults are shown values).

'Example Response'
----
HTTP/1.1 200 OK

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<atom:feed 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:provider="Artificer" s-ramp:itemsPerPage="20"
  s-ramp:startIndex="0" s-ramp:totalResults="2">
  <atom:title>S-RAMP Feed</atom:title>
  <atom:subtitle>Ad Hoc query feed</atom:subtitle>
  <atom:updated>2014-09-25T17:03:32.504-04:00</atom:updated>
  <atom:id>b4746dcd-82b9-433a-9d61-e54a384ae4e6</atom:id>
  <atom:author>
    <atom:name>anonymous</atom:name>
  </atom:author>
  <atom:entry s-ramp:derived="false" s-ramp:extendedType="FooType">
    <atom:title>FooArtifact</atom:title>
    <atom:link
      href="http://localhost:9093/artificer-server/s-ramp/ext/FooType/f57c30d3-9a9a-4df9-b362-8f0b0816af99"
      rel="self" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link
      href="http://localhost:9093/artificer-server/s-ramp/ext/FooType/f57c30d3-9a9a-4df9-b362-8f0b0816af99/media"
      rel="edit-media" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link
      href="http://localhost:9093/artificer-server/s-ramp/ext/FooType/f57c30d3-9a9a-4df9-b362-8f0b0816af99"
      rel="edit" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:category label="Extended Artifact Type" scheme="x-s-ramp:2013:type"
      term="FooType" />
    <atom:category label="Extended Artifact Type" scheme="x-s-ramp:2013:model"
      term="ext" />
    <atom:updated>2014-09-25T17:03:27.392-04:00</atom:updated>
    <atom:id>f57c30d3-9a9a-4df9-b362-8f0b0816af99</atom:id>
    <atom:published>2014-09-25T17:03:27.392-04:00</atom:published>
    <atom:author>
      <atom:name>asdf</atom:name>
    </atom:author>
    <s-ramp:artifact>
      <s-ramp:ExtendedArtifactType />
    </s-ramp:artifact>
  </atom:entry>
  <atom:entry s-ramp:derived="false" s-ramp:extendedType="FooType">
    <atom:title>FooArtifact2</atom:title>
    <atom:link
      href="http://localhost:9093/artificer-server/s-ramp/ext/FooType/e8b6aaf2-d787-45d0-a534-b9205d6e8815"
      rel="self" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link
      href="http://localhost:9093/artificer-server/s-ramp/ext/FooType/e8b6aaf2-d787-45d0-a534-b9205d6e8815/media"
      rel="edit-media" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:link
      href="http://localhost:9093/artificer-server/s-ramp/ext/FooType/e8b6aaf2-d787-45d0-a534-b9205d6e8815"
      rel="edit" type="application/atom+xml;type=&quot;entry&quot;" />
    <atom:category label="Extended Artifact Type" scheme="x-s-ramp:2013:type"
      term="FooType" />
    <atom:category label="Extended Artifact Type" scheme="x-s-ramp:2013:model"
      term="ext" />
    <atom:updated>2014-09-25T17:03:29.580-04:00</atom:updated>
    <atom:id>e8b6aaf2-d787-45d0-a534-b9205d6e8815</atom:id>
    <atom:published>2014-09-25T17:03:29.580-04:00</atom:published>
    <atom:author>
      <atom:name>asdf</atom:name>
    </atom:author>
    <s-ramp:artifact>
      <s-ramp:ExtendedArtifactType />
    </s-ramp:artifact>
  </atom:entry>
</atom:feed>
----

[[api-delete-storedquery]]
API: Delete Stored Query
++++++++++++++++++++++++
----
  /s-ramp/query/{queryName}
----
Deletes the given stored query from the repository.

[width="50%",options="header"]
|=============================
|#HTTP Method# |#Request#            |#Response#
|DELETE        |N/A                  |N/A
|=============================


Ontologies
~~~~~~~~~~

[[api-add-ontology]]
API: Add Ontology
^^^^^^^^^^^^^^^^^
----
  /s-ramp/ontology
----
Adds a new ontology (*.owl file) to the repository.  This allows artifacts to be classified using
the classes defined in the ontology.

[width="50%",options="header"]
|=============================
|#HTTP Method# |#Request#            |#Response#
|POST          |application/rdf+xml  |Atom Entry
|=============================

This endpoint is used to add an ontology to the repository.  The body of the request
must be the OWL Lite formatted ontology (see the S-RAMP specification for more details).
The response is an Atom Entry containing meta-data about the ontology, most importantly
the UUID of the ontology (which can be later used to update or delete it).

'Example Request'
----
POST /s-ramp/ontology HTTP/1.1

<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
    xmlns:owl="http://www.w3.org/2002/07/owl#"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xml:base="http://www.example.org/sample-ontology-1.owl">
    
    <owl:Ontology rdf:ID="SampleOntology1">
        <rdfs:label>Sample Ontology 1</rdfs:label>
        <rdfs:comment>A sample ontology.</rdfs:comment>
    </owl:Ontology>
    
    <owl:Class rdf:ID="All">
        <rdfs:label>All</rdfs:label>
    </owl:Class>
    
    <owl:Class rdf:ID="King">
        <rdfs:subClassOf rdf:resource="http://www.example.org/sample-ontology-1.owl#All" />
        <rdfs:label>King</rdfs:label>
        <rdfs:comment>Feudal ruler.</rdfs:comment>
    </owl:Class>
    <owl:Class rdf:ID="Imperator">
        <rdfs:subClassOf rdf:resource="http://www.example.org/sample-ontology-1.owl#All" />
        <rdfs:label>Imperator</rdfs:label>
        <rdfs:comment>Roman ruler.</rdfs:comment>
    </owl:Class>

    <owl:Class rdf:ID="Baron">
        <rdfs:subClassOf rdf:resource="http://www.example.org/sample-ontology-1.owl#King" />
        <rdfs:label>Baron</rdfs:label>
    </owl:Class>
    <owl:Class rdf:ID="Rex">
        <rdfs:subClassOf rdf:resource="http://www.example.org/sample-ontology-1.owl#Imperator" />
        <rdfs:label>Imperator</rdfs:label>
    </owl:Class>

    <owl:Class rdf:ID="Knight">
        <rdfs:subClassOf rdf:resource="http://www.example.org/sample-ontology-1.owl#Baron" />
        <rdfs:label>Knight</rdfs:label>
    </owl:Class>
    <owl:Class rdf:ID="Dux">
        <rdfs:subClassOf rdf:resource="http://www.example.org/sample-ontology-1.owl#Rex" />
        <rdfs:label>Dux</rdfs:label>
    </owl:Class>
    
</rdf:RDF>
----

'Example Response'
----
HTTP/1.1 200 OK

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<atom:entry xmlns="http://www.w3.org/2000/01/rdf-schema#" xmlns:atom="http://www.w3.org/2005/Atom"
  xmlns:ns2="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ns3="http://www.w3.org/2002/07/owl#">
  <atom:title>Sample Ontology 1</atom:title>
  <atom:id>e8fe74f3-c9c3-4678-ba76-d71158141ddd</atom:id>
  <atom:author />
  <atom:summary>A sample ontology.</atom:summary>
  <ns2:RDF xml:base="http://www.example.org/sample-ontology-1.owl">
    <ns3:Ontology ns2:ID="SampleOntology1">
      <label>Sample Ontology 1</label>
      <comment>A sample ontology.</comment>
    </ns3:Ontology>
    <ns3:Class ns2:ID="All">
      <label>All</label>
    </ns3:Class>
    <ns3:Class ns2:ID="King">
      <subClassOf ns2:resource="http://www.example.org/sample-ontology-1.owl#All" />
      <label>King</label>
      <comment>Feudal ruler.</comment>
    </ns3:Class>
    <ns3:Class ns2:ID="Imperator">
      <subClassOf ns2:resource="http://www.example.org/sample-ontology-1.owl#All" />
      <label>Imperator</label>
      <comment>Roman ruler.</comment>
    </ns3:Class>
    <ns3:Class ns2:ID="Baron">
      <subClassOf ns2:resource="http://www.example.org/sample-ontology-1.owl#King" />
      <label>Baron</label>
    </ns3:Class>
    <ns3:Class ns2:ID="Knight">
      <subClassOf ns2:resource="http://www.example.org/sample-ontology-1.owl#Baron" />
      <label>Knight</label>
    </ns3:Class>
    <ns3:Class ns2:ID="Rex">
      <subClassOf ns2:resource="http://www.example.org/sample-ontology-1.owl#Imperator" />
      <label>Imperator</label>
    </ns3:Class>
    <ns3:Class ns2:ID="Dux">
      <subClassOf ns2:resource="http://www.example.org/sample-ontology-1.owl#Rex" />
      <label>Dux</label>
    </ns3:Class>
  </ns2:RDF>
</atom:entry>
----


[[api-list-ontologies]]
API: List Ontologies
^^^^^^^^^^^^^^^^^^^^
----
  /s-ramp/ontology
----
Retrieves, as an Atom feed, all ontologies currently known to the repository.

[width="50%",options="header"]
|=============================
|#HTTP Method# |#Request#            |#Response#
|GET           |N/A                  |Atom Feed
|=============================

This endpoint is used to retrieve all ontologies known to the repository as an
Atom Feed of Entries, with one Entry for each ontology.  Full information about
the ontology can subsequently be retrieved by calling the Get Ontology endpoint.

'Example Request'
----
GET /s-ramp/ontology HTTP/1.1
----

'Example Response'
----
HTTP/1.1 200 OK

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<atom:feed xmlns:atom="http://www.w3.org/2005/Atom">
  <atom:title>S-RAMP ontology feed</atom:title>
  <atom:updated>2013-07-23T10:58:40.356-04:00</atom:updated>
  <atom:entry>
    <atom:title>Sample Ontology 1</atom:title>
    <atom:updated>2013-07-23T10:56:50.410-04:00</atom:updated>
    <atom:id>e8fe74f3-c9c3-4678-ba76-d71158141ddd</atom:id>
    <atom:published>2013-07-23T10:56:50.410-04:00</atom:published>
    <atom:author>
      <atom:name>eric</atom:name>
    </atom:author>
    <atom:source xml:base="http://www.example.org/sample-ontology-1.owl">
      <atom:id>SampleOntology1</atom:id>
    </atom:source>
    <atom:summary>A sample ontology.</atom:summary>
  </atom:entry>
  <atom:entry>
    <atom:title>Animal Kingdom</atom:title>
    <atom:updated>2013-07-23T10:58:37.737-04:00</atom:updated>
    <atom:id>fd0e5210-2567-409f-8df0-f851e1ce630d</atom:id>
    <atom:published>2013-07-23T10:58:37.737-04:00</atom:published>
    <atom:author>
      <atom:name>eric</atom:name>
    </atom:author>
    <atom:source xml:base="http://www.example.org/sample-ontology-2.owl">
      <atom:id>AnimalKingdom</atom:id>
    </atom:source>
    <atom:summary>Animal Kingdom Ontology</atom:summary>
  </atom:entry>
</atom:feed>
----


[[api-update-ontology]]
API: Update Ontology
^^^^^^^^^^^^^^^^^^^^
----
  /s-ramp/ontology/{uuid}
----
Updates an existing ontology by its UUID.

[width="50%",options="header"]
|=============================
|#HTTP Method# |#Request#            |#Response#
|PUT           |application/rdf+xml  |N/A
|=============================

This endpoint is used to update a single ontology in the repository.  The request body
must be a new version of the ontology in OWL Lite RDF format.  Note that this might 
fail if the ontology changes in an incompatible way (e.g. a class is removed that is 
currently in use).

'Example Request'
----
PUT /s-ramp/ontology/fd0e5210-2567-409f-8df0-f851e1ce630d HTTP/1.1

<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
    xmlns:owl="http://www.w3.org/2002/07/owl#"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xml:base="http://www.example.org/sample-ontology-1.owl">
    
    <owl:Ontology rdf:ID="SampleOntology1">
        <rdfs:label>Sample Ontology 1</rdfs:label>
        <rdfs:comment>A sample ontology.</rdfs:comment>
    </owl:Ontology>
    
    <owl:Class rdf:ID="All">
        <rdfs:label>All</rdfs:label>
    </owl:Class>
    
    <owl:Class rdf:ID="King">
        <rdfs:subClassOf rdf:resource="http://www.example.org/sample-ontology-1.owl#All" />
        <rdfs:label>King</rdfs:label>
        <rdfs:comment>Feudal ruler.</rdfs:comment>
    </owl:Class>
    <owl:Class rdf:ID="Imperator">
        <rdfs:subClassOf rdf:resource="http://www.example.org/sample-ontology-1.owl#All" />
        <rdfs:label>Imperator</rdfs:label>
        <rdfs:comment>Roman ruler.</rdfs:comment>
    </owl:Class>

    <owl:Class rdf:ID="Baron">
        <rdfs:subClassOf rdf:resource="http://www.example.org/sample-ontology-1.owl#King" />
        <rdfs:label>Baron</rdfs:label>
    </owl:Class>
    <owl:Class rdf:ID="Rex">
        <rdfs:subClassOf rdf:resource="http://www.example.org/sample-ontology-1.owl#Imperator" />
        <rdfs:label>Imperator</rdfs:label>
    </owl:Class>

    <owl:Class rdf:ID="Knight">
        <rdfs:subClassOf rdf:resource="http://www.example.org/sample-ontology-1.owl#Baron" />
        <rdfs:label>Knight</rdfs:label>
    </owl:Class>
    <owl:Class rdf:ID="Dux">
        <rdfs:subClassOf rdf:resource="http://www.example.org/sample-ontology-1.owl#Rex" />
        <rdfs:label>Dux</rdfs:label>
    </owl:Class>
    
</rdf:RDF>
----

'Example Response'
----
HTTP/1.1 200 OK
----


[[api-get-ontology]]
API: Get Ontology
^^^^^^^^^^^^^^^^^
----
  /s-ramp/ontology/{uuid}
----
Returns the OWL representation of an ontology (wrapped in an Atom Entry).

[width="50%",options="header"]
|=============================
|#HTTP Method# |#Request#            |#Response#
|GET           |N/A                  |Atom Entry
|=============================

This endpoint is used to get the full ontology (by its UUID) in OWL Lite (RDF)
format, wrapped in an Atom Entry.  The response body is an Atom Entry with a single
extension element that is the ontology RDF.  This will fail if no ontology exists
with the given UUID.

'Example Request'
----
GET /s-ramp/ontology/fd0e5210-2567-409f-8df0-f851e1ce630d HTTP/1.1
----

'Example Response'
----
HTTP/1.1 200 OK

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<atom:entry xmlns="http://www.w3.org/2000/01/rdf-schema#" xmlns:atom="http://www.w3.org/2005/Atom"
  xmlns:ns2="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:ns3="http://www.w3.org/2002/07/owl#">
  <atom:title>Animal Kingdom</atom:title>
  <atom:updated>2013-07-23T10:58:37.737-04:00</atom:updated>
  <atom:id>fd0e5210-2567-409f-8df0-f851e1ce630d</atom:id>
  <atom:published>2013-07-23T10:58:37.737-04:00</atom:published>
  <atom:author>
    <atom:name>eric</atom:name>
  </atom:author>
  <atom:summary>Animal Kingdom Ontology</atom:summary>
  <ns2:RDF xml:base="http://www.example.org/sample-ontology-2.owl">
    <ns3:Ontology ns2:ID="AnimalKingdom">
      <label>Animal Kingdom</label>
      <comment>Animal Kingdom Ontology</comment>
    </ns3:Ontology>
    <ns3:Class ns2:ID="Animal">
      <label>Animal</label>
      <comment>All animals.</comment>
    </ns3:Class>
    <ns3:Class ns2:ID="UnicellularAnimal">
      <subClassOf ns2:resource="http://www.example.org/sample-ontology-2.owl#Animal" />
      <label>Unicellular Animal</label>
      <comment>Single-celled animal.</comment>
    </ns3:Class>
    <ns3:Class ns2:ID="MulticellularAnimal">
      <subClassOf ns2:resource="http://www.example.org/sample-ontology-2.owl#Animal" />
      <label>Multicellular Animal</label>
      <comment>Multi-celled animal.</comment>
    </ns3:Class>
    <ns3:Class ns2:ID="Protozoa">
      <subClassOf ns2:resource="http://www.example.org/sample-ontology-2.owl#UnicellularAnimal" />
      <label>Protozoa</label>
    </ns3:Class>
    <ns3:Class ns2:ID="Metazoa">
      <subClassOf ns2:resource="http://www.example.org/sample-ontology-2.owl#MulticellularAnimal" />
      <label>Metazoa</label>
    </ns3:Class>
    <ns3:Class ns2:ID="Invertebrate">
      <subClassOf ns2:resource="http://www.example.org/sample-ontology-2.owl#Metazoa" />
      <label>Invertebrate</label>
    </ns3:Class>
    <ns3:Class ns2:ID="Vertebrate">
      <subClassOf ns2:resource="http://www.example.org/sample-ontology-2.owl#Metazoa" />
      <label>Vertebrate</label>
    </ns3:Class>
  </ns2:RDF>
</atom:entry>
----


[[api-delete-ontology]]
API: Delete Ontology
^^^^^^^^^^^^^^^^^^^^
----
  /s-ramp/ontology/{uuid}
----
Deletes an ontology from the repository.

[width="50%",options="header"]
|=============================
|#HTTP Method# |#Request#            |#Response#
|DELETE        |N/A                  |N/A
|=============================

This endpoint is used to delete a single ontology from the repository.  This might 
fail if the ontology is currently in-use (at least one artifact is classified by
at least one class defined by the ontology).

'Example Request'
----
DELETE /s-ramp/ontology/fd0e5210-2567-409f-8df0-f851e1ce630d HTTP/1.1
----

'Example Response'
----
HTTP/1.1 200 OK
----


Auditing
~~~~~~~~

[[api-get-artifact-audit-history]]
API: Get Artifact Audit History
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
----
  /s-ramp/audit/artifact/{artifactUuid}
----
Retrieves an Atom feed containing all of the audit entries for a single artifact.

[width="50%",options="header"]
|=============================
|#HTTP Method# |#Request#            |#Response#
|GET           |N/A                  |Atom Feed
|=============================

This endpoint is used to get a feed of the audit history of a single artifact.  The
request URL can include standard paging parameters.  The response is an Atom Feed
where each Entry in the feed represents a single audit event in the history of the
artifact.  A followup call must be made to the Get Artifact Audit Entry endpoint
in order to retrieve full detail information about the audit event.  This call 
might fail if no artifact exits with the given UUID.

'Example Request'
----
GET /s-ramp/audit/artifact/b086c558-58d6-4837-bb38-6c3da760ae80 HTTP/1.1
----

'Example Response'
----
HTTP/1.1 200 OK

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<atom:feed xmlns:atom="http://www.w3.org/2005/Atom" xmlns:s-ramp="http://docs.oasis-open.org/s-ramp/ns/s-ramp-v1.0"
  s-ramp:itemsPerPage="100" s-ramp:provider="Artificer" s-ramp:startIndex="0" s-ramp:totalResults="2">
  <atom:title>S-RAMP Audit Feed</atom:title>
  <atom:subtitle>All Audit Entries for Artifact</atom:subtitle>
  <atom:updated>2013-07-23T11:14:07.189-04:00</atom:updated>
  <atom:id>bff03dd5-e55c-4528-b1aa-ee1eb471b899</atom:id>
  <atom:entry>
    <atom:title>artifact:update</atom:title>
    <atom:updated>2013-07-23T11:14:03.225-04:00</atom:updated>
    <atom:id>2947f90e-0f5a-4099-b3dc-29124c96c7d0</atom:id>
    <atom:published>2013-07-23T11:14:03.225-04:00</atom:published>
    <atom:author>
      <atom:name>eric</atom:name>
    </atom:author>
    <atom:summary />
  </atom:entry>
  <atom:entry>
    <atom:title>artifact:add</atom:title>
    <atom:updated>2013-07-23T11:13:28.513-04:00</atom:updated>
    <atom:id>e41404b3-9ec6-43f5-a6d8-aa6089bc6704</atom:id>
    <atom:published>2013-07-23T11:13:28.513-04:00</atom:published>
    <atom:author>
      <atom:name>eric</atom:name>
    </atom:author>
    <atom:summary />
  </atom:entry>
</atom:feed>
----


[[api-get-user-audit-history]]
API: Get User Audit History
^^^^^^^^^^^^^^^^^^^^^^^^^^^
----
  /s-ramp/audit/user/{username}
----
Retrieves an Atom feed containing all of the audit entries for a specific user.

[width="50%",options="header"]
|=============================
|#HTTP Method# |#Request#            |#Response#
|GET           |N/A                  |Atom Feed
|=============================

This endpoint is used to get a feed of the audit history for a single user.  The
request URL can include standard paging parameters.  The response is an Atom Feed
where each Entry in the feed represents a single audit event in the history of the
artifact.  A followup call must be made to the Get Artifact Audit Entry endpoint
in order to retrieve full detail information about the audit event.  This call 
might fail if no user exists with the given username.

'Example Request'
----
GET /s-ramp/audit/user/eric HTTP/1.1
----

'Example Response'
----
HTTP/1.1 200 OK

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<atom:feed xmlns:atom="http://www.w3.org/2005/Atom" xmlns:s-ramp="http://docs.oasis-open.org/s-ramp/ns/s-ramp-v1.0"
  s-ramp:itemsPerPage="100" s-ramp:provider="Artificer" s-ramp:startIndex="0" s-ramp:totalResults="2">
  <atom:title>S-RAMP Audit Feed</atom:title>
  <atom:subtitle>All Audit Entries for Artifact</atom:subtitle>
  <atom:updated>2013-07-23T11:16:00.545-04:00</atom:updated>
  <atom:id>d49057a2-2f84-48aa-9c79-078b1e86680a</atom:id>
  <atom:entry>
    <atom:title>artifact:update</atom:title>
    <atom:updated>2013-07-23T11:14:03.225-04:00</atom:updated>
    <atom:id>2947f90e-0f5a-4099-b3dc-29124c96c7d0</atom:id>
    <atom:published>2013-07-23T11:14:03.225-04:00</atom:published>
    <atom:author>
      <atom:name>eric</atom:name>
    </atom:author>
    <atom:summary />
  </atom:entry>
  <atom:entry>
    <atom:title>artifact:add</atom:title>
    <atom:updated>2013-07-23T11:13:28.513-04:00</atom:updated>
    <atom:id>e41404b3-9ec6-43f5-a6d8-aa6089bc6704</atom:id>
    <atom:published>2013-07-23T11:13:28.513-04:00</atom:published>
    <atom:author>
      <atom:name>eric</atom:name>
    </atom:author>
    <atom:summary />
  </atom:entry>
</atom:feed>
----


[[api-add-artifact-audit-entry]]
API: Add Artifact Audit Entry
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
----
  /s-ramp/audit/artifact/{artifactUuid}
----
Adds a user-defined (custom) audit entry to an artifact.

[width="50%",options="header"]
|=============================
|#HTTP Method# |#Request#                   |#Response#
|POST          |application/auditEntry+xml  |Atom Entry
|=============================

This endpoint is used to add a custom audit entry to a particular artifact.
The request must be a POST of an XML document conforming to the audit schema
type 'auditEntry'.  This call may fail if no artifact exists with the given
UUID.

'Example Request'
----
POST /s-ramp/audit/artifact/b086c558-58d6-4837-bb38-6c3da760ae80 HTTP/1.1
----

'Example Response'
----
HTTP/1.1 200 OK

<auditEntry type="custom:foo" uuid="" when="" who="">
  <auditItem type="custom:item-type-1">
    <property name="my-property-1" value="some-value" />
    <property name="my-property-2" value="other-value" />
  </auditItem>
  <auditItem type="custom:item-type-2" />
</auditEntry>
----


[[api-get-artifact-audit-entry]]
API: Get Artifact Audit Entry
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
----
  /s-ramp/audit/artifact/{artifactUuid}/{auditEntryUuid}
----
Retrieves full detailed information about a single audit entry.

[width="50%",options="header"]
|=============================
|#HTTP Method# |#Request#            |#Response#
|GET           |N/A                  |Atom Entry
|=============================

This endpoint is used to get the full details for a single audit event for a 
particular artifact.  The particulars of the detailed information are specific
to the type of audit entry, so 'artifact create' detail information might be
different from 'artifact update' detail information.  In addition, there is 
the possibility that the detail information might be from a custom audit entry
added by an end user.  This call might fail if the artifact does not exist or
the audit entry does not exist.

'Example Request'
----
GET /s-ramp/audit/artifact/b086c558-58d6-4837-bb38-6c3da760ae80/2947f90e-0f5a-4099-b3dc-29124c96c7d0 HTTP/1.1
----

'Example Response'
----
HTTP/1.1 200 OK

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<atom:entry xmlns="http://downloads.jboss.org/artificer/2013/auditing.xsd" xmlns:atom="http://www.w3.org/2005/Atom">
  <atom:title>artifact:update</atom:title>
  <atom:updated>2013-07-23T11:14:03.225-04:00</atom:updated>
  <atom:id>2947f90e-0f5a-4099-b3dc-29124c96c7d0</atom:id>
  <atom:published>2013-07-23T11:14:03.225-04:00</atom:published>
  <atom:author>
    <atom:name>eric</atom:name>
  </atom:author>
  <atom:summary />
  <auditEntry type="artifact:update" uuid="2947f90e-0f5a-4099-b3dc-29124c96c7d0" when="2013-07-23T11:14:03.225-04:00"
    who="eric">
    <auditItem type="property:added">
      <property name="sramp-properties:foo" value="bar" />
      <property name="sramp-properties:hello" value="world" />
    </auditItem>
    <auditItem type="property:changed" />
    <auditItem type="property:removed" />
  </auditEntry>
</atom:entry>
----

