Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

Query related with DNG API's

Hello,
Currently i am working on DNG utility which will send a PUT request to update some the artifact column values
and below are my query
  • If we want to update anything in DNG Module, we need to create a changeset, so does it mean if i try to programmatically update any module artifact data, do i need to first create a DNG Changeset programmatically and then only i can update the artifact data?
  • if Changeset creation is not required then what if i update the artifact in DNG and at the same time some other user is working in same module (under same stream) with open changeset, then will my changes (which i have done using API) will go and sit in his/her changeset changed resources history?
Thank you

0 votes



2 answers

Permanent link

 Rajat,


as a reference, the API landing page: https://jazz.net/wiki/bin/view/Deployment/CLMProductAPILanding
In addition the DNG Server API e.g. for delivery: https://jazz.net/wiki/bin/view/Main/DNGServerAPI

I have worked with the Configuration Management API https://jazz.net/wiki/bin/view/Main/DNGConfigManagement in the past. See https://rsjazz.wordpress.com/2019/03/07/type-system-manager-part-2/ and follow the links to read up on it. Especially: https://jazz.net/library/article/92596 . Please note there is code available.

As a summary

If you want to deliver something, you need to provide the source and the target configuration. If a change set is required, you have to create a changeset and do the changes related to this change set. The API will not pick up an arbitrary configuration.

Note, as discussed in https://jazz.net/library/article/92596 the change set API is public, but unfortunately undocumented. You can trace the code and how it works.

0 votes

Comments

Please also note that the error handling support in general e.g. for the  Configuration Management API leaves much to be desired. I do not think you can do much programmatically if the operation fails. Even the error messages are so generic, it does not help much. 

I would suggest to create ideas/enhancement requests if you want more/different API. If there is enough demand, it would be possible to enhance the APIs.

Thanks Ralph for your quick response
I will go through the docs you mentioned if still i don't find a way out i will create a enhancement

Currently, the OSLC Configuration Management specification does not define any mechanisms for delivering change sets, or findinfg the history of such deliveries (e.g. find all the change sets delivered to a specified stream). The OSLC Open Projects Work Group has recently discussed changes to the OSLC Configuration Management specification address these gaps. I recommend anyone interested in this topic participate in the discussions by joining the OSLC Open Projects group - see https://lists.oasis-open-projects.org/g/oslc-op and https://open-services.net/contribute/ for more information.


Permanent link

> If we want to update anything in DNG Module, we need to create a changeset, so does it mean if i try to programmatically update any module artifact data, do i need to first create a DNG Changeset programmatically and then only i can update the artifact data?


Yes that's correct. Once you've created the changeset make sure to use the changeset URL as the configuration for the updates (PUTs) to the artifact(s).

> if Changeset creation is not required then what if i update the artifact in DNG and at the same time some other user is working in same module (under same stream) with open changeset, then will my changes (which i have done using API) will go and sit in his/her changeset changed resources history?

The most recent update sets the value. Or if you mean what happens when updates (PUTs) happen "simultaneously":
  • When you GET the artifact content to retrieve attribute values that you're going to modify later, you also get an etag - this changes whenever the artifact is modified.
  • When you modify the content and do the PUT you have to provide the etag value you retrieved in the header if-match and the server checks if the artifact has been updated since you did the GET then the result will be a 412 precondition failed. You must decide how your code should handle this. One way of handling it could be to somehow stop and notify the user, or another way would be to repeat the GET (i.e. get the latest values and latest etag) and then redo the updates and do PUT again with the new etag.

0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,937

Question asked: Sep 14 '23, 3:36 a.m.

Question was seen: 895 times

Last updated: Sep 25 '23, 4:56 a.m.

Confirmation Cancel Confirm