Hi Oliver.
Well, a reason...
I can only assume:
In general, it is not a common procedure to delete records in sdm, of course with some exceptions...
Normally you just inactivate records.
But sure, especially regarding those n-m relationships, you might think, deletion is an appropriate data change, as a relationship between ci's either exists or not.
The hier factory, in my understanding is an old way to handle these kind of relationships .
Nowadays I would suggest to use bmhier instead. They have an additional relationship type attribute. They can be deleted through REST by default, and also be inactivated (set delete_flag=1 ,keeping the history ;) ). Additionally, they get displayed in the CMDB Visualizer. And changes are tracked in the CI versioning !
The hier factory has no active flag. That means the only way to go, is to delete them .
I assume it was just forgotten to make the DELETE operation available.
Just my 2 cents.
Beste Grüße aus Köln.
....Michael
------------------------------
Principal Services Consultant
HCL Enterprise Studio
Germany
------------------------------
Original Message:
Sent: 09-25-2020 03:01 AM
From: Oliver Gaida
Subject: How to delete records via REST API
Hi Micheal,
Thank you very much for your advice, unfortunately I am not the administrator of the SDM and have to wait if and when my colleagues can make this change. I'll get back to you when I can test it.
Do you know any reason why it is not allowed by default?
Regards
Oliver
------------------------------
Devops Engineer
Sycor GmbH
Original Message:
Sent: 09-23-2020 07:16 AM
From: Michael Müller
Subject: How to delete records via REST API
Hi Oliver.
Still struggeling with this challenge?
In SDM, you can specify which of the REST CRUD operations are allowed per factory.
For the hier factory , by default , only CREATE , READ, and UPDATE are allowed.
Well, at least in my understanding, this is a misssing, incomplete default settings.
I just added a
MODIFY FACTORY hier REST_OPERATIONS "CREATE READ UPDATE DELETE";
to a site/mods/majic/*.mod file and restarted the service
After this change , I was able to delete hier records through REST.
Let us know your progress.
Regards
....Michael
------------------------------
Principal Services Consultant
HCL Enterprise Studio
Germany
Original Message:
Sent: 09-17-2020 04:42 PM
From: Oliver Gaida
Subject: How to delete records via REST API
hello,
it is easy to connect to nr objects via rest api calls to a parent-child relation with new records in the hier object. does anybody know a reason why it is not possible to delete this relationship via rest api call. what is the point of not allowing this method via the api. I think: half an API is not a whole API. it is only an unfinished api, isn't it?
If i look at the documentation in https://techdocs.broadcom.com/us/en/ca-enterprise-software/business-management/ca-service-management/17-2/reference/ca-service-desk-manager-reference-commands/objects-and-attributes.html allowed operations for any objects are: CREATE, READ and UPDATE .... no DELETE
best regards from germany
Oliver
------------------------------
Devops Engineer
Sycor GmbH
------------------------------