Documentation
¶
Index ¶
- type DNSFailoverLog
- type DNSFailoverLogItem
- type DNSGetAccountOverviewResponse
- type DNSGetAccountOverviewResponseInfo
- type DNSLabelName
- type DNSLocationTranslations
- type DNSLookupParams
- type DNSLookupParamsRequestServer
- type DNSLookupResponse
- type DNSMappingEntry
- type DNSMappingEntryParam
- type DNSNameServer
- type DNSNetworkMapping
- type DNSNetworkMappingParam
- type DNSOutputRrset
- type DNSOutputRrsetPicker
- type DNSOutputRrsetResourceRecord
- type DNSOutputRrsetType
- type DNSOutputRrsetWarning
- type DNSService
- type Error
- type LocationListContinentsResponse
- type LocationListCountriesResponse
- type LocationListRegionsResponse
- type LocationListResponse
- type LocationService
- func (r *LocationService) List(ctx context.Context, opts ...option.RequestOption) (res *LocationListResponse, err error)
- func (r *LocationService) ListContinents(ctx context.Context, opts ...option.RequestOption) (res *LocationListContinentsResponse, err error)
- func (r *LocationService) ListCountries(ctx context.Context, opts ...option.RequestOption) (res *LocationListCountriesResponse, err error)
- func (r *LocationService) ListRegions(ctx context.Context, opts ...option.RequestOption) (res *LocationListRegionsResponse, err error)
- type MetricListParams
- type MetricService
- type NetworkMappingDeleteResponse
- type NetworkMappingImportResponse
- type NetworkMappingListParams
- type NetworkMappingListParamsOrderDirection
- type NetworkMappingListResponse
- type NetworkMappingNewParams
- type NetworkMappingNewResponse
- type NetworkMappingReplaceParams
- type NetworkMappingReplaceResponse
- type NetworkMappingService
- func (r *NetworkMappingService) Delete(ctx context.Context, id int64, opts ...option.RequestOption) (res *NetworkMappingDeleteResponse, err error)
- func (r *NetworkMappingService) Get(ctx context.Context, id int64, opts ...option.RequestOption) (res *DNSNetworkMapping, err error)
- func (r *NetworkMappingService) GetByName(ctx context.Context, name string, opts ...option.RequestOption) (res *DNSNetworkMapping, err error)
- func (r *NetworkMappingService) Import(ctx context.Context, opts ...option.RequestOption) (res *NetworkMappingImportResponse, err error)
- func (r *NetworkMappingService) List(ctx context.Context, query NetworkMappingListParams, ...) (res *NetworkMappingListResponse, err error)
- func (r *NetworkMappingService) New(ctx context.Context, body NetworkMappingNewParams, ...) (res *NetworkMappingNewResponse, err error)
- func (r *NetworkMappingService) Replace(ctx context.Context, id int64, body NetworkMappingReplaceParams, ...) (res *NetworkMappingReplaceResponse, err error)
- type PickerPresetListResponse
- type PickerPresetService
- type PickerService
- type ZoneCheckDelegationStatusResponse
- type ZoneDeleteResponse
- type ZoneDisableResponse
- type ZoneDnssecGetResponse
- type ZoneDnssecService
- type ZoneDnssecUpdateParams
- type ZoneDnssecUpdateResponse
- type ZoneEnableResponse
- type ZoneExportResponse
- type ZoneGetResponse
- type ZoneGetResponseRecord
- type ZoneGetResponseRrsetsAmount
- type ZoneGetResponseRrsetsAmountDynamic
- type ZoneGetStatisticsParams
- type ZoneGetStatisticsResponse
- type ZoneImportParams
- type ZoneImportResponse
- type ZoneImportResponseImported
- type ZoneListParams
- type ZoneListParamsOrderDirection
- type ZoneListResponse
- type ZoneListResponseZone
- type ZoneListResponseZoneRecord
- type ZoneListResponseZoneRrsetsAmount
- type ZoneListResponseZoneRrsetsAmountDynamic
- type ZoneNewParams
- type ZoneNewResponse
- type ZoneReplaceParams
- type ZoneReplaceResponse
- type ZoneRrsetDeleteParams
- type ZoneRrsetDeleteResponse
- type ZoneRrsetGetFailoverLogsParams
- type ZoneRrsetGetFailoverLogsResponse
- type ZoneRrsetGetParams
- type ZoneRrsetListParams
- type ZoneRrsetListParamsOrderDirection
- type ZoneRrsetListResponse
- type ZoneRrsetNewParams
- type ZoneRrsetNewParamsPicker
- type ZoneRrsetNewParamsResourceRecord
- type ZoneRrsetReplaceParams
- type ZoneRrsetReplaceParamsPicker
- type ZoneRrsetReplaceParamsResourceRecord
- type ZoneRrsetService
- func (r *ZoneRrsetService) Delete(ctx context.Context, rrsetType string, body ZoneRrsetDeleteParams, ...) (res *ZoneRrsetDeleteResponse, err error)
- func (r *ZoneRrsetService) Get(ctx context.Context, rrsetType string, query ZoneRrsetGetParams, ...) (res *DNSOutputRrset, err error)
- func (r *ZoneRrsetService) GetFailoverLogs(ctx context.Context, rrsetType string, params ZoneRrsetGetFailoverLogsParams, ...) (res *ZoneRrsetGetFailoverLogsResponse, err error)
- func (r *ZoneRrsetService) List(ctx context.Context, zoneName string, query ZoneRrsetListParams, ...) (res *ZoneRrsetListResponse, err error)
- func (r *ZoneRrsetService) New(ctx context.Context, rrsetType string, params ZoneRrsetNewParams, ...) (res *DNSOutputRrset, err error)
- func (r *ZoneRrsetService) Replace(ctx context.Context, rrsetType string, params ZoneRrsetReplaceParams, ...) (res *DNSOutputRrset, err error)
- type ZoneService
- func (r *ZoneService) CheckDelegationStatus(ctx context.Context, name string, opts ...option.RequestOption) (res *ZoneCheckDelegationStatusResponse, err error)
- func (r *ZoneService) Delete(ctx context.Context, name string, opts ...option.RequestOption) (res *ZoneDeleteResponse, err error)
- func (r *ZoneService) Disable(ctx context.Context, name string, opts ...option.RequestOption) (res *ZoneDisableResponse, err error)
- func (r *ZoneService) Enable(ctx context.Context, name string, opts ...option.RequestOption) (res *ZoneEnableResponse, err error)
- func (r *ZoneService) Export(ctx context.Context, zoneName string, opts ...option.RequestOption) (res *ZoneExportResponse, err error)
- func (r *ZoneService) Get(ctx context.Context, name string, opts ...option.RequestOption) (res *ZoneGetResponse, err error)
- func (r *ZoneService) GetStatistics(ctx context.Context, name string, query ZoneGetStatisticsParams, ...) (res *ZoneGetStatisticsResponse, err error)
- func (r *ZoneService) Import(ctx context.Context, zoneName string, body ZoneImportParams, ...) (res *ZoneImportResponse, err error)
- func (r *ZoneService) List(ctx context.Context, query ZoneListParams, opts ...option.RequestOption) (res *ZoneListResponse, err error)
- func (r *ZoneService) New(ctx context.Context, body ZoneNewParams, opts ...option.RequestOption) (res *ZoneNewResponse, err error)
- func (r *ZoneService) Replace(ctx context.Context, name string, body ZoneReplaceParams, ...) (res *ZoneReplaceResponse, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DNSFailoverLog ¶
type DNSFailoverLog []DNSFailoverLogItem
type DNSFailoverLogItem ¶
type DNSFailoverLogItem struct {
Action string `json:"action"`
Address string `json:"address"`
Time int64 `json:"time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Action respjson.Field
Address respjson.Field
Time respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
FailoverLogEntry
func (DNSFailoverLogItem) RawJSON ¶
func (r DNSFailoverLogItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*DNSFailoverLogItem) UnmarshalJSON ¶
func (r *DNSFailoverLogItem) UnmarshalJSON(data []byte) error
type DNSGetAccountOverviewResponse ¶
type DNSGetAccountOverviewResponse struct {
Info DNSGetAccountOverviewResponseInfo `json:"Info"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Info respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DNSGetAccountOverviewResponse) RawJSON ¶
func (r DNSGetAccountOverviewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*DNSGetAccountOverviewResponse) UnmarshalJSON ¶
func (r *DNSGetAccountOverviewResponse) UnmarshalJSON(data []byte) error
type DNSGetAccountOverviewResponseInfo ¶
type DNSGetAccountOverviewResponseInfo struct {
Contact string `json:"contact"`
NameServer1 string `json:"name_server_1"`
NameServer2 string `json:"name_server_2"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Contact respjson.Field
NameServer1 respjson.Field
NameServer2 respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DNSGetAccountOverviewResponseInfo) RawJSON ¶
func (r DNSGetAccountOverviewResponseInfo) RawJSON() string
Returns the unmodified JSON received from the API
func (*DNSGetAccountOverviewResponseInfo) UnmarshalJSON ¶
func (r *DNSGetAccountOverviewResponseInfo) UnmarshalJSON(data []byte) error
type DNSLabelName ¶
type DNSLabelName struct {
Label string `json:"label"`
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Label respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DNSLabelName) RawJSON ¶
func (r DNSLabelName) RawJSON() string
Returns the unmodified JSON received from the API
func (*DNSLabelName) UnmarshalJSON ¶
func (r *DNSLabelName) UnmarshalJSON(data []byte) error
type DNSLocationTranslations ¶
type DNSLocationTranslations struct {
Names map[string]string `json:"names"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Names respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DNSLocationTranslations) RawJSON ¶
func (r DNSLocationTranslations) RawJSON() string
Returns the unmodified JSON received from the API
func (*DNSLocationTranslations) UnmarshalJSON ¶
func (r *DNSLocationTranslations) UnmarshalJSON(data []byte) error
type DNSLookupParams ¶
type DNSLookupParams struct {
// Domain name
Name param.Opt[string] `query:"name,omitzero" json:"-"`
// Server that will be used as resolver
//
// Any of "authoritative_dns", "google", "cloudflare", "open_dns", "quad9",
// "gcore".
RequestServer DNSLookupParamsRequestServer `query:"request_server,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (DNSLookupParams) URLQuery ¶
func (r DNSLookupParams) URLQuery() (v url.Values, err error)
URLQuery serializes DNSLookupParams's query parameters as `url.Values`.
type DNSLookupParamsRequestServer ¶
type DNSLookupParamsRequestServer string
Server that will be used as resolver
const ( DNSLookupParamsRequestServerAuthoritativeDNS DNSLookupParamsRequestServer = "authoritative_dns" DNSLookupParamsRequestServerGoogle DNSLookupParamsRequestServer = "google" DNSLookupParamsRequestServerCloudflare DNSLookupParamsRequestServer = "cloudflare" DNSLookupParamsRequestServerOpenDNS DNSLookupParamsRequestServer = "open_dns" DNSLookupParamsRequestServerQuad9 DNSLookupParamsRequestServer = "quad9" DNSLookupParamsRequestServerGcore DNSLookupParamsRequestServer = "gcore" )
type DNSLookupResponse ¶
type DNSLookupResponse struct {
Content []string `json:"content"`
Name string `json:"name"`
Ttl int64 `json:"ttl"`
Type string `json:"type"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
Name respjson.Field
Ttl respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DNSLookupResponse) RawJSON ¶
func (r DNSLookupResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*DNSLookupResponse) UnmarshalJSON ¶
func (r *DNSLookupResponse) UnmarshalJSON(data []byte) error
type DNSMappingEntry ¶ added in v0.24.0
type DNSMappingEntry struct {
Cidr4 []string `json:"cidr4"`
Cidr6 []string `json:"cidr6"`
Tags []string `json:"tags"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Cidr4 respjson.Field
Cidr6 respjson.Field
Tags respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DNSMappingEntry) RawJSON ¶ added in v0.24.0
func (r DNSMappingEntry) RawJSON() string
Returns the unmodified JSON received from the API
func (DNSMappingEntry) ToParam ¶ added in v0.24.0
func (r DNSMappingEntry) ToParam() DNSMappingEntryParam
ToParam converts this DNSMappingEntry to a DNSMappingEntryParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with DNSMappingEntryParam.Overrides()
func (*DNSMappingEntry) UnmarshalJSON ¶ added in v0.24.0
func (r *DNSMappingEntry) UnmarshalJSON(data []byte) error
type DNSMappingEntryParam ¶ added in v0.24.0
type DNSMappingEntryParam struct {
Cidr4 []string `json:"cidr4,omitzero"`
Cidr6 []string `json:"cidr6,omitzero"`
Tags []string `json:"tags,omitzero"`
// contains filtered or unexported fields
}
func (DNSMappingEntryParam) MarshalJSON ¶ added in v0.24.0
func (r DNSMappingEntryParam) MarshalJSON() (data []byte, err error)
func (*DNSMappingEntryParam) UnmarshalJSON ¶ added in v0.24.0
func (r *DNSMappingEntryParam) UnmarshalJSON(data []byte) error
type DNSNameServer ¶
type DNSNameServer struct {
Ipv4Addresses []string `json:"ipv4Addresses"`
Ipv6Addresses []string `json:"ipv6Addresses"`
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Ipv4Addresses respjson.Field
Ipv6Addresses respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
NameServer
func (DNSNameServer) RawJSON ¶
func (r DNSNameServer) RawJSON() string
Returns the unmodified JSON received from the API
func (*DNSNameServer) UnmarshalJSON ¶
func (r *DNSNameServer) UnmarshalJSON(data []byte) error
type DNSNetworkMapping ¶ added in v0.24.0
type DNSNetworkMapping struct {
ID int64 `json:"id"`
Mapping []DNSMappingEntry `json:"mapping"`
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Mapping respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DNSNetworkMapping) RawJSON ¶ added in v0.24.0
func (r DNSNetworkMapping) RawJSON() string
Returns the unmodified JSON received from the API
func (DNSNetworkMapping) ToParam ¶ added in v0.24.0
func (r DNSNetworkMapping) ToParam() DNSNetworkMappingParam
ToParam converts this DNSNetworkMapping to a DNSNetworkMappingParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with DNSNetworkMappingParam.Overrides()
func (*DNSNetworkMapping) UnmarshalJSON ¶ added in v0.24.0
func (r *DNSNetworkMapping) UnmarshalJSON(data []byte) error
type DNSNetworkMappingParam ¶ added in v0.24.0
type DNSNetworkMappingParam struct {
Name param.Opt[string] `json:"name,omitzero"`
Mapping []DNSMappingEntryParam `json:"mapping,omitzero"`
// contains filtered or unexported fields
}
func (DNSNetworkMappingParam) MarshalJSON ¶ added in v0.24.0
func (r DNSNetworkMappingParam) MarshalJSON() (data []byte, err error)
func (*DNSNetworkMappingParam) UnmarshalJSON ¶ added in v0.24.0
func (r *DNSNetworkMappingParam) UnmarshalJSON(data []byte) error
type DNSOutputRrset ¶
type DNSOutputRrset struct {
Name string `json:"name,required"`
// List of resource record from rrset
ResourceRecords []DNSOutputRrsetResourceRecord `json:"resource_records,required"`
// RRSet type
//
// Any of "A", "AAAA", "NS", "CNAME", "MX", "TXT", "SRV", "SOA".
Type DNSOutputRrsetType `json:"type,required"`
FilterSetID int64 `json:"filter_set_id"`
// Meta information for rrset. Map with string key and any valid json as value,
// with valid keys
//
// 1. `failover` (object, beta feature, might be changed in the future) can have
// fields 1.1. `protocol` (string, required, HTTP, TCP, UDP, ICMP) 1.2. `port`
// (int, required, 1-65535) 1.3. `frequency` (int, required, in seconds 10-3600)
// 1.4. `timeout` (int, required, in seconds 1-10), 1.5. `method` (string, only
// for protocol=HTTP) 1.6. `command` (string, bytes to be sent only for
// protocol=TCP/UDP) 1.7. `url` (string, only for protocol=HTTP) 1.8. `tls`
// (bool, only for protocol=HTTP) 1.9. `regexp` (string regex to match, only for
// non-ICMP) 1.10. `http_status_code` (int, only for protocol=HTTP) 1.11. `host`
// (string, only for protocol=HTTP)
// 2. `geodns_link` (string) - name of the geodns link to use, if previously set,
// must re-send when updating or CDN integration will be removed for this RRSet
Meta map[string]any `json:"meta"`
// Set of pickers
Pickers []DNSOutputRrsetPicker `json:"pickers"`
Ttl int64 `json:"ttl"`
// Timestamp marshals/unmarshals date and time as timestamp in json
UpdatedAt time.Time `json:"updated_at" format:"date-time"`
// Warning about some possible side effects without strictly disallowing operations
// on rrset readonly Deprecated: use Warnings instead
Warning string `json:"warning"`
// Warning about some possible side effects without strictly disallowing operations
// on rrset readonly
Warnings []DNSOutputRrsetWarning `json:"warnings"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Name respjson.Field
ResourceRecords respjson.Field
Type respjson.Field
FilterSetID respjson.Field
Meta respjson.Field
Pickers respjson.Field
Ttl respjson.Field
UpdatedAt respjson.Field
Warning respjson.Field
Warnings respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DNSOutputRrset) RawJSON ¶
func (r DNSOutputRrset) RawJSON() string
Returns the unmodified JSON received from the API
func (*DNSOutputRrset) UnmarshalJSON ¶
func (r *DNSOutputRrset) UnmarshalJSON(data []byte) error
type DNSOutputRrsetPicker ¶
type DNSOutputRrsetPicker struct {
// Filter type
//
// Any of "geodns", "asn", "country", "continent", "region", "ip", "geodistance",
// "weighted_shuffle", "default", "first_n".
Type string `json:"type,required"`
// Limits the number of records returned by the filter Can be a positive value for
// a specific limit. Use zero or leave it blank to indicate no limits.
Limit int64 `json:"limit"`
// if strict=false, then the filter will return all records if no records match the
// filter
Strict bool `json:"strict"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Type respjson.Field
Limit respjson.Field
Strict respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DNSOutputRrsetPicker) RawJSON ¶
func (r DNSOutputRrsetPicker) RawJSON() string
Returns the unmodified JSON received from the API
func (*DNSOutputRrsetPicker) UnmarshalJSON ¶
func (r *DNSOutputRrsetPicker) UnmarshalJSON(data []byte) error
type DNSOutputRrsetResourceRecord ¶
type DNSOutputRrsetResourceRecord struct {
// Content of resource record The exact length of the array depends on the type of
// rrset, each individual record parameter must be a separate element of the array.
// For example
//
// - SRV-record: `[100, 1, 5061, "example.com"]`
// - CNAME-record: `[ "the.target.domain" ]`
// - A-record: `[ "1.2.3.4", "5.6.7.8" ]`
// - AAAA-record: `[ "2001:db8::1", "2001:db8::2" ]`
// - MX-record: `[ "mail1.example.com", "mail2.example.com" ]`
// - SVCB/HTTPS-record:
// `[ 1, ".", ["alpn", "h3", "h2"], [ "port", 1443 ], [ "ipv4hint", "10.0.0.1" ], [ "ech", "AEn+DQBFKwAgACABWIHUGj4u+PIggYXcR5JF0gYk3dCRioBW8uJq9H4mKAAIAAEAAQABAANAEnB1YmxpYy50bHMtZWNoLmRldgAA" ] ]`
Content []any `json:"content,required"`
ID int64 `json:"id"`
Enabled bool `json:"enabled"`
// Meta information for record Map with string key and any valid json as value,
// with valid keys
//
// 1. `asn` (array of int)
// 2. `continents` (array of string)
// 3. `countries` (array of string)
// 4. `latlong` (array of float64, latitude and longitude)
// 5. `backup` (bool)
// 6. `notes` (string)
// 7. `weight` (float)
// 8. `ip` (string)
// 9. `default` (bool)
//
// Some keys are reserved for balancing, @see
// https://api.gcore.com/dns/v2/info/meta
//
// This meta will be used to decide which resource record should pass through
// filters from the filter set
Meta map[string]any `json:"meta"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Content respjson.Field
ID respjson.Field
Enabled respjson.Field
Meta respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DNSOutputRrsetResourceRecord) RawJSON ¶
func (r DNSOutputRrsetResourceRecord) RawJSON() string
Returns the unmodified JSON received from the API
func (*DNSOutputRrsetResourceRecord) UnmarshalJSON ¶
func (r *DNSOutputRrsetResourceRecord) UnmarshalJSON(data []byte) error
type DNSOutputRrsetType ¶
type DNSOutputRrsetType string
RRSet type
const ( DNSOutputRrsetTypeA DNSOutputRrsetType = "A" DNSOutputRrsetTypeAaaa DNSOutputRrsetType = "AAAA" DNSOutputRrsetTypeNs DNSOutputRrsetType = "NS" DNSOutputRrsetTypeCname DNSOutputRrsetType = "CNAME" DNSOutputRrsetTypeMx DNSOutputRrsetType = "MX" DNSOutputRrsetTypeTxt DNSOutputRrsetType = "TXT" DNSOutputRrsetTypeSrv DNSOutputRrsetType = "SRV" DNSOutputRrsetTypeSoa DNSOutputRrsetType = "SOA" )
type DNSOutputRrsetWarning ¶
type DNSOutputRrsetWarning struct {
Key string `json:"key"`
Message string `json:"message"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Key respjson.Field
Message respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (DNSOutputRrsetWarning) RawJSON ¶
func (r DNSOutputRrsetWarning) RawJSON() string
Returns the unmodified JSON received from the API
func (*DNSOutputRrsetWarning) UnmarshalJSON ¶
func (r *DNSOutputRrsetWarning) UnmarshalJSON(data []byte) error
type DNSService ¶
type DNSService struct {
Options []option.RequestOption
Locations LocationService
Metrics MetricService
Pickers PickerService
Zones ZoneService
NetworkMappings NetworkMappingService
}
DNSService contains methods and other services that help with interacting with the gcore API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewDNSService method instead.
func NewDNSService ¶
func NewDNSService(opts ...option.RequestOption) (r DNSService)
NewDNSService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*DNSService) GetAccountOverview ¶
func (r *DNSService) GetAccountOverview(ctx context.Context, opts ...option.RequestOption) (res *DNSGetAccountOverviewResponse, err error)
Get info about client
func (*DNSService) Lookup ¶
func (r *DNSService) Lookup(ctx context.Context, query DNSLookupParams, opts ...option.RequestOption) (res *[]DNSLookupResponse, err error)
Get the dns records from a specific domain or ip.
type LocationListContinentsResponse ¶
type LocationListContinentsResponse map[string]DNSLocationTranslations
type LocationListCountriesResponse ¶
type LocationListCountriesResponse map[string]DNSLocationTranslations
type LocationListRegionsResponse ¶
type LocationListRegionsResponse map[string]DNSLocationTranslations
type LocationListResponse ¶
type LocationListResponse struct {
Continents map[string]DNSLocationTranslations `json:"continents"`
Countries map[string]DNSLocationTranslations `json:"countries"`
Regions map[string]DNSLocationTranslations `json:"regions"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Continents respjson.Field
Countries respjson.Field
Regions respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (LocationListResponse) RawJSON ¶
func (r LocationListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*LocationListResponse) UnmarshalJSON ¶
func (r *LocationListResponse) UnmarshalJSON(data []byte) error
type LocationService ¶
type LocationService struct {
Options []option.RequestOption
}
LocationService contains methods and other services that help with interacting with the gcore API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewLocationService method instead.
func NewLocationService ¶
func NewLocationService(opts ...option.RequestOption) (r LocationService)
NewLocationService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*LocationService) List ¶
func (r *LocationService) List(ctx context.Context, opts ...option.RequestOption) (res *LocationListResponse, err error)
List of All locations continents/countries/regions.
func (*LocationService) ListContinents ¶
func (r *LocationService) ListContinents(ctx context.Context, opts ...option.RequestOption) (res *LocationListContinentsResponse, err error)
List of All locations continents.
func (*LocationService) ListCountries ¶
func (r *LocationService) ListCountries(ctx context.Context, opts ...option.RequestOption) (res *LocationListCountriesResponse, err error)
List of All locations countries.
func (*LocationService) ListRegions ¶
func (r *LocationService) ListRegions(ctx context.Context, opts ...option.RequestOption) (res *LocationListRegionsResponse, err error)
List of All locations regions.
type MetricListParams ¶
type MetricListParams struct {
// Admin and technical user can specify `client_id` to get metrics for particular
// client. Ignored for client
ClientIDs []int64 `query:"client_ids,omitzero" json:"-"`
// Admin and technical user can specify `monitor_id` to get metrics for particular
// zone. Ignored for client
ZoneNames []string `query:"zone_names,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (MetricListParams) URLQuery ¶
func (r MetricListParams) URLQuery() (v url.Values, err error)
URLQuery serializes MetricListParams's query parameters as `url.Values`.
type MetricService ¶
type MetricService struct {
Options []option.RequestOption
}
MetricService contains methods and other services that help with interacting with the gcore API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewMetricService method instead.
func NewMetricService ¶
func NewMetricService(opts ...option.RequestOption) (r MetricService)
NewMetricService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*MetricService) List ¶
func (r *MetricService) List(ctx context.Context, query MetricListParams, opts ...option.RequestOption) (res *string, err error)
Example of success response:
``` # HELP healthcheck_state The `healthcheck_state` metric reflects the state of a specific monitor after conducting a health check # TYPE healthcheck_state gauge healthcheck_state{client_id="1",monitor_id="431",monitor_locations="us-east-1,us-west-1",monitor_name="test-monitor-1",monitor_type="http",rrset_name="rrset-name1",rrset_type="rrset-type1",zone_name="zone-name1"} 0 healthcheck_state{client_id="1",monitor_id="4871",monitor_locations="fr-1,fr-2",monitor_name="test-monitor-2",monitor_type="tcp",rrset_name="rrset-name2",rrset_type="rrset-type2",zone_name="zone-name2"} 1 healthcheck_state{client_id="2",monitor_id="7123",monitor_locations="ua-1,ua-2",monitor_name="test-monitor-3",monitor_type="icmp",rrset_name="rrset-name3",rrset_type="rrset-type3",zone_name="zone-name3"} 0 ```
type NetworkMappingDeleteResponse ¶ added in v0.24.0
type NetworkMappingDeleteResponse = any
type NetworkMappingImportResponse ¶ added in v0.24.0
type NetworkMappingImportResponse struct {
Success bool `json:"success"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Success respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (NetworkMappingImportResponse) RawJSON ¶ added in v0.24.0
func (r NetworkMappingImportResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*NetworkMappingImportResponse) UnmarshalJSON ¶ added in v0.24.0
func (r *NetworkMappingImportResponse) UnmarshalJSON(data []byte) error
type NetworkMappingListParams ¶ added in v0.24.0
type NetworkMappingListParams struct {
// Max number of records in response
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Amount of records to skip before beginning to write in response.
Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
// Field name to sort by
OrderBy param.Opt[string] `query:"order_by,omitzero" json:"-"`
// Ascending or descending order
//
// Any of "asc", "desc".
OrderDirection NetworkMappingListParamsOrderDirection `query:"order_direction,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (NetworkMappingListParams) URLQuery ¶ added in v0.24.0
func (r NetworkMappingListParams) URLQuery() (v url.Values, err error)
URLQuery serializes NetworkMappingListParams's query parameters as `url.Values`.
type NetworkMappingListParamsOrderDirection ¶ added in v0.24.0
type NetworkMappingListParamsOrderDirection string
Ascending or descending order
const ( NetworkMappingListParamsOrderDirectionAsc NetworkMappingListParamsOrderDirection = "asc" NetworkMappingListParamsOrderDirectionDesc NetworkMappingListParamsOrderDirection = "desc" )
type NetworkMappingListResponse ¶ added in v0.24.0
type NetworkMappingListResponse struct {
NetworkMappings []DNSNetworkMapping `json:"network_mappings"`
TotalAmount int64 `json:"total_amount"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
NetworkMappings respjson.Field
TotalAmount respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (NetworkMappingListResponse) RawJSON ¶ added in v0.24.0
func (r NetworkMappingListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*NetworkMappingListResponse) UnmarshalJSON ¶ added in v0.24.0
func (r *NetworkMappingListResponse) UnmarshalJSON(data []byte) error
type NetworkMappingNewParams ¶ added in v0.24.0
type NetworkMappingNewParams struct {
DNSNetworkMapping DNSNetworkMappingParam
// contains filtered or unexported fields
}
func (NetworkMappingNewParams) MarshalJSON ¶ added in v0.24.0
func (r NetworkMappingNewParams) MarshalJSON() (data []byte, err error)
func (*NetworkMappingNewParams) UnmarshalJSON ¶ added in v0.24.0
func (r *NetworkMappingNewParams) UnmarshalJSON(data []byte) error
type NetworkMappingNewResponse ¶ added in v0.24.0
type NetworkMappingNewResponse struct {
ID int64 `json:"id"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (NetworkMappingNewResponse) RawJSON ¶ added in v0.24.0
func (r NetworkMappingNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*NetworkMappingNewResponse) UnmarshalJSON ¶ added in v0.24.0
func (r *NetworkMappingNewResponse) UnmarshalJSON(data []byte) error
type NetworkMappingReplaceParams ¶ added in v0.24.0
type NetworkMappingReplaceParams struct {
DNSNetworkMapping DNSNetworkMappingParam
// contains filtered or unexported fields
}
func (NetworkMappingReplaceParams) MarshalJSON ¶ added in v0.24.0
func (r NetworkMappingReplaceParams) MarshalJSON() (data []byte, err error)
func (*NetworkMappingReplaceParams) UnmarshalJSON ¶ added in v0.24.0
func (r *NetworkMappingReplaceParams) UnmarshalJSON(data []byte) error
type NetworkMappingReplaceResponse ¶ added in v0.24.0
type NetworkMappingReplaceResponse = any
type NetworkMappingService ¶ added in v0.24.0
type NetworkMappingService struct {
Options []option.RequestOption
}
NetworkMappingService contains methods and other services that help with interacting with the gcore API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewNetworkMappingService method instead.
func NewNetworkMappingService ¶ added in v0.24.0
func NewNetworkMappingService(opts ...option.RequestOption) (r NetworkMappingService)
NewNetworkMappingService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*NetworkMappingService) Delete ¶ added in v0.24.0
func (r *NetworkMappingService) Delete(ctx context.Context, id int64, opts ...option.RequestOption) (res *NetworkMappingDeleteResponse, err error)
Delete network mapping.
Example of request:
``` curl --location --request DELETE 'https://api.gcore.com/dns/v2/network-mappings/123' \ --header 'Authorization: Bearer ...' ```
func (*NetworkMappingService) Get ¶ added in v0.24.0
func (r *NetworkMappingService) Get(ctx context.Context, id int64, opts ...option.RequestOption) (res *DNSNetworkMapping, err error)
Particular network mapping item info
Example of request:
``` curl --location --request GET 'https://api.gcore.com/dns/v2/network-mappings/123' \ --header 'Authorization: Bearer ...' ```
func (*NetworkMappingService) GetByName ¶ added in v0.24.0
func (r *NetworkMappingService) GetByName(ctx context.Context, name string, opts ...option.RequestOption) (res *DNSNetworkMapping, err error)
Get network mapping by name.
Particular network mapping item info ¶
Example of request:
``` curl --location --request GET 'https://api.gcore.com/dns/v2/network-mappings/test-mapping' \ --header 'Authorization: Bearer ...' ```
func (*NetworkMappingService) Import ¶ added in v0.24.0
func (r *NetworkMappingService) Import(ctx context.Context, opts ...option.RequestOption) (res *NetworkMappingImportResponse, err error)
Import network mapping from YAML file.
Note: A YAML file use spaces as indentation, tabs are not allowed. Example of input file:
```
name: mapping_rule_1
mapping:
- tags:
- tag_name_1
cidr4:
- 127.0.2.0/24
- tags:
- tag_name_2
- tag_name_3
cidr4:
- 128.0.1.0/24
- 128.0.2.0/24
- 128.0.3.0/24
cidr6:
- ac:20::0/64
---
name: mapping_rule_2
mapping:
- tags:
- my_network
cidr4:
- 129.0.2.0/24
cidr6:
- ac:20::0/64
```
Example of request:
``` curl --location --request POST 'https://api.gcore.com/dns/v2/network-mappings/import' \ --header 'Authorization: Bearer ...' \ --header 'Content-Type: text/plain' \ --data-raw 'name: mapping_rule_1 mapping:
- tags:
- tag_name_1 cidr4:
- 127.0.2.0/24
- tags:
- tag_name_2
- tag_name_3 cidr4:
- 128.0.1.0/24
- 128.0.2.0/24
- 128.0.3.0/24 cidr6:
- aa:10::/64
--- name: mapping_rule_2 mapping:
- tags:
- my_network cidr4:
- 129.0.2.0/24 cidr6:
- ac:20::0/64'
```
func (*NetworkMappingService) List ¶ added in v0.24.0
func (r *NetworkMappingService) List(ctx context.Context, query NetworkMappingListParams, opts ...option.RequestOption) (res *NetworkMappingListResponse, err error)
List of network mappings.
Example of request:
```
curl --location --request GET 'https://api.gcore.com/dns/v2/network-mappings' \ --header 'Authorization: Bearer ...'
```
func (*NetworkMappingService) New ¶ added in v0.24.0
func (r *NetworkMappingService) New(ctx context.Context, body NetworkMappingNewParams, opts ...option.RequestOption) (res *NetworkMappingNewResponse, err error)
Create new network mapping.
Example of request:
``` curl --location --request POST 'https://api.gcore.com/dns/v2/network-mappings' \ --header 'Authorization: Bearer ...' \ --header 'Content-Type: application/json' \
--data-raw '{
"name": "test",
"mapping": [
{
"tags": [
"tag1"
],
"cidr4": [
"192.0.2.0/24",
"198.0.100.0/24"
]
},
{
"tags": [
"tag2",
"tag3"
],
"cidr4": [
"192.1.2.0/24",
"198.1.100.0/24"
],
"cidr6": [
"aa:10::/64"
]
}
]
}'
```
func (*NetworkMappingService) Replace ¶ added in v0.24.0
func (r *NetworkMappingService) Replace(ctx context.Context, id int64, body NetworkMappingReplaceParams, opts ...option.RequestOption) (res *NetworkMappingReplaceResponse, err error)
Update network mapping (Note: name of network mapping cannot be changed)
Example of request:
``` curl --location --request PUT 'https://api.gcore.com/dns/v2/network-mappings/123' \ --header 'Authorization: Bearer ...' \ --header 'Content-Type: application/json' \
--data-raw '{
"name": "test-mapping",
"mapping": [
{
"tags": [
"tag1"
],
"cidr4": [
"192.0.2.0/24"
]
},
{
"tags": [
"tag2",
"tag3"
],
"cidr4": [
"192.1.2.0/24"
],
"cidr6": [
"aa:10::/64"
]
}
]
}'
```
type PickerPresetListResponse ¶
type PickerPresetListResponse map[string][]DNSLabelName
type PickerPresetService ¶
type PickerPresetService struct {
Options []option.RequestOption
}
PickerPresetService contains methods and other services that help with interacting with the gcore API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPickerPresetService method instead.
func NewPickerPresetService ¶
func NewPickerPresetService(opts ...option.RequestOption) (r PickerPresetService)
NewPickerPresetService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*PickerPresetService) List ¶
func (r *PickerPresetService) List(ctx context.Context, opts ...option.RequestOption) (res *PickerPresetListResponse, err error)
Returns list of picker preset
type PickerService ¶
type PickerService struct {
Options []option.RequestOption
Presets PickerPresetService
}
PickerService contains methods and other services that help with interacting with the gcore API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPickerService method instead.
func NewPickerService ¶
func NewPickerService(opts ...option.RequestOption) (r PickerService)
NewPickerService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*PickerService) List ¶
func (r *PickerService) List(ctx context.Context, opts ...option.RequestOption) (res *[]DNSLabelName, err error)
Returns list of picker
type ZoneCheckDelegationStatusResponse ¶
type ZoneCheckDelegationStatusResponse struct {
AuthoritativeNameServers []DNSNameServer `json:"authoritative_name_servers"`
GcoreAuthorizedCount int64 `json:"gcore_authorized_count"`
IsWhitelabelDelegation bool `json:"is_whitelabel_delegation"`
NonGcoreAuthorizedCount int64 `json:"non_gcore_authorized_count"`
ZoneExists bool `json:"zone_exists"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AuthoritativeNameServers respjson.Field
GcoreAuthorizedCount respjson.Field
IsWhitelabelDelegation respjson.Field
NonGcoreAuthorizedCount respjson.Field
ZoneExists respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ZoneCheckDelegationStatusResponse) RawJSON ¶
func (r ZoneCheckDelegationStatusResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ZoneCheckDelegationStatusResponse) UnmarshalJSON ¶
func (r *ZoneCheckDelegationStatusResponse) UnmarshalJSON(data []byte) error
type ZoneDeleteResponse ¶
type ZoneDeleteResponse = any
type ZoneDisableResponse ¶
type ZoneDisableResponse = any
type ZoneDnssecGetResponse ¶
type ZoneDnssecGetResponse struct {
// Specifies the algorithm used for the key.
Algorithm string `json:"algorithm"`
// Represents the hashed value of the DS record.
Digest string `json:"digest"`
// Specifies the algorithm used to generate the digest.
DigestAlgorithm string `json:"digest_algorithm"`
// Specifies the type of the digest algorithm used.
DigestType string `json:"digest_type"`
// Represents the complete DS record.
Ds string `json:"ds"`
// Represents the flag for DNSSEC record.
Flags int64 `json:"flags"`
// Represents the identifier of the DNSKEY record.
KeyTag int64 `json:"key_tag"`
// Specifies the type of the key used in the algorithm.
KeyType string `json:"key_type"`
// Represents the public key used in the DS record.
PublicKey string `json:"public_key"`
Uuid string `json:"uuid"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Algorithm respjson.Field
Digest respjson.Field
DigestAlgorithm respjson.Field
DigestType respjson.Field
Ds respjson.Field
Flags respjson.Field
KeyTag respjson.Field
KeyType respjson.Field
PublicKey respjson.Field
Uuid respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ZoneDnssecGetResponse) RawJSON ¶
func (r ZoneDnssecGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ZoneDnssecGetResponse) UnmarshalJSON ¶
func (r *ZoneDnssecGetResponse) UnmarshalJSON(data []byte) error
type ZoneDnssecService ¶
type ZoneDnssecService struct {
Options []option.RequestOption
}
ZoneDnssecService contains methods and other services that help with interacting with the gcore API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewZoneDnssecService method instead.
func NewZoneDnssecService ¶
func NewZoneDnssecService(opts ...option.RequestOption) (r ZoneDnssecService)
NewZoneDnssecService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ZoneDnssecService) Get ¶
func (r *ZoneDnssecService) Get(ctx context.Context, name string, opts ...option.RequestOption) (res *ZoneDnssecGetResponse, err error)
Get DNSSEC DS for a DNS zone.
func (*ZoneDnssecService) Update ¶
func (r *ZoneDnssecService) Update(ctx context.Context, name string, body ZoneDnssecUpdateParams, opts ...option.RequestOption) (res *ZoneDnssecUpdateResponse, err error)
Enable or disable DNSSEC for a DNS zone.
type ZoneDnssecUpdateParams ¶
type ZoneDnssecUpdateParams struct {
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// contains filtered or unexported fields
}
func (ZoneDnssecUpdateParams) MarshalJSON ¶
func (r ZoneDnssecUpdateParams) MarshalJSON() (data []byte, err error)
func (*ZoneDnssecUpdateParams) UnmarshalJSON ¶
func (r *ZoneDnssecUpdateParams) UnmarshalJSON(data []byte) error
type ZoneDnssecUpdateResponse ¶
type ZoneDnssecUpdateResponse struct {
// Specifies the algorithm used for the key.
Algorithm string `json:"algorithm"`
// Represents the hashed value of the DS record.
Digest string `json:"digest"`
// Specifies the algorithm used to generate the digest.
DigestAlgorithm string `json:"digest_algorithm"`
// Specifies the type of the digest algorithm used.
DigestType string `json:"digest_type"`
// Represents the complete DS record.
Ds string `json:"ds"`
// Represents the flag for DNSSEC record.
Flags int64 `json:"flags"`
// Represents the identifier of the DNSKEY record.
KeyTag int64 `json:"key_tag"`
// Specifies the type of the key used in the algorithm.
KeyType string `json:"key_type"`
Message string `json:"message"`
// Represents the public key used in the DS record.
PublicKey string `json:"public_key"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Algorithm respjson.Field
Digest respjson.Field
DigestAlgorithm respjson.Field
DigestType respjson.Field
Ds respjson.Field
Flags respjson.Field
KeyTag respjson.Field
KeyType respjson.Field
Message respjson.Field
PublicKey respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ZoneDnssecUpdateResponse) RawJSON ¶
func (r ZoneDnssecUpdateResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ZoneDnssecUpdateResponse) UnmarshalJSON ¶
func (r *ZoneDnssecUpdateResponse) UnmarshalJSON(data []byte) error
type ZoneEnableResponse ¶
type ZoneEnableResponse = any
type ZoneExportResponse ¶
type ZoneExportResponse struct {
RawZone string `json:"raw_zone"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
RawZone respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ZoneExportResponse) RawJSON ¶
func (r ZoneExportResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ZoneExportResponse) UnmarshalJSON ¶
func (r *ZoneExportResponse) UnmarshalJSON(data []byte) error
type ZoneGetResponse ¶
type ZoneGetResponse struct {
// ID of zone. This field usually is omitted in response and available only in case
// of getting deleted zones by admin.
ID int64 `json:"id"`
// email address of the administrator responsible for this zone
Contact string `json:"contact"`
// describe dnssec status true means dnssec is enabled for the zone false means
// dnssec is disabled for the zone
DnssecEnabled bool `json:"dnssec_enabled"`
Enabled bool `json:"enabled"`
// number of seconds after which secondary name servers should stop answering
// request for this zone
Expiry int64 `json:"expiry"`
// arbitrarily data of zone in json format
Meta map[string]any `json:"meta"`
// name of DNS zone
Name string `json:"name"`
// Time To Live of cache
NxTtl int64 `json:"nx_ttl"`
// primary master name server for zone
PrimaryServer string `json:"primary_server"`
Records []ZoneGetResponseRecord `json:"records"`
// number of seconds after which secondary name servers should query the master for
// the SOA record, to detect zone changes.
Refresh int64 `json:"refresh"`
// number of seconds after which secondary name servers should retry to request the
// serial number
Retry int64 `json:"retry"`
RrsetsAmount ZoneGetResponseRrsetsAmount `json:"rrsets_amount"`
// Serial number for this zone or Timestamp of zone modification moment. If a
// secondary name server slaved to this one observes an increase in this number,
// the slave will assume that the zone has been updated and initiate a zone
// transfer.
Serial int64 `json:"serial"`
Status string `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Contact respjson.Field
DnssecEnabled respjson.Field
Enabled respjson.Field
Expiry respjson.Field
Meta respjson.Field
Name respjson.Field
NxTtl respjson.Field
PrimaryServer respjson.Field
Records respjson.Field
Refresh respjson.Field
Retry respjson.Field
RrsetsAmount respjson.Field
Serial respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Complete zone info with all records included
func (ZoneGetResponse) RawJSON ¶
func (r ZoneGetResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ZoneGetResponse) UnmarshalJSON ¶
func (r *ZoneGetResponse) UnmarshalJSON(data []byte) error
type ZoneGetResponseRecord ¶ added in v0.29.0
type ZoneGetResponseRecord struct {
Name string `json:"name"`
ShortAnswers []string `json:"short_answers"`
Ttl int64 `json:"ttl"`
Type string `json:"type"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Name respjson.Field
ShortAnswers respjson.Field
Ttl respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Record - readonly short version of rrset
func (ZoneGetResponseRecord) RawJSON ¶ added in v0.29.0
func (r ZoneGetResponseRecord) RawJSON() string
Returns the unmodified JSON received from the API
func (*ZoneGetResponseRecord) UnmarshalJSON ¶ added in v0.29.0
func (r *ZoneGetResponseRecord) UnmarshalJSON(data []byte) error
type ZoneGetResponseRrsetsAmount ¶ added in v0.29.0
type ZoneGetResponseRrsetsAmount struct {
// Amount of dynamic RRsets in zone
Dynamic ZoneGetResponseRrsetsAmountDynamic `json:"dynamic"`
// Amount of static RRsets in zone
Static int64 `json:"static"`
// Total amount of RRsets in zone
Total int64 `json:"total"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Dynamic respjson.Field
Static respjson.Field
Total respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ZoneGetResponseRrsetsAmount) RawJSON ¶ added in v0.29.0
func (r ZoneGetResponseRrsetsAmount) RawJSON() string
Returns the unmodified JSON received from the API
func (*ZoneGetResponseRrsetsAmount) UnmarshalJSON ¶ added in v0.29.0
func (r *ZoneGetResponseRrsetsAmount) UnmarshalJSON(data []byte) error
type ZoneGetResponseRrsetsAmountDynamic ¶ added in v0.29.0
type ZoneGetResponseRrsetsAmountDynamic struct {
// Amount of RRsets with enabled healthchecks
Healthcheck int64 `json:"healthcheck"`
// Total amount of dynamic RRsets in zone
Total int64 `json:"total"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Healthcheck respjson.Field
Total respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Amount of dynamic RRsets in zone
func (ZoneGetResponseRrsetsAmountDynamic) RawJSON ¶ added in v0.29.0
func (r ZoneGetResponseRrsetsAmountDynamic) RawJSON() string
Returns the unmodified JSON received from the API
func (*ZoneGetResponseRrsetsAmountDynamic) UnmarshalJSON ¶ added in v0.29.0
func (r *ZoneGetResponseRrsetsAmountDynamic) UnmarshalJSON(data []byte) error
type ZoneGetStatisticsParams ¶
type ZoneGetStatisticsParams struct {
// Beginning of the requested time period (Unix Timestamp, UTC.)
//
// In a query string: &from=1709068637
From param.Opt[int64] `query:"from,omitzero" json:"-"`
// Granularity parameter string is a sequence of decimal numbers, each with
// optional fraction and a unit suffix, such as "300ms", "1.5h" or "2h45m".
//
// Valid time units are "s", "m", "h".
Granularity param.Opt[string] `query:"granularity,omitzero" json:"-"`
// DNS record type.
//
// Possible values:
//
// - A
// - AAAA
// - NS
// - CNAME
// - MX
// - TXT
// - SVCB
// - HTTPS
RecordType param.Opt[string] `query:"record_type,omitzero" json:"-"`
// End of the requested time period (Unix Timestamp, UTC.)
//
// In a query string: &to=1709673437
To param.Opt[int64] `query:"to,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (ZoneGetStatisticsParams) URLQuery ¶
func (r ZoneGetStatisticsParams) URLQuery() (v url.Values, err error)
URLQuery serializes ZoneGetStatisticsParams's query parameters as `url.Values`.
type ZoneGetStatisticsResponse ¶
type ZoneGetStatisticsResponse struct {
// Requests amount (values) for particular zone fractionated by time intervals
// (keys).
//
// Example of response:
// `{ "requests": { "1598608080000": 14716, "1598608140000": 51167, "1598608200000": 53432, "1598611020000": 51050, "1598611080000": 52611, "1598611140000": 46884 } }`
Requests any `json:"requests"`
// Total - sum of all values
Total int64 `json:"total"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Requests respjson.Field
Total respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
StatisticsZoneResponse
func (ZoneGetStatisticsResponse) RawJSON ¶
func (r ZoneGetStatisticsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ZoneGetStatisticsResponse) UnmarshalJSON ¶
func (r *ZoneGetStatisticsResponse) UnmarshalJSON(data []byte) error
type ZoneImportParams ¶
type ZoneImportParams struct {
// Read reads up to len(p) bytes into p. It returns the number of bytes read (0 <=
// n <= len(p)) and any error encountered. Even if Read returns n < len(p), it may
// use all of p as scratch space during the call. If some data is available but not
// len(p) bytes, Read conventionally returns what is available instead of waiting
// for more.
//
// When Read encounters an error or end-of-file condition after successfully
// reading n > 0 bytes, it returns the number of bytes read. It may return the
// (non-nil) error from the same call or return the error (and n == 0) from a
// subsequent call. An instance of this general case is that a Reader returning a
// non-zero number of bytes at the end of the input stream may return either err ==
// EOF or err == nil. The next Read should return 0, EOF.
//
// Callers should always process the n > 0 bytes returned before considering the
// error err. Doing so correctly handles I/O errors that happen after reading some
// bytes and also both of the allowed EOF behaviors.
//
// If len(p) == 0, Read should always return n == 0. It may return a non-nil error
// if some error condition is known, such as EOF.
//
// Implementations of Read are discouraged from returning a zero byte count with a
// nil error, except when len(p) == 0. Callers should treat a return of 0 and nil
// as indicating that nothing happened; in particular it does not indicate EOF.
//
// Implementations must not retain p.
Body any
// contains filtered or unexported fields
}
func (ZoneImportParams) MarshalJSON ¶
func (r ZoneImportParams) MarshalJSON() (data []byte, err error)
func (*ZoneImportParams) UnmarshalJSON ¶
func (r *ZoneImportParams) UnmarshalJSON(data []byte) error
type ZoneImportResponse ¶
type ZoneImportResponse struct {
// ImportedRRSets - import statistics
Imported ZoneImportResponseImported `json:"imported"`
Success bool `json:"success"`
Warnings map[string]map[string]string `json:"warnings"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Imported respjson.Field
Success respjson.Field
Warnings respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ZoneImportResponse) RawJSON ¶
func (r ZoneImportResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ZoneImportResponse) UnmarshalJSON ¶
func (r *ZoneImportResponse) UnmarshalJSON(data []byte) error
type ZoneImportResponseImported ¶
type ZoneImportResponseImported struct {
Qtype int64 `json:"qtype"`
ResourceRecords int64 `json:"resource_records"`
Rrsets int64 `json:"rrsets"`
SkippedResourceRecords int64 `json:"skipped_resource_records"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Qtype respjson.Field
ResourceRecords respjson.Field
Rrsets respjson.Field
SkippedResourceRecords respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
ImportedRRSets - import statistics
func (ZoneImportResponseImported) RawJSON ¶
func (r ZoneImportResponseImported) RawJSON() string
Returns the unmodified JSON received from the API
func (*ZoneImportResponseImported) UnmarshalJSON ¶
func (r *ZoneImportResponseImported) UnmarshalJSON(data []byte) error
type ZoneListParams ¶
type ZoneListParams struct {
CaseSensitive param.Opt[bool] `query:"case_sensitive,omitzero" json:"-"`
// Zones with dynamic RRsets
Dynamic param.Opt[bool] `query:"dynamic,omitzero" json:"-"`
Enabled param.Opt[bool] `query:"enabled,omitzero" json:"-"`
ExactMatch param.Opt[bool] `query:"exact_match,omitzero" json:"-"`
// Zones with RRsets that have healthchecks
Healthcheck param.Opt[bool] `query:"healthcheck,omitzero" json:"-"`
// Max number of records in response
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Amount of records to skip before beginning to write in response.
Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
// Field name to sort by
OrderBy param.Opt[string] `query:"order_by,omitzero" json:"-"`
Status param.Opt[string] `query:"status,omitzero" json:"-"`
UpdatedAtFrom param.Opt[time.Time] `query:"updated_at_from,omitzero" format:"date-time" json:"-"`
UpdatedAtTo param.Opt[time.Time] `query:"updated_at_to,omitzero" format:"date-time" json:"-"`
// to pass several ids `id=1&id=3&id=5...`
ID []int64 `query:"id,omitzero" json:"-"`
// to pass several `client_ids` `client_id=1&client_id=3&client_id=5...`
ClientID []int64 `query:"client_id,omitzero" json:"-"`
IamResellerID []int64 `query:"iam_reseller_id,omitzero" json:"-"`
// to pass several names `name=first&name=second...`
Name []string `query:"name,omitzero" json:"-"`
// Ascending or descending order
//
// Any of "asc", "desc".
OrderDirection ZoneListParamsOrderDirection `query:"order_direction,omitzero" json:"-"`
ResellerID []int64 `query:"reseller_id,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (ZoneListParams) URLQuery ¶
func (r ZoneListParams) URLQuery() (v url.Values, err error)
URLQuery serializes ZoneListParams's query parameters as `url.Values`.
type ZoneListParamsOrderDirection ¶
type ZoneListParamsOrderDirection string
Ascending or descending order
const ( ZoneListParamsOrderDirectionAsc ZoneListParamsOrderDirection = "asc" ZoneListParamsOrderDirectionDesc ZoneListParamsOrderDirection = "desc" )
type ZoneListResponse ¶
type ZoneListResponse struct {
TotalAmount int64 `json:"total_amount"`
Zones []ZoneListResponseZone `json:"zones"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
TotalAmount respjson.Field
Zones respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ZoneListResponse) RawJSON ¶
func (r ZoneListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ZoneListResponse) UnmarshalJSON ¶
func (r *ZoneListResponse) UnmarshalJSON(data []byte) error
type ZoneListResponseZone ¶
type ZoneListResponseZone struct {
// ID of zone. This field usually is omitted in response and available only in case
// of getting deleted zones by admin.
ID int64 `json:"id"`
ClientID int64 `json:"client_id"`
// email address of the administrator responsible for this zone
Contact string `json:"contact"`
// describe dnssec status true means dnssec is enabled for the zone false means
// dnssec is disabled for the zone
DnssecEnabled bool `json:"dnssec_enabled"`
Enabled bool `json:"enabled"`
// number of seconds after which secondary name servers should stop answering
// request for this zone
Expiry int64 `json:"expiry"`
// arbitrarily data of zone in json format
Meta map[string]any `json:"meta"`
// name of DNS zone
Name string `json:"name"`
// Time To Live of cache
NxTtl int64 `json:"nx_ttl"`
// primary master name server for zone
PrimaryServer string `json:"primary_server"`
Records []ZoneListResponseZoneRecord `json:"records"`
// number of seconds after which secondary name servers should query the master for
// the SOA record, to detect zone changes.
Refresh int64 `json:"refresh"`
// number of seconds after which secondary name servers should retry to request the
// serial number
Retry int64 `json:"retry"`
RrsetsAmount ZoneListResponseZoneRrsetsAmount `json:"rrsets_amount"`
// Serial number for this zone or Timestamp of zone modification moment. If a
// secondary name server slaved to this one observes an increase in this number,
// the slave will assume that the zone has been updated and initiate a zone
// transfer.
Serial int64 `json:"serial"`
Status string `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
ClientID respjson.Field
Contact respjson.Field
DnssecEnabled respjson.Field
Enabled respjson.Field
Expiry respjson.Field
Meta respjson.Field
Name respjson.Field
NxTtl respjson.Field
PrimaryServer respjson.Field
Records respjson.Field
Refresh respjson.Field
Retry respjson.Field
RrsetsAmount respjson.Field
Serial respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
OutputZone
func (ZoneListResponseZone) RawJSON ¶
func (r ZoneListResponseZone) RawJSON() string
Returns the unmodified JSON received from the API
func (*ZoneListResponseZone) UnmarshalJSON ¶
func (r *ZoneListResponseZone) UnmarshalJSON(data []byte) error
type ZoneListResponseZoneRecord ¶
type ZoneListResponseZoneRecord struct {
Name string `json:"name"`
ShortAnswers []string `json:"short_answers"`
Ttl int64 `json:"ttl"`
Type string `json:"type"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Name respjson.Field
ShortAnswers respjson.Field
Ttl respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Record - readonly short version of rrset
func (ZoneListResponseZoneRecord) RawJSON ¶
func (r ZoneListResponseZoneRecord) RawJSON() string
Returns the unmodified JSON received from the API
func (*ZoneListResponseZoneRecord) UnmarshalJSON ¶
func (r *ZoneListResponseZoneRecord) UnmarshalJSON(data []byte) error
type ZoneListResponseZoneRrsetsAmount ¶
type ZoneListResponseZoneRrsetsAmount struct {
// Amount of dynamic RRsets in zone
Dynamic ZoneListResponseZoneRrsetsAmountDynamic `json:"dynamic"`
// Amount of static RRsets in zone
Static int64 `json:"static"`
// Total amount of RRsets in zone
Total int64 `json:"total"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Dynamic respjson.Field
Static respjson.Field
Total respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ZoneListResponseZoneRrsetsAmount) RawJSON ¶
func (r ZoneListResponseZoneRrsetsAmount) RawJSON() string
Returns the unmodified JSON received from the API
func (*ZoneListResponseZoneRrsetsAmount) UnmarshalJSON ¶
func (r *ZoneListResponseZoneRrsetsAmount) UnmarshalJSON(data []byte) error
type ZoneListResponseZoneRrsetsAmountDynamic ¶
type ZoneListResponseZoneRrsetsAmountDynamic struct {
// Amount of RRsets with enabled healthchecks
Healthcheck int64 `json:"healthcheck"`
// Total amount of dynamic RRsets in zone
Total int64 `json:"total"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Healthcheck respjson.Field
Total respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Amount of dynamic RRsets in zone
func (ZoneListResponseZoneRrsetsAmountDynamic) RawJSON ¶
func (r ZoneListResponseZoneRrsetsAmountDynamic) RawJSON() string
Returns the unmodified JSON received from the API
func (*ZoneListResponseZoneRrsetsAmountDynamic) UnmarshalJSON ¶
func (r *ZoneListResponseZoneRrsetsAmountDynamic) UnmarshalJSON(data []byte) error
type ZoneNewParams ¶
type ZoneNewParams struct {
// name of DNS zone
Name string `json:"name,required"`
// email address of the administrator responsible for this zone
Contact param.Opt[string] `json:"contact,omitzero"`
// If a zone is disabled, then its records will not be resolved on dns servers
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// number of seconds after which secondary name servers should stop answering
// request for this zone
Expiry param.Opt[int64] `json:"expiry,omitzero"`
// Time To Live of cache
NxTtl param.Opt[int64] `json:"nx_ttl,omitzero"`
// primary master name server for zone
PrimaryServer param.Opt[string] `json:"primary_server,omitzero"`
// number of seconds after which secondary name servers should query the master for
// the SOA record, to detect zone changes.
Refresh param.Opt[int64] `json:"refresh,omitzero"`
// number of seconds after which secondary name servers should retry to request the
// serial number
Retry param.Opt[int64] `json:"retry,omitzero"`
// Serial number for this zone or Timestamp of zone modification moment. If a
// secondary name server slaved to this one observes an increase in this number,
// the slave will assume that the zone has been updated and initiate a zone
// transfer.
Serial param.Opt[int64] `json:"serial,omitzero"`
// arbitrarily data of zone in json format you can specify `webhook` url and
// `webhook_method` here webhook will get a map with three arrays: for created,
// updated and deleted rrsets `webhook_method` can be omitted, POST will be used by
// default
Meta map[string]any `json:"meta,omitzero"`
// contains filtered or unexported fields
}
func (ZoneNewParams) MarshalJSON ¶
func (r ZoneNewParams) MarshalJSON() (data []byte, err error)
func (*ZoneNewParams) UnmarshalJSON ¶
func (r *ZoneNewParams) UnmarshalJSON(data []byte) error
type ZoneNewResponse ¶
type ZoneNewResponse struct {
ID int64 `json:"id"`
Warnings []string `json:"warnings"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Warnings respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ZoneNewResponse) RawJSON ¶
func (r ZoneNewResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ZoneNewResponse) UnmarshalJSON ¶
func (r *ZoneNewResponse) UnmarshalJSON(data []byte) error
type ZoneReplaceParams ¶
type ZoneReplaceParams struct {
// name of DNS zone
Name string `json:"name,required"`
// email address of the administrator responsible for this zone
Contact param.Opt[string] `json:"contact,omitzero"`
// If a zone is disabled, then its records will not be resolved on dns servers
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// number of seconds after which secondary name servers should stop answering
// request for this zone
Expiry param.Opt[int64] `json:"expiry,omitzero"`
// Time To Live of cache
NxTtl param.Opt[int64] `json:"nx_ttl,omitzero"`
// primary master name server for zone
PrimaryServer param.Opt[string] `json:"primary_server,omitzero"`
// number of seconds after which secondary name servers should query the master for
// the SOA record, to detect zone changes.
Refresh param.Opt[int64] `json:"refresh,omitzero"`
// number of seconds after which secondary name servers should retry to request the
// serial number
Retry param.Opt[int64] `json:"retry,omitzero"`
// Serial number for this zone or Timestamp of zone modification moment. If a
// secondary name server slaved to this one observes an increase in this number,
// the slave will assume that the zone has been updated and initiate a zone
// transfer.
Serial param.Opt[int64] `json:"serial,omitzero"`
// arbitrarily data of zone in json format you can specify `webhook` url and
// `webhook_method` here webhook will get a map with three arrays: for created,
// updated and deleted rrsets `webhook_method` can be omitted, POST will be used by
// default
Meta map[string]any `json:"meta,omitzero"`
// contains filtered or unexported fields
}
func (ZoneReplaceParams) MarshalJSON ¶
func (r ZoneReplaceParams) MarshalJSON() (data []byte, err error)
func (*ZoneReplaceParams) UnmarshalJSON ¶
func (r *ZoneReplaceParams) UnmarshalJSON(data []byte) error
type ZoneReplaceResponse ¶
type ZoneReplaceResponse = any
type ZoneRrsetDeleteParams ¶
type ZoneRrsetDeleteResponse ¶
type ZoneRrsetDeleteResponse = any
type ZoneRrsetGetFailoverLogsParams ¶
type ZoneRrsetGetFailoverLogsParams struct {
ZoneName string `path:"zoneName,required" json:"-"`
RrsetName string `path:"rrsetName,required" json:"-"`
// Max number of records in response
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Amount of records to skip before beginning to write in response.
Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (ZoneRrsetGetFailoverLogsParams) URLQuery ¶
func (r ZoneRrsetGetFailoverLogsParams) URLQuery() (v url.Values, err error)
URLQuery serializes ZoneRrsetGetFailoverLogsParams's query parameters as `url.Values`.
type ZoneRrsetGetFailoverLogsResponse ¶
type ZoneRrsetGetFailoverLogsResponse struct {
// FailoverLog
Log DNSFailoverLog `json:"log"`
TotalAmount int64 `json:"total_amount"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Log respjson.Field
TotalAmount respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ZoneRrsetGetFailoverLogsResponse) RawJSON ¶
func (r ZoneRrsetGetFailoverLogsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ZoneRrsetGetFailoverLogsResponse) UnmarshalJSON ¶
func (r *ZoneRrsetGetFailoverLogsResponse) UnmarshalJSON(data []byte) error
type ZoneRrsetGetParams ¶
type ZoneRrsetListParams ¶
type ZoneRrsetListParams struct {
// Max number of records in response
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Amount of records to skip before beginning to write in response.
Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
// Field name to sort by
OrderBy param.Opt[string] `query:"order_by,omitzero" json:"-"`
// Ascending or descending order
//
// Any of "asc", "desc".
OrderDirection ZoneRrsetListParamsOrderDirection `query:"order_direction,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (ZoneRrsetListParams) URLQuery ¶
func (r ZoneRrsetListParams) URLQuery() (v url.Values, err error)
URLQuery serializes ZoneRrsetListParams's query parameters as `url.Values`.
type ZoneRrsetListParamsOrderDirection ¶
type ZoneRrsetListParamsOrderDirection string
Ascending or descending order
const ( ZoneRrsetListParamsOrderDirectionAsc ZoneRrsetListParamsOrderDirection = "asc" ZoneRrsetListParamsOrderDirectionDesc ZoneRrsetListParamsOrderDirection = "desc" )
type ZoneRrsetListResponse ¶
type ZoneRrsetListResponse struct {
Rrsets []DNSOutputRrset `json:"rrsets"`
TotalAmount int64 `json:"total_amount"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Rrsets respjson.Field
TotalAmount respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ZoneRrsetListResponse) RawJSON ¶
func (r ZoneRrsetListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ZoneRrsetListResponse) UnmarshalJSON ¶
func (r *ZoneRrsetListResponse) UnmarshalJSON(data []byte) error
type ZoneRrsetNewParams ¶
type ZoneRrsetNewParams struct {
ZoneName string `path:"zoneName,required" json:"-"`
RrsetName string `path:"rrsetName,required" json:"-"`
// List of resource record from rrset
ResourceRecords []ZoneRrsetNewParamsResourceRecord `json:"resource_records,omitzero,required"`
Ttl param.Opt[int64] `json:"ttl,omitzero"`
// Meta information for rrset
Meta map[string]any `json:"meta,omitzero"`
// Set of pickers
Pickers []ZoneRrsetNewParamsPicker `json:"pickers,omitzero"`
// contains filtered or unexported fields
}
func (ZoneRrsetNewParams) MarshalJSON ¶
func (r ZoneRrsetNewParams) MarshalJSON() (data []byte, err error)
func (*ZoneRrsetNewParams) UnmarshalJSON ¶
func (r *ZoneRrsetNewParams) UnmarshalJSON(data []byte) error
type ZoneRrsetNewParamsPicker ¶
type ZoneRrsetNewParamsPicker struct {
// Filter type
//
// Any of "geodns", "asn", "country", "continent", "region", "ip", "geodistance",
// "weighted_shuffle", "default", "first_n".
Type string `json:"type,omitzero,required"`
// Limits the number of records returned by the filter Can be a positive value for
// a specific limit. Use zero or leave it blank to indicate no limits.
Limit param.Opt[int64] `json:"limit,omitzero"`
// if strict=false, then the filter will return all records if no records match the
// filter
Strict param.Opt[bool] `json:"strict,omitzero"`
// contains filtered or unexported fields
}
The property Type is required.
func (ZoneRrsetNewParamsPicker) MarshalJSON ¶
func (r ZoneRrsetNewParamsPicker) MarshalJSON() (data []byte, err error)
func (*ZoneRrsetNewParamsPicker) UnmarshalJSON ¶
func (r *ZoneRrsetNewParamsPicker) UnmarshalJSON(data []byte) error
type ZoneRrsetNewParamsResourceRecord ¶
type ZoneRrsetNewParamsResourceRecord struct {
// Content of resource record The exact length of the array depends on the type of
// rrset, each individual record parameter must be a separate element of the array.
// For example
//
// - SRV-record: `[100, 1, 5061, "example.com"]`
// - CNAME-record: `[ "the.target.domain" ]`
// - A-record: `[ "1.2.3.4", "5.6.7.8" ]`
// - AAAA-record: `[ "2001:db8::1", "2001:db8::2" ]`
// - MX-record: `[ "mail1.example.com", "mail2.example.com" ]`
// - SVCB/HTTPS-record:
// `[ 1, ".", ["alpn", "h3", "h2"], [ "port", 1443 ], [ "ipv4hint", "10.0.0.1" ], [ "ech", "AEn+DQBFKwAgACABWIHUGj4u+PIggYXcR5JF0gYk3dCRioBW8uJq9H4mKAAIAAEAAQABAANAEnB1YmxpYy50bHMtZWNoLmRldgAA" ] ]`
Content []any `json:"content,omitzero,required"`
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// This meta will be used to decide which resource record should pass through
// filters from the filter set
Meta map[string]any `json:"meta,omitzero"`
// contains filtered or unexported fields
}
nolint: lll
The property Content is required.
func (ZoneRrsetNewParamsResourceRecord) MarshalJSON ¶
func (r ZoneRrsetNewParamsResourceRecord) MarshalJSON() (data []byte, err error)
func (*ZoneRrsetNewParamsResourceRecord) UnmarshalJSON ¶
func (r *ZoneRrsetNewParamsResourceRecord) UnmarshalJSON(data []byte) error
type ZoneRrsetReplaceParams ¶
type ZoneRrsetReplaceParams struct {
ZoneName string `path:"zoneName,required" json:"-"`
RrsetName string `path:"rrsetName,required" json:"-"`
// List of resource record from rrset
ResourceRecords []ZoneRrsetReplaceParamsResourceRecord `json:"resource_records,omitzero,required"`
Ttl param.Opt[int64] `json:"ttl,omitzero"`
// Meta information for rrset
Meta map[string]any `json:"meta,omitzero"`
// Set of pickers
Pickers []ZoneRrsetReplaceParamsPicker `json:"pickers,omitzero"`
// contains filtered or unexported fields
}
func (ZoneRrsetReplaceParams) MarshalJSON ¶
func (r ZoneRrsetReplaceParams) MarshalJSON() (data []byte, err error)
func (*ZoneRrsetReplaceParams) UnmarshalJSON ¶
func (r *ZoneRrsetReplaceParams) UnmarshalJSON(data []byte) error
type ZoneRrsetReplaceParamsPicker ¶
type ZoneRrsetReplaceParamsPicker struct {
// Filter type
//
// Any of "geodns", "asn", "country", "continent", "region", "ip", "geodistance",
// "weighted_shuffle", "default", "first_n".
Type string `json:"type,omitzero,required"`
// Limits the number of records returned by the filter Can be a positive value for
// a specific limit. Use zero or leave it blank to indicate no limits.
Limit param.Opt[int64] `json:"limit,omitzero"`
// if strict=false, then the filter will return all records if no records match the
// filter
Strict param.Opt[bool] `json:"strict,omitzero"`
// contains filtered or unexported fields
}
The property Type is required.
func (ZoneRrsetReplaceParamsPicker) MarshalJSON ¶
func (r ZoneRrsetReplaceParamsPicker) MarshalJSON() (data []byte, err error)
func (*ZoneRrsetReplaceParamsPicker) UnmarshalJSON ¶
func (r *ZoneRrsetReplaceParamsPicker) UnmarshalJSON(data []byte) error
type ZoneRrsetReplaceParamsResourceRecord ¶
type ZoneRrsetReplaceParamsResourceRecord struct {
// Content of resource record The exact length of the array depends on the type of
// rrset, each individual record parameter must be a separate element of the array.
// For example
//
// - SRV-record: `[100, 1, 5061, "example.com"]`
// - CNAME-record: `[ "the.target.domain" ]`
// - A-record: `[ "1.2.3.4", "5.6.7.8" ]`
// - AAAA-record: `[ "2001:db8::1", "2001:db8::2" ]`
// - MX-record: `[ "mail1.example.com", "mail2.example.com" ]`
// - SVCB/HTTPS-record:
// `[ 1, ".", ["alpn", "h3", "h2"], [ "port", 1443 ], [ "ipv4hint", "10.0.0.1" ], [ "ech", "AEn+DQBFKwAgACABWIHUGj4u+PIggYXcR5JF0gYk3dCRioBW8uJq9H4mKAAIAAEAAQABAANAEnB1YmxpYy50bHMtZWNoLmRldgAA" ] ]`
Content []any `json:"content,omitzero,required"`
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// This meta will be used to decide which resource record should pass through
// filters from the filter set
Meta map[string]any `json:"meta,omitzero"`
// contains filtered or unexported fields
}
nolint: lll
The property Content is required.
func (ZoneRrsetReplaceParamsResourceRecord) MarshalJSON ¶
func (r ZoneRrsetReplaceParamsResourceRecord) MarshalJSON() (data []byte, err error)
func (*ZoneRrsetReplaceParamsResourceRecord) UnmarshalJSON ¶
func (r *ZoneRrsetReplaceParamsResourceRecord) UnmarshalJSON(data []byte) error
type ZoneRrsetService ¶
type ZoneRrsetService struct {
Options []option.RequestOption
}
ZoneRrsetService contains methods and other services that help with interacting with the gcore API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewZoneRrsetService method instead.
func NewZoneRrsetService ¶
func NewZoneRrsetService(opts ...option.RequestOption) (r ZoneRrsetService)
NewZoneRrsetService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ZoneRrsetService) Delete ¶
func (r *ZoneRrsetService) Delete(ctx context.Context, rrsetType string, body ZoneRrsetDeleteParams, opts ...option.RequestOption) (res *ZoneRrsetDeleteResponse, err error)
Delete RRset.
func (*ZoneRrsetService) Get ¶
func (r *ZoneRrsetService) Get(ctx context.Context, rrsetType string, query ZoneRrsetGetParams, opts ...option.RequestOption) (res *DNSOutputRrset, err error)
Particular RRset item info
func (*ZoneRrsetService) GetFailoverLogs ¶
func (r *ZoneRrsetService) GetFailoverLogs(ctx context.Context, rrsetType string, params ZoneRrsetGetFailoverLogsParams, opts ...option.RequestOption) (res *ZoneRrsetGetFailoverLogsResponse, err error)
Get failover history for the RRset
func (*ZoneRrsetService) List ¶
func (r *ZoneRrsetService) List(ctx context.Context, zoneName string, query ZoneRrsetListParams, opts ...option.RequestOption) (res *ZoneRrsetListResponse, err error)
List of RRset.
func (*ZoneRrsetService) New ¶
func (r *ZoneRrsetService) New(ctx context.Context, rrsetType string, params ZoneRrsetNewParams, opts ...option.RequestOption) (res *DNSOutputRrset, err error)
Add the RRSet to the zone specified by zoneName, RRSets can be configured to be either dynamic or static.
### Static RRsets
Staticly configured RRSets provide DNS responses as is.
### Dynamic RRsets
Dynamic RRSets have picker configuration defined thus it's possible to finely customize DNS response. Picking rules are defined on the RRSet level as a list of selectors, filters and mutators. Picker considers different resource records metadata, requestor IP, and other event-feeds like monitoring. Picker configuration is an ordered list defined by "pickers" attribute. Requestor IP is determined by EDNS Client Subnet (ECS) if defined, otherwise - by client/recursor IP. Selector pickers are used in the specified order until the first match, in case of match - all next selectors are bypassed. Filters or mutators are applied to the match according to the order they are specified.
For example, sort records by proximity to user, shuffle based on weights and return not more than 3:
`"pickers": [ { "type": "geodistance" }, { "type": "weighted_shuffle" }, { "type": "first_n", "limit": 3 } ]`
#### geodns filter
A resource record is included in the answer if resource record's metadata matches requestor info. For each resource record in RRSet, the following metadata is considered (in the order specified):
- `ip` - list of network addresses in CIDR format, e.g. `["192.168.15.150/25", "2003:de:2016::/48"]`;
- `asn` - list of autonomous system numbers, e.g. `[1234, 5678]`;
- `regions` - list of region codes, e.g. `["de-bw", "de-by"]`;
- `countries` - list of country codes, e.g. `["de", "lu", "lt"]`;
- `continents` - list of continent codes, e.g. `["af", "an", "eu", "as", "na", "sa", "oc"]`.
If there is a record (or multiple) with metadata matched IP, it's used as a response. If not - asn, then country and then continent are checked for a match. If there is no match, then the behaviour is defined by _strict_ parameter of the filter.
Example: `"pickers": [ { "type": "geodns", "strict": true } ]`
##### Strict parameter
`strict: true` means that if no records percolate through the geodns filter it returns no answers. `strict: false` means that if no records percolate through the geodns filter, all records are passed over.
#### asn selector
Resource records which ASN metadata matches ASN of the requestor are picked by this selector, and passed to the next non-selector picker, if there is no match - next configured picker starts with all records.
Example: `"pickers": [ {"type": "asn"} ]`
#### country selector
Resource records which country metadata matches country of the requestor are picked by this selector, and passed to the next non-selector picker, if there is no match - next configured picker starts with all records.
Example: `"pickers": [ { "type": "country" } ]`
#### continent selector
Resource records which continent metadata matches continent of the requestor are picked by this selector, and passed to the next non-selector picker, if there is no match - next configured picker starts with all records.
Example: `"pickers": [ { "type": "continent" } ]`
#### region selector
Resource records which region metadata matches region of the requestor are picked by this selector, and passed to the next non-selector picker, if there is no match - next configured picker starts with all records. e.g. `fr-nor` for France/Normandy.
Example: `"pickers": [ { "type": "region" } ]`
#### ip selector
Resource records which IP metadata matches IP of the requestor are picked by this selector, and passed to the next non-selector picker, if there is no match - next configured picker starts with all records. Maximum 100 subnets are allowed to specify in meta of RR.
Example: `"pickers": [ { "type": "ip" } ]`
#### default selector
When enabled, records marked as default are selected: `"meta": {"default": true}`.
Example: `"pickers": [ { "type": "geodns", "strict": false }, { "type": "default" }, { "type": "first_n", "limit": 2 } ]`
#### geodistance mutator
The resource records are rearranged in ascending order based on the distance (in meters) from requestor to the coordinates specified in latlong metadata. Distance is calculated using Haversine formula. The "nearest" to the user's IP RR goes first. The records without latlong metadata come last. e.g. for Berlin `[52.520008, 13.404954]`.;
In this configuration the only "nearest" to the requestor record to be returned: `"pickers": [ { "type": "geodistance" }, { "type": "first_n", "limit": 1 } ]`
#### `weighted_shuffle` mutator
The resource records are rearranged in random order based on the `weight` metadata. Default weight (if not specified) is 50.
Example: `"pickers": [ { "type": "weighted_shuffle" } ]`
#### `first_n` filter
Slices first N (N specified as a limit parameter value) resource records.
Example: `"pickers": [ { "type": "first_n", "limit": 1 } ]` returns only the first resource record.
##### limit parameter
Can be a positive value for a specific limit. Use zero or leave it blank to indicate no limits.
func (*ZoneRrsetService) Replace ¶
func (r *ZoneRrsetService) Replace(ctx context.Context, rrsetType string, params ZoneRrsetReplaceParams, opts ...option.RequestOption) (res *DNSOutputRrset, err error)
Create/update RRset.
type ZoneService ¶
type ZoneService struct {
Options []option.RequestOption
Dnssec ZoneDnssecService
Rrsets ZoneRrsetService
}
ZoneService contains methods and other services that help with interacting with the gcore API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewZoneService method instead.
func NewZoneService ¶
func NewZoneService(opts ...option.RequestOption) (r ZoneService)
NewZoneService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*ZoneService) CheckDelegationStatus ¶
func (r *ZoneService) CheckDelegationStatus(ctx context.Context, name string, opts ...option.RequestOption) (res *ZoneCheckDelegationStatusResponse, err error)
Returns delegation status for specified domain name. This endpoint has rate limit.
func (*ZoneService) Delete ¶
func (r *ZoneService) Delete(ctx context.Context, name string, opts ...option.RequestOption) (res *ZoneDeleteResponse, err error)
Delete DNS zone and its records and raws.
func (*ZoneService) Disable ¶
func (r *ZoneService) Disable(ctx context.Context, name string, opts ...option.RequestOption) (res *ZoneDisableResponse, err error)
Disable DNS zone.
func (*ZoneService) Enable ¶
func (r *ZoneService) Enable(ctx context.Context, name string, opts ...option.RequestOption) (res *ZoneEnableResponse, err error)
Enable DNS zone.
func (*ZoneService) Export ¶
func (r *ZoneService) Export(ctx context.Context, zoneName string, opts ...option.RequestOption) (res *ZoneExportResponse, err error)
Export zone to bind9 format.
func (*ZoneService) Get ¶
func (r *ZoneService) Get(ctx context.Context, name string, opts ...option.RequestOption) (res *ZoneGetResponse, err error)
Zone info by zone name.
func (*ZoneService) GetStatistics ¶
func (r *ZoneService) GetStatistics(ctx context.Context, name string, query ZoneGetStatisticsParams, opts ...option.RequestOption) (res *ZoneGetStatisticsResponse, err error)
Statistics of DNS zone in common and by record types.
To get summary statistics for all zones use `all` instead of zone name in path.
Note: Consumption statistics is updated in near real-time as a standard practice. However, the frequency of updates can vary, but they are typically available within a 30 minutes period. Exceptions, such as maintenance periods, may delay data beyond 30 minutes until servers resume and backfill missing statistics.
func (*ZoneService) Import ¶
func (r *ZoneService) Import(ctx context.Context, zoneName string, body ZoneImportParams, opts ...option.RequestOption) (res *ZoneImportResponse, err error)
Import zone in bind9 format.
func (*ZoneService) List ¶
func (r *ZoneService) List(ctx context.Context, query ZoneListParams, opts ...option.RequestOption) (res *ZoneListResponse, err error)
Show created zones with pagination managed by limit and offset params. All query params are optional.
func (*ZoneService) New ¶
func (r *ZoneService) New(ctx context.Context, body ZoneNewParams, opts ...option.RequestOption) (res *ZoneNewResponse, err error)
Add DNS zone.
func (*ZoneService) Replace ¶
func (r *ZoneService) Replace(ctx context.Context, name string, body ZoneReplaceParams, opts ...option.RequestOption) (res *ZoneReplaceResponse, err error)
Update DNS zone and SOA record.