Documentation ¶
Overview ¶
Package dns provides access to the Akamai DNS V2 APIs
Index ¶
- Variables
- type Authorities
- type AuthorityResponse
- type BulkCreateResultResponse
- type BulkDeleteResultResponse
- type BulkFailedZone
- type BulkStatusResponse
- type BulkZonesCreate
- type BulkZonesResponse
- type ChangeListResponse
- type ClientFunc
- type Contract
- type DNS
- type Error
- type ListMetadata
- type MetadataH
- type Option
- type RecordBody
- type RecordSetResponse
- type RecordSets
- type Records
- type Recordset
- type RecordsetQueryArgs
- type Recordsets
- type TSIGKey
- type TSIGKeyBulkPost
- type TSIGKeyResponse
- type TSIGKeys
- type TSIGQueryString
- type TSIGReportMeta
- type TSIGReportResponse
- type TSIGZoneAliases
- type ZoneCreate
- type ZoneListQueryArgs
- type ZoneListResponse
- type ZoneNameListResponse
- type ZoneNameTypesResponse
- type ZoneNamesResponse
- type ZoneQueryString
- type ZoneResponse
- type Zones
Constants ¶
This section is empty.
Variables ¶
var ( // ErrBadRequest is returned when a required parameter is missing ErrBadRequest = errors.New("missing argument") )
var ( // ErrStructValidation is returned returned when given struct validation failed ErrStructValidation = errors.New("struct validation") )
Functions ¶
This section is empty.
Types ¶
type Authorities ¶
type Authorities interface { // GetAuthorities provides a list of structured read-only list of name serveers // See: https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html#getauthoritativenameserverdata GetAuthorities(context.Context, string) (*AuthorityResponse, error) // GetNameServerRecordList provides a list of name server records // See: https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html#getauthoritativenameserverdata GetNameServerRecordList(context.Context, string) ([]string, error) // NewAuthorityResponse(context.Context, string) *AuthorityResponse }
Authorities contains operations available on Authorities data sources See: https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html#getauthoritativenameserverdata
type AuthorityResponse ¶
type AuthorityResponse struct {
Contracts []Contract `json:"contracts"`
}
AuthorityResponse contains response with a list of one or more Contracts
type BulkCreateResultResponse ¶ added in v2.0.2
type BulkCreateResultResponse struct { RequestId string `json:"requestId"` SuccessfullyCreatedZones []string `json:"successfullyCreatedZones"` FailedZones []*BulkFailedZone `json:"failedZones"` }
BulkCreateResultResponse contains the response from a completed bulk-create request
type BulkDeleteResultResponse ¶ added in v2.0.2
type BulkDeleteResultResponse struct { RequestId string `json:"requestId"` SuccessfullyDeletedZones []string `json:"successfullyDeletedZones"` FailedZones []*BulkFailedZone `json:"failedZones"` }
BulkDeleteResultResponse contains the response from a completed bulk-delete request
type BulkFailedZone ¶ added in v2.0.2
type BulkFailedZone struct { Zone string `json:"zone"` FailureReason string `json:"failureReason"` }
BulkFailedZone contains information about failed zone
type BulkStatusResponse ¶ added in v2.0.2
type BulkStatusResponse struct { RequestId string `json:"requestId"` ZonesSubmitted int `json:"zonesSubmitted"` SuccessCount int `json:"successCount"` FailureCount int `json:"failureCount"` IsComplete bool `json:"isComplete"` ExpirationDate string `json:"expirationDate"` }
BulkStatusResponse contains current status of a running or completed bulk-create request
type BulkZonesCreate ¶ added in v2.0.2
type BulkZonesCreate struct {
Zones []*ZoneCreate `json:"zones"`
}
BulkZonesCreate contains a list of one or more new Zones to create
type BulkZonesResponse ¶ added in v2.0.2
type BulkZonesResponse struct { RequestId string `json:"requestId"` ExpirationDate string `json:"expirationDate"` }
BulkZonesResponse contains response from bulk-create request
type ChangeListResponse ¶
type ChangeListResponse struct { Zone string `json:"zone,omitempty"` ChangeTag string `json:"changeTag,omitempty"` ZoneVersionID string `json:"zoneVersionId,omitempty"` LastModifiedDate string `json:"lastModifiedDate,omitempty"` Stale bool `json:"stale,omitempty"` }
ChangeListResponse contains metadata about a change list
type ClientFunc ¶
ClientFunc is a dns client new method, this can used for mocking
type Contract ¶
type Contract struct { ContractID string `json:"contractId"` Authorities []string `json:"authorities"` }
Contract contains contractID and a list of currently assigned Akamai authoritative nameservers
type DNS ¶
type DNS interface { Zones TSIGKeys Authorities Records RecordSets }
DNS is the dns api interface
type Error ¶
type Error struct { Type string `json:"type"` Title string `json:"title"` Detail string `json:"detail"` Instance string `json:"instance,omitempty"` BehaviorName string `json:"behaviorName,omitempty"` ErrorLocation string `json:"errorLocation,omitempty"` StatusCode int `json:"-"` }
Error is a papi error interface
type ListMetadata ¶
type ListMetadata struct { ContractIDs []string `json:"contractIds"` Page int `json:"page"` PageSize int `json:"pageSize"` ShowAll bool `json:"showAll"` TotalElements int `json:"totalElements"` } //`json:"metadata"`
ListMetadata contains metadata for List Zones request
type MetadataH ¶
type MetadataH struct { LastPage int `json:"lastPage"` Page int `json:"page"` PageSize int `json:"pageSize"` ShowAll bool `json:"showAll"` TotalElements int `json:"totalElements"` } //`json:"metadata"`
MetadataH contains metadata of RecordSet response
type RecordBody ¶
type RecordBody struct { Name string `json:"name,omitempty"` RecordType string `json:"type,omitempty"` TTL int `json:"ttl,omitempty"` // Active field no longer used in v2 Active bool `json:"active,omitempty"` Target []string `json:"rdata,omitempty"` }
RecordBody contains request body for dns record
type RecordSetResponse ¶
type RecordSetResponse struct { Metadata MetadataH `json:"metadata"` Recordsets []Recordset `json:"recordsets"` }
RecordSetResponse contains a response with a list of recordsets
type RecordSets ¶
type RecordSets interface { // NewRecordSetResponse returns new response object NewRecordSetResponse(context.Context, string) *RecordSetResponse // GetRecordsets retrieves recordsets with Query Args. No formatting of arg values // See: See: https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html#getzonerecordsets GetRecordsets(context.Context, string, ...RecordsetQueryArgs) (*RecordSetResponse, error) // CreateRecordsets creates multiple recordsets // See: https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html#postzonerecordsets CreateRecordsets(context.Context, *Recordsets, string, ...bool) error // UpdateRecordsets sreplaces list of recordsets // See: https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html#putzonerecordsets UpdateRecordsets(context.Context, *Recordsets, string, ...bool) error }
RecordSets contains operations available on a recordsets See: https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html
type Records ¶
type Records interface { // RecordToMap returns a map containing record content RecordToMap(context.Context, *RecordBody) map[string]interface{} // Return bare bones tsig key struct NewRecordBody(context.Context, RecordBody) *RecordBody // GetRecordList retrieves recordset list based on type // See: https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html#getzonerecordsets GetRecordList(context.Context, string, string, string) (*RecordSetResponse, error) // GetRdata retrieves record rdata, e.g. target GetRdata(context.Context, string, string, string) ([]string, error) // ProcessRdata ProcessRdata(context.Context, []string, string) []string // ParseRData parses rdata. returning map ParseRData(context.Context, string, []string) map[string]interface{} // GetRecord retrieves a recordset and returns as RecordBody // See: https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html#getzonerecordset GetRecord(context.Context, string, string, string) (*RecordBody, error) // CreateRecord creates recordset // See: https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html#postzonerecordset CreateRecord(context.Context, *RecordBody, string, ...bool) error // DeleteRecord removes recordset // See: https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html#deletezonerecordset DeleteRecord(context.Context, *RecordBody, string, ...bool) error // UpdateRecord replaces the recordset // See: https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html#putzonerecordset UpdateRecord(context.Context, *RecordBody, string, ...bool) error // FullIPv6 is utility method to convert IP to string FullIPv6(context.Context, net.IP) string // PadCoordinates is utility method to convert IP to normalize coordinates PadCoordinates(context.Context, string) string }
Records contains operations available on a Record resource See: https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html
type Recordset ¶
type Recordset struct { Name string `json:"name"` Type string `json:"type"` TTL int `json:"ttl"` Rdata []string `json:"rdata"` } //`json:"recordsets"`
Recordset contains recordset metadata
type RecordsetQueryArgs ¶
type RecordsetQueryArgs struct { Page int PageSize int Search string ShowAll bool SortBy string Types string }
RecordsetQueryArgs contains query parameters for recordset request
type Recordsets ¶
type Recordsets struct {
Recordsets []Recordset `json:"recordsets"`
}
Recordsets Struct. Used for Create and Update Recordsets. Contains a list of Recordset objects
type TSIGKey ¶
type TSIGKey struct { Name string `json:"name"` Algorithm string `json:"algorithm,omitempty"` Secret string `json:"secret,omitempty"` }
TSIGKey contains TSIG key POST response
type TSIGKeyBulkPost ¶
TSIGKeyBulkPost contains TSIG key and a list of names of zones that should use the key. Used with update function.
func (*TSIGKeyBulkPost) Validate ¶
func (bulk *TSIGKeyBulkPost) Validate() error
Validate validates TSIGKeyBulkPost
type TSIGKeyResponse ¶
TSIGKeyResponse contains TSIG key GET response
type TSIGKeys ¶
type TSIGKeys interface { // NewTsigKey returns bare bones tsig key struct NewTsigKey(context.Context, string) *TSIGKey // NewTsigQueryString returns empty query string struct. No elements required. NewTsigQueryString(context.Context) *TSIGQueryString // ListTsigKeys lists the TSIG keys used by zones that you are allowed to manage // See: ListTsigKeys(context.Context, *TSIGQueryString) (*TSIGReportResponse, error) // GetTsigKeyZones retrieves DNS Zones using tsig key // See: https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html#gettsigkeys GetTsigKeyZones(context.Context, *TSIGKey) (*ZoneNameListResponse, error) // GetTsigKeyAliases retrieves a DNS Zone's aliases // See: https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html#posttsigusedby GetTsigKeyAliases(context.Context, string) (*ZoneNameListResponse, error) // TsigKeyBulkUpdate updates Bulk Zones tsig key // See: https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html#posttsigbulkupdate TsigKeyBulkUpdate(context.Context, *TSIGKeyBulkPost) error // GetTsigKey retrieves a Tsig key for zone // See: https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html#getzonekey GetTsigKey(context.Context, string) (*TSIGKeyResponse, error) // DeleteTsigKey deletes tsig key for zone // See: https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html#deletezonekey DeleteTsigKey(context.Context, string) error // UpdateTsigKey updates tsig key for zone // See: https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html#putzonekey UpdateTsigKey(context.Context, *TSIGKey, string) error }
TSIGKeys contains operations available on TSIKeyG resource See: https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html
type TSIGQueryString ¶
type TSIGQueryString struct { ContractIds []string `json:"contractIds,omitempty"` Search string `json:"search,omitempty"` SortBy []string `json:"sortBy,omitempty"` Gid int64 `json:"gid,omitempty"` }
TSIGQueryString contains TSIG query parameters
type TSIGReportMeta ¶
type TSIGReportMeta struct { TotalElements int64 `json:"totalElements"` Search string `json:"search,omitempty"` Contracts []string `json:"contracts,omitempty"` Gid int64 `json:"gid,omitempty"` SortBy []string `json:"sortBy,omitempty"` }
TSIGReportMeta contains metadata for TSIGReport response
type TSIGReportResponse ¶
type TSIGReportResponse struct { Metadata *TSIGReportMeta `json:"metadata"` Keys []*TSIGKeyResponse `json:"keys,omitempty"` }
TSIGReportResponse contains response with a list of the TSIG keys used by zones.
type TSIGZoneAliases ¶
type TSIGZoneAliases struct {
Aliases []string `json:"aliases"`
}
TSIGZoneAliases contains list of zone aliases
type ZoneCreate ¶
type ZoneCreate struct { Zone string `json:"zone"` Type string `json:"type"` Masters []string `json:"masters,omitempty"` Comment string `json:"comment,omitempty"` SignAndServe bool `json:"signAndServe"` SignAndServeAlgorithm string `json:"signAndServeAlgorithm,omitempty"` TsigKey *TSIGKey `json:"tsigKey,omitempty"` Target string `json:"target,omitempty"` EndCustomerID string `json:"endCustomerId,omitempty"` ContractID string `json:"contractId,omitempty"` }
ZoneCreate contains zone create request
type ZoneListQueryArgs ¶
type ZoneListQueryArgs struct { ContractIDs string Page int PageSize int Search string ShowAll bool SortBy string Types string }
ZoneListQueryArgs contains parameters for List Zones query
type ZoneListResponse ¶
type ZoneListResponse struct { Metadata *ListMetadata `json:"metadata,omitempty"` Zones []*ZoneResponse `json:"zones,omitempty"` }
ZoneListResponse contains response for List Zones request
type ZoneNameListResponse ¶
type ZoneNameListResponse struct { Zones []string `json:"zones"` Aliases []string `json:"aliases,omitempty"` }
ZoneNameListResponse contains response with a list of zone's names and aliases
type ZoneNameTypesResponse ¶
type ZoneNameTypesResponse struct {
Types []string `json:"types"`
}
ZoneNameTypesResponse contains record set types for zone
type ZoneNamesResponse ¶
type ZoneNamesResponse struct {
Names []string `json:"names"`
}
ZoneNamesResponse contains record set names for zone
type ZoneQueryString ¶
ZoneQueryString contains zone query parameters
type ZoneResponse ¶
type ZoneResponse struct { Zone string `json:"zone,omitempty"` Type string `json:"type,omitempty"` Masters []string `json:"masters,omitempty"` Comment string `json:"comment,omitempty"` SignAndServe bool `json:"signAndServe"` SignAndServeAlgorithm string `json:"signAndServeAlgorithm,omitempty"` TsigKey *TSIGKey `json:"tsigKey,omitempty"` Target string `json:"target,omitempty"` EndCustomerID string `json:"endCustomerId,omitempty"` ContractID string `json:"contractId,omitempty"` AliasCount int64 `json:"aliasCount,omitempty"` ActivationState string `json:"activationState,omitempty"` LastActivationDate string `json:"lastActivationDate,omitempty"` LastModifiedBy string `json:"lastModifiedBy,omitempty"` LastModifiedDate string `json:"lastModifiedDate,omitempty"` VersionId string `json:"versionId,omitempty"` }
ZoneResponse contains zone create response
type Zones ¶
type Zones interface { // ListZones retrieves a list of all zones user can access // See: https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html#getzones ListZones(context.Context, ...ZoneListQueryArgs) (*ZoneListResponse, error) // NewZone returns a new ZoneCreate object NewZone(context.Context, ZoneCreate) *ZoneCreate // NewZoneResponse returns a new ZoneResponse object NewZoneResponse(context.Context, string) *ZoneResponse // NewChangeListResponse returns a new ChangeListResponse object NewChangeListResponse(context.Context, string) *ChangeListResponse // NewZoneQueryString returns a new ZoneQueryString object NewZoneQueryString(context.Context, string, string) *ZoneQueryString // GetZone retrieves Zone metadata // See: https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html#getzone GetZone(context.Context, string) (*ZoneResponse, error) //GetChangeList treieves Zone changelist // See: https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html#getchangelist GetChangeList(context.Context, string) (*ChangeListResponse, error) // GetMasterZoneFile retrieves master zone file // https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html#getversionmasterzonefile GetMasterZoneFile(context.Context, string) (string, error) // PostMasterZoneFile updates master zone file // https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html#postmasterzonefile PostMasterZoneFile(context.Context, string, string) error // CreateZone // See: https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html#postzones CreateZone(context.Context, *ZoneCreate, ZoneQueryString, ...bool) error // SaveChangelist // See: https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html#postchangelists SaveChangelist(context.Context, *ZoneCreate) error // SubmitChangelist submits changelist for the Zone to create default NS SOA records // See: https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html#postchangelistsubmit SubmitChangelist(context.Context, *ZoneCreate) error // UpdateZone updates the Zone // See: https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html#putzone UpdateZone(context.Context, *ZoneCreate, ZoneQueryString) error // DeleteZone a zone // See: N/A DeleteZone(context.Context, *ZoneCreate, ZoneQueryString) error // ValidateZone validates zone metadata based on type ValidateZone(context.Context, *ZoneCreate) error // GetZoneNames retrieves a list of a zone's record names // See: https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html#getzonerecordsetnames GetZoneNames(context.Context, string) (*ZoneNamesResponse, error) // GetZoneNameTypes retrieves a zone name's record types // See: https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html#getzonerecordsettypes GetZoneNameTypes(context.Context, string, string) (*ZoneNameTypesResponse, error) // CreateBulkZones submits create bulk zone request // https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html#postbulkzonecreate CreateBulkZones(context.Context, *BulkZonesCreate, ZoneQueryString) (*BulkZonesResponse, error) // DeleteBulkZones submits delete bulk zone request // https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html#postbulkzonedelete DeleteBulkZones(context.Context, *ZoneNameListResponse, ...bool) (*BulkZonesResponse, error) // GetBulkZoneCreateStatus retrieves submit request status // https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html#getbulkzonecreatestatus GetBulkZoneCreateStatus(context.Context, string) (*BulkStatusResponse, error) //GetBulkZoneDeleteStatus retrieves submit request status // https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html#getbulkzonedeletestatus GetBulkZoneDeleteStatus(context.Context, string) (*BulkStatusResponse, error) // GetBulkZoneCreateResult retrieves create request result // https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html#getbulkzonecreateresult GetBulkZoneCreateResult(ctx context.Context, requestid string) (*BulkCreateResultResponse, error) // GetBulkZoneDeleteResult retrieves delete request result // https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html#getbulkzonedeleteresult GetBulkZoneDeleteResult(context.Context, string) (*BulkDeleteResultResponse, error) }
Zones contains operations available on Zone resources See: https://developer.akamai.com/api/cloud_security/edge_dns_zone_management/v2.html