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