Architecture Management Link Type Management REST API
1.0 SPECIFICATION DRAFT
Introduction
The Architecture Management Link Type Management {Link Type URI} is a discoverable URI that specifies how a client can determine the set of supported link types. This interface also defines how a server can optionally permit the dynamic creation, removal or updating of link type definitions.
Requests can denied based on user privlege, content type, or invalid content.
Link Type Factory URI
GET {Link type 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 {Link Type Factory URI}
If supported by the server allows the client to register new link types with the server. The content body of the request MUST contain the full content of a link type resource.
A service provider MUST support at least the following HTTP response status codes:
Status Code |
Response Content |
Response Headers |
Description |
201 Created |
|
ETag: {the current ETag value for this resource} Location: {The URI of the link type registration} |
The request was sucessful, the new link type was registered. The returned document represents the definition of the link type |
400 Bad Request |
Error message |
|
This response can be returned when any of the parameters or content is not properly structured |
Example
POST
http://example.com/linkTypeFactory
Content-Type: application/x-oslc-am-linktype+xml
Request Body
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:dc="http://purl.org/dc/terms/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="http://www.example.com/linktype/implements">
<dc:title>Implements</dc:title>
<dc:description>
The subject resource provides an implementation of the subject resource.
</dc:description>
</rdf:Description>
</rdf:RDF>
Response
201 Created
Location: http://example.com/linktype/resources/e3a78263cd917a
ETag: "_3Z3mxMD_Ed6YkqfTZH8hGg"
PUT {Link type 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 {Link type 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.
Link Type Resource URI
GET {Link Type Resource URI}
Returns the Link Type Resource.
Status Code |
Response Content |
Response Headers |
Description |
200 OK |
A Link Type resource document |
ETag: {Current ETag for link type resource} |
The request was successful and the server has returned the collection of known link types. |
400 Bad Request |
Error message |
|
This response can be returned when any of the parameters or content is not properly structured. |
Example
Request
GET http://example.com/linktype/resources/e3a78263cd917a
Accept: application/x-oslc-common-linktype+xml
Response
ETag: "_3Z3mxMD_Ed6YkqfTZH8hGg"
Content-Type: application/x-oslc-common-linktype+xml
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:dc="http://purl.org/dc/terms/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="http://standard.com/linktype/implements">
<dc:title>Implements</dc:title>
<dc:description>
The subject resource provides an implementation of the subject resource.
</dc:description>
</rdf:Description>
</rdf:RDF>
POST {Link type 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.
PUT {Link Type Resource URI}
Updates the link type definition on the server. Only the dc:title and dc:description are updatable. The type id is not changeable.
The If-Match header with current ETag value is required.
Status Code |
Response Content |
Response Headers |
Description |
200 OK |
|
ETag: {the current ETag value for this resource} |
The request was sucessful, the new link type was registered. The returned document represents the definition of the link type |
400 Bad Request |
Error message |
|
This response can be returned when any of the parameters or content is not properly structured. |
Example
Request
PUT http://example.com/linktype/resources/e3a78263cd917a
Content-Type: application/x-oslc-am-linktype+xml
If-Match: "_3Z3mxMD_Ed6YkqfTZH8hGg"
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:dc="http://purl.org/dc/terms/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="http://www.example.com/linktype/implements">
<dc:title>Implements</dc:title>
<dc:description>This implements that.</dc:description>
</rdf:Description>
</rdf:RDF>
Response 200 OK
ETag: "_3uImlMD_Ed6YkqfTZH8hGg"
DELETE {Link Type Resource URI}
Deletes the link type definition on the server for the link type id. This specification does not address the removal of all links with this type, which is at the service's discretion.
The If-Match header with current ETag value is required.
Status Code |
Response Content |
Response Headers |
Description |
200 OK |
|
|
The request was successful, the link type was deleted, and will not appear in future requests for supported/known link types. |
400 Bad Request |
Error message |
|
This response can be returned when any of the parameters or content is not properly structured. |
Example
Request
DELETE http://example.com/linktype/resources/e3a78263cd917a
If-Match: "_3Z3mxMD_Ed6YkqfTZH8hGg"
Response 200 OK
Link Type Query URI
GET {Link Type Query URI}?type={URL encoded link type URI}
Returns an Link Type Resource describing the link represented by the link type URI.
Status Code |
Response Content |
Response Headers |
Description |
200 OK |
A Link Type resource document |
Location: {Link Type Resource URI} ETag: {Current ETag for link type resource} |
The request was successful and the server has returned the collection of known link types. |
400 Bad Request |
Error message |
|
This response can be returned when any of the parameters or content is not properly structured. |
Example
Request
GET http://example.com/linktypes?type=http%3A%2F%2Fstandard.com%2Flinktype%2Fimplements
Accept: application/x-oslc-am-linktype+xml
Response
Location: http://example.com/linktype/resources/e3a78263cd917a
ETag: "_3Z3mxMD_Ed6YkqfTZH8hGg"
<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF
xmlns:dc="http://purl.org/dc/terms/"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about="http://standard.com/linktype/implements">
<dc:title>Implements</dc:title>
<dc:description>
The subject resource provides an implementation of the subject resource.
</dc:description>
</rdf:Description>
</rdf:RDF>
GET {Link Type Query URI}
Returns a collection of all the link types supported by the server.
Note: we are using ATOM Feeds to manage collections.
Status Code |
Response Content |
Response Headers |
Description |
200 OK |
Collection of all supported link types |
|
The request was sucessful and the server has returned the ATOM collection of known link types. |
400 Bad Request |
Error message |
|
This response can be returned when any of the parameters or content is not properly structured. |
Example
GET http://example.com/linktypes
Accept: application/atom+xml
Response <?xml version='1.0' encoding='UTF-8'?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">
<title type="text">Link Types</title>
<updated>2009-11-15T02:58:57.406Z</updated>
<link href="https://am.acme.com/linkTypeFactory/_oSa28Mr5Ed6ugb3EZOtmVQ" rel="self" />
<opensearch:totalResults>3</opensearch:totalResults>
<entry>
<link href="https://am.acme.com/linkTypeFactory/_-uhmwdF_Ed6KwZENF5babw" rel="self" />
<oslc_am:etag>"_sopwiryfcnma937rhsk"</oslc_am:etag>
<content type="application/xml">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/terms/">
<rdf:Description rdf:about="http://open-services.net/xmlns/am/1.0/implements">
<dc:title>Implements</dc:title>
<dc:description>The subject implements the object.</dc:description>
</rdf:Description>
</rdf:RDF>
</content>
</entry>
<entry>
<link href="https://am.acme.com/linkTypeFactory/_AK6FMNGAEd6KwZENF5babw" rel="self" />
<oslc_am:etag>"_Ksos92ksndjs8ualoas"</oslc_am:etag>
<content type="application/xml">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/terms/">
<rdf:Description rdf:about="http://purl.org/dc/terms/license">
<dc:title>License</dc:title>
<dc:description>The resource is governed by the referenced license.</dc:description>
</rdf:Description>
</rdf:RDF>
</content>
</entry>
<entry>
<link href="https://am.acme.com/linkTypeFactory/_ALpsENGAEd6KwZENF5babw" rel="self" />
<oslc_am:etag>"_kasApaq932kaiwjfyabc023"</oslc_am:etag>
<content type="application/xml">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/terms/">
<rdf:Description rdf:about="http://acme.org/linktypes/elaborates">
<dc:title>Elaborates</dc:title>
<dc:description>The subject elaborates the object.</dc:description>
</rdf:Description>
</rdf:RDF>
</content>
</entry>
</feed>
POST {Link type 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.
PUT {Link type 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 {Link type 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.