Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REST API Feature: Create the possibility to delete cryptokeys by id using rest api. #1

Closed
MrM0nkey opened this issue May 15, 2016 · 1 comment
Assignees

Comments

@MrM0nkey
Copy link
Collaborator

MrM0nkey commented May 15, 2016

Feature

This feature should delete cryptokeys by their id.

The link leads to the TODO in the api_spec.md from pdns repo.

For protocol guidelines i would recommand this:

DELETE specification

DELETE is pretty easy to understand. It is used to delete a resource identified by a URI.

On successful deletion, return HTTP status 200 (OK) along with a response body, perhaps the representation of the deleted item (often demands too much bandwidth), or a wrapped response (see Return Values below). Either that or return HTTP status 204 (NO CONTENT) with no response body. In other words, a 204 status with no body, or the JSEND-style response and HTTP status 200 are the recommended responses.

HTTP-spec-wise, DELETE operations are idempotent. If you DELETE a resource, it's removed. Repeatedly calling DELETE on that resource ends up the same: the resource is gone. If calling DELETE say, decrements a counter (within the resource), the DELETE call is no longer idempotent. As mentioned previously, usage statistics and measurements may be updated while still considering the service idempotent as long as no resource data is changed. Using POST for non-idempotent resource requests is recommended.

There is a caveat about DELETE idempotence, however. Calling DELETE on a resource a second time will often return a 404 (NOT FOUND) since it was already removed and therefore is no longer findable. This, by some opinions, makes DELETE operations no longer idempotent, however, the end-state of the resource is the same. Returning a 404 is acceptable and communicates accurately the status of the call

@MrM0nkey MrM0nkey self-assigned this May 15, 2016
@MrM0nkey MrM0nkey changed the title Create the possibility to delete cryptokeys by id using rest api. REST Api Feature: Create the possibility to delete cryptokeys by id using rest api. May 16, 2016
@MrM0nkey MrM0nkey changed the title REST Api Feature: Create the possibility to delete cryptokeys by id using rest api. REST API Feature: Create the possibility to delete cryptokeys by id using rest api. May 16, 2016
@MrM0nkey
Copy link
Collaborator Author

MrM0nkey commented Jun 2, 2016

This feature is finished.
It handles DELETE requests for URL /api/v1/servers/:server_id/zones/:zone_name/cryptokeys/:cryptokey_id .
It Deletes a key from :zone_name specified by :cryptokey_id.

Server Answers:

Case 1: zone_name not found

The server returns 404 Not Found

Case 2: the backend returns true on removal. This means the key is gone.

The server returns 200 No Content

Case 3: the backend returns false on removal. An error occoured.

The sever returns 422 Unknown Status with message "Could not DELETE :cryptokey_id"

@MrM0nkey MrM0nkey closed this as completed Jun 2, 2016
MrM0nkey pushed a commit that referenced this issue Jun 2, 2016
benj-zen pushed a commit that referenced this issue Jul 1, 2016
duplicate header change to dnsdist.cc; make openbsd exceptions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant