It's all about the answers!

Ask a question

Query related with DNG API's


Rajat Krishnan (721223) | asked Sep 14 '23, 3:36 a.m.
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

2 answers



permanent link
Ralph Schoon (63.5k33646) | answered Sep 14 '23, 4:32 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 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.


Comments
Ralph Schoon commented Sep 14 '23, 4:39 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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.


Rajat Krishnan commented Sep 14 '23, 8:09 a.m.
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

David Honey commented Sep 14 '23, 11:59 a.m. | edited Sep 14 '23, 11:59 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

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
Ian Barnard (2.1k613) | answered Sep 25 '23, 4:37 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
edited Sep 25 '23, 4:56 a.m.

> 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.

Your answer


Register or 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.