All URIs are relative to https://napi.arvancloud.ir/cdn/4.0
Method | HTTP request | Description |
---|---|---|
DnsRecordsCloud | Put /domains/{domain}/dns-records/{id}/cloud | Toggle cloud status (To proxy or not proxy, that's the question!) |
DnsRecordsDestroy | Delete /domains/{domain}/dns-records/{id} | Remove a DNS record |
DnsRecordsDnsSecShow | Get /domains/{domain}/dns-records/dnssec | Get status of DNSSEC |
DnsRecordsDnsSecUpdate | Put /domains/{domain}/dns-records/dnssec/actions | Update DNSSEC status |
DnsRecordsImport | Post /domains/{domain}/dns-records/import | Import DNS records using BIND file |
DnsRecordsIndex | Get /domains/{domain}/dns-records | Get list of DNS records |
DnsRecordsShow | Get /domains/{domain}/dns-records/{id} | Get information of a record |
DnsRecordsStore | Post /domains/{domain}/dns-records | Create new DNS record |
DnsRecordsUpdate | Put /domains/{domain}/dns-records/{id} | Update a DNS record |
DnsRecordResponse DnsRecordsCloud(ctx, domain, id).DnsRecordCloud(dnsRecordCloud).Execute()
Toggle cloud status (To proxy or not proxy, that's the question!)
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/arash-r1c/cdn-go-sdk"
)
func main() {
domain := "example.com" // string | Domain name
id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | ID of the DNS record
dnsRecordCloud := *openapiclient.NewDnsRecordCloud(false) // DnsRecordCloud | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DNSManagementApi.DnsRecordsCloud(context.Background(), domain, id).DnsRecordCloud(dnsRecordCloud).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DNSManagementApi.DnsRecordsCloud``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DnsRecordsCloud`: DnsRecordResponse
fmt.Fprintf(os.Stdout, "Response from `DNSManagementApi.DnsRecordsCloud`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
domain | string | Domain name | |
id | string | ID of the DNS record |
Other parameters are passed through a pointer to a apiDnsRecordsCloudRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
dnsRecordCloud | DnsRecordCloud | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
MessageResponse DnsRecordsDestroy(ctx, domain, id).Execute()
Remove a DNS record
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/arash-r1c/cdn-go-sdk"
)
func main() {
domain := "example.com" // string | Domain name
id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | ID of the DNS record
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DNSManagementApi.DnsRecordsDestroy(context.Background(), domain, id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DNSManagementApi.DnsRecordsDestroy``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DnsRecordsDestroy`: MessageResponse
fmt.Fprintf(os.Stdout, "Response from `DNSManagementApi.DnsRecordsDestroy`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
domain | string | Domain name | |
id | string | ID of the DNS record |
Other parameters are passed through a pointer to a apiDnsRecordsDestroyRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DnsSecData DnsRecordsDnsSecShow(ctx, domain).Execute()
Get status of DNSSEC
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/arash-r1c/cdn-go-sdk"
)
func main() {
domain := "example.com" // string | Domain name
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DNSManagementApi.DnsRecordsDnsSecShow(context.Background(), domain).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DNSManagementApi.DnsRecordsDnsSecShow``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DnsRecordsDnsSecShow`: DnsSecData
fmt.Fprintf(os.Stdout, "Response from `DNSManagementApi.DnsRecordsDnsSecShow`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
domain | string | Domain name |
Other parameters are passed through a pointer to a apiDnsRecordsDnsSecShowRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DnsSecData DnsRecordsDnsSecUpdate(ctx, domain).DnsSecStatus(dnsSecStatus).Execute()
Update DNSSEC status
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/arash-r1c/cdn-go-sdk"
)
func main() {
domain := "example.com" // string | Domain name
dnsSecStatus := *openapiclient.NewDnsSecStatus(false) // DnsSecStatus | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DNSManagementApi.DnsRecordsDnsSecUpdate(context.Background(), domain).DnsSecStatus(dnsSecStatus).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DNSManagementApi.DnsRecordsDnsSecUpdate``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DnsRecordsDnsSecUpdate`: DnsSecData
fmt.Fprintf(os.Stdout, "Response from `DNSManagementApi.DnsRecordsDnsSecUpdate`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
domain | string | Domain name |
Other parameters are passed through a pointer to a apiDnsRecordsDnsSecUpdateRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
dnsSecStatus | DnsSecStatus | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
MessageResponse DnsRecordsImport(ctx, domain).FZoneFile(fZoneFile).Execute()
Import DNS records using BIND file
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/arash-r1c/cdn-go-sdk"
)
func main() {
domain := "example.com" // string | Domain name
fZoneFile := os.NewFile(1234, "some_file") // *os.File | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DNSManagementApi.DnsRecordsImport(context.Background(), domain).FZoneFile(fZoneFile).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DNSManagementApi.DnsRecordsImport``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DnsRecordsImport`: MessageResponse
fmt.Fprintf(os.Stdout, "Response from `DNSManagementApi.DnsRecordsImport`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
domain | string | Domain name |
Other parameters are passed through a pointer to a apiDnsRecordsImportRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
fZoneFile | *os.File | |
- Content-Type: multipart/form-data
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DnsRecordsIndex200Response DnsRecordsIndex(ctx, domain).Search(search).Type_(type_).Page(page).PerPage(perPage).Execute()
Get list of DNS records
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/arash-r1c/cdn-go-sdk"
)
func main() {
domain := "example.com" // string | Domain name
search := "search_example" // string | Search term (optional)
type_ := "a,cname,txt" // string | Type of a dns record. To filter multiple types separate them using a comma (optional)
page := int32(56) // int32 | Set the desired page number (optional) (default to 1)
perPage := int32(56) // int32 | Set how many items returned per page (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DNSManagementApi.DnsRecordsIndex(context.Background(), domain).Search(search).Type_(type_).Page(page).PerPage(perPage).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DNSManagementApi.DnsRecordsIndex``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DnsRecordsIndex`: DnsRecordsIndex200Response
fmt.Fprintf(os.Stdout, "Response from `DNSManagementApi.DnsRecordsIndex`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
domain | string | Domain name |
Other parameters are passed through a pointer to a apiDnsRecordsIndexRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
search | string | Search term | type_ | string | Type of a dns record. To filter multiple types separate them using a comma | page | int32 | Set the desired page number | [default to 1] perPage | int32 | Set how many items returned per page |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DnsRecordData DnsRecordsShow(ctx, domain, id).Execute()
Get information of a record
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/arash-r1c/cdn-go-sdk"
)
func main() {
domain := "example.com" // string | Domain name
id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | ID of the DNS record
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DNSManagementApi.DnsRecordsShow(context.Background(), domain, id).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DNSManagementApi.DnsRecordsShow``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DnsRecordsShow`: DnsRecordData
fmt.Fprintf(os.Stdout, "Response from `DNSManagementApi.DnsRecordsShow`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
domain | string | Domain name | |
id | string | ID of the DNS record |
Other parameters are passed through a pointer to a apiDnsRecordsShowRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DnsRecordResponse DnsRecordsStore(ctx, domain).DnsRecord(dnsRecord).Execute()
Create new DNS record
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/arash-r1c/cdn-go-sdk"
)
func main() {
domain := "example.com" // string | Domain name
dnsRecord := openapiclient.DnsRecord{AAAARecord: openapiclient.NewAAAARecord()} // DnsRecord | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DNSManagementApi.DnsRecordsStore(context.Background(), domain).DnsRecord(dnsRecord).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DNSManagementApi.DnsRecordsStore``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DnsRecordsStore`: DnsRecordResponse
fmt.Fprintf(os.Stdout, "Response from `DNSManagementApi.DnsRecordsStore`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
domain | string | Domain name |
Other parameters are passed through a pointer to a apiDnsRecordsStoreRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
dnsRecord | DnsRecord | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DnsRecordResponse DnsRecordsUpdate(ctx, domain, id).DnsRecord(dnsRecord).Execute()
Update a DNS record
package main
import (
"context"
"fmt"
"os"
openapiclient "github.com/arash-r1c/cdn-go-sdk"
)
func main() {
domain := "example.com" // string | Domain name
id := "38400000-8cf0-11bd-b23e-10b96e4ef00d" // string | ID of the DNS record
dnsRecord := openapiclient.DnsRecord{AAAARecord: openapiclient.NewAAAARecord()} // DnsRecord | (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.DNSManagementApi.DnsRecordsUpdate(context.Background(), domain, id).DnsRecord(dnsRecord).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `DNSManagementApi.DnsRecordsUpdate``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `DnsRecordsUpdate`: DnsRecordResponse
fmt.Fprintf(os.Stdout, "Response from `DNSManagementApi.DnsRecordsUpdate`: %v\n", resp)
}
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
domain | string | Domain name | |
id | string | ID of the DNS record |
Other parameters are passed through a pointer to a apiDnsRecordsUpdateRequest struct via the builder pattern
Name | Type | Description | Notes |
---|
dnsRecord | DnsRecord | |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]