Architecture Management Resource Factory REST API
1.0 SPECIFICATION DRAFT
Introduction
The Architecture Management Resource Factory URI
{AMR Factory URI}
is a discoverable URI that specifies where to POST a request to create new AM resource. Not all model element types are supported by the server. Requests can denied based on user privlege, content type, or invalid content.
GET {AMR Factory URI}
Not supported. The Service Provider MUST return a 405 Method Not Allowed response. The response MUST include an Allow header containing a list of valid methods for the requested resource.
POST {AMR Factory URI}
Creates a new model element from the content body of the request. The Content-Type header MUST be specified. The server MAY support the creation of the element. The content body of the request MUST contain the full content required for an element of the specified type.
A service provider MUST support at least the following HTTP response status codes:
Status Code |
Response Content |
Response Headers |
Description |
200 OK |
AM Resource content (including server generated elements) |
ETag : {the current ETag value for this resource} Location : {AM Resource Web URI} |
The request was sucessful and the server has created the new resource. |
400 Bad Request |
Error message |
|
This response can be returned when any of the parameters or content is not properly structured. |
415 Unsupported Media Type |
Error message |
|
The Content-Type header does not specify a content type that the server can create a model element for. |
Examples
Example 1. Client sucessfully POSTs a new AM Resource (OSLC AM Resource Format)
The service provider permits AM resource creation and is familiar with and supports the creation of resources of this MIME type.
The client POSTs a new resource to the AMR Factory URI, which is specified in the
Service Description Document. Upon successful creation the service provider returns a 201 Created response with a Location and ETag header that the client can use to manage the newly created resource.
Request:
POST http://am.acme.com/resources
Content-Type: application/rdf+xml
Body:
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/terms/"
xmlns:uml="http://uml/types/">
<rdf:Description rdf:about="">
<dc:title>ServiceInterface</dc:title>
<dc:description>This is a sample UML interface</dc:description>
<rdf:type rdf:resource="http://www.eclipse.org/uml2/3.0.0/UML/Interface" />
<uml:generalizes rdf:resource="http://am.acme.com/resources/res29"/>
</rdf:Description>
</rdf:RDF>
Response:
201 Created
Location: http://am.acme.com/resources/res55
ETag: "_28ce9abbf723s7fac993"
Example 2. Client un-sucessfully POSTs a new AM Resource
The service provider denies the AM resource creation for the given content type.
The client POSTs a new resource to the AMR Factory URI, which is specified in the
Service Description Document. The service does not support this content type, or does not support the creation of new elements of this type.
The service returns a
415 Media Unsupported
response.
Request:
POST http://am.acme.com/resources
Content-Type: application/x-uml+xml
Body:
<uml:Class xmlns:uml="http://open-services.net/am/uml/1.0#">
<uml:name>Class1</uml:name>
<uml:abstract>true</uml:abstract>
</uml:Class>
Response:
415 Media Unsupported
Example 3. Client sucessfully POSTs a new AM Resource (binary)
The service provider permits AM resource creation and is familiar with and supports the creation of resources of this MIME type.
The client POSTs a new resource to the AMR Factory URI, which is specified in the
Service Description Document. Upon successful creation the service provider returns a 201 Created response with a Location and ETag header that the client can use to manage the newly created resource.
Request:
POST http://am.acme.com/resources
Content-Type: application/x-model
Body:
(binary stream)
Response:
201 Created
Location: http://am.acme.com/resources/res55
ETag: "_3928jd7sh722js7a7a7a233A"
PUT {AMR Factory URI}
Not supported. The Service Provider MUST return a 405 Method Not Allowed response. The response MUST include an Allow header containing a list of valid methods for the requested resource.
DELETE {AMR Factory URI}
Not supported. The Service Provider MUST return a 405 Method Not Allowed response. The response MUST include an Allow header containing a list of valid methods for the requested resource.
Back to
Architecture Management REST API 1.0 Home
--
JimConallen - 01 Sep 2009