Commit a95bcecd authored by Yauheni Lesnikau's avatar Yauheni Lesnikau Committed by Smitha Manjunath
Browse files

update documentation for record bulk delete api

parent d601dc28
......@@ -195,7 +195,44 @@ paths:
security:
- datalake_auth:
- "email"
- Bearer: []
- Bearer: []
"/records/delete":
post:
tags:
- records
summary: Soft delete of multiple records
description: "The API performs a soft deletion of the given list of records. Required roles: 'users.datalake.editors' or
'users.datalake.admins'."
operationId: Delete records
parameters:
- name: data-partition-id
in: header
description: This value should be the desired data partition id.
required: true
schema:
type: string
default: common
requestBody:
content:
application/json:
schema:
type: array
items:
type: string
responses:
"204":
description: All records deleted successfully.
"207":
description: Some of the records weren't deleted successfully.
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/DeleteRecordsException"
security:
- bearer: []
- appkey: []
/records/{id}:
get:
tags:
......@@ -700,6 +737,18 @@ definitions:
- "tenant1:wellLog:654abc987"
attributes:
- "data.msg"
DeleteRecordsException:
type: object
properties:
notDeletedRecordId:
type: string
example: common:welldb:123456
description: Record id which wasn't deleted successfully.
message:
type: string
example: Record with id 'common:welldb:123456' not found
description: Brief description of the cause why record wasn't delete
description: Delete Records Response Body
RecordData:
type: "object"
properties:
......
......@@ -33,6 +33,7 @@
- [Get record <a name="Retrieve-latest-record-version"></a>](#get-record)
- [Parameters <a name="parameters"></a>](#parameters-2)
- [Delete record <a name="Delete-record"></a>](#delete-record)
- [Delete records <a name="Delete-records"></a>](#delete-records)
- [Patch api <a name="patch-api"></a>](#patch-api)
- [Replace Tags, ACLs and Legal Tags <a name="patch-api-metadata-bulk-replace"></a>](#patch-api-metadata-bulk-replace)
- [Add Tags, ACLs and Legal Tags <a name="patch-api-metadata-bulk-add"></a>](#patch-api-metadata-bulk-add)
......@@ -456,6 +457,29 @@ curl --request POST \
```
</details>
### Delete records <a name="Delete-records"></a>
The API performs a logical deletion of batch of record (max size of a batch is 500 records). This operation can be reverted later by ingesting record with the same id one more time. The deleted (inactive) records will be removed from the index, and therefore will not be returned to the search result.
```
POST /api/storage/v2/records/delete
```
<details><summary>curl</summary>
```
curl --request POST \
--url '/api/storage/v2/records/delete' \
--header 'accept: application/json' \
--header 'authorization: Bearer <JWT>' \
--header 'content-type: application/json'\
--header 'Data-Partition-Id: common'
--data-raw '[
"tenant:type:unique-identifier",
"tenant:type:unique-identifier",
"tenant:type:unique-identifier"
]'
```
</details>
## Patch api <a name="patch-api"></a>
Bulk Update API allows the update of records metadata in batch. It takes an array of record ids with/without version
......
// Copyright 2017-2021, Schlumberger
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package org.opengroup.osdu.storage.exception;
import java.util.List;
......
// Copyright 2017-2021, Schlumberger
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package org.opengroup.osdu.storage.records;
import org.junit.After;
......
// Copyright 2017-2019, Schlumberger
// Copyright 2017-2021, Schlumberger
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment