Submitting and updating an asset by using HTTP POST

To submit and update assets, use the HTTP POST.

About this task

When you submit an asset, a number that indicates the revision version number is returned. If you and another user update the asset at the same time, a collision message will return. You must download the asset and update the asset.

To submit new assets or update existing assets by using the HTTP POST calls, use the following HTTP form:

<form method="post" enctype="mulitpart/form-data" action="">
		<textarea name="serializedAsset"></textarea>
		<textarea name="serializedDetails">>/textarea>
		<input type="text" name="assetGroup" size="20">
		<input type="file" name="assetFile" size="100">
		<input type="text" name="assetOwnerID" size="100">
		<select name="stateOption">
				<option value="saveAsNormal" selected>Save Normal</option>
				<option value="saveAsDraft">Save As Draft</option>
				<option value="saveAsIS">Save As Is</option>
		</select>
		<input type="checkbox" name="isUpdate">	
				<input type="text" name ="updateOriginalGUID" size="50">
				<input type="text" name="updateOriginalVersion" size="50">
				<input type="checkbox" name="isKeepOldAssetVersion">
		<input type="text" name="useAssetTags" size="100">
		<input type="submit" name="Submit" value="Submit">
</form>
See the following elements in this table:
Table 1. Element descriptors
Element Type Description
serializedAsset RAS manifest file Provides a .RAS (Reusable Asset Specification) manifest file.
serializedDetails Text Provides a serialized form of artifact details of the asset.
assetOwnerIDs Text Provides a comma- separated list of the new asset owners.
assetGroup Integer Provides an integer that represents the group to submit the asset to.
assetFile .RAS file Provides the .RAS file to be submitted to the server.
Important: The .RAS file must contain the manifest file and artifacts.
stateOption State definition When you submit an asset to Rational® Asset Manager, this element defines the state that the asset should be submitted into. These are the following states:
  • Save as normal. Submits the asset for review.
  • Save as draft. Submits the asset in an editable draft state.
  • As-is. Submits the asset without requiring the asset to be formally reviewed.
isUpdate Check box When you update an asset, select this check box to require the GUID and version number of the asset. You can provide the unique ID and version of the asset in the UpdateOrigionalGUID and UpdateOrigionalVersion element lines.
keepOldAssetVersion Check box When you update an asset, select this check box to keep the old asset version and create a new version for the updated asset. If you do not select the check box, the version number will be replaced at the same version.
userAssetTags Text string Provides tags for the asset. You can remove tags or add new tags based on what is specified.
Submit Button Submits the form.

Procedure

To submit or update an asset by using your user name and password:

  1. Submit the HTTP POST FORM to https://host:port/com.ibm.ram.repository.web.ws.was/RAMSecure/RAMAssetAccess.jsp, where host is the host name of the server, port is the port number, com.ibm.ram.repository.web.ws.was is the web services web application.
  2. Provide your user name and password by using basic authentication.

Example

To submit or update an asset anonymously, remove RAMSecure and use the following URL: http://host:port/com.ibm.ram.repository.web.ws.was/RAMAssetAccess.jsp

When there are problems submitting or updating assets, the following HTTP error codes are thrown:
  • 403 FORBIDDEN: Caller does not have required permissions to submit or update an asset
  • 500 INTERNAL_SERVER_ERROR: Problems or exceptions trying to submit or update the asset
  • 400® BAD_REQUEST: HTTP request made by the caller is semantically incorrect, or incorrect data sent
  • 409 CONFLICT: Asset being submitted already exists on the server
Remember: To connect by using a HTTPS SSL secure connection, confirm that the public key of the server is in the key ring of the client.

After an asset is submitted, the new revision count of the asset is returned as an integer in the response body and as the value of the header com.ibm.ram.asset.revision. Error response messages from the server are returned in the header com.ibm.ram.error.


Feedback