Documentation ¶
Index ¶
- Constants
- func AccountsURI() string
- func CheckResponse(r *http.Response) error
- func Endpoint(BaseURL string) oauth2.Endpoint
- func NewConfig(username, password, BaseURL string) *oauthPassword.Config
- func TasksQueryURI(query string, offset int) string
- func TokenURL(BaseURL string) string
- type Account
- type AccountKey
- type AccountLevelGeoDirectionalGroupDTO
- type AccountLevelGeoDirectionalGroupListDTO
- type AccountLevelIPDirectionalGroupDTO
- type AccountLevelIPDirectionalGroupListDTO
- type AccountListDTO
- type AccountsService
- type AlertsService
- type BackupRecord
- type Client
- type DNSProbeDetailsDTO
- type DPRDataInfo
- type DirPoolProfile
- type DirectionalPool
- type DirectionalPoolKey
- type DirectionalPoolListDTO
- type DirectionalPoolsService
- type ErrorResponse
- type ErrorResponseList
- type EventInfoDTO
- type EventInfoListDTO
- type EventKey
- type EventsService
- func (s *EventsService) Create(r RRSetKey, ev EventInfoDTO) (*http.Response, error)
- func (s *EventsService) Delete(e EventKey) (*http.Response, error)
- func (s *EventsService) Find(e EventKey) (EventInfoDTO, *http.Response, error)
- func (s *EventsService) Select(r RRSetKey, query string) ([]EventInfoDTO, error)
- func (s *EventsService) SelectWithOffset(r RRSetKey, query string, offset int) ([]EventInfoDTO, ResultInfo, *http.Response, error)
- func (s *EventsService) Update(e EventKey, ev EventInfoDTO) (*http.Response, error)
- type FTPProbeDetailsDTO
- type GeoDirectionalPoolKey
- type GeoDirectionalPoolsService
- func (s *GeoDirectionalPoolsService) Create(k GeoDirectionalPoolKey, val interface{}) (*http.Response, error)
- func (s *GeoDirectionalPoolsService) Delete(k GeoDirectionalPoolKey) (*http.Response, error)
- func (s *GeoDirectionalPoolsService) Find(k GeoDirectionalPoolKey) (AccountLevelGeoDirectionalGroupDTO, *http.Response, error)
- func (s *GeoDirectionalPoolsService) Select(k GeoDirectionalPoolKey, query string) ([]AccountLevelGeoDirectionalGroupDTO, error)
- func (s *GeoDirectionalPoolsService) SelectWithOffset(k GeoDirectionalPoolKey, query string, offset int) ([]AccountLevelGeoDirectionalGroupDTO, ResultInfo, *http.Response, error)
- func (s *GeoDirectionalPoolsService) Update(k GeoDirectionalPoolKey, val interface{}) (*http.Response, error)
- type GeoInfo
- type HTTPProbeDetailsDTO
- type IPAddrDTO
- type IPDirectionalPoolKey
- type IPDirectionalPoolsService
- func (s *IPDirectionalPoolsService) Create(k IPDirectionalPoolKey, val interface{}) (*http.Response, error)
- func (s *IPDirectionalPoolsService) Delete(k IPDirectionalPoolKey) (*http.Response, error)
- func (s *IPDirectionalPoolsService) Find(k IPDirectionalPoolKey) (AccountLevelIPDirectionalGroupDTO, *http.Response, error)
- func (s *IPDirectionalPoolsService) Select(k IPDirectionalPoolKey, query string) ([]AccountLevelIPDirectionalGroupDTO, error)
- func (s *IPDirectionalPoolsService) SelectWithOffset(k IPDirectionalPoolKey, query string, offset int) ([]AccountLevelIPDirectionalGroupDTO, ResultInfo, *http.Response, error)
- func (s *IPDirectionalPoolsService) Update(k IPDirectionalPoolKey, val interface{}) (*http.Response, error)
- type IPInfo
- type NotificationDTO
- type NotificationInfoDTO
- type NotificationKey
- type NotificationListDTO
- type NotificationPoolRecord
- type NotificationsService
- func (s *NotificationsService) Create(k NotificationKey, n NotificationDTO) (*http.Response, error)
- func (s *NotificationsService) Delete(k NotificationKey) (*http.Response, error)
- func (s *NotificationsService) Find(k NotificationKey) (NotificationDTO, *http.Response, error)
- func (s *NotificationsService) Select(k RRSetKey, query string) ([]NotificationDTO, *http.Response, error)
- func (s *NotificationsService) SelectWithOffset(k RRSetKey, query string, offset int) ([]NotificationDTO, ResultInfo, *http.Response, error)
- func (s *NotificationsService) Update(k NotificationKey, n NotificationDTO) (*http.Response, error)
- type PingProbeDetailsDTO
- type ProbeAlertDataDTO
- type ProbeAlertDataListDTO
- type ProbeDetailsDTO
- func (s *ProbeDetailsDTO) DNSProbeDetails() (DNSProbeDetailsDTO, error)
- func (s *ProbeDetailsDTO) FTPProbeDetails() (FTPProbeDetailsDTO, error)
- func (s *ProbeDetailsDTO) GetData() []byte
- func (s *ProbeDetailsDTO) GetDetailsObject(t ProbeType) (interface{}, error)
- func (s *ProbeDetailsDTO) GoString() string
- func (s *ProbeDetailsDTO) HTTPProbeDetails() (HTTPProbeDetailsDTO, error)
- func (s *ProbeDetailsDTO) MarshalJSON() ([]byte, error)
- func (s *ProbeDetailsDTO) PingProbeDetails() (PingProbeDetailsDTO, error)
- func (s *ProbeDetailsDTO) Populate(t ProbeType) (err error)
- func (s *ProbeDetailsDTO) SMTPProbeDetails() (SMTPProbeDetailsDTO, error)
- func (s *ProbeDetailsDTO) SMTPSENDProbeDetails() (SMTPSENDProbeDetailsDTO, error)
- func (s *ProbeDetailsDTO) String() string
- func (s *ProbeDetailsDTO) TCPProbeDetails() (TCPProbeDetailsDTO, error)
- func (s *ProbeDetailsDTO) UnmarshalJSON(b []byte) (err error)
- type ProbeDetailsLimitDTO
- type ProbeInfoDTO
- type ProbeKey
- type ProbeListDTO
- type ProbeType
- type ProbesService
- func (s *ProbesService) Create(k RRSetKey, dp ProbeInfoDTO) (*http.Response, error)
- func (s *ProbesService) Delete(k ProbeKey) (*http.Response, error)
- func (s *ProbesService) Find(k ProbeKey) (ProbeInfoDTO, *http.Response, error)
- func (s *ProbesService) Select(k RRSetKey, query string) ([]ProbeInfoDTO, *http.Response, error)
- func (s *ProbesService) Update(k ProbeKey, dp ProbeInfoDTO) (*http.Response, error)
- type ProfileSchema
- type QueryInfo
- type RDPoolProfile
- type RRSet
- type RRSetKey
- func (k RRSetKey) AlertsQueryURI(offset int) string
- func (k RRSetKey) AlertsURI() string
- func (k RRSetKey) EventsQueryURI(query string, offset int) string
- func (k RRSetKey) EventsURI() string
- func (k RRSetKey) NotificationsQueryURI(query string, offset int) string
- func (k RRSetKey) NotificationsURI() string
- func (k RRSetKey) ProbesQueryURI(query string) string
- func (k RRSetKey) ProbesURI() string
- func (k RRSetKey) QueryURI(offset int) string
- func (k RRSetKey) URI() string
- type RRSetListDTO
- type RRSetsService
- func (s *RRSetsService) Create(k RRSetKey, rrset RRSet) (*http.Response, error)
- func (s *RRSetsService) Delete(k RRSetKey) (*http.Response, error)
- func (s *RRSetsService) Select(k RRSetKey) ([]RRSet, error)
- func (s *RRSetsService) SelectWithOffset(k RRSetKey, offset int) ([]RRSet, ResultInfo, *http.Response, error)
- func (s *RRSetsService) Update(k RRSetKey, val RRSet) (*http.Response, error)
- type RawProfile
- func (rp RawProfile) Context() ProfileSchema
- func (rp RawProfile) DirPoolProfile() (DirPoolProfile, error)
- func (rp RawProfile) GetProfileObject() (interface{}, error)
- func (rp RawProfile) RDPoolProfile() (RDPoolProfile, error)
- func (rp RawProfile) SBPoolProfile() (SBPoolProfile, error)
- func (rp RawProfile) TCPoolProfile() (TCPoolProfile, error)
- type ResultInfo
- type SBPoolProfile
- type SBRDataInfo
- type SMTPProbeDetailsDTO
- type SMTPSENDProbeDetailsDTO
- type TCPProbeDetailsDTO
- type TCPoolProfile
- type Task
- type TaskID
- type TaskListDTO
- type TasksService
- func (s *TasksService) Delete(t TaskID) (*http.Response, error)
- func (s *TasksService) Find(t TaskID) (Task, *http.Response, error)
- func (s *TasksService) FindResult(t TaskID) (*http.Response, error)
- func (s *TasksService) FindResultByTask(t Task) (*http.Response, error)
- func (s *TasksService) Select(query string) ([]Task, error)
- func (s *TasksService) SelectWithOffset(query string, offset int) ([]Task, ResultInfo, *http.Response, error)
- type Transaction
Constants ¶
const ( // DirPoolSchema is the schema URI for a Directional pool profile DirPoolSchema ProfileSchema = "http://schemas.ultradns.com/DirPool.jsonschema" // RDPoolSchema is the schema URI for a Resource Distribution pool profile RDPoolSchema = "http://schemas.ultradns.com/RDPool.jsonschema" // SBPoolSchema is the schema URI for a SiteBacker pool profile SBPoolSchema = "http://schemas.ultradns.com/SBPool.jsonschema" // TCPoolSchema is the schema URI for a Traffic Controller pool profile TCPoolSchema = "http://schemas.ultradns.com/TCPool.jsonschema" )
const ( // DefaultTestBaseURL returns the URL for UltraDNS's test restapi endpoint DefaultTestBaseURL = "https://test-restapi.ultradns.com/" // DefaultLiveBaseURL returns the URL for UltraDNS's production restapi endpoint DefaultLiveBaseURL = "https://restapi.ultradns.com/" )
Variables ¶
This section is empty.
Functions ¶
func CheckResponse ¶
CheckResponse checks the API response for errors, and returns them if present. A response is considered an error if the status code is different than 2xx. Specific requests may have additional requirements, but this is sufficient in most of the cases.
func NewConfig ¶ added in v1.2.0
func NewConfig(username, password, BaseURL string) *oauthPassword.Config
NewConfig creates a new *password.config for UltraDNS OAuth2
func TasksQueryURI ¶
TasksQueryURI generates the query URI for the tasks collection given a query and offset
Types ¶
type Account ¶
type Account struct { AccountName string `json:"accountName"` AccountHolderUserName string `json:"accountHolderUserName"` OwnerUserName string `json:"ownerUserName"` NumberOfUsers int `json:"numberOfUsers"` NumberOfGroups int `json:"numberOfGroups"` AccountType string `json:"accountType"` }
Account represents responses from the service
type AccountLevelGeoDirectionalGroupDTO ¶
type AccountLevelGeoDirectionalGroupDTO struct { Name string `json:"name"` Description string `json:"description"` Codes []string `json:"codes"` }
AccountLevelGeoDirectionalGroupDTO wraps an account-level, geo directonal-group response
type AccountLevelGeoDirectionalGroupListDTO ¶
type AccountLevelGeoDirectionalGroupListDTO struct { AccountName string `json:"zoneName"` GeoGroups []AccountLevelGeoDirectionalGroupDTO `json:"geoGroups"` Queryinfo QueryInfo `json:"queryInfo"` Resultinfo ResultInfo `json:"resultInfo"` }
AccountLevelGeoDirectionalGroupListDTO wraps a list of account-level, geo directional-groups response from a index request
type AccountLevelIPDirectionalGroupDTO ¶
type AccountLevelIPDirectionalGroupDTO struct { Name string `json:"name"` Description string `json:"description"` IPs []IPAddrDTO `json:"ips"` }
AccountLevelIPDirectionalGroupDTO wraps an account-level, IP directional-group response
type AccountLevelIPDirectionalGroupListDTO ¶
type AccountLevelIPDirectionalGroupListDTO struct { AccountName string `json:"zoneName"` IPGroups []AccountLevelIPDirectionalGroupDTO `json:"ipGroups"` Queryinfo QueryInfo `json:"queryInfo"` Resultinfo ResultInfo `json:"resultInfo"` }
AccountLevelIPDirectionalGroupListDTO wraps an account-level, IP directional-group response
type AccountListDTO ¶
type AccountListDTO struct { Accounts []Account `json:"accounts"` Resultinfo ResultInfo `json:"resultInfo"` }
AccountListDTO represents a account index response
type AccountsService ¶
type AccountsService struct {
// contains filtered or unexported fields
}
AccountsService provides access to account resources
func (*AccountsService) Delete ¶
func (s *AccountsService) Delete(k AccountKey) (*http.Response, error)
Delete requests deletion of an Account by AccountKey
func (*AccountsService) Find ¶
func (s *AccountsService) Find(k AccountKey) (Account, *http.Response, error)
Find requests an Account by AccountKey
type AlertsService ¶
type AlertsService struct {
// contains filtered or unexported fields
}
AlertsService manages Alerts
func (*AlertsService) Select ¶
func (s *AlertsService) Select(k RRSetKey) ([]ProbeAlertDataDTO, error)
Select returns all probe alerts with a RRSetKey
func (*AlertsService) SelectWithOffset ¶
func (s *AlertsService) SelectWithOffset(k RRSetKey, offset int) ([]ProbeAlertDataDTO, ResultInfo, *http.Response, error)
SelectWithOffset returns the probe alerts with a RRSetKey, accepting an offset
type BackupRecord ¶
type BackupRecord struct { RData string `json:"rdata,omitempty"` FailoverDelay int `json:"failoverDelay,omitempty"` AvailableToServe bool `json:"availableToServe,omitempty"` }
BackupRecord wraps the backupRecord objects of an SBPoolProfile response
type Client ¶
type Client struct { // This is our client structure. HTTPClient *http.Client Config *oauthPassword.Config BaseURL *url.URL UserAgent string // Accounts API Accounts *AccountsService // Probe Alerts API Alerts *AlertsService // Directional Pools API DirectionalPools *DirectionalPoolsService // Events API Events *EventsService // Notifications API Notifications *NotificationsService // Probes API Probes *ProbesService // Resource Record Sets API RRSets *RRSetsService // Tasks API Tasks *TasksService }
Client wraps our general-purpose Service Client
func (*Client) Do ¶
Do sends an API request and returns the API response. The API response is JSON decoded and stored in the value pointed by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response body will be written to v, without attempting to decode it.
func (*Client) GetResultByURI ¶
GetResultByURI just requests a URI
func (*Client) NewRequest ¶
NewRequest creates an API request. The path is expected to be a relative path and will be resolved according to the BaseURL of the Client. Paths should always be specified without a preceding slash.
type DNSProbeDetailsDTO ¶
type DNSProbeDetailsDTO struct { Port int `json:"port,omitempty"` TCPOnly bool `json:"tcpOnly,omitempty"` RecordType string `json:"type,omitempty"` OwnerName string `json:"ownerName,omitempty"` Limits map[string]ProbeDetailsLimitDTO `json:"limits"` }
DNSProbeDetailsDTO wraps DNS probe details
type DPRDataInfo ¶
type DPRDataInfo struct { AllNonConfigured bool `json:"allNonConfigured,omitempty" terraform:"all_non_configured"` IPInfo *IPInfo `json:"ipInfo,omitempty" terraform:"ip_info"` GeoInfo *GeoInfo `json:"geoInfo,omitempty" terraform:"geo_info"` Type string `json:"type,omitempty" terraform:"type"` // not mentioned in REST API doc }
DPRDataInfo wraps the rdataInfo object of a DirPoolProfile response
type DirPoolProfile ¶
type DirPoolProfile struct { Context ProfileSchema `json:"@context"` Description string `json:"description"` ConflictResolve string `json:"conflictResolve,omitempty"` RDataInfo []DPRDataInfo `json:"rdataInfo"` NoResponse DPRDataInfo `json:"noResponse,omitempty"` }
DirPoolProfile wraps a Profile for a Directional Pool
func (DirPoolProfile) RawProfile ¶
func (p DirPoolProfile) RawProfile() RawProfile
RawProfile converts to a naive RawProfile
type DirectionalPool ¶
type DirectionalPool struct { DirectionalPoolID string `json:"taskId"` DirectionalPoolStatusCode string `json:"taskStatusCode"` Message string `json:"message"` ResultURI string `json:"resultUri"` }
DirectionalPool wraps an account-level directional-groups response from a index request
type DirectionalPoolKey ¶
type DirectionalPoolKey struct { Account AccountKey Type string Name string }
DirectionalPoolKey collects the identifiers of a DirectionalPool
func (DirectionalPoolKey) QueryURI ¶
func (k DirectionalPoolKey) QueryURI(query string, offset int) string
QueryURI generates the URI for directional pools by account, type, query & offset
func (DirectionalPoolKey) URI ¶
func (k DirectionalPoolKey) URI() string
URI generates the URI for directional pools by account, type & slug ID
type DirectionalPoolListDTO ¶
type DirectionalPoolListDTO struct { DirectionalPools []DirectionalPool `json:"tasks"` Queryinfo QueryInfo `json:"queryInfo"` Resultinfo ResultInfo `json:"resultInfo"` }
DirectionalPoolListDTO wraps a list of account-level directional-groups response from a index request
type DirectionalPoolsService ¶
type DirectionalPoolsService struct {
// contains filtered or unexported fields
}
DirectionalPoolsService manages 'account level' 'geo' and 'ip' groups for directional-pools
func (*DirectionalPoolsService) Geos ¶
func (s *DirectionalPoolsService) Geos() *GeoDirectionalPoolsService
Geos allows access to the Geo DirectionalPools API
func (*DirectionalPoolsService) IPs ¶
func (s *DirectionalPoolsService) IPs() *IPDirectionalPoolsService
IPs allows access to the IP DirectionalPools API
type ErrorResponse ¶
type ErrorResponse struct { Response *http.Response // HTTP response that caused this error ErrorCode int `json:"errorCode"` // error code ErrorMessage string `json:"errorMessage"` // human-readable message ErrorStr string `json:"error"` ErrorDescription string `json:"error_description"` }
ErrorResponse represents an error caused by an API request. Example: {"errorCode":60001,"errorMessage":"invalid_grant:Invalid username & password combination.","error":"invalid_grant","error_description":"60001: invalid_grant:Invalid username & password combination."}
func (ErrorResponse) Error ¶
func (r ErrorResponse) Error() string
Error implements the error interface.
type ErrorResponseList ¶
type ErrorResponseList struct { Response *http.Response // HTTP response that caused this error Responses []ErrorResponse }
ErrorResponseList wraps an HTTP response that has a list of errors
func (ErrorResponseList) Error ¶
func (r ErrorResponseList) Error() string
type EventInfoDTO ¶
type EventInfoDTO struct { ID string `json:"id"` PoolRecord string `json:"poolRecord"` EventType string `json:"type"` Start time.Time `json:"start"` Repeat string `json:"repeat"` End time.Time `json:"end"` Notify string `json:"notify"` }
EventInfoDTO wraps an event's info response
type EventInfoListDTO ¶
type EventInfoListDTO struct { Events []EventInfoDTO `json:"events"` Queryinfo QueryInfo `json:"queryInfo"` Resultinfo ResultInfo `json:"resultInfo"` }
EventInfoListDTO wraps a list of event info and list metadata, from an index request
type EventKey ¶
EventKey collects the identifiers of an Event
type EventsService ¶
type EventsService struct {
// contains filtered or unexported fields
}
EventsService manages Events
func (*EventsService) Create ¶
func (s *EventsService) Create(r RRSetKey, ev EventInfoDTO) (*http.Response, error)
Create requests creation of an event by RRSetKey, with provided event-info, returning actual response or an error
func (*EventsService) Delete ¶
func (s *EventsService) Delete(e EventKey) (*http.Response, error)
Delete requests deletion of an event by EventKey, returning the actual response or an error
func (*EventsService) Find ¶
func (s *EventsService) Find(e EventKey) (EventInfoDTO, *http.Response, error)
Find requests an event by name, type, zone & guid, also returning the actual response, or an error
func (*EventsService) Select ¶
func (s *EventsService) Select(r RRSetKey, query string) ([]EventInfoDTO, error)
Select requests all events, using pagination and error handling
func (*EventsService) SelectWithOffset ¶
func (s *EventsService) SelectWithOffset(r RRSetKey, query string, offset int) ([]EventInfoDTO, ResultInfo, *http.Response, error)
SelectWithOffset requests list of events by RRSetKey, query and offset, also returning list metadata, the actual response, or an error
func (*EventsService) Update ¶
func (s *EventsService) Update(e EventKey, ev EventInfoDTO) (*http.Response, error)
Update requests update of an event by EventKey, withprovided event-info, returning the actual response or an error
type FTPProbeDetailsDTO ¶
type FTPProbeDetailsDTO struct { Port int `json:"port,omitempty"` PassiveMode bool `json:"passiveMode,omitempty"` Username string `json:"username,omitempty"` Password string `json:"password,omitempty"` Path string `json:"path"` Limits map[string]ProbeDetailsLimitDTO `json:"limits"` }
FTPProbeDetailsDTO wraps FTP probe details
type GeoDirectionalPoolKey ¶
type GeoDirectionalPoolKey struct { Account AccountKey Name string }
GeoDirectionalPoolKey collects the identifiers of an DirectionalPool with type Geo
func (GeoDirectionalPoolKey) DirectionalPoolKey ¶
func (k GeoDirectionalPoolKey) DirectionalPoolKey() DirectionalPoolKey
DirectionalPoolKey generates the DirectionalPoolKey for the GeoDirectionalPoolKey
func (GeoDirectionalPoolKey) QueryURI ¶
func (k GeoDirectionalPoolKey) QueryURI(query string, offset int) string
QueryURI generates the GeoDirectionalPool URI with query
func (GeoDirectionalPoolKey) URI ¶
func (k GeoDirectionalPoolKey) URI() string
URI generates the URI for a GeoDirectionalPool
type GeoDirectionalPoolsService ¶
type GeoDirectionalPoolsService struct {
// contains filtered or unexported fields
}
GeoDirectionalPoolsService manages 'geo' groups for directional-pools
func (*GeoDirectionalPoolsService) Create ¶
func (s *GeoDirectionalPoolsService) Create(k GeoDirectionalPoolKey, val interface{}) (*http.Response, error)
Create requests creation of a DirectionalPool by DirectionalPoolKey given a directional-pool
func (*GeoDirectionalPoolsService) Delete ¶
func (s *GeoDirectionalPoolsService) Delete(k GeoDirectionalPoolKey) (*http.Response, error)
Delete requests deletion of a DirectionalPool
func (*GeoDirectionalPoolsService) Find ¶
func (s *GeoDirectionalPoolsService) Find(k GeoDirectionalPoolKey) (AccountLevelGeoDirectionalGroupDTO, *http.Response, error)
Find requests a geo directional-pool by name & account
func (*GeoDirectionalPoolsService) Select ¶
func (s *GeoDirectionalPoolsService) Select(k GeoDirectionalPoolKey, query string) ([]AccountLevelGeoDirectionalGroupDTO, error)
Select requests all geo directional-pools, by query and account, providing pagination and error handling
func (*GeoDirectionalPoolsService) SelectWithOffset ¶
func (s *GeoDirectionalPoolsService) SelectWithOffset(k GeoDirectionalPoolKey, query string, offset int) ([]AccountLevelGeoDirectionalGroupDTO, ResultInfo, *http.Response, error)
SelectWithOffset requests list of geo directional-pools, by query & account, and an offset, returning the directional-group, the list-metadata, the actual response, or an error
func (*GeoDirectionalPoolsService) Update ¶
func (s *GeoDirectionalPoolsService) Update(k GeoDirectionalPoolKey, val interface{}) (*http.Response, error)
Update requests update of a DirectionalPool by DirectionalPoolKey given a directional-pool
type GeoInfo ¶
type GeoInfo struct { Name string `json:"name" terraform:"name"` IsAccountLevel bool `json:"isAccountLevel,omitempty" terraform:"is_account_level"` Codes []string `json:"codes,omitempty" terraform:"-"` }
GeoInfo wraps the geoInfo object of a DPRDataInfo
type HTTPProbeDetailsDTO ¶
type HTTPProbeDetailsDTO struct { Transactions []Transaction `json:"transactions"` TotalLimits *ProbeDetailsLimitDTO `json:"totalLimits,omitempty"` }
HTTPProbeDetailsDTO wraps HTTP probe details
type IPAddrDTO ¶
type IPAddrDTO struct { Start string `json:"start,omitempty" terraform:"start"` End string `json:"end,omitempty" terraform:"end"` CIDR string `json:"cidr,omitempty" terraform:"cidr"` Address string `json:"address,omitempty" terraform:"address"` }
IPAddrDTO wraps an IP address range or CIDR block
type IPDirectionalPoolKey ¶
type IPDirectionalPoolKey struct { Account AccountKey Name string }
IPDirectionalPoolKey collects the identifiers of an DirectionalPool with type IP
func (IPDirectionalPoolKey) DirectionalPoolKey ¶
func (k IPDirectionalPoolKey) DirectionalPoolKey() DirectionalPoolKey
DirectionalPoolKey generates the DirectionalPoolKey for the IPDirectionalPoolKey
func (IPDirectionalPoolKey) QueryURI ¶
func (k IPDirectionalPoolKey) QueryURI(query string, offset int) string
QueryURI generates the IPDirectionalPool URI with query
func (IPDirectionalPoolKey) URI ¶
func (k IPDirectionalPoolKey) URI() string
URI generates the IPDirectionalPool query URI
type IPDirectionalPoolsService ¶
type IPDirectionalPoolsService struct {
// contains filtered or unexported fields
}
IPDirectionalPoolsService manages 'geo' groups for directional-pools
func (*IPDirectionalPoolsService) Create ¶
func (s *IPDirectionalPoolsService) Create(k IPDirectionalPoolKey, val interface{}) (*http.Response, error)
Create requests creation of a DirectionalPool by DirectionalPoolKey given a directional-pool
func (*IPDirectionalPoolsService) Delete ¶
func (s *IPDirectionalPoolsService) Delete(k IPDirectionalPoolKey) (*http.Response, error)
Delete deletes an directional-pool
func (*IPDirectionalPoolsService) Find ¶
func (s *IPDirectionalPoolsService) Find(k IPDirectionalPoolKey) (AccountLevelIPDirectionalGroupDTO, *http.Response, error)
Find requests a directional-pool by name & account
func (*IPDirectionalPoolsService) Select ¶
func (s *IPDirectionalPoolsService) Select(k IPDirectionalPoolKey, query string) ([]AccountLevelIPDirectionalGroupDTO, error)
Select requests all IP directional-pools, using pagination and error handling
func (*IPDirectionalPoolsService) SelectWithOffset ¶
func (s *IPDirectionalPoolsService) SelectWithOffset(k IPDirectionalPoolKey, query string, offset int) ([]AccountLevelIPDirectionalGroupDTO, ResultInfo, *http.Response, error)
SelectWithOffset requests all IP directional-pools, by query & account, and an offset, returning the list of IP groups, list metadata & the actual response, or an error
func (*IPDirectionalPoolsService) Update ¶
func (s *IPDirectionalPoolsService) Update(k IPDirectionalPoolKey, val interface{}) (*http.Response, error)
Update requests update of a DirectionalPool by DirectionalPoolKey given a directional-pool
type IPInfo ¶
type IPInfo struct { Name string `json:"name" terraform:"name"` IsAccountLevel bool `json:"isAccountLevel,omitempty" terraform:"is_account_level"` Ips []IPAddrDTO `json:"ips,omitempty" terraform:"-"` }
IPInfo wraps the ipInfo object of a DPRDataInfo
type NotificationDTO ¶
type NotificationDTO struct { Email string `json:"email"` PoolRecords []NotificationPoolRecord `json:"poolRecords"` }
NotificationDTO manages notifications
type NotificationInfoDTO ¶
type NotificationInfoDTO struct { Probe bool `json:"probe"` Record bool `json:"record"` Scheduled bool `json:"scheduled"` }
NotificationInfoDTO does things unknown
type NotificationKey ¶
NotificationKey collects the identifiers of an Notification
func (NotificationKey) RRSetKey ¶
func (k NotificationKey) RRSetKey() RRSetKey
RRSetKey generates the RRSetKey for the NotificationKey
func (NotificationKey) URI ¶
func (k NotificationKey) URI() string
URI generates the URI for a probe
type NotificationListDTO ¶
type NotificationListDTO struct { Notifications []NotificationDTO `json:"notifications"` Queryinfo QueryInfo `json:"queryInfo"` Resultinfo ResultInfo `json:"resultInfo"` }
NotificationListDTO does things unknown
type NotificationPoolRecord ¶
type NotificationPoolRecord struct { PoolRecord string `json:"poolRecord"` Notification NotificationInfoDTO `json:"notification"` }
NotificationPoolRecord does things unknown
type NotificationsService ¶
type NotificationsService struct {
// contains filtered or unexported fields
}
NotificationsService manages Probes
func (*NotificationsService) Create ¶
func (s *NotificationsService) Create(k NotificationKey, n NotificationDTO) (*http.Response, error)
Create requests creation of an event by RRSetKey, with provided NotificationInfoDTO, returning actual response or an error
func (*NotificationsService) Delete ¶
func (s *NotificationsService) Delete(k NotificationKey) (*http.Response, error)
Delete requests deletion of an event by NotificationKey, returning the actual response or an error
func (*NotificationsService) Find ¶
func (s *NotificationsService) Find(k NotificationKey) (NotificationDTO, *http.Response, error)
Find requests a notification by NotificationKey,returning the actual response, or an error
func (*NotificationsService) Select ¶
func (s *NotificationsService) Select(k RRSetKey, query string) ([]NotificationDTO, *http.Response, error)
Select requests all notifications by RRSetKey and optional query, using pagination and error handling
func (*NotificationsService) SelectWithOffset ¶
func (s *NotificationsService) SelectWithOffset(k RRSetKey, query string, offset int) ([]NotificationDTO, ResultInfo, *http.Response, error)
SelectWithOffset requests list of notifications by RRSetKey, query and offset, also returning list metadata, the actual response, or an error
func (*NotificationsService) Update ¶
func (s *NotificationsService) Update(k NotificationKey, n NotificationDTO) (*http.Response, error)
Update requests update of an event by NotificationKey, with provided NotificationInfoDTO, returning the actual response or an error
type PingProbeDetailsDTO ¶
type PingProbeDetailsDTO struct { Packets int `json:"packets,omitempty"` PacketSize int `json:"packetSize,omitempty"` Limits map[string]ProbeDetailsLimitDTO `json:"limits"` }
PingProbeDetailsDTO wraps Ping probe details
type ProbeAlertDataDTO ¶
type ProbeAlertDataDTO struct { PoolRecord string `json:"poolRecord"` ProbeType string `json:"probeType"` ProbeStatus string `json:"probeStatus"` AlertDate time.Time `json:"alertDate"` FailoverOccured bool `json:"failoverOccured"` OwnerName string `json:"ownerName"` Status string `json:"status"` }
ProbeAlertDataDTO wraps a probe alert response
func (ProbeAlertDataDTO) Equal ¶ added in v1.1.0
func (a ProbeAlertDataDTO) Equal(b ProbeAlertDataDTO) bool
Equal compares to another ProbeAlertDataDTO, but uses time.Equals to compare semantic equvalance of AlertDate
type ProbeAlertDataListDTO ¶
type ProbeAlertDataListDTO struct { Alerts []ProbeAlertDataDTO `json:"alerts"` Queryinfo QueryInfo `json:"queryInfo"` Resultinfo ResultInfo `json:"resultInfo"` }
ProbeAlertDataListDTO wraps the response for an index of probe alerts
type ProbeDetailsDTO ¶
type ProbeDetailsDTO struct { Detail interface{} `json:"detail,omitempty"` // contains filtered or unexported fields }
ProbeDetailsDTO wraps the details of a probe
func (*ProbeDetailsDTO) DNSProbeDetails ¶ added in v1.2.0
func (s *ProbeDetailsDTO) DNSProbeDetails() (DNSProbeDetailsDTO, error)
DNSProbeDetails returns the ProbeDetailsDTO data deserialized as a DNSProbeDetailsDTO
func (*ProbeDetailsDTO) FTPProbeDetails ¶ added in v1.2.0
func (s *ProbeDetailsDTO) FTPProbeDetails() (FTPProbeDetailsDTO, error)
FTPProbeDetails returns the ProbeDetailsDTO data deserialized as a FTPProbeDetailsDTO
func (*ProbeDetailsDTO) GetData ¶
func (s *ProbeDetailsDTO) GetData() []byte
GetData returns the data because I'm working around something.
func (*ProbeDetailsDTO) GetDetailsObject ¶ added in v1.2.0
func (s *ProbeDetailsDTO) GetDetailsObject(t ProbeType) (interface{}, error)
GetDetailsObject extracts the appropriate details object from a ProbeDetailsDTO with the given ProbeType
func (*ProbeDetailsDTO) GoString ¶
func (s *ProbeDetailsDTO) GoString() string
GoString returns a string representation of the ProbeDetailsDTO internal data
func (*ProbeDetailsDTO) HTTPProbeDetails ¶ added in v1.2.0
func (s *ProbeDetailsDTO) HTTPProbeDetails() (HTTPProbeDetailsDTO, error)
HTTPProbeDetails returns the ProbeDetailsDTO data deserialized as a HTTPProbeDetailsDTO
func (*ProbeDetailsDTO) MarshalJSON ¶
func (s *ProbeDetailsDTO) MarshalJSON() ([]byte, error)
MarshalJSON does what it says on the tin
func (*ProbeDetailsDTO) PingProbeDetails ¶ added in v1.2.0
func (s *ProbeDetailsDTO) PingProbeDetails() (PingProbeDetailsDTO, error)
PingProbeDetails returns the ProbeDetailsDTO data deserialized as a PingProbeDetailsDTO
func (*ProbeDetailsDTO) Populate ¶
func (s *ProbeDetailsDTO) Populate(t ProbeType) (err error)
Populate does magical things with json unmarshalling to unroll the Probe into an appropriate datatype. These are helper structures and functions for testing and direct API use. In the Terraform implementation, we will use Terraforms own warped schema structure to handle the marshalling and unmarshalling.
func (*ProbeDetailsDTO) SMTPProbeDetails ¶ added in v1.2.0
func (s *ProbeDetailsDTO) SMTPProbeDetails() (SMTPProbeDetailsDTO, error)
SMTPProbeDetails returns the ProbeDetailsDTO data deserialized as a SMTPProbeDetailsDTO
func (*ProbeDetailsDTO) SMTPSENDProbeDetails ¶ added in v1.2.0
func (s *ProbeDetailsDTO) SMTPSENDProbeDetails() (SMTPSENDProbeDetailsDTO, error)
SMTPSENDProbeDetails returns the ProbeDetailsDTO data deserialized as a SMTPSENDProbeDetailsDTO
func (*ProbeDetailsDTO) String ¶
func (s *ProbeDetailsDTO) String() string
func (*ProbeDetailsDTO) TCPProbeDetails ¶ added in v1.2.0
func (s *ProbeDetailsDTO) TCPProbeDetails() (TCPProbeDetailsDTO, error)
TCPProbeDetails returns the ProbeDetailsDTO data deserialized as a TCPProbeDetails
func (*ProbeDetailsDTO) UnmarshalJSON ¶
func (s *ProbeDetailsDTO) UnmarshalJSON(b []byte) (err error)
UnmarshalJSON does what it says on the tin
type ProbeDetailsLimitDTO ¶
type ProbeDetailsLimitDTO struct { Warning int `json:"warning"` Critical int `json:"critical"` Fail int `json:"fail"` }
ProbeDetailsLimitDTO wraps a probe
type ProbeInfoDTO ¶
type ProbeInfoDTO struct { ID string `json:"id,omitempty"` PoolRecord string `json:"poolRecord,omitempty"` ProbeType ProbeType `json:"type"` Interval string `json:"interval"` Agents []string `json:"agents"` Threshold int `json:"threshold"` Details *ProbeDetailsDTO `json:"details"` }
ProbeInfoDTO wraps a probe response
type ProbeKey ¶
ProbeKey collects the identifiers of a Probe
type ProbeListDTO ¶
type ProbeListDTO struct { Probes []ProbeInfoDTO `json:"probes"` Queryinfo QueryInfo `json:"queryInfo"` Resultinfo ResultInfo `json:"resultInfo"` }
ProbeListDTO wraps a list of probes
type ProbeType ¶ added in v1.2.0
type ProbeType string
ProbeType wraps the possible types of a ProbeInfoDTO
type ProbesService ¶
type ProbesService struct {
// contains filtered or unexported fields
}
ProbesService manages Probes
func (*ProbesService) Create ¶
func (s *ProbesService) Create(k RRSetKey, dp ProbeInfoDTO) (*http.Response, error)
Create creates a probe with a RRSetKey using the ProbeInfoDTO dp
func (*ProbesService) Delete ¶
func (s *ProbesService) Delete(k ProbeKey) (*http.Response, error)
Delete deletes a probe by its ProbeKey
func (*ProbesService) Find ¶
func (s *ProbesService) Find(k ProbeKey) (ProbeInfoDTO, *http.Response, error)
Find returns a probe from a ProbeKey
func (*ProbesService) Select ¶
func (s *ProbesService) Select(k RRSetKey, query string) ([]ProbeInfoDTO, *http.Response, error)
Select returns all probes by a RRSetKey, with an optional query
func (*ProbesService) Update ¶
func (s *ProbesService) Update(k ProbeKey, dp ProbeInfoDTO) (*http.Response, error)
Update updates a probe given a ProbeKey with the ProbeInfoDTO dp
type QueryInfo ¶
type QueryInfo struct { Q string `json:"q"` Sort string `json:"sort"` Reverse bool `json:"reverse"` Limit int `json:"limit"` }
QueryInfo wraps a query request
type RDPoolProfile ¶
type RDPoolProfile struct { Context ProfileSchema `json:"@context"` Order string `json:"order"` Description string `json:"description"` }
RDPoolProfile wraps a Profile for a Resource Distribution pool
func (RDPoolProfile) RawProfile ¶
func (p RDPoolProfile) RawProfile() RawProfile
RawProfile converts to a naive RawProfile
type RRSet ¶
type RRSet struct { OwnerName string `json:"ownerName"` RRType string `json:"rrtype"` TTL int `json:"ttl"` RData []string `json:"rdata"` Profile RawProfile `json:"profile,omitempty"` }
RRSet wraps an RRSet resource
type RRSetKey ¶
RRSetKey collects the identifiers of a Zone
func (RRSetKey) AlertsQueryURI ¶
AlertsQueryURI generates the alerts query URI for an RRSet with query
func (RRSetKey) EventsQueryURI ¶
EventsQueryURI generates the events query URI for an RRSet with query
func (RRSetKey) NotificationsQueryURI ¶
NotificationsQueryURI generates the notifications query URI for an RRSet with query
func (RRSetKey) NotificationsURI ¶
NotificationsURI generates the notifications URI for an RRSet
func (RRSetKey) ProbesQueryURI ¶
ProbesQueryURI generates the probes query URI for an RRSet with query
type RRSetListDTO ¶
type RRSetListDTO struct { ZoneName string `json:"zoneName"` Rrsets []RRSet `json:"rrsets"` Queryinfo QueryInfo `json:"queryInfo"` Resultinfo ResultInfo `json:"resultInfo"` }
RRSetListDTO wraps a list of RRSet resources
type RRSetsService ¶
type RRSetsService struct {
// contains filtered or unexported fields
}
RRSetsService provides access to RRSet resources
func (*RRSetsService) Delete ¶
func (s *RRSetsService) Delete(k RRSetKey) (*http.Response, error)
Delete deletes an RRSet
func (*RRSetsService) Select ¶
func (s *RRSetsService) Select(k RRSetKey) ([]RRSet, error)
Select will list the zone rrsets, paginating through all available results
func (*RRSetsService) SelectWithOffset ¶
func (s *RRSetsService) SelectWithOffset(k RRSetKey, offset int) ([]RRSet, ResultInfo, *http.Response, error)
SelectWithOffset requests zone rrsets by RRSetKey & optional offset
type RawProfile ¶
type RawProfile map[string]interface{}
RawProfile represents the naive interface to an RRSet Profile
func (RawProfile) Context ¶
func (rp RawProfile) Context() ProfileSchema
Context extracts the schema context from a RawProfile
func (RawProfile) DirPoolProfile ¶
func (rp RawProfile) DirPoolProfile() (DirPoolProfile, error)
DirPoolProfile extracts the full Profile as a DirPoolProfile or returns an error
func (RawProfile) GetProfileObject ¶
func (rp RawProfile) GetProfileObject() (interface{}, error)
GetProfileObject extracts the full Profile by its schema type
func (RawProfile) RDPoolProfile ¶
func (rp RawProfile) RDPoolProfile() (RDPoolProfile, error)
RDPoolProfile extracts the full Profile as a RDPoolProfile or returns an error
func (RawProfile) SBPoolProfile ¶
func (rp RawProfile) SBPoolProfile() (SBPoolProfile, error)
SBPoolProfile extracts the full Profile as a SBPoolProfile or returns an error
func (RawProfile) TCPoolProfile ¶
func (rp RawProfile) TCPoolProfile() (TCPoolProfile, error)
TCPoolProfile extracts the full Profile as a TCPoolProfile or returns an error
type ResultInfo ¶
type ResultInfo struct { TotalCount int `json:"totalCount"` Offset int `json:"offset"` ReturnedCount int `json:"returnedCount"` }
ResultInfo wraps the list metadata for an index response
type SBPoolProfile ¶
type SBPoolProfile struct { Context ProfileSchema `json:"@context"` Description string `json:"description"` RunProbes bool `json:"runProbes"` ActOnProbes bool `json:"actOnProbes"` Order string `json:"order,omitempty"` MaxActive int `json:"maxActive,omitempty"` MaxServed int `json:"maxServed,omitempty"` RDataInfo []SBRDataInfo `json:"rdataInfo"` BackupRecords []BackupRecord `json:"backupRecords"` }
SBPoolProfile wraps a Profile for a SiteBacker pool
func (SBPoolProfile) RawProfile ¶
func (p SBPoolProfile) RawProfile() RawProfile
RawProfile converts to a naive RawProfile
type SBRDataInfo ¶
type SBRDataInfo struct { State string `json:"state"` RunProbes bool `json:"runProbes"` Priority int `json:"priority"` FailoverDelay int `json:"failoverDelay,omitempty"` Threshold int `json:"threshold"` Weight int `json:"weight"` AvailableToServe bool `json:"availableToServe,omitempty"` }
SBRDataInfo wraps the rdataInfo object of a SBPoolProfile
type SMTPProbeDetailsDTO ¶
type SMTPProbeDetailsDTO struct { Port int `json:"port,omitempty"` Limits map[string]ProbeDetailsLimitDTO `json:"limits"` }
SMTPProbeDetailsDTO wraps SMTP probe details
type SMTPSENDProbeDetailsDTO ¶
type SMTPSENDProbeDetailsDTO struct { Port int `json:"port,omitempty"` From string `json:"from"` To string `json:"to"` Message string `json:"message,omitempty"` Limits map[string]ProbeDetailsLimitDTO `json:"limits"` }
SMTPSENDProbeDetailsDTO wraps SMTP SEND probe details
type TCPProbeDetailsDTO ¶
type TCPProbeDetailsDTO struct { Port int `json:"port,omitempty"` ControlIP string `json:"controlIP,omitempty"` Limits map[string]ProbeDetailsLimitDTO `json:"limits"` }
TCPProbeDetailsDTO wraps TCP probe details
type TCPoolProfile ¶
type TCPoolProfile struct { Context ProfileSchema `json:"@context"` Description string `json:"description"` RunProbes bool `json:"runProbes"` ActOnProbes bool `json:"actOnProbes"` MaxToLB int `json:"maxToLB,omitempty"` RDataInfo []SBRDataInfo `json:"rdataInfo"` BackupRecord *BackupRecord `json:"backupRecord,omitempty"` Status string `json:"status,omitempty"` }
TCPoolProfile wraps a Profile for a Traffic Controller pool
func (TCPoolProfile) RawProfile ¶
func (p TCPoolProfile) RawProfile() RawProfile
RawProfile converts to a naive RawProfile
type Task ¶
type Task struct { TaskID string `json:"taskId"` TaskStatusCode string `json:"taskStatusCode"` Message string `json:"message"` ResultURI string `json:"resultUri"` }
Task wraps a task response
type TaskID ¶
type TaskID string
TaskID represents the string identifier of a task
type TaskListDTO ¶
type TaskListDTO struct { Tasks []Task `json:"tasks"` Queryinfo QueryInfo `json:"queryInfo"` Resultinfo ResultInfo `json:"resultInfo"` }
TaskListDTO wraps a list of Task resources, from an HTTP response
type TasksService ¶
type TasksService struct {
// contains filtered or unexported fields
}
TasksService provides access to the tasks resources
func (*TasksService) Delete ¶
func (s *TasksService) Delete(t TaskID) (*http.Response, error)
Delete requests deletions
func (*TasksService) FindResult ¶
func (s *TasksService) FindResult(t TaskID) (*http.Response, error)
FindResult requests
func (*TasksService) FindResultByTask ¶
func (s *TasksService) FindResultByTask(t Task) (*http.Response, error)
FindResultByTask requests a task by the provided task's result uri
func (*TasksService) Select ¶
func (s *TasksService) Select(query string) ([]Task, error)
Select requests all tasks, with pagination
func (*TasksService) SelectWithOffset ¶
func (s *TasksService) SelectWithOffset(query string, offset int) ([]Task, ResultInfo, *http.Response, error)
SelectWithOffset request tasks by query & offset, list them also returning list metadata, the actual response, or an error
type Transaction ¶
type Transaction struct { Method string `json:"method"` URL string `json:"url"` TransmittedData string `json:"transmittedData,omitempty"` FollowRedirects bool `json:"followRedirects,omitempty"` Limits map[string]ProbeDetailsLimitDTO `json:"limits"` }
Transaction wraps a transaction response