Comments (4)
To add on to this: we did that in staging of IATI Registry
from ckanext-iati.
Hi @robredpath
I can confirm the data purge works on IATI.
As per the CKAN docs to delete a dataset the endpoint is package_delete
To purge the endpoint is dataset_purge
Also what username is trying to do the, they must be an admin on the publisher they are trying to purge the dataset on. Or else a superadmin
I created a script here which works for me on staging:
import requests
from requests.auth import HTTPBasicAuth
api_token = 'INSERT_OWN_TOKEN'headers = {
'X-CKAN-API-Key': api_token,
'Content-Type': 'application/json',
}
username = "BASIC_AUTH_USERNAME"
password = "BASIC_AUTH_PASSWORD"
auth = HTTPBasicAuth(username, password)IATI_STAGING_API_URL = 'https://staging.iatiregistry.org/api/action/'
PACKAGE_ID = 'test-cormac-delete-me'package = requests.get(IATI_STAGING_API_URL + f'package_show?id={PACKAGE_ID}', headers=headers, auth=auth)
print(package)
package_delete = requests.post(IATI_STAGING_API_URL + 'package_delete',
json={'id': PACKAGE_ID},
headers=headers,
auth=auth
)
print(package_delete.dict)package_purge = requests.post(IATI_STAGING_API_URL + 'dataset_purge',
json={'id': PACKAGE_ID},
headers=headers,
auth=auth
)
print(package_purge.dict)
from ckanext-iati.
@cormachallinanderilinx
Apologies, I was testing using the endpoint package_purge
. Purging works fine when using the endpoint dataset_purge
.
Thank you
from ckanext-iati.
Thanks for looking into this @cormachallinanderilinx; glad you got it sorted @PG-Momik
As per the CKAN docs to delete a dataset the endpoint is package_delete
To purge the endpoint is dataset_purge
Now that's a trap for the unwary!
from ckanext-iati.
Related Issues (20)
- Intermittently IATI Archiver incorrectly exits HOT 16
- CSV upload failure due to too many rows has hard-coded value HOT 4
- Value for the "Order By" field on the individual publisher page is incorrectly displayed HOT 1
- 404s on home page HOT 4
- Page 2 broken on user list HOT 2
- Updating emails HOT 31
- Possible regression on staging
- API response isn't valid JSON due to unescaped control characters in user-supplied fields. HOT 1
- Per cent encoding in source URLs
- Change Logs shouldn't be so prominent, especially given its private page
- API Tokens invalidated on upgrade to 2.9.11 HOT 4
- How can someone delete their legacy API Keys? HOT 2
- Publisher Information>Publisher Type dropdown uses out of date codelist
- Understanding our users' usage of the API HOT 2
- Archiver deletes packages that have been deleted and re-created HOT 2
- Duplicates appearing in the Recent Publishers list HOT 2
- dashboard_activity_list endpoint 504ing for one user HOT 6
- Download Error ยท due to Content-length HOT 5
- 2.9.11 Upgrade
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ckanext-iati.