Skip to content

Latest commit

 

History

History
659 lines (435 loc) · 19.3 KB

DNSManagementApi.md

File metadata and controls

659 lines (435 loc) · 19.3 KB

\DNSManagementApi

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

DnsRecordsCloud

DnsRecordResponse DnsRecordsCloud(ctx, domain, id).DnsRecordCloud(dnsRecordCloud).Execute()

Toggle cloud status (To proxy or not proxy, that's the question!)

Example

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)
}

Path Parameters

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

Other parameters are passed through a pointer to a apiDnsRecordsCloudRequest struct via the builder pattern

Name Type Description Notes

dnsRecordCloud | DnsRecordCloud | |

Return type

DnsRecordResponse

Authorization

ApiKey, UserToken

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DnsRecordsDestroy

MessageResponse DnsRecordsDestroy(ctx, domain, id).Execute()

Remove a DNS record

Example

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)
}

Path Parameters

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

Other parameters are passed through a pointer to a apiDnsRecordsDestroyRequest struct via the builder pattern

Name Type Description Notes

Return type

MessageResponse

Authorization

ApiKey, UserToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DnsRecordsDnsSecShow

DnsSecData DnsRecordsDnsSecShow(ctx, domain).Execute()

Get status of DNSSEC

Example

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)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
domain string Domain name

Other Parameters

Other parameters are passed through a pointer to a apiDnsRecordsDnsSecShowRequest struct via the builder pattern

Name Type Description Notes

Return type

DnsSecData

Authorization

ApiKey, UserToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DnsRecordsDnsSecUpdate

DnsSecData DnsRecordsDnsSecUpdate(ctx, domain).DnsSecStatus(dnsSecStatus).Execute()

Update DNSSEC status

Example

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)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
domain string Domain name

Other Parameters

Other parameters are passed through a pointer to a apiDnsRecordsDnsSecUpdateRequest struct via the builder pattern

Name Type Description Notes

dnsSecStatus | DnsSecStatus | |

Return type

DnsSecData

Authorization

ApiKey, UserToken

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DnsRecordsImport

MessageResponse DnsRecordsImport(ctx, domain).FZoneFile(fZoneFile).Execute()

Import DNS records using BIND file

Example

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)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
domain string Domain name

Other Parameters

Other parameters are passed through a pointer to a apiDnsRecordsImportRequest struct via the builder pattern

Name Type Description Notes

fZoneFile | *os.File | |

Return type

MessageResponse

Authorization

ApiKey, UserToken

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DnsRecordsIndex

DnsRecordsIndex200Response DnsRecordsIndex(ctx, domain).Search(search).Type_(type_).Page(page).PerPage(perPage).Execute()

Get list of DNS records

Example

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)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
domain string Domain name

Other Parameters

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 |

Return type

DnsRecordsIndex200Response

Authorization

ApiKey, UserToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DnsRecordsShow

DnsRecordData DnsRecordsShow(ctx, domain, id).Execute()

Get information of a record

Example

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)
}

Path Parameters

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

Other parameters are passed through a pointer to a apiDnsRecordsShowRequest struct via the builder pattern

Name Type Description Notes

Return type

DnsRecordData

Authorization

ApiKey, UserToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DnsRecordsStore

DnsRecordResponse DnsRecordsStore(ctx, domain).DnsRecord(dnsRecord).Execute()

Create new DNS record

Example

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)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
domain string Domain name

Other Parameters

Other parameters are passed through a pointer to a apiDnsRecordsStoreRequest struct via the builder pattern

Name Type Description Notes

dnsRecord | DnsRecord | |

Return type

DnsRecordResponse

Authorization

ApiKey, UserToken

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DnsRecordsUpdate

DnsRecordResponse DnsRecordsUpdate(ctx, domain, id).DnsRecord(dnsRecord).Execute()

Update a DNS record

Example

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)
}

Path Parameters

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

Other parameters are passed through a pointer to a apiDnsRecordsUpdateRequest struct via the builder pattern

Name Type Description Notes

dnsRecord | DnsRecord | |

Return type

DnsRecordResponse

Authorization

ApiKey, UserToken

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]