Manage Records Transactionally

Registered by Ron Rickard

This blueprint has been superseded. See the newer blueprint "A user can modify or delete multiple resources easily" for updated plans.

This blueprint proposes the Designate API includes the ability to manage (create, update, or delete) multiple records in a single transaction.

For example, with nsupdate, you are able to delete an old record and add a new record:

nsupdate
> server ns.example.com
> update delete oldhost.example.com. A
> update add newhost.example.com. 86400 A 192.168.0.109
> send
> quit

The example APl calls that would do the same in Designate (assuming the oldhost.example.com. record has an identifier of a86dba58-0043-4cc6-a1bb-69d5e86f3ca3):

Request:
POST /v2/zones/{zone-id}/transactions
Host: dns.provider.com
Accept: application/json
Content-Type: application/json

Response:
HTTP/1.1 201 Created
Content-Type: application/json
Location: https://dns.provider.com/v2/zones/transactions/2e32e609-3a4f-45ba-bdef-e50eacd345ad
{
    "id": "2e32e609-3a4f-45ba-bdef-e50eacd345ad",
    "links": {
        "self": "https://dns.provider.com/v2/zones/transaction/2e32e609-3a4f-45ba-bdef-e50eacd345ad"
    }
}

Request:
PUT /v2/zones/{zone-id}/transactions/2e32e609-3a4f-45ba-bdef-e50eacd345ad
Host: dns.provider.com
Accept: application/json
Content-Type: application/json
{
    "records": [
        {
            "id": "a86dba58-0043-4cc6-a1bb-69d5e86f3ca3",
            "action": "DELETE"
        },
        {
            "name": "oldhost.example.com.",
            "type": "A",
            "data": "192.168.0.109",
            "action": "CREATE"
        }
}

Any number of records can be managed in a single transaction this way. Valid action attributes are "CREATE", "DELETE", "UPDATE".

Note transactions will be rolled back automatically after a timeout period expires or they can be rolled back explicitly using HTTP DELETE method.

Blueprint information

Status:
Complete
Approver:
None
Priority:
Medium
Drafter:
Ron Rickard
Direction:
Needs approval
Assignee:
None
Definition:
Superseded
Series goal:
None
Implementation:
Unknown
Milestone target:
None
Completed by
Kiall Mac Innes

Related branches

Sprints

Whiteboard

This blueprint needs some more discussion around the API (how does it get exposed?). Assuming "transactions" refers to ensuring all changes are executed. If any failures, changes are rolled back like a DB transaction. Implementing this would mean that the other bulk operations may not be needed.

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.