Community:NDR/delete
From NSDLWiki
Contents[hide] |
delete
Deletes objects in the NDR
Request URL
- http://ndr.nsdl.org/api/delete/[handle]
- where [handle] is an NDR handle for an existing object.
- Must be an HTTP POST request.
Arguments
- cascade
- If set to true, then any surrounding dependent objects will be deleted.
- Example: http://ndr.nsdl.org/api/delete/2200/198003200913T?cascade=true
Behaviour
'Deleting' an object in the NDR via delete does not actually remove it from the NDR; it changes the object's state to 'Deleted'. Thus, delete is a non-destructive operation. No data is lost upon delete, and any deleted object can be undeleted as desired.
Any object that is deleted is invisible to all API calls unless explicitely referenced by handle or state. For example:
- If a Metadata object is deleted, it will not appear in a ListMembers call on its parent MetadataProvider.
- A 'get' call on a specific deleted object will display its contents
- if a resource is memberOf an aggregator, and that aggregator is subsequently deleted, then a 'get' call on the resource will not show that particular memberOf relationship in its relationship list
- A 'find' request will not match any deleted object (even if it otherwise matches) unless the find request explicitly declares a 'deleted' state as one if its match criteria
Currently, only Metadata, Aggregator, and MetadataProvider objects may be deleted by normal NDR user agents. This is by policy.
The cascade parameter deletes any direct dependent objects. Right now, this only really applies to Metadata and MetadataProviders. An active Metadata object cannot exist without an active MetadataProvider in the NDR, so it is not possible to delete a MetadataProvider if there are any active Metadata objects within it. Deleting a MetadataProvider with the cascade option will invoke a 'delete' operation on every active Metadata record underneath it before it is deleted itself.
Response Example
- <?xml version="1.0" encoding="UTF-8"?>
- <NSDLDataRepository schemaVersion="1.00.000" xmlns="http://ns.nsdl.org/ndr/response_v1.00/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://ns.nsdl.org/ndr/response_v1.00/ http://ns.nsdl.org/schemas/ndr/response_v1.00.xsd">
- <responseTime>2006-04-10T18:07:53Z</responseTime>
- <requestURL>http://ndr.nsdl.org/api/delete/2200/20060410173455215T</requestURL>
- <resultData>
- <handle>2200/20060410173455215T</handle>
- </resultData>
- </NSDLDataRepository>