Skip to content

Latest commit

 

History

History
732 lines (476 loc) · 20.4 KB

ZonesApi.md

File metadata and controls

732 lines (476 loc) · 20.4 KB

\ZonesApi

All URIs are relative to https://gateway.stackpath.com

Method HTTP request Description
CreateZone Post /dns/v1/stacks/{stack_id}/zones Create a zone
DeleteZone Delete /dns/v1/stacks/{stack_id}/zones/{zone_id} Delete a zone
DisableZone Post /dns/v1/stacks/{stack_id}/zones/{zone_id}/disable Disable a zone
EnableZone Post /dns/v1/stacks/{stack_id}/zones/{zone_id}/enable Enable a zone
GetNameserversForZone Get /dns/v1/stacks/{stack_id}/zones/{zone_id}/discover_nameservers Get a zone's nameservers
GetZone Get /dns/v1/stacks/{stack_id}/zones/{zone_id} Get a zone
GetZones Get /dns/v1/stacks/{stack_id}/zones Get all zones
ParseRecordsFromZoneFile Post /dns/v1/stacks/{stack_id}/zones/{zone_id}/parse Parse a zone file
PushFullZone Post /dns/v1/stacks/{stack_id}/zones/{zone_id}/repush Publish a zone
UpdateZone Put /dns/v1/stacks/{stack_id}/zones/{zone_id} Update a zone

CreateZone

ZoneCreateZoneResponse CreateZone(ctx, stackId).ZoneCreateZoneMessage(zoneCreateZoneMessage).Execute()

Create a zone

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    stackId := "stackId_example" // string | A stack ID or slug
    zoneCreateZoneMessage := openapiclient.zoneCreateZoneMessage{Domain: "Domain_example", Labels: map[string]string{ "Key" = "Value" }, UseApexDomain: false} // ZoneCreateZoneMessage | 

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.ZonesApi.CreateZone(context.Background(), stackId, zoneCreateZoneMessage).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ZonesApi.CreateZone``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `CreateZone`: ZoneCreateZoneResponse
    fmt.Fprintf(os.Stdout, "Response from `ZonesApi.CreateZone`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
stackId string A stack ID or slug

Other Parameters

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

Name Type Description Notes

zoneCreateZoneMessage | ZoneCreateZoneMessage | |

Return type

ZoneCreateZoneResponse

Authorization

oauth2

HTTP request headers

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

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

DeleteZone

DeleteZone(ctx, stackId, zoneId).Execute()

Delete a zone

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    stackId := "stackId_example" // string | A stack ID or slug
    zoneId := "zoneId_example" // string | A DNS zone ID

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.ZonesApi.DeleteZone(context.Background(), stackId, zoneId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ZonesApi.DeleteZone``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
stackId string A stack ID or slug
zoneId string A DNS zone ID

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

oauth2

HTTP request headers

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

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

DisableZone

DisableZone(ctx, stackId, zoneId).Execute()

Disable a zone

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    stackId := "stackId_example" // string | A stack ID or slug
    zoneId := "zoneId_example" // string | A DNS zone ID

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.ZonesApi.DisableZone(context.Background(), stackId, zoneId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ZonesApi.DisableZone``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
stackId string A stack ID or slug
zoneId string A DNS zone ID

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

oauth2

HTTP request headers

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

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

EnableZone

EnableZone(ctx, stackId, zoneId).Execute()

Enable a zone

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    stackId := "stackId_example" // string | A stack ID or slug
    zoneId := "zoneId_example" // string | A DNS zone ID

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.ZonesApi.EnableZone(context.Background(), stackId, zoneId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ZonesApi.EnableZone``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
stackId string A stack ID or slug
zoneId string A DNS zone ID

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

oauth2

HTTP request headers

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

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

GetNameserversForZone

ZoneGetNameserversForZoneResponse GetNameserversForZone(ctx, stackId, zoneId).Execute()

Get a zone's nameservers

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    stackId := "stackId_example" // string | A stack ID or slug
    zoneId := "zoneId_example" // string | A DNS zone ID

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.ZonesApi.GetNameserversForZone(context.Background(), stackId, zoneId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ZonesApi.GetNameserversForZone``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetNameserversForZone`: ZoneGetNameserversForZoneResponse
    fmt.Fprintf(os.Stdout, "Response from `ZonesApi.GetNameserversForZone`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
stackId string A stack ID or slug
zoneId string A DNS zone ID

Other Parameters

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

Name Type Description Notes

Return type

ZoneGetNameserversForZoneResponse

Authorization

oauth2

HTTP request headers

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

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

GetZone

ZoneGetZoneResponse GetZone(ctx, stackId, zoneId).Execute()

Get a zone

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    stackId := "stackId_example" // string | A stack ID or slug
    zoneId := "zoneId_example" // string | A DNS zone ID

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.ZonesApi.GetZone(context.Background(), stackId, zoneId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ZonesApi.GetZone``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetZone`: ZoneGetZoneResponse
    fmt.Fprintf(os.Stdout, "Response from `ZonesApi.GetZone`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
stackId string A stack ID or slug
zoneId string A DNS zone ID

Other Parameters

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

Name Type Description Notes

Return type

ZoneGetZoneResponse

Authorization

oauth2

HTTP request headers

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

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

GetZones

ZoneGetZonesResponse GetZones(ctx, stackId).PageRequestFirst(pageRequestFirst).PageRequestAfter(pageRequestAfter).PageRequestFilter(pageRequestFilter).PageRequestSortBy(pageRequestSortBy).Execute()

Get all zones

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    stackId := "stackId_example" // string | A stack ID or slug
    pageRequestFirst := "pageRequestFirst_example" // string | The number of items desired. (optional)
    pageRequestAfter := "pageRequestAfter_example" // string | The cursor value after which data will be returned. (optional)
    pageRequestFilter := "pageRequestFilter_example" // string | SQL-style constraint filters. (optional)
    pageRequestSortBy := "pageRequestSortBy_example" // string | Sort the response by the given field. (optional)

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.ZonesApi.GetZones(context.Background(), stackId).PageRequestFirst(pageRequestFirst).PageRequestAfter(pageRequestAfter).PageRequestFilter(pageRequestFilter).PageRequestSortBy(pageRequestSortBy).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ZonesApi.GetZones``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetZones`: ZoneGetZonesResponse
    fmt.Fprintf(os.Stdout, "Response from `ZonesApi.GetZones`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
stackId string A stack ID or slug

Other Parameters

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

Name Type Description Notes

pageRequestFirst | string | The number of items desired. | pageRequestAfter | string | The cursor value after which data will be returned. | pageRequestFilter | string | SQL-style constraint filters. | pageRequestSortBy | string | Sort the response by the given field. |

Return type

ZoneGetZonesResponse

Authorization

oauth2

HTTP request headers

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

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

ParseRecordsFromZoneFile

ZoneParseRecordsFromZoneFileResponse ParseRecordsFromZoneFile(ctx, stackId, zoneId).ZoneParseRecordsFromZoneFileRequest(zoneParseRecordsFromZoneFileRequest).Execute()

Parse a zone file

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    stackId := "stackId_example" // string | A stack ID or slug
    zoneId := "zoneId_example" // string | A DNS zone ID
    zoneParseRecordsFromZoneFileRequest := openapiclient.zoneParseRecordsFromZoneFileRequest{ZoneFile: 123} // ZoneParseRecordsFromZoneFileRequest | 

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.ZonesApi.ParseRecordsFromZoneFile(context.Background(), stackId, zoneId, zoneParseRecordsFromZoneFileRequest).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ZonesApi.ParseRecordsFromZoneFile``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `ParseRecordsFromZoneFile`: ZoneParseRecordsFromZoneFileResponse
    fmt.Fprintf(os.Stdout, "Response from `ZonesApi.ParseRecordsFromZoneFile`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
stackId string A stack ID or slug
zoneId string A DNS zone ID

Other Parameters

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

Name Type Description Notes

zoneParseRecordsFromZoneFileRequest | ZoneParseRecordsFromZoneFileRequest | |

Return type

ZoneParseRecordsFromZoneFileResponse

Authorization

oauth2

HTTP request headers

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

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

PushFullZone

PushFullZone(ctx, stackId, zoneId).Execute()

Publish a zone

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    stackId := "stackId_example" // string | A stack ID or slug
    zoneId := "zoneId_example" // string | A DNS zone ID

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.ZonesApi.PushFullZone(context.Background(), stackId, zoneId).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ZonesApi.PushFullZone``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
stackId string A stack ID or slug
zoneId string A DNS zone ID

Other Parameters

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

Name Type Description Notes

Return type

(empty response body)

Authorization

oauth2

HTTP request headers

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

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

UpdateZone

ZoneUpdateZoneResponse UpdateZone(ctx, stackId, zoneId).ZoneUpdateZoneMessage(zoneUpdateZoneMessage).Execute()

Update a zone

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    stackId := "stackId_example" // string | A stack ID or slug
    zoneId := "zoneId_example" // string | A DNS zone ID
    zoneUpdateZoneMessage := openapiclient.zoneUpdateZoneMessage{Labels: map[string]string{ "Key" = "Value" }} // ZoneUpdateZoneMessage | 

    configuration := openapiclient.NewConfiguration()
    api_client := openapiclient.NewAPIClient(configuration)
    resp, r, err := api_client.ZonesApi.UpdateZone(context.Background(), stackId, zoneId, zoneUpdateZoneMessage).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ZonesApi.UpdateZone``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `UpdateZone`: ZoneUpdateZoneResponse
    fmt.Fprintf(os.Stdout, "Response from `ZonesApi.UpdateZone`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
stackId string A stack ID or slug
zoneId string A DNS zone ID

Other Parameters

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

Name Type Description Notes

zoneUpdateZoneMessage | ZoneUpdateZoneMessage | |

Return type

ZoneUpdateZoneResponse

Authorization

oauth2

HTTP request headers

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

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