Documentation ¶
Index ¶
- Variables
- func Init(config edgegrid.Config)
- func IsConfigGTMError(e error) bool
- type AsAssignment
- type AsMap
- func (as *AsMap) Create(domainName string) (*AsMapResponse, error)
- func (as *AsMap) Delete(domainName string) (*ResponseStatus, error)
- func (as *AsMap) NewAssignment(dcID int, nickname string) *AsAssignment
- func (as *AsMap) NewDefaultDatacenter(dcID int) *DatacenterBase
- func (as *AsMap) Update(domainName string) (*ResponseStatus, error)
- type AsMapResponse
- type CidrAssignment
- type CidrMap
- func (cidr *CidrMap) Create(domainName string) (*CidrMapResponse, error)
- func (cidr *CidrMap) Delete(domainName string) (*ResponseStatus, error)
- func (cidr *CidrMap) NewAssignment(dcid int, nickname string) *CidrAssignment
- func (cidr *CidrMap) NewDefaultDatacenter(dcid int) *DatacenterBase
- func (cidr *CidrMap) Update(domainName string) (*ResponseStatus, error)
- type CidrMapList
- type CidrMapResponse
- type CommonError
- func (e CommonError) Error() string
- func (CommonError) FailedToSave() bool
- func (e CommonError) GetItem(itemName string) interface{}
- func (e CommonError) Network() bool
- func (e CommonError) NotFound() bool
- func (e CommonError) SetItem(itemName string, itemVal interface{})
- func (e CommonError) ValidationFailed() bool
- type ConfigGTMError
- type Datacenter
- type DatacenterBase
- type DatacenterList
- type DatacenterResponse
- type Domain
- type DomainItem
- type DomainResponse
- type DomainsList
- type GeoAssignment
- type GeoMap
- func (geo *GeoMap) Create(domainName string) (*GeoMapResponse, error)
- func (geo *GeoMap) Delete(domainName string) (*ResponseStatus, error)
- func (geo *GeoMap) NewAssignment(dcID int, nickname string) *GeoAssignment
- func (geo *GeoMap) NewDefaultDatacenter(dcID int) *DatacenterBase
- func (geo *GeoMap) Update(domainName string) (*ResponseStatus, error)
- type GeoMapList
- type GeoMapResponse
- type Link
- type LivenessTest
- type LoadObject
- type MxRecord
- type Property
- func (property *Property) Create(domainName string) (*PropertyResponse, error)
- func (property *Property) Delete(domainName string) (*ResponseStatus, error)
- func (prop *Property) NewLivenessTest(name string, objproto string, interval int, timeout float32) *LivenessTest
- func (prop *Property) NewMxRecord() *MxRecord
- func (prop *Property) NewTrafficTarget() *TrafficTarget
- func (property *Property) Update(domainName string) (*ResponseStatus, error)
- type PropertyList
- type PropertyResponse
- type Resource
- type ResourceInstance
- type ResourceList
- type ResourceResponse
- type ResponseBody
- type ResponseStatus
- type TrafficTarget
Constants ¶
This section is empty.
Variables ¶
var ( // Config contains the Akamai OPEN Edgegrid API credentials // for automatic signing of requests Config edgegrid.Config )
Functions ¶
func IsConfigGTMError ¶
Types ¶
type AsAssignment ¶
type AsAssignment struct { DatacenterBase AsNumbers []int64 `json:"asNumbers,omitempty"` }
AsAssignment represents a GTM asmap assignment structure
type AsMap ¶
type AsMap struct { DefaultDatacenter *DatacenterBase `json:"defaultDatacenter"` Assignments []*AsAssignment `json:"assignments,omitempty"` Name string `json:"name"` Links []*Link `json:"links,omitempty"` }
AsMap represents a GTM AsMap
func (*AsMap) Create ¶
func (as *AsMap) Create(domainName string) (*AsMapResponse, error)
Create asMap in provided domain
func (*AsMap) Delete ¶
func (as *AsMap) Delete(domainName string) (*ResponseStatus, error)
Delete AsMap method
func (*AsMap) NewAssignment ¶
func (as *AsMap) NewAssignment(dcID int, nickname string) *AsAssignment
Instantiate new Assignment struct
func (*AsMap) NewDefaultDatacenter ¶
func (as *AsMap) NewDefaultDatacenter(dcID int) *DatacenterBase
Instantiate new Default Datacenter Struct
type AsMapResponse ¶
type AsMapResponse struct { Resource *AsMap `json:"resource"` Status *ResponseStatus `json:"status"` }
type CidrAssignment ¶
type CidrAssignment struct { DatacenterBase Blocks []string `json:"blocks,omitempty"` }
CidrAssignment represents a GTM cidr assignment element
type CidrMap ¶
type CidrMap struct { DefaultDatacenter *DatacenterBase `json:"defaultDatacenter"` Assignments []*CidrAssignment `json:"assignments,omitempty"` Name string `json:"name"` Links []*Link `json:"links,omitempty"` }
CidrMap represents a GTM cidrMap element
func GetCidrMap ¶
GetCidrMap retrieves a CidrMap with the given name.
func ListCidrMaps ¶
ListCidrMap retreieves all CidrMaps
func (*CidrMap) Create ¶
func (cidr *CidrMap) Create(domainName string) (*CidrMapResponse, error)
Create CidrMap in provided domain
func (*CidrMap) Delete ¶
func (cidr *CidrMap) Delete(domainName string) (*ResponseStatus, error)
Delete CidrMap method
func (*CidrMap) NewAssignment ¶
func (cidr *CidrMap) NewAssignment(dcid int, nickname string) *CidrAssignment
Instantiate new Assignment struct
func (*CidrMap) NewDefaultDatacenter ¶
func (cidr *CidrMap) NewDefaultDatacenter(dcid int) *DatacenterBase
Instantiate new Default Datacenter Struct
type CidrMapList ¶
type CidrMapList struct {
CidrMapItems []*CidrMap `json:"items"`
}
CidrMapList represents a GTM returned cidrmap list body
type CidrMapResponse ¶
type CidrMapResponse struct { Resource *CidrMap `json:"resource"` Status *ResponseStatus `json:"status"` }
type CommonError ¶
type CommonError struct {
// contains filtered or unexported fields
}
func (CommonError) Error ¶
func (e CommonError) Error() string
func (CommonError) FailedToSave ¶
func (CommonError) FailedToSave() bool
func (CommonError) GetItem ¶
func (e CommonError) GetItem(itemName string) interface{}
func (CommonError) Network ¶
func (e CommonError) Network() bool
func (CommonError) NotFound ¶
func (e CommonError) NotFound() bool
func (CommonError) SetItem ¶
func (e CommonError) SetItem(itemName string, itemVal interface{})
func (CommonError) ValidationFailed ¶
func (e CommonError) ValidationFailed() bool
type ConfigGTMError ¶
type Datacenter ¶
type Datacenter struct { City string `json:"city,omitempty"` CloneOf int `json:"cloneOf,omitempty"` CloudServerTargeting bool `json:"cloudServerTargeting"` Continent string `json:"continent,omitempty"` Country string `json:"country,omitempty"` DefaultLoadObject *LoadObject `json:"defaultLoadObject,omitempty"` Latitude float64 `json:"latitude,omitempty"` Links []*Link `json:"links,omitempty"` Longitude float64 `json:"longitude,omitempty"` Nickname string `json:"nickname,omitempty"` PingInterval int `json:"pingInterval,omitempty"` PingPacketSize int `json:"pingPacketSize,omitempty"` DatacenterId int `json:"datacenterId,omitempty"` ScorePenalty int `json:"scorePenalty,omitempty"` ServermonitorLivenessCount int `json:"servermonitorLivenessCount,omitempty"` ServermonitorLoadCount int `json:"servermonitorLoadCount,omitempty"` ServermonitorPool string `json:"servermonitorPool,omitempty"` StateOrProvince string `json:"stateOrProvince,omitempty"` Virtual bool `json:"virtual"` }
Datacenter represents a GTM datacenter
func GetDatacenter ¶
func GetDatacenter(dcID int, domainName string) (*Datacenter, error)
GetDatacenter retrieves a Datacenter with the given name. NOTE: Id arg is int!
func ListDatacenters ¶
func ListDatacenters(domainName string) ([]*Datacenter, error)
ListDatacenters retreieves all Datacenters
func (*Datacenter) Create ¶
func (dc *Datacenter) Create(domainName string) (*DatacenterResponse, error)
Create the datacenter identified by the receiver argument in the specified domain.
func (*Datacenter) Delete ¶
func (dc *Datacenter) Delete(domainName string) (*ResponseStatus, error)
Delete the datacenter identified by the receiver argument from the domain specified.
func (*Datacenter) Update ¶
func (dc *Datacenter) Update(domainName string) (*ResponseStatus, error)
Update the datacenter identified in the receiver argument in the provided domain.
type DatacenterBase ¶
type DatacenterBase struct { Nickname string `json:"nickname"` DatacenterId int `json:"datacenterId"` }
func NewDatacenterBase ¶
func NewDatacenterBase() *DatacenterBase
NewDatacenterBase returns a new DatacenterBase structure
type DatacenterList ¶
type DatacenterList struct {
DatacenterItems []*Datacenter `json:"items"`
}
type DatacenterResponse ¶
type DatacenterResponse struct { Status *ResponseStatus `json:"status"` Resource *Datacenter `json:"resource"` }
func NewDatacenterResponse ¶
func NewDatacenterResponse() *DatacenterResponse
NewDatacenterResponse instantiates a new DatacenterResponse structure
type Domain ¶
type Domain struct { Name string `json:"name"` Type string `json:"type"` AsMaps []*AsMap `json:"asMaps,omitempty"` Resources []*Resource `json:"resources,omitempty"` DefaultUnreachableThreshold float32 `json:"defaultUnreachableThreshold,omitempty"` EmailNotificationList []string `json:"emailNotificationList,omitempty"` MinPingableRegionFraction float32 `json:"minPingableRegionFraction,omitempty"` DefaultTimeoutPenalty int `json:"defaultTimeoutPenalty,omitempty"` Datacenters []*Datacenter `json:"datacenters,omitempty"` ServermonitorLivenessCount int `json:"servermonitorLivenessCount,omitempty"` RoundRobinPrefix string `json:"roundRobinPrefix,omitempty"` ServermonitorLoadCount int `json:"servermonitorLoadCount"` PingInterval int `json:"pingInterval"` MaxTTL int64 `json:"maxTTL,omitempty"` LoadImbalancePercentage float64 `json:"loadImbalancePercentage,omitempty"` DefaultHealthMax float64 `json:"defaultHealthMax,omitempty"` LastModified string `json:"lastModified,omitempty"` Status *ResponseStatus `json:"status,omitempty"` MapUpdateInterval int `json:"mapUpdateInterval,omitempty"` MaxProperties int `json:"maxProperties,omitempty"` MaxResources int `json:"maxResources,omitempty"` DefaultSslClientPrivateKey string `json:"defaultSslClientPrivateKey,omitempty"` DefaultErrorPenalty int `json:"defaultErrorPenalty,omitempty"` Links []*Link `json:"links,omitempty"` Properties []*Property `json:"properties,omitempty"` MaxTestTimeout float64 `json:"maxTestTimeout,omitempty"` CnameCoalescingEnabled bool `json:"cnameCoalescingEnabled"` DefaultHealthMultiplier int `json:"defaultHealthMultiplier"` ServermonitorPool string `json:"servermonitorPool,omitempty"` LoadFeedback bool `json:"loadFeedback"` MinTTL int64 `json:"minTTL,omitempty"` GeographicMaps []*GeoMap `json:"geographicMaps,omitempty"` CidrMaps []*CidrMap `json:"cidrMaps,omitempty"` DefaultMaxUnreachablePenalty int `json:"defaultMaxUnreachablePenalty,omitempty"` DefaultHealthThreshold float64 `json:"defaultHealthThreshold,omitempty"` LastModifiedBy string `json:"lastModifiedBy,omitempty"` ModificationComments string `json:"modificationComments,omitempty"` MinTestInterval int `json:"minTestInterval,omitempty"` PingPacketSize int `json:"pingPacketSize,omitempty"` DefaultSslClientCertificate string `json:"defaultSslClientCertificate,omitempty"` }
The Domain data structure represents a GTM domain
func (*Domain) Create ¶
func (domain *Domain) Create(queryArgs map[string]string) (*DomainResponse, error)
Create is a method applied to a domain object resulting in creation.
func (*Domain) Delete ¶ added in v0.9.3
func (domain *Domain) Delete() (*ResponseStatus, error)
Delete is a method applied to a domain object resulting in removal.
type DomainItem ¶
type DomainItem struct { AcgId string `json:"acgId"` LastModified string `json:"lastModified"` Links []*Link `json:"links"` Name string `json:"name"` Status string `json:"status"` }
DomainItem is a DomainsList item
type DomainResponse ¶
type DomainResponse struct { Resource *Domain `json:"resource"` Status *ResponseStatus `json:"status"` }
Response structs by Entity Type
type DomainsList ¶
type DomainsList struct {
DomainItems []*DomainItem `json:"items"`
}
type GeoAssignment ¶
type GeoAssignment struct { DatacenterBase Countries []string `json:"countries,omitempty"` }
GeoAssigment represents a GTM geo assignment element
type GeoMap ¶
type GeoMap struct { DefaultDatacenter *DatacenterBase `json:"defaultDatacenter"` Assignments []*GeoAssignment `json:"assignments,omitempty"` Name string `json:"name"` Links []*Link `json:"links,omitempty"` }
GeoMap represents a GTM GeoMap
func ListGeoMaps ¶
ListGeoMap retreieves all GeoMaps
func (*GeoMap) Create ¶
func (geo *GeoMap) Create(domainName string) (*GeoMapResponse, error)
Create GeoMap in provided domain
func (*GeoMap) Delete ¶
func (geo *GeoMap) Delete(domainName string) (*ResponseStatus, error)
Delete GeoMap method
func (*GeoMap) NewAssignment ¶
func (geo *GeoMap) NewAssignment(dcID int, nickname string) *GeoAssignment
Instantiate new Assignment struct
func (*GeoMap) NewDefaultDatacenter ¶
func (geo *GeoMap) NewDefaultDatacenter(dcID int) *DatacenterBase
Instantiate new Default Datacenter Struct
type GeoMapList ¶
type GeoMapList struct {
GeoMapItems []*GeoMap `json:"items"`
}
GeoMapList represents the returned GTM GeoMap List body
type GeoMapResponse ¶
type GeoMapResponse struct { Resource *GeoMap `json:"resource"` Status *ResponseStatus `json:"status"` }
type LivenessTest ¶
type LivenessTest struct { Name string `json:"name"` ErrorPenalty float64 `json:"errorPenalty"` PeerCertificateVerification bool `json:"peerCertificateVerification"` TestInterval int `json:"testInterval,omitempty"` TestObject string `json:"testObject,omitempty"` Links []*Link `json:"links,omitempty"` RequestString string `json:"requestString,omitempty"` ResponseString string `json:"responseString,omitempty"` HttpError3xx bool `json:"httpError3xx"` HttpError4xx bool `json:"httpError4xx"` HttpError5xx bool `json:"httpError5xx"` TestObjectProtocol string `json:"testObjectProtocol,omitempty"` TestObjectPassword string `json:"testObjectPassword,omitempty"` TestObjectPort int `json:"testObjectPort,omitempty"` SslClientPrivateKey string `json:"sslClientPrivateKey,omitempty"` SslClientCertificate string `json:"sslClientCertificate,omitempty"` DisableNonstandardPortWarning bool `json:"disableNonstandardPortWarning"` HostHeader string `json:"hostHeader,omitempty"` TestObjectUsername string `json:"testObjectUsername,omitempty"` TestTimeout float32 `json:"testTimeout,omitempty"` TimeoutPenalty float64 `json:"timeoutPenalty,omitempty"` AnswersRequired bool `json:"answersRequired"` ResourceType string `json:"resourceType,omitempty"` RecursionRequested bool `json:"recursionRequested"` }
type LoadObject ¶
type LoadObject struct { LoadObject string `json:"loadObject,omitempty"` LoadObjectPort int `json:"loadObjectPort,omitempty"` LoadServers []string `json:"loadServers,omitempty"` }
func NewLoadObject ¶
func NewLoadObject() *LoadObject
NewLoadObject returns a new LoadObject structure
type MxRecord ¶
type MxRecord struct { Exchange string `json:"exchange,omitempty"` Preference int `json:"preference,omitempty"` }
MxRecord struc
type Property ¶
type Property struct { Name string `json:"name"` Type string `json:"type"` Ipv6 bool `json:"ipv6"` ScoreAggregationType string `json:"scoreAggregationType,omitempty"` StickinessBonusPercent int `json:"stickinessBonusPercentage,omitempty"` StickinessBonusConstant int `json:"stickinessBonusConstant,omitempty"` HealthThreshold float64 `json:"healthThreshold,omitempty"` UseComputedTargets bool `json:"useComputedTargets"` BackupIp string `json:"backupIp,omitempty"` BalanceByDownloadScore bool `json:"balanceByDownloadScore"` StaticTTL int `json:"staticTTL,omitempty"` LastModified string `json:"lastModified,omitempty"` UnreachableThreshold float64 `json:"unreachableThreshold,omitempty"` HealthMultiplier float64 `json:"healthMultiplier,omitempty"` DynamicTTL int `json:"dynamicTTL,omitempty"` MaxUnreachablePenalty int `json:"maxUnreachablePenalty,omitempty"` MapName string `json:"mapName,omitempty"` HandoutLimit int `json:"handoutLimit,omitempty"` HandoutMode string `json:"handoutMode,omitempty"` FailoverDelay int `json:"failoverDelay,omitempty"` BackupCName string `json:"backupCName,omitempty"` FailbackDelay int `json:"failbackDelay,omitempty"` LoadImbalancePercentage float64 `json:"loadImbalancePercentage,omitempty"` HealthMax float64 `json:"healthMax,omitempty"` GhostDemandReporting bool `json:"ghostDemandReporting"` Comments string `json:"comments,omitempty"` CName string `json:"cname,omitempty"` WeightedHashBitsForIPv4 int `json:"weightedHashBitsForIPv4,omitempty"` WeightedHashBitsForIPv6 int `json:"weightedHashBitsForIPv6,omitempty"` TrafficTargets []*TrafficTarget `json:"trafficTargets,omitempty"` MxRecords []*MxRecord `json:"mxRecords,omitempty"` Links []*Link `json:"links,omitempty"` LivenessTests []*LivenessTest `json:"livenessTests,omitempty"` }
Property represents a GTM property
func GetProperty ¶
GetProperty retrieves a Property with the given name.
func ListProperties ¶
ListProperties retreieves all Properties for the provided domainName.
func NewProperty ¶
NewProperty creates a new Property object.
func (*Property) Create ¶
func (property *Property) Create(domainName string) (*PropertyResponse, error)
Create the property in the receiver argument in the specified domain.
func (*Property) Delete ¶
func (property *Property) Delete(domainName string) (*ResponseStatus, error)
Delete the property identified by the receiver argument from the domain provided.
func (*Property) NewLivenessTest ¶
func (prop *Property) NewLivenessTest(name string, objproto string, interval int, timeout float32) *LivenessTest
NewLivenessTest is a method applied to a property object that instantiates a LivenessTest object.
func (*Property) NewMxRecord ¶
NewMxRecord is a method applied to a property object that instantiates an MxRecord object.
func (*Property) NewTrafficTarget ¶
func (prop *Property) NewTrafficTarget() *TrafficTarget
NewTrafficTarget is a method applied to a property object that instantiates a TrafficTarget object.
type PropertyList ¶
type PropertyList struct {
PropertyItems []*Property `json:"items"`
}
type PropertyResponse ¶
type PropertyResponse struct { Resource *Property `json:"resource"` Status *ResponseStatus `json:"status"` }
type Resource ¶
type Resource struct { Type string `json:"type"` HostHeader string `json:"hostHeader,omitempty"` LeastSquaresDecay float64 `json:"leastSquaresDecay,omitempty"` Description string `json:"description,omitempty"` LeaderString string `json:"leaderString,omitempty"` ConstrainedProperty string `json:"constrainedProperty,omitempty"` ResourceInstances []*ResourceInstance `json:"resourceInstances,omitempty"` AggregationType string `json:"aggregationType,omitempty"` Links []*Link `json:"links,omitempty"` LoadImbalancePercentage float64 `json:"loadImbalancePercentage,omitempty"` UpperBound int `json:"upperBound,omitempty"` Name string `json:"name"` MaxUMultiplicativeIncrement float64 `json:"maxUMultiplicativeIncrement,omitempty"` DecayRate float64 `json:"decayRate,omitempty"` }
Resource represents a GTM resource
func GetResource ¶
GetResource retrieves a Resource with the given name in the specified domain.
func ListResources ¶
ListResources retreieves all Resources in the specified domain.
func NewResource ¶
NewResource creates a new Resource object.
func (*Resource) Create ¶
func (rsrc *Resource) Create(domainName string) (*ResourceResponse, error)
Create the resource identified by the receiver argument in the specified domain.
func (*Resource) Delete ¶
func (rsrc *Resource) Delete(domainName string) (*ResponseStatus, error)
Delete the resource identified in the receiver argument from the specified domain.
func (*Resource) NewResourceInstance ¶
func (rsrc *Resource) NewResourceInstance(dcID int) *ResourceInstance
NewResourceInstance instantiates a new ResourceInstance.
type ResourceInstance ¶
type ResourceInstance struct { DatacenterId int `json:"datacenterId"` UseDefaultLoadObject bool `json:"useDefaultLoadObject"` LoadObject }
ResourceInstance
type ResourceList ¶
type ResourceList struct {
ResourceItems []*Resource `json:"items"`
}
ResourceList is the structure returned by List Resources
type ResourceResponse ¶
type ResourceResponse struct { Resource *Resource `json:"resource"` Status *ResponseStatus `json:"status"` }
type ResponseBody ¶
type ResponseBody struct { Resource interface{} `json:"resource"` Status *ResponseStatus `json:"status"` }
Generic response structs
type ResponseStatus ¶
type ResponseStatus struct { ChangeId string `json:"changeId,omitempty"` Links *[]Link `json:"links,omitempty"` Message string `json:"message,omitempty"` PassingValidation bool `json:"passingValidation,omitempty"` PropagationStatus string `json:"propagationStatus,omitempty"` PropagationStatusDate string `json:"propagationStatusDate,omitempty"` }
response Status is returned on Create, Update or Delete operations for all entity types
func GetDomainStatus ¶
func GetDomainStatus(domainName string) (*ResponseStatus, error)
GetStatus retrieves current status for the given domainname.
func NewResponseStatus ¶
func NewResponseStatus() *ResponseStatus
NewResponseStatus returns a new ResponseStatus struct
type TrafficTarget ¶
type TrafficTarget struct { DatacenterId int `json:"datacenterId"` Enabled bool `json:"enabled"` Weight float64 `json:"weight,omitempty"` Servers []string `json:"servers,omitempty"` Name string `json:"name,omitempty"` HandoutCName string `json:"handoutCName,omitempty"` }
TrafficTarget struc