Back to Lego

Notes

providers/dns/derak/internal/readme.md

4.35.211.9 KB
Original Source

Notes

Forum


DNS records (API)

GET: Get a list of all DNS records

ex: https://api.derak.cloud/v1.0/zones/47c0ecf6c91243308c649ad1d2d618dd/dnsrecords

Query

The name of the parameterDescription
dnsTypednsType query
contentThe Host value of the DNS record

Errors

type errorError code
ForbiddenError1003
RateLimitExceeded1013

Example

bash
curl -X GET --user "api:YOUR_API_KEY" \
https://api.derak.cloud/v1.0/zones/47c0ecf6c91243308c649ad1d2d618dd/dnsrecords
bash
curl -X GET --user "api:api-MbmnxdpIBvk14nk5LFFdG1CV9PdMDfqi3tZAixBZLXYzM3qc187d7ede2de" \
https://api.derak.cloud/v1.0/zones/47c0ecf6c91243308c649ad1d2d618dd/dnsrecords \
-F dnsType="TXT" 

PUT: Creating a new DNS record on the desired website

ex: https://api.derak.cloud/v1.0/zones/47c0ecf6c91243308c649ad1d2d618dd/dnsrecords

parameters

The name of the parameterDescription
*typeDNS record type [of types Aand AAAAand CNAMEand MXand NSand CAAand TXTand SPFand PTRand SRV]
*hostThe Host value of the DNS record
*contentThe Host value of the DNS record
ttlTTL of DNS record [default: 0]
cloudThis parameter specifies whether the traffic of this record passes through the cloud or not [Default: false]
priorityPriority of MX and SRV records [Default: 0]
serviceSRV record service
protocolSRV record protocol [default: _tcp]
weightSRV Record Weight [Default: 0]
portPriority of MX and SRV records [Default: 0]
advancedThis parameter specifies whether this record has advanced settings or not [default: false]
upstreamPortUpstream Port of DNS record [Default: 80]
upstreamProtocolUpstream protocol related to DNS records. Note that if you change these settings for another record of the same subdomain, the settings will be overwritten. [Default: http]
customSSLTypeCustom SSL related DNS record. Note that if you change these settings for another record of the same subdomain, the settings will be overwritten.

Errors

type errorError code
ForbiddenError1003
RateLimitExceeded1013
DNSValidationError1008

Example

bash
curl -X PUT --user "api:YOUR_API_KEY" \
https://api.derak.cloud/v1.0/zones/47c0ecf6c91243308c649ad1d2d618dd/dnsrecords  \
-F type="A"  \
-F host="app"  \
-F content="1.2.3.4"

GET: Get the information of a single DNS record

ex: https://api.derak.cloud/v1.0/zones/47c0ecf6c91243308c649ad1d2d618dd/dnsrecords/:recordId

Errors

type errorError code
ForbiddenError1003
RateLimitExceeded1013
RecordNotFoundError1021

Example

bash
curl -X GET --user "api:YOUR_API_KEY" \
https://api.derak.cloud/v1.0/zones/47c0ecf6c91243308c649ad1d2d618dd/dnsrecords/:recordId

PATCH: Edit the parameters of a DNS record

https://api.derak.cloud/v1.0/zones/47c0ecf6c91243308c649ad1d2d618dd/dnsrecords/:recordId

parameters

The name of the parameterDescription
typeDNS record type [of types Aand AAAAand CNAMEand MXand NSand CAAand TXTand SPFand PTRand SRV]
hostThe Host value of the DNS record
contentThe Host value of the DNS record
ttlTTL of DNS record [default: 0]
cloudThis parameter specifies whether the traffic of this record passes through the cloud or not [Default: false]
priorityPriority of MX and SRV records [Default: 0]
serviceSRV record service
protocolSRV record protocol [default: _tcp]
weightSRV Record Weight [Default: 0]
portPriority of MX and SRV records [Default: 0]
advancedThis parameter specifies whether this record has advanced settings or not [default: false]
upstreamPortUpstream Port of DNS record [Default: 80]
upstreamProtocolUpstream protocol related to DNS records. Note that if you change these settings for another record of the same subdomain, the settings will be overwritten. [Default: http]
customSSLTypeCustom SSL related DNS record. Note that if you change these settings for another record of the same subdomain, the settings will be overwritten.

Errors

type errorError code
ForbiddenError1003
RateLimitExceeded1013
RecordNotFoundError1021
DNSValidationError1008

Example

bash
curl -X PATCH --user "api:YOUR_API_KEY" \
https://api.derak.cloud/v1.0/zones/47c0ecf6c91243308c649ad1d2d618dd/dnsrecords/:recordId  \
-F cloud="true"

DELETE: Delete a DNS record

ex: https://api.derak.cloud/v1.0/zones/47c0ecf6c91243308c649ad1d2d618dd/dnsrecords/:recordId

Errors

type errorError code
ForbiddenError1003
RateLimitExceeded1013
RecordNotFoundError1021

Example

bash
curl -X DELETE --user "api:YOUR_API_KEY" \
https://api.derak.cloud/v1.0/zones/47c0ecf6c91243308c649ad1d2d618dd/dnsrecords/:recordId

Cache clearing (API)

POST: Clearing (Purge Cache) specified parameters, if no parameter is specified, the entire cache is deleted.

ex: https://api.derak.cloud/v1.0/zones/47c0ecf6c91243308c649ad1d2d618dd/cache/purge

parameters

The name of the parameterDescription
hostnameThe hostname to be deleted
hostnamesAn array of hostnames to be cleared
urlThe URL to be deleted
urlsAn array of URLs to be purged

Errors

type errorError code
ForbiddenError1003
RateLimitExceeded1013

Examples

Purge URLS:

bash
curl -X POST --user "api:YOUR_API_KEY" \
https://api.derak.cloud/v1.0/zones/47c0ecf6c91243308c649ad1d2d618dd/cache/purge  \
-F urls[]="https://www.derak.cloud/post/1"  \
-F urls[]="https://www.derak.cloud/post/2"

Purge HOSTNAMES:

bash
curl -X POST --user "api:YOUR_API_KEY" \
https://api.derak.cloud/v1.0/zones/47c0ecf6c91243308c649ad1d2d618dd/cache/purge  \
-F hostnames[]="www.derak.cloud"  \
-F hostnames[]="app.derak.cloud"

Purge EVERYTHING:

bash
curl -X POST --user "api:YOUR_API_KEY" \
https://api.derak.cloud/v1.0/zones/47c0ecf6c91243308c649ad1d2d618dd/cache/purge

API for SSL certificates

PUT: Enable SSL for a domain

ex: https://api.derak.cloud/v1.0/zones/47c0ecf6c91243308c649ad1d2d618dd/ssl/

Errors

type errorError code
ForbiddenError1003

Example

bash
curl -X PUT --user "api:YOUR_API_KEY" \
https://api.derak.cloud/v1.0/zones/47c0ecf6c91243308c649ad1d2d618dd/ssl/

DELETE: Disable SSL for a domain

ex: https://api.derak.cloud/v1.0/zones/47c0ecf6c91243308c649ad1d2d618dd/ssl/

Errors

type errorError code
ForbiddenError1003

Example

bash
curl -X DELETE --user "api:YOUR_API_KEY" \
https://api.derak.cloud/v1.0/zones/47c0ecf6c91243308c649ad1d2d618dd/ssl/