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

Add additional APIs for requesting more specific details of zones and records #5

Merged
merged 9 commits into from Nov 5, 2020

Conversation

aeden
Copy link
Member

@aeden aeden commented Oct 23, 2020

Note that these API changes are intended to be completely backwards compatible with the current caller expecations. In the future the zones API will likely change to make meta-only the only behavior, removing the parameter.

Depends on dnsimple/erldns#118

Example of getting only zone metadata:

curl -i -u "username:password" "http://localhost:8083/zones/example.com?metaonly=1" -H "Accept:application/json"
HTTP/1.1 200 OK
content-length: 138
content-type: application/json
date: Fri, 23 Oct 2020 14:02:02 GMT
server: Cowboy
vary: accept

{"erldns":{"zone":{"name":"example.com","version":"03f9b1ecc0b8ba95286b0425f39bf5e9607ed9d9eaad121be04f0853c1e79758","records_count":15}}}

Example of getting details for records with a specific record name:

curl -i -u "username:password" "http://localhost:8083/zones/example.com/records/www.example.com" -H "Accept:application/json"
HTTP/1.1 200 OK
content-length: 534
content-type: application/json
date: Sat, 24 Oct 2020 08:58:00 GMT
server: Cowboy
vary: accept

[{"name":"www.example.com.","type":"A","ttl":3600,"content":"4.5.6.7"},{"name":"www.example.com.","type":"RRSIG","ttl":3600,"content":"1 8 3 3600 1610635684 1602859684 41299 <<101,120,97,109,112,108,101,46,99,111,109>> \\�Z�o�����ٸ�\u001f\u001d�U\u0011v�fbм\u0017��Ͻ?\u001a0�ͬ�v\u0000\u001b�ާ�\u001bJ\bP���E��=C4��\u0015\u000b!�5[�(a���ԫ\u0013\u0005\u0014pP蕵F�ƒ��q���\u0017%��m�j:�̿{�-ARBY��\u0006Z\u0014\u001b�\f\u000fg�8hs\u00041E�"}]

Example of getting details for records with a specific record name and type:

curl -i -u "username:password" "http://localhost:8083/zones/example.com/records/example.com?type=NS" -H "Accept:application/json"
HTTP/1.1 200 OK
content-length: 309
content-type: application/json
date: Sat, 24 Oct 2020 09:02:36 GMT
server: Cowboy
vary: accept

[{"name":"example.com.","type":"NS","ttl":3600,"content":"ns1.dnsimple.com."},{"name":"example.com.","type":"NS","ttl":3600,"content":"ns2.dnsimple.com."},{"name":"example.com.","type":"NS","ttl":3600,"content":"ns3.dnsimple.com."},{"name":"example.com.","type":"NS","ttl":3600,"content":"ns4.dnsimple.com."}]

@aeden aeden self-assigned this Oct 23, 2020
@aeden aeden marked this pull request as draft October 23, 2020 14:55
@aeden aeden changed the title Add metaonly query param which will only render the zone metadata if present Add additional APIs for requesting more specific details of zones and records Oct 24, 2020
@aeden aeden marked this pull request as ready for review October 24, 2020 09:08
@aeden aeden requested review from m0rcq and weppos October 24, 2020 09:08
@aeden
Copy link
Member Author

aeden commented Oct 24, 2020

@weppos I added you for review of the API design.

@m0rcq I added you for review of the erlang implementation.

@aeden aeden merged commit 37ad199 into master Nov 5, 2020
@aeden aeden deleted the api-endpoint-for-zone-metadata-only branch November 5, 2020 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants