Skip to content

Commit

Permalink
Merge pull request #158 from digital-land/av/remove_entities
Browse files Browse the repository at this point in the history
Remove entities when retire resource
  • Loading branch information
averheecke-tpx authored Nov 21, 2024
2 parents c15d8a4 + 6f1fffc commit 4e747b3
Showing 1 changed file with 20 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,27 @@

In order to retire a resource, we will need the resource hash. This can be found in a variety of ways on [datasette](https://datasette.planning.data.gov.uk/digital-land), some of the will be listed below:

- [`lookup`](https://datasette.planning.data.gov.uk/digital-land/lookup): If you know the reference or the entity number associated with the resource, you can find the resource hash by filtering for the data you have. However, in some cases, there might not be an entity or reference row with a resource associated for whatever reason. In this case, use another method.
- [`resource_endpoint`](https://datasette.planning.data.gov.uk/digital-land/resource_endpoint): If you know the endpoint hash of the associated resource, you can find it here using the endpoint hash.
- [`reporting_latest_endpoints`](https://datasette.planning.data.gov.uk/digital-land/reporting_latest_endpoints): If you know the endpoint hash or the endpoint\_url, you can use these to find the resource

2. **Populate `old-resource.csv`:**

- [`lookup`](https://datasette.planning.data.gov.uk/digital-land/lookup): If you know the reference or the entity number associated with the resource, you can find the resource hash by filtering for the data you have. However, in some cases, there might not be an entity or reference row with a resource associated for whatever reason. In this case, use another method.
- [`resource_endpoint`](https://datasette.planning.data.gov.uk/digital-land/resource_endpoint): If you know the endpoint hash of the associated resource, you can find it here using the endpoint hash.
- [`reporting_latest_endpoints`](https://datasette.planning.data.gov.uk/digital-land/reporting_latest_endpoints): If you know the endpoint hash or the endpoint_url, you can use these to find the resource

Using the resource hash from step , add a new row in `old-resource.csv` located in the config repository. Each row will have the following columns:
2. **Populate `old-resource.csv`:**

* `old-resource` \- the resource hash you identified above
* `status` \- for retiring a resource this should be 410
* `resource` \- not needed for retiring an endpoint
* `notes` \- details on why the resource should no longer be processed E.g., ‘Errors in resource’
Using the resource hash from step 1, add a new row in `old-resource.csv` located in the config repository. Each row will have the following columns:

The following assumes a resource hash *70100002871:*
- `old-resource` \- the resource hash you identified above
- `status` \- for retiring a resource this should be 410
- `resource` \- not needed for retiring an endpoint
- `notes` \- details on why the resource should no longer be processed E.g., ‘Errors in resource’

```
7010002871,410,,new endpoint and reference field for GLO,,,
```
The following assumes a resource hash 70100002871:

```
7010002871,410,,new endpoint and reference field for GLO,,,
```

3. **(Optional) Retire entities**

In cases when the LPA has requested to remove the data from the platform, retiring the resource is not enough as the entities that came from the resource will still be on the platform. To fully remove the data, we will also need to retire the entities.

Follow the instructions for [retiring entities](Retire-entities.md) for this process.

0 comments on commit 4e747b3

Please sign in to comment.