Data deletion service#
Data Deletion Service manages deletion of stored data.
OpenAPI file: nominal.storage.v1.json
Endpoints#
Delete data#
POST /storage/data-deletion/v1/delete-data
Do not use it for new integrations.
Deletes stored data. This is an irreversible operation so be careful about specified time range, channel names, and tag scope. requires the user to be an admin for the organization.
Body
dataSourceRidstring
timeRangeRangeIf specified, will only delete data within the given time range. If not specified, will delete data across all time.
tagsmap of string to stringIf specified, will only delete data that fully matches the given tags. If not specified, will delete data across all tags.
channelNamesarray of stringIf specified, will only delete data that has an exact channel name match with the given names. If not specified, will delete data across all channels.
deleteMetadatabooleanIf true and tags, channelNames, and timeRange are empty, will also delete associated channel metadata. Otherwise, will only delete raw data. This is to guarantee that you are not orphaning data unintentionally by deleting the metadata.
Response
An empty JSON object, {}.
Request
curl -X POST "https://api.gov.nominal.io/api/storage/data-deletion/v1/delete-data" \
-H "Authorization: Bearer <api key>" \
-H "Content-Type: application/json" \
--data '{
"dataSourceRid": "<data source rid>",
"timeRange": {
"start": {
"seconds": "1",
"nanos": "1"
},
"end": {
"seconds": "1",
"nanos": "1"
}
},
"tags": {
"<key>": "<value>"
},
"channelNames": [
"<channel names>"
],
"deleteMetadata": true
}'
import requests
response = requests.post(
"https://api.gov.nominal.io/api/storage/data-deletion/v1/delete-data",
headers={"Authorization": "Bearer <api key>"},
json={
"dataSourceRid": "<data source rid>",
"timeRange": {
"start": {"seconds": "1", "nanos": "1"},
"end": {"seconds": "1", "nanos": "1"},
},
"tags": {"<key>": "<value>"},
"channelNames": ["<channel names>"],
"deleteMetadata": True,
},
)
response.raise_for_status()
print(response.json())
import httpx
response = httpx.post(
"https://api.gov.nominal.io/api/storage/data-deletion/v1/delete-data",
headers={"Authorization": "Bearer <api key>"},
json={
"dataSourceRid": "<data source rid>",
"timeRange": {
"start": {"seconds": "1", "nanos": "1"},
"end": {"seconds": "1", "nanos": "1"},
},
"tags": {"<key>": "<value>"},
"channelNames": ["<channel names>"],
"deleteMetadata": True,
},
)
response.raise_for_status()
print(response.json())
import asyncio
import aiohttp
async def main() -> None:
async with aiohttp.ClientSession() as session:
async with session.post(
"https://api.gov.nominal.io/api/storage/data-deletion/v1/delete-data",
headers={"Authorization": "Bearer <api key>"},
json={
"dataSourceRid": "<data source rid>",
"timeRange": {
"start": {"seconds": "1", "nanos": "1"},
"end": {"seconds": "1", "nanos": "1"},
},
"tags": {"<key>": "<value>"},
"channelNames": ["<channel names>"],
"deleteMetadata": True,
},
) as response:
response.raise_for_status()
print(await response.json())
asyncio.run(main())
Response: 200
{}
Types#
Range#
Deprecated for new APIs. Define an API-owned range with the endpoint semantics it needs instead.
Timestamp#
Deprecated for new APIs. Use google.protobuf.Timestamp for absolute instants.
This legacy nanosecond-precision timestamp is represented by an epoch time in seconds and a nanosecond offset. The nanosecond offset is from the start of the epoch second, so must be less than 1 billion.
secondsstring (int64)
nanosstring (int64)
Page design based on Scalar, MIT License.