Asset Management REST Services API
1.0 Specification
Contents
Introduction
Asset Management resources include the asset, artifact, and relationship properties needed for the creation, retrieval, and updating of assets in the software delivery lifecycle. This version of the specification focuses on a basic definition of an asset resource and the interactions needed to satisfy the
V1 usage scenarios.
The intent of this specification is to define the set of HTTP-based RESTful interfaces in terms of HTTP methods: GET, POST, PUT and DELETE, HTTP response codes, mime type handling and resource representations. The capabilities of the interface definitions are driven by specific integration scenarios and therefore don't represent a complete set of operations on resources or resource types. The approach is to define how service providers can interoperate with other tools without having to expose their complete data model and application logic.
Refer to the
definitions page for descriptions on asset management related terms used here.
Notations and Conventions
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in
RFC2119. Domain name examples use
RFC2606.
Summary
Resource URLs and Methods
Resource | URL | GET | POST | PUT | DELETE | Description |
---|
Asset Creation Factory | {Asset Creation URL} | N
| Y
| N | N | A URL where new Asset Resources are posted to create new Assets |
Asset Query Resource
| {Asset Query URL}
| Y
| N
| N
| N
| A URL where you can query Asset Resources
|
Asset Resource | {Asset URL} | Y | N | Y | Y | Representation of an asset resource. |
Artifact Creation Factory
| {Artifact Creation URL}
| N
| Y
| N
| N
| A URL where new Artifact or Artifact Media Resource are posted to add new Artifacts to an Asset.
|
Artifact Media Resource
| {Artifact Media URL}
| Y
| N
| Y
| Y
| Artifact media representation
|
N - in the HTTP verb column indicates a 405 Not Supported response
For a complete list of
HTTP Response Codes .
URLs for working with Assets
The following table outlines the key items that are exposed in the Asset Management Service Discovery Document. Details of each of these capabilities will follow in subsequent sections.
URL Parameters
The following table summarizes a set of HTTP URL parameters used for various operations. The support for these parameters varies based on which resources and what request type (GET/PUT/POST) they are used. Subsequent sections will define thie usage.
Parameter | Value | Description | Sample |
---|
oslc_asset.query | URL-encoded query | See Asset Mgmt Simple Query Syntax | /assets?oslc_asset.query=<url-encoded-value> |
oslc_asset.properties | Comma-separated list of requested properties | Used to retrieve only desired properties | /assets?oslc_asset.properties=state,id,description,owner |
oslc_asset.pageSize | Positive integer | Specifies the maximum number of items to return in one response | /assets?oslc_asset.pageSize=50 |
oslc_asset.name | artifact name
| Used to pass the name* of an artifact resource while posting an artifact media resource | /asset/artifacts?oslc_asset.name=myfile.pdf |
*Servers MAY use the value of the
name property when creating the URI or title of the newly created Resource, for instance, by using some or all of the words in the value for the last URI segment.
Namespaces Used
The table below lists the namespace prefixes and associated namespaces used for samples and specification text. Service Providers MUST support these reserved namespace prefixes.
Prefix | Namespace | Defined |
---|
oslc_asset | http://open-services.net/xmlns/asset/1.0/ |
Asset Mg Resources
|
ras | http://www.omg.org/ras/v2.2 | OMG Reusable Asset Specification
|
dc | http://purl.org/dc/terms/ | The Dublin Core Metadata Terms namespace |
rdf
| http://www.w3.org/1999/02/22-rdf-syntax-ns# | RDF/XML
|
atom
| http://www.w3.org/2005/Atom
| RFC4287 - Atom Syndication Format
|
Media Types Used
The following table summarizes the media types used for various resource requests. See appropriate sections for specification requirements on usage.
Media Type | Defined | Resource |
---|
application/xml | W3C Extensible Markup Language (XML) 1..0 | General XML format request/response |
application/json | <a target="_top" href="http://tools.ietf.org/html/rfc4627">RFC4627 - The application/json Media Type for JavaScript? Object Notation (JSON)</a>
| General JSON format request/response
|
application/atom+xml | RFC4287 - Atom Syndication Format , RFC5005 - Feed Paging and Archiving | Asset Query Resource |
application/zip
| Asset manifest and artifact medias in a single zip fiie.
| Asset Resource Zipped
|
application/ras
| Asset Resource representation based on the reuable asset specification (RAS) format. A RAS format is a a zip with a collection of Artifact Media Resources, and a RAS manifest.
| Asset Resource
|
Service Implementers MUST support RDF/XML formats. Service Implementers MAY support JSON formats.
Requesting Formats
There will be a single supported method for a client to designate it's required response format, using the HTTP request header of Accept
If only Accept header is supplied and has more than one {mime-type}, then the server will determine the {mime-type} will be used for the response content type.
If none are provided then a default is used, which is application/xml unless defined otherwise.
If the requested {mime-type} is unknown, a HTTP response code of 415 Unsupported Media Type will be returned.
Each of the operation on a given URI may support a different default {mime-type}.
Service implementors MAY specify alternate ways (i.e. url extension or url accept parameter) to specify a requesting format.
Selective Properties
A client MAY request a restricted number of resource properties as well as properties from a referenced resource. In order to support this behavior a service provider MUST support the oslc_asset.properties parameter on HTTP GET requests on individual resource requests as well as for requests on Asset Query Resources. If the oslc_asset.properties parameter is omitted on the request, then all resource properties MUST be provided in the response.
If properties listed in the oslc_asset.properties do not exist for the resource, a HTTP response status of 409 Conflict MUST be used.
If the resource does not exist at the request URL, a HTTP response status of 404 Not Found MUST be used.
This property may also be used to perform
partial updates.
Parameter: oslc_asset.properties
Syntax:
BNF
properties ::= property ("," property)*
property ::= identifier | nested_prop | wildcard
nested_prop ::= property "{" properties "}"
identifier ::= word (":" word)?
word ::= /any sequence of letters and numbers, starting with a letter/
wildcard ::= "*"
Sample:
Request the Asset resource at {Asset Resource URI} and only the properties of title (asset name) and version.
Request:
{Asset Resource URI}?oslc_asset.properties=dc:title,ras:id{version}
Response:
<oslc_asset:asset>
<dc:title>GetCustomer</dc:title>
<ras:id>
<version>1.2</version>
</ras:id>
</oslc_asset:asset>
Artifact Media Resources
An Asset's Artifacts have a Media Resource representing the actual content of the Artifact. This relationship between an Asset's Artifacts and associated Media Resources is defined in the same manner as the
Media Resource and Media Link Entries for the Atom Publishing Protocol.
A client can POST Media Resources (content) to the {Artifact Media Creation URL} which is a property of the Asset. When POSTed, the service provider creates a new Media Resource and adds an associated Artifact property to the Asset.
The Artifact property has properties which include the URL to the (potentially binary) Media Resource. The Property thus makes the description for that Media Resource separately available for retrieval and alteration.
Successful responses to creation requests must return a status code of 201, and a Location Header indicating the URL of the Media Resource. The new Artifact property must have an olsc_asset:content element with a "rdf:resource" attribute. The value of the "rdf:resource" attribute is an URL for the newly created Media Resource.
Upon successful creation of a Resource, a server must populate mandatory elements with values derived from the POSTed entity or from any other source. A server may not allow a client to modify server-selected values (such as creation time, size, mime type).
Resource Creation
Asset Creation
POST {Asset Creation URL}
Creates a new asset based using the content body from the request.
A service provider MUST support at least the following HTTP response status codes:
Code | Content | Description |
---|
201 OK
| HTTP-Header> Location {New Asset UR} | A new asset resource has been created at the URI returned.
|
403 Forbidden | Error Message
| Server rejects request. User not authorized to create the resource. |
Example
Adding Artifacts to an Asset
POST {Artifact Media Creation URL}
Creates a new artifact based using the content body from the request. You name use the oslc_asset.name parameter to supply an artifact name to the service.
A service provider MUST support at least the following HTTP response status codes:
Code | Content | Description |
---|
201 OK
| HTTP-Header> Location {New Artifact Media URI} and the Artrifact Resource per Accept Header.
| A new artifact resource has been created at the URI returned.
|
403 Forbidden | Error Message
| Server rejects request. User not authorized to create the resource. |
Get Resources
Get an Asset
GET {Asset Resource URI}
Returns the asset resource from the URI given.
The service provider MUST Accept these media types for the response content body:
- application/xml
- application/zip
The service provider MAY Accept these media types for the response content body:
- application/json
- application/ras
A server provider MAY return an
ETag HTTP header in the response that can be included in HTTP PUT requests for concurrent modification validation.
A service provider MUST support at least the following HTTP response status codes:
Code | Content | Description |
---|
200 OK
| Asset Resource per Accept Header | A representation of the asset resource.
|
403 Forbidden | Error Message
| Server rejects request. User not authorized to create the resource |
404 Not Found | Error Message | Asset does not exist on the server
|
Example
Get an Artifact Media Resource
GET {Artifact Media Resource URI}
Returns the artifact media resource from the URI given.
A server provider MAY return an
ETag HTTP header in the response that can be included in HTTP PUT requests for concurrent modification validation.
A service provider MUST support at least the following HTTP response status codes:
Code | Content | Description |
---|
200 OK
| Artifact Media Resource
| A content of the artifact resource.
|
403 Forbidden | Error Message
| Server rejects the request. User not authorized to view the resource. |
404 Not Found | Error Message | Server rejects the request. Artifact does not exist on the server. |
Asset Query Resources
GET {Asset Query URL}
Returns a collection of assets. The service MUST support application/atom+xml and MAY support application/json for the response content body.
When returning application/json format, the service provider MUST provide the properties of each resource within the atom:content element of the atom:entry element.
The number of entries in the collection response are driven by HTTP query parameters oslc_asset.query. If this parameter is omitted, the server MAY respond with:
- a page of results
- all results
Code | Content | Description |
---|
200 OK
| Collection of assets in format per Accept header | A collection of assets with summary information and references to external change requests. |
406 Not Acceptable | Error Message | Server can not fulfill the request due to it's Accept headers |
Example
Query Syntax
A filtered set of Assets can be retrieved using a HTTP GET-based method where query terms are URL-encoded.
Service providers MUST support the query syntax supported in the
Asset Management Query Syntax specification.
Pagination
Asset Query representations SHOULD be limited in size by the request parameter oslc_asset.pageSize.
Subsequent pages MUST be able to be requested using pagination elements in the Asset Query Resource response content.
For application/atom+xml representations, these additional link rels MUST be supported as defined in
RFC5005 - Atom Feed Paging and Archiving:
- next - A URI that refers to the immediately following document in a series of documents.
- previous - A URI that refers to the immediately preceding document in a series of documents.
For exmaple:
<atom:feed xml:base="http://localhost:8080/am/" oslc_asset:totalCount="853">
<atom:id>Asset Manager 1.2 [http://localhost:8080/am/oslc/search] - 7/18/09 1:18 PM</atom:id>
<link rel="next" href="oslc/search?oslc_query=title="Server"?oslc_asset.oslc_startIndex=201&oslc_asset.oslc_pageSize=200"/>
<atom:link type="application/atom+xml" rel="self" href="oslc/search?oslc_query=title="Server"&oslc_asset.oslc_pageSize=200"/>
<atom:title>Asset Query Result [title="Server"]</atom:title>
<atom:updated>2009-07-18T12:44:25.640-04:00</atom:updated>
<atom:entry xml:base="http://localhost:8080/am/">
...
For application/atom+xml representations these is additional elements MAY be supported:
- oslc_asset:totalCount - A positive integer that represents the total number of resources that are a result of the request.
As an example, a query request that would result in 200 entries and is limited by a oslc_asset:pageSize=20, then oslc_asset:totalCount=200.
For application/json Resource Collections the additional attributes defined in
JSON format MUST be supported.
Update a resource
Update an asset
PUT {Asset Resource URI}
Update the referenced asset resource with the request's body. The service MUST support
application/xml
and MAY support
application/json
for the request's content body.
A service provider MUST support at least the following HTTP response status codes:
Code | Content | Description |
---|
200 OK
| Asset Resource per Accept Header.
| Once the asset is updated with the supplied changes, the resulting asset representation is returned.
|
400 Bad Request
| Error Message
| Server rejects the request. The uploaded content was malformed.
|
403 Forbidden | Error Message
| Server rejects the request. User not authorized to update the resource. |
404 Not Found | Error Message | Server rejects the request. Asset does not exist on the server. |
409 Conflict
| Error Message
| Server rejects the request. The asset has been modified on the server.
|
415 Unsupported Media Type
| Error Message
| Server rejects the request. The media type requested by the accept header is not supported by the server.
|
Partial update
The resource's request representation can be a subset of the complete resource. The URL in the PUT request must provide the list of properties to be updated (see the
Selective Properties section for the property details).
An abbreviated example where only the
dc:title
and
dc:subject
properties are updated could be:
PUT {Asset Resource URI}?oslc_asset.properties=dc:title,dc:subject
Content:
<oslc_asset:Asset>
<dc:title>Myco Web Services</dc:title>
<dc:subject>Web services for the Myco web site.</dc:subject>
</oslc_asset:Asset>
If the parameter
oslc_cm.properties
contains a valid resource property on the request that is not provided in the content, the server must set the resource's property to a null or empty value.
If the parameter
oslc_cm.properties
contains an invalid resource property, then a
400 Bad Request
must be returned.
Delete a resource
DELETE
{Resource URI}
Delete a resource represented by the given URL. Further GET requests on this resource SHOULD result in a "410 Gone" or a "404 Not Found" response.
A service provider MUST support at least the following HTTP response status codes:
Code | Content | Description |
---|
200 OK
| none
| The service has marked the resource as deleted or physically deleted the resource. |
403 Forbidden | Error Message
| Server rejects the request. User not authorized to delete the resource. |
404 Not Found | Error Message | Server rejects the request. Resource does not exist on the server. |
Examples
In this scenario a build system will search the asset management system looking for an approved logging asset to include in the build. Upon finding the approved logging asset, the build system retrieves the logging asset and performs the build. The build system publishes the built component (.ear) to the asset management system. This scenario is described further in the
Asset Management Scenarios For v1 REST Spec.
Query Example
Build system queries Asset Management system for assets to include in the build
In this example a build process will search for the latest version of an asset to include in a build. It will query for assets of a given name.
- The build script specifies the asset to be included in the build
- The build system queries the asset repository for the latest approved version of the specific assets.
The build system queries using the asset's name and the asset's state. For our purposes here the "Approved" asset are those which can be included in a build.
From the
Build System Query Use Case Scenario
Get the service definition
- *Request:* GET https://server:9443/am/oslc/assets/services
Accept: application/xml
Response:
Status Code: 200 (OK)
Content-Type: application/xml
Body:
<?xml version="1.0" encoding="UTF-8"?>
<oslc_asset:ServiceDescriptor rdf:about="https://server:9443/am/oslc/assets/services">
<dc:title>Asset Management Services</dc:title>
<dc:description>Asset Manager OSLC Service Description</dc:description>
<dc:contributor>
<dc:title>Asset Manager</dc:title>
<dc:identifier>com.myco.am.assets</dc:identifier>
<oslc_asset:icon> https://am/images/AssetManager.ico
</oslc_asset:icon>
</dc:contributor>
<!-- Services -->
<oslc_asset:assets oslc_asset:version="1.0">
<oslc_asset:home rdf:about="https://server:9443/am/home.faces">
<dc:title>Assets Home</dc:title>
</oslc_asset:home>
<!-- Create asset location -->
<oslc_asset:factory rdf:about="https://server:9443/am/oslc/assets">
<dc:title>Default location for creation of assets</dc:title>
</oslc_asset:factory>
<!-- Asset Simple Query -->
<oslc_asset:simpleQuery rdf:about="https://server:9443/am/oslc/simpleQuery">
<dc:title>Assets queries</dc:title>
</oslc_asset:simpleQuery>
</oslc_asset:assets>
</oslc_asset:ServiceDescriptor>
-
Query for the latest approved Apache Logging Services Project asset
Request: GET https://server:9443/am/oslc/simpleQuery?oslc_asset.query=oslc_asset:state="Approved" and dc:title="Apache Logging Services Project"&oslc_asset.properties=ras:id,dc:title
Accept: application/atom+xml
Response:
Status Code: 200 (OK)
Content-Type: application/atom+xml
<?xml version="1.0" encoding="UTF-8"?>
<atom:feed xml:base="http://localhost:8080/am/">
<atom:id>Asset Manager 7.2 [http://localhost:8080/am/oslc/search]
- 7/18/09 1:18 PM</atom:id>
<atom:link type="application/atom+xml" rel="self"
href="oslc_asset.query=oslc_asset:state="Approved" and dc:title="Apache Logging Services Project"&oslc_asset.properties=ras:id,dc:title" />
<atom:title>Asset Query Result [oslc_asset:state="Approved" and dc:title="Apache Logging Services Project""]</atom:title>
<atom:updated>2009-07-18T12:44:25.640-04:00</atom:updated>
<atom:entry xml:base="http://localhost:8080/am/">
<atom:id>{1082CDD3-1E40-5648-E7DC-5137CC841AA5}/1.2</atom:id>
<atom:link type="text/html" rel="alternate" href="assetDetail/generalDetails.faces?guid=%7B882B4FD7-3C72-4DB0-8097-66866E7D45F6%7D&v1.2"></atom:link>
<atom:link type="text/xml" rel="alternate" href="oslc/assets/%7B882B4FD7-3C72-4DB0-8097-66866E7D45F6%7D/1.2"></atom:link>
<atom:summary>Apache Logging Services Project is an open source project based on the work of many authors. It allows the developer to control which log statement are output with arbitrary granularity.</atom:summary>
<atom:title>Apache Logging Services Project [1.2]</atom:title>
<atom:updated>2009-07-18T12:31:11.265-04:00</atom:updated>
<atom:content type="application/xml">
<asset rdf:resource="oslc/assets/%7B882B4FD7-3C72-4DB0-8097-66866E7D45F6%7D/1.2">
<ras:id>
<ras:GUID>{882B4FD7-3C72-4DB0-8097-66866E7D45F6}</ras:GUID>
<ras:version>1.2</ras:version>
</ras:id>
<dc:title>Apache Logging Services Project</dc:title>
</asset>
</atom:content>
</atom:entry>
<atom:entry xml:base="http://localhost:8080/am/">
<atom:id>{1082CDD3-1E40-5648-E7DC-5137CC841AA5}/1.0.4</atom:id>
<atom:link type="text/html" rel="alternate" href="assetDetail/generalDetails.faces?guid=%7B882B4FD7-3C72-4DB0-8097-66866E7D45F6%7D&v1.0.4"></atom:link>
<atom:link type="text/xml" rel="alternate" href="oslc/assets/%7B882B4FD7-3C72-4DB0-8097-66866E7D45F6%7D/1.0.4"></atom:link>
<atom:summary>Apache Logging Services Project is an open source project based on the work of many authors. It allows the developer to control which log statement are output with arbitrary granularity.</atom:summary>
<atom:title>Apache Logging Services Project [1.0.4]</atom:title>
<atom:updated>2005-11-21T12:31:23.235-04:00</atom:updated>
<atom:content type="application/xml">
<asset rdf:resource="oslc/assets/%7B882B4FD7-3C72-4DB0-8097-66866E7D45F6%7D/1.0.4">
<ras:id>
<ras:GUID>{882B4FD7-3C72-4DB0-8097-66866E7D45F6}</ras:GUID>
<ras:version>1.0.4</ras:version>
</ras:id>
<dc:title>Apache Logging Services Project</dc:title>
</asset>
</atom:content>
</atom:entry>
</atom:feed>
Retrieve Example
Build system retrieves asset from Asset Management system to include in the build
The build system has identified the asset to include in the build. In this scenario the build system retrieves the specific asset from the Asset Management system to be included in the build.
- The build system downloads the full description of the latest version (1.2) of the Apache Logging Services Project asset. The build logs information about this asset (name, URL, owners, and list of artifact) in to the build results log.
- The build notices that this asset has only a single artifact (log4j.jar) so the build downloads the artifact media resource directlly and places this jar in the compliation path for the build.
From the
Build System Retrieve Use Case Scenario -
Download the Apache Logging Services Project asset resource
Request: GET https://server:9443/am/oslc/assets/%7B882B4FD7-3C72-4DB0-8097-66866E7D45F6%7D/1.2
Accept: application/xml
Response:
Status Code: 200 (OK)
Content-Type: application/xml
Body:
<oslc_asset:asset rdf:about="https://server:9443/am/oslc/assets/%7B882B4FD7-3C72-4DB0-8097-66866E7D45F6%7D/1.2">
<ras:id>
<ras:GUID>{882B4FD7-3C72-4DB0-8097-66866E7D45F6}</ras:GUID>
<ras:version>1.2</ras:version>
</ras:id>
<dc:title>Apache Logging Services Project</dc:title>
<dc:subject>Apache Logging Services Project is an open source project based on the work of many authors. It allows the developer to control which log statement are output with arbitrary granularity.</dc:subject>
<dc:type>Software</dc:type>
<oslc_asset:state>Approved</oslc_asset:state>
<dc:contributor>bobsmith@myco.com</dc:contributor>
<oslc_asset:artifactContentFactory rdf:about="https://server:9443/am/oslc/assets/%7B882B4FD7-3C72-4DB0-8097-66866E7D45F6%7D/1.2/artifacts"/>
<oslc_asset:artifact>
<dc:title>log4j.jar</dc:title>
<oslc_asset:size>123412</oslc_asset:size>
<oslc_asset:mimeType>application/java-archive</oslc_asset:mimeType>
<oslc_asset:content rdf:resource="https://server:9443/am/oslc/assets/%7B882B4FD7-3C72-4DB0-8097-66866E7D45F6%7D/1.2/artifactContents/log4j.jar"/>
</oslc_asset:artifact>
</oslc_asset:asset>
-
Download the Apache Logging Services Project's log4j.jar artifact media resource
Request: GET https://server:9443/am/oslc/assets/%7B882B4FD7-3C72-4DB0-8097-66866E7D45F6%7D/1.2/artifactContents/log4j.jar
Response:
Status Code: 200 (OK)
Content-Type: application/java-archive
Body: <JAR File>
Publish Example
Build wants to create an asset with the EAR file it has built and the an HTML document that includes a build summary. It will relate the new asset to an asset containing the log4j library used in the build.
From the
Build System Publish Use Case Scenario
-
POST to the asset factory to create a new asset
Request:
POST https://server:9443/am/oslc/assets
Accept: application/xml
Body:
<oslc_asset:asset>
<ras:id>
<ras:version>1.0.20091011</ras:version>
</ras:id>
<dc:title>Myco Services Application</dc:title>
<dc:subject>My Company's REST Services Application</dc:subject>
<dc:type>Application</dc:type>
<oslc_asset:relation rdf:resource="https://server:9443/am/oslc/assets/%7B882B4FD7-3C72-4DB0-8097-66866E7D45F6%7D/1.2">
<dc:title>Logging Service</dc:title>
<dc:type>Dependency</dc:type>
</oslc_asset:relation>
</oslc_asset:asset>
- Response:
Status Code: 201 (Created)
Location: https://server:9443/am/oslc/assets/%7B1082CDD3-1E40-5648-E7DC-5137CC841AA5%7D/1.0
Content-Type: application/xml
Body:
<oslc_asset:asset rdf:about="https://server:9443/am/oslc/assets/%7B1082CDD3-1E40-5648-E7DC-5137CC841AA5%7D/1.0">
<ras:id>
<ras:GUID>{1082CDD3-1E40-5648-E7DC-5137CC841AA5}</ras:GUID>
<ras:version>1.0.20091011</ras:version>
</ras:id>
<dc:title>Myco Services Application</dc:title>
<dc:subject>My Company's REST Services Application</dc:subject>
<dc:type>Application</dc:type>
<oslc_asset:state>Approved</oslc_asset:state>
<dc:contributor>bobsmith@myco.com</dc:contributor>
<oslc_asset:artifactContentFactory rdf:about="https://server:9443/am/oslc/assets/%7B1082CDD3-1E40-5648-E7DC-5137CC841AA5%7D/1.0/artifacts"/>
<oslc_asset:relation rdf:resource="https://server:9443/am/oslc/assets/%7B882B4FD7-3C72-4DB0-8097-66866E7D45F6%7D/1.2">
<dc:title>Logging Service</dc:title>
<dc:type>Dependency</dc:type>
</oslc_asset:relation>
</oslc_asset:asset>
-
Post the built EAR to the asset's artifact content factory URL
Request: POST https://server:9443/am/oslc/assets/%7B1082CDD3-1E40-5648-E7DC-5137CC841AA5%7D/1.0/artifacts
oslc_asset.name: services.ear
Body: <EAR file>
Response:
Status Code: 201 (created)
Location: https://server:9443/am/oslc/assets/%7B1082CDD3-1E40-5648-E7DC-5137CC841AA5%7D/1.0/artifactContents/services.ear -
Update the created artifact's subject
The system performs a partial update on the asset overriding the list of artifacts in the asset. We add a new artifact (with remote content) that is the build summary
Request:
PUT https://server:9443/am/oslc/assets/%7B1082CDD3-1E40-5648-E7DC-5137CC841AA5%7D/1.0?oslc_asset.properties=artifact
Accept: application/xml
Content-Type: application/xml
Body:
<oslc_asset:asset rdf:about="https://server:9443/am/oslc/assets/%7B1082CDD3-1E40-5648-E7DC-5137CC841AA5%7D/1.0">
<oslc_asset:artifact>
<dc:title>services.ear</dc:title>
<oslc_asset:content rdf:resource="https://server:9443/am/oslc/assets/%7B1082CDD3-1E40-5648-E7DC-5137CC841AA5%7D/1.0/artifactContents/services.ear"/>
<dc:subject>MyCo's employee web services Java Enterprise Application [2009-10-11T12:10:16.593-04:00]</dc:subject>
</oslc_asset:artifact>
<oslc_asset:artifact>
<dc:title>buildSummary.html</dc:title>
<oslc_asset:content rdf:resource="https://buildServer/fullcontrol/index.php?mod=jobs&action=edit&bf_id=965518"/>
<dc:subject>Myco Services[2009-10-11T12:10:16.593-04:00] Build Results</dc:subject>
</oslc_asset:artifact>
</oslc_asset:asset>
Response:
Status Code: 200 (OK)
Content-Type: application/xml
Body:
<oslc_asset:asset rdf:about="https://server:9443/am/oslc/assets/%7B1082CDD3-1E40-5648-E7DC-5137CC841AA5%7D/1.0">
<ras:id>
<ras:GUID>{1082CDD3-1E40-5648-E7DC-5137CC841AA5}</ras:GUID>
<ras:version>1.0.20091011</ras:version>
</ras:id>
<dc:title>Myco Services Application</dc:title>
<dc:subject>My Company's REST Services Application</dc:subject>
<dc:type>Application</dc:type>
<oslc_asset:state>Approved</oslc_asset:state>
<dc:contributor>bobsmith@myco.com</dc:contributor>
<oslc_asset:artifactContentFactory rdf:about="https://server:9443/am/oslc/assets/%7B1082CDD3-1E40-5648-E7DC-5137CC841AA5%7D/1.0/artifacts"/>
<oslc_asset:artifact>
<dc:title>services.ear</dc:title>
<oslc_asset:size>6439267</oslc_asset:size>
<oslc_asset:content rdf:resource="https://server:9443/am/oslc/assets/%7B1082CDD3-1E40-5648-E7DC-5137CC841AA5%7D/1.0/artifactContents/services.ear"/>
<oslc_asset:mimeType>application/java-archive</oslc_asset:mimeType>
<dc:subject>MyCo's employee web services Java Enterprise Application [2009-10-11T12:10:16.593-04:00]</dc:subject>
<oslc_asset:lastModified>2009-10-11T12:10:16.593-04:00</oslc_asset:lastModified>
</oslc_asset:artifact>
<oslc_asset:artifact>
<dc:title>buildSummary.html</dc:title>
<oslc_asset:content rdf:resource="https://buildServer/fullcontrol/index.php?mod=jobs&action=edit&bf_id=965518"/>
<dc:subject>Myco Services[2009-10-11T12:10:16.593-04:00] Build Results</dc:subject>
</oslc_asset:artifact>
<oslc_asset:relation rdf:resource="https://server:9443/am/oslc/assets/%7B882B4FD7-3C72-4DB0-8097-66866E7D45F6%7D/1.2">
<dc:title>Appache Logging Service</dc:title>
<dc:type>Dependency</dc:type>
</oslc_asset:relation>
</oslc_asset:asset>
-
Resource Formats
References