Skip to content

Commit

Permalink
Merge pull request #71 from akamai/gtm_schema_1.4
Browse files Browse the repository at this point in the history
Gtm schema 1.4
  • Loading branch information
edglynes authored Feb 18, 2020
2 parents c993444 + aec4de6 commit fd2a4de
Show file tree
Hide file tree
Showing 16 changed files with 258 additions and 258 deletions.
6 changes: 3 additions & 3 deletions configgtm-v1_3/asmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ import (
// AsAssignment represents a GTM asmap assignment structure
type AsAssignment struct {
DatacenterBase
AsNumbers []int64 `json:"asNumbers"`
AsNumbers []int64 `json:"asNumbers,omitempty"`
}

// AsMap represents a GTM AsMap
type AsMap struct {
DefaultDatacenter *DatacenterBase `json:"defaultDatacenter"`
Assignments []*AsAssignment `json:"assignments"`
Assignments []*AsAssignment `json:"assignments,omitempty"`
Name string `json:"name"`
Links []*Link `json:"links"`
Links []*Link `json:"links,omitempty"`
}

// NewAsMap creates a new asMap
Expand Down
6 changes: 3 additions & 3 deletions configgtm-v1_3/cidrmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ import (
//CidrAssignment represents a GTM cidr assignment element
type CidrAssignment struct {
DatacenterBase
Blocks []string `json:"blocks"`
Blocks []string `json:"blocks,omitempty"`
}

// CidrMap represents a GTM cidrMap element
type CidrMap struct {
DefaultDatacenter *DatacenterBase `json:"defaultDatacenter"`
Assignments []*CidrAssignment `json:"assignments"`
Assignments []*CidrAssignment `json:"assignments,omitempty"`
Name string `json:"name"`
Links []*Link `json:"links"`
Links []*Link `json:"links,omitempty"`
}

// CidrMapList represents a GTM returned cidrmap list body
Expand Down
18 changes: 9 additions & 9 deletions configgtm-v1_3/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ func setVersionHeader(req *http.Request, version string) {

// response Status is returned on Create, Update or Delete operations for all entity types
type ResponseStatus struct {
ChangeId string `json:"changeId"`
Links *[]Link `json:"links"`
Message string `json:"message"`
PassingValidation bool `json:"passingValidation"`
PropagationStatus string `json:"propagationStatus"`
PropagationStatusDate string `json:"propagationStatusDate"`
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"`
}

// NewResponseStatus returns a new ResponseStatus struct
Expand Down Expand Up @@ -108,9 +108,9 @@ type Link struct {

//
type LoadObject struct {
LoadObject string `json:"loadObject"`
LoadObjectPort int `json:"loadObjectPort"`
LoadServers []string `json:"loadServers"`
LoadObject string `json:"loadObject,omitempty"`
LoadObjectPort int `json:"loadObjectPort,omitempty"`
LoadServers []string `json:"loadServers,omitempty"`
}

// NewLoadObject returns a new LoadObject structure
Expand Down
34 changes: 17 additions & 17 deletions configgtm-v1_3/datacenter.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,24 +14,24 @@ import (

// Datacenter represents a GTM datacenter
type Datacenter struct {
City string `json:"city"`
CloneOf int `json:"cloneOf"`
City string `json:"city,omitempty"`
CloneOf int `json:"cloneOf,omitempty"`
CloudServerTargeting bool `json:"cloudServerTargeting"`
Continent string `json:"continent"`
Country string `json:"country"`
DefaultLoadObject *LoadObject `json:"defaultLoadObject"`
Latitude float64 `json:"latitude"`
Links []*Link `json:"links"`
Longitude float64 `json:"longitude"`
Nickname string `json:"nickname"`
PingInterval int `json:"pingInterval"`
PingPacketSize int `json:"pingPacketSize"`
DatacenterId int `json:"datacenterId"`
ScorePenalty int `json:"scorePenalty"`
ServermonitorLivenessCount int `json:"servermonitorLivenessCount"`
ServermonitorLoadCount int `json:"servermonitorLoadCount"`
ServermonitorPool string `json:"servermonitorPool"`
StateOrProvince string `json:"stateOrProvince"`
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"`
}

Expand Down
66 changes: 33 additions & 33 deletions configgtm-v1_3/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,44 +16,44 @@ import (
type Domain struct {
Name string `json:"name"`
Type string `json:"type"`
AsMaps []*AsMap `json:"asMaps"`
Resources []*Resource `json:"resources"`
DefaultUnreachableThreshold float32 `json:"defaultUnreachableThreshold"`
EmailNotificationList []string `json:"emailNotificationList"`
MinPingableRegionFraction float32 `json:"minPingableRegionFraction"`
DefaultTimeoutPenalty int `json:"defaultTimeoutPenalty"`
Datacenters []*Datacenter `json:"datacenters"`
ServermonitorLivenessCount int `json:"servermonitorLivenessCount"`
RoundRobinPrefix string `json:"roundRobinPrefix"`
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"`
LoadImbalancePercentage float64 `json:"loadImbalancePercentage"`
DefaultHealthMax int `json:"defaultHealthMax"`
LastModified string `json:"lastModified"`
Status *ResponseStatus `json:"status"`
MapUpdateInterval int `json:"mapUpdateInterval"`
MaxProperties int `json:"maxProperties"`
MaxResources int `json:"maxResources"`
DefaultSslClientPrivateKey string `json:"defaultSslClientPrivateKey"`
DefaultErrorPenalty int `json:"defaultErrorPenalty"`
Links []*Link `json:"links"`
Properties []*Property `json:"properties"`
MaxTestTimeout float64 `json:"maxTestTimeout"`
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"`
ServermonitorPool string `json:"servermonitorPool,omitempty"`
LoadFeedback bool `json:"loadFeedback"`
MinTTL int64 `json:"minTTL"`
GeographicMaps []*GeoMap `json:"geographicMaps"`
CidrMaps []*CidrMap `json:"cidrMaps"`
DefaultMaxUnreachablePenalty int `json:"defaultMaxUnreachablePenalty"`
DefaultHealthThreshold int `json:"defaultHealthThreshold"`
LastModifiedBy string `json:"lastModifiedBy"`
ModificationComments string `json:"modificationComments"`
MinTestInterval int `json:"minTestInterval"`
PingPacketSize int `json:"pingPacketSize"`
DefaultSslClientCertificate string `json:"defaultSslClientCertificate"`
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"`
}

type DomainsList struct {
Expand Down
6 changes: 3 additions & 3 deletions configgtm-v1_3/geomap.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ import (
// GeoAssigment represents a GTM geo assignment element
type GeoAssignment struct {
DatacenterBase
Countries []string `json:"countries"`
Countries []string `json:"countries,omitempty"`
}

// GeoMap represents a GTM GeoMap
type GeoMap struct {
DefaultDatacenter *DatacenterBase `json:"defaultDatacenter"`
Assignments []*GeoAssignment `json:"assignments"`
Assignments []*GeoAssignment `json:"assignments,omitempty"`
Name string `json:"name"`
Links []*Link `json:"links"`
Links []*Link `json:"links,omitempty"`
}

// GeoMapList represents the returned GTM GeoMap List body
Expand Down
100 changes: 50 additions & 50 deletions configgtm-v1_3/property.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,42 +15,42 @@ import (
type TrafficTarget struct {
DatacenterId int `json:"datacenterId"`
Enabled bool `json:"enabled"`
Weight float64 `json:"weight"`
Servers []string `json:"servers"`
Name string `json:"name"`
HandoutCName string `json:"handoutCName"`
Weight float64 `json:"weight,omitempty"`
Servers []string `json:"servers,omitempty"`
Name string `json:"name,omitempty"`
HandoutCName string `json:"handoutCName,omitempty"`
}

// MxRecord struc
type MxRecord struct {
Exchange string `json:"exchange"`
Preference int `json:"preference"`
Exchange string `json:"exchange,omitempty"`
Preference int `json:"preference,omitempty"`
}

type LivenessTest struct {
Name string `json:"name"`
ErrorPenalty int `json:"errorPenalty"`
ErrorPenalty float64 `json:"errorPenalty"`
PeerCertificateVerification bool `json:"peerCertificateVerification"`
TestInterval int `json:"testInterval"`
TestObject string `json:"testObject"`
Links []*Link `json:"links"`
RequestString string `json:"requestString"`
ResponseString string `json:"responseString"`
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"`
TestObjectPassword string `json:"testObjectPassword"`
TestObjectPort int `json:"testObjectPort"`
SslClientPrivateKey string `json:"sslClientPrivateKey"`
SslClientCertificate string `json:"sslClientCertificate"`
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"`
TestObjectUsername string `json:"testObjectUsername"`
TestTimeout float32 `json:"testTimeout"`
TimeoutPenalty int `json:"timeoutPenalty"`
AnswerRequired bool `json:"answerRequired"`
ResourceType string `json:"resourceType"`
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"`
}

Expand All @@ -59,36 +59,36 @@ type Property struct {
Name string `json:"name"`
Type string `json:"type"`
Ipv6 bool `json:"ipv6"`
ScoreAggregationType string `json:"scoreAggregationType"`
StickinessBonusPercent int `json:"stickinessBonusPercentage"`
StickinessBonusConstant int `json:"stickinessBonusConstant"`
HealthThreshold int `json:"healthThreshold"`
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"`
BackupIp string `json:"backupIp,omitempty"`
BalanceByDownloadScore bool `json:"balanceByDownloadScore"`
StaticTTL int `json:"staticTTL"`
LastModified string `json:"lastModified"`
UnreachableThreshold int `json:"unreachableThreshold"`
HealthMultiplier int `json:"healthMultiplier"`
DynamicTTL int `json:"dynamicTTL"`
MaxUnreachablePenalty int `json:"maxUnreachablePenalty"`
MapName string `json:"mapName"`
HandoutLimit int `json:"handoutLimit"`
HandoutMode string `json:"handoutMode"`
FailoverDelay int `json:"failoverDelay"`
BackupCName string `json:"backupCName"`
FailbackDelay int `json:"failbackDelay"`
LoadImbalancePercentage float64 `json:"loadImbalancePercentage"`
HealthMax int `json:"healthMax"`
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"`
CName string `json:"cname"`
WeightedHashBitsForIPv4 int `json:"weightedHashBitsForIPv4"`
WeightedHashBitsForIPv6 int `json:"weightedHashBitsForIPv6"`
TrafficTargets []*TrafficTarget `json:"trafficTargets"`
MxRecords []*MxRecord `json:"mxRecords"`
Links []*Link `json:"links"`
LivenessTests []*LivenessTest `json:"livenessTests"`
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"`
}

type PropertyList struct {
Expand Down
Loading

0 comments on commit fd2a4de

Please sign in to comment.