Documentation ¶
Overview ¶
Package tc provides structures, constants, and functions that are used throughout the components of Apache Traffic Control.
In general, the symbols defined here should be used by more than one component of Traffic Control - otherwise it can just appear in the only component that needs it. Most often this means that the symbols herein defined are referring to objects and/or concepts exposed through the Traffic Ops API, and usually serve to define payloads of HTTP requests and responses.
Enumerated Types ¶
Enumerated types - which should typically go in enum.go - should be treated as enumerables, and MUST NOT be cast as anything else (integer, strings, etc.). Enums MUST NOT be compared to strings or integers via casting. Enumerable data SHOULD be stored as the enumeration, not as a string or number. The *only* reason they are internally represented as strings, is to make them implicitly serialize to human-readable JSON. They should not be treated as strings. Casting or storing strings or numbers defeats the purpose of enum safety and conveniences.
An example of an enumerated string type 'Foo' and an enumerated integral (or arbitrary) type 'Bar' are shown below:
type Foo string const ( FooA Foo = "A" FooB Foo = "B" ) type Bar int const ( BarTest Bar = iota BarQuest )
Note the way each member of the "enum" is prefixed with the type name, to help avoid collisions. Also note how, for string enumerations, the type must be repeated with each assignment, whereas for an arbitrary enumeration, you can make use of the special 'iota' language constant to start with some arbitrary value and then just make names on subsequent lines to implicitly increment from there, while maintaining proper type.
Enumerables that need to be serialized and deserialized in JSON should use strings to make them easiest to understand and work with (serialization will work out-of-the-box that way). One way to implement type safety for enumerated types that require serialization support is to implement the encoding/json.Unmarshaler interface and return an error for unsupported values. However, note that this causes the unmarshaling to halt immediately, which is fast but if there are other errors in the JSON document that would be encountered later, they will not be reported. Therefore, types used in structures that the Traffic Ops API unmarshals should generally instead use an "invalid" value that indicates the problem but allows parsing to continue. The way this is normally done is with a 'FromString' method like so:
type Foo string const ( FooA Foo = "A" FooB Foo = "B" FooInvalid = "" ) func FooFromString(foo string) Foo { switch foo { case FooA: fallthrough case FooB: return Foo(foo) } return FooInvalid }
However, this requires postprocessing after deserialization, so one might instead implement encoding/json.Unmarshaler:
import "errors" type Foo string const ( FooA Foo = "A" FooB Foo = "B" FooInvalid = "" ) func (f *Foo) UnmarshalJSON(data []byte) error { if string(data) == "null" { return errors.New("'null' is not a valid 'Foo'") } s := strings.Trim(string(data), "\"") switch s { case FooA: fallthrough case FooB: *f = Foo(s) return } // This is an invalid *value* not a parse error, so we don't return // an error and instead just make it clear that the value was // invalid. *f = FooInvalid return nil }
Though in this case the original, raw, string value of the 'Foo' is lost. Be aware of the limitations of these two designs during implementation.
When storing enumumerable data in memory, it SHOULD be converted to and stored as an enum via the corresponding `FromString` function, checked whether the conversion failed and Invalid values handled, and valid data stored as the enum. This guarantees stored data is valid, and catches invalid input as soon as possible.
Conversion functions, whether they be a 'FromString' function or an UnmarshalJSON method, should not be case-insensitive.
When adding new enum types, enums should be internally stored as strings, so they implicitly serialize as human-readable JSON, unless the performance or memory of integers is necessary (it almost certainly isn't). Enums should always have the "invalid" value as the empty string (or 0), so default-initialized enums are invalid.
Enums should always have a String() method, that way they implement fmt.Stringer and can be easily represented in a human-readable way.
When to Use Custom Types ¶
A type should be defined whenever there is a need to represent a data *structure* (in a 'struct'), or whenever the type has some enforced semantics. For example, enumerated types have the attached semantic that there is a list of valid values, and generally there are methods and/or functions associated with those types that act on that limitation. On the otherhand, if there is a type 'Foo' that has some property 'Bar' that contains arbitrary textual data with no other semantics or limitations, then 'string' is the appropriate type; there is no need to make a type 'FooBar' to express the relationship between a Foo and its Bar - that's the job of the Go language itself.
Similarly, try to avoid duplication. For example, Parameters can be assigned to Profiles or (in legacy code that may have been removed by the time this is being read) Cache Groups. It was not necessary to create a type CacheGroupParameter that contains all of the same data as a regular Parameter simply because of this relationship.
Versioning Structures ¶
Structures used by the Traffic Ops API may change over time as the API itself changes. Typically, each new major API version will cause some breaking change to some structure in this package. This means that a new structure will need to be created to avoid breaking old clients that are deprecated but still supported. The naming convention for a new version of a structure that represents a Foo object in the new version - say, 2.0 - is to call it FooV20. Then, a more general type alias should be made for the API major version for use in client methods (so that they can be silently upgraded for non-breaking changes) - in this case: FooV2. A deprecation notice should then be added to the legacy type (which is hopefully but not necessarily named FooV1/FooV11 etc.) indicating the new structure. For example:
// FooV11 represents a Foo in TO APIv1.1. // // Deprecated: TO APIv1.1 is deprecated; upgrade to FooV2. type FooV11 struct { Bar string `json:"bar"` } // FooV1 represents a Foo in the latest minor version of TO APIv1. // // Deprecated: TO APIv1 is deprecated; upgrade to FooV2. type FooV1 = FooV11 // FooV20 represents a Foo in TO APIv2.0. type FooV20 struct { Bar string `json:"bar"` } // FooV2 represents a Foo in the latest minor version of TO APIv2. type FooV2 = FooV20
Note that there is no type alias simply named "Foo" - that is exactly how it should be.
Legacy types may not include version information - newer versions should add it as described above. Legacy types may also include the word "Nullable" somewhere - strip this out! That word included in a type name is only to differentiate between older structures that were not "nullable" and the newer ones. Newly added types should only have one structure that is as "nullable" or "non-nullable" as it needs to be, so there is no need to specify.
Index ¶
- Constants
- Variables
- func CDNExistsByName(name string, tx *sql.Tx) (bool, error)
- func CRStatesMarshall(states CRStates) ([]byte, error)
- func DurationLiteralToSeconds(d string) (int64, error)
- func GetDSTypeCategory(dsType string) string
- func GetRenewalKid(set jwk.Set) *string
- func GetTypeData(tx *sql.Tx, id int) (string, string, bool, error)
- func IsReservedStatus(status string) bool
- func IsValidCacheType(s string) bool
- func LegacyMonitorConfigValid(cfg *LegacyTrafficMonitorConfigMap) errordeprecated
- func MessagesToString(msgs []influx.Message) string
- func ParamExists(id int64, tx *sql.Tx) (bool, error)
- func ParamsExist(ids []int64, tx *sql.Tx) ([]int64, error)
- func ProfileExistsByID(id int64, tx *sql.Tx) (bool, error)
- func ProfileExistsByName(name string, tx *sql.Tx) (bool, error)
- func ProfilesExistByIDs(ids []int64, tx *sql.Tx) (bool, error)
- func ValidateJobUniqueness(tx *sql.Tx, dsID uint, startTime time.Time, assetURL string, ttlHours uint) []string
- func ValidateTypeID(tx *sql.Tx, typeID *int, expectedUseInTable string) (string, error)
- type APICapability
- type APICapabilityResponse
- type ASN
- type ASNNullable
- type ASNResponse
- type ASNResponseV5
- type ASNResponseV50
- type ASNV5
- type ASNV50
- type ASNsResponse
- type ASNsResponseV5
- type ASNsResponseV50
- type ASNsV11
- type AcmeAccount
- type Alert
- type AlertLevel
- type Alerts
- type AllCacheGroupParametersResponsedeprecated
- type AllDeliveryServiceFederationsMapping
- type AllFederationCDN
- type AssignFederationFederationResolversResponse
- type AssignFederationResolversRequest
- type AssignedDsResponse
- type AsyncStatus
- type AsyncStatusResponse
- type CDN
- type CDNConfig
- type CDNDNSSECGenerateReq
- type CDNDNSSECGenerateReqDate
- type CDNDNSSECKeysResponse
- type CDNFederation
- type CDNFederationDeliveryService
- type CDNFederationResponse
- type CDNFederationV5
- type CDNFederationV5Response
- type CDNFederationsV5Response
- type CDNGenerateKSKReq
- type CDNLock
- type CDNLockCreateResponse
- type CDNLockDeleteResponse
- type CDNLocksGetResponse
- type CDNName
- type CDNNotification
- type CDNNotificationRequest
- type CDNNotificationsResponse
- type CDNNullable
- type CDNQueueUpdateRequest
- type CDNQueueUpdateResponse
- type CDNResponse
- type CDNSSLKey
- type CDNSSLKeyCert
- type CDNSSLKeys
- type CDNSSLKeysCertificate
- type CDNSSLKeysRespdeprecated
- type CDNSSLKeysResponse
- type CDNV5
- type CDNsResponse
- type CDNsV5Response
- type CRConfig
- type CRConfigBackupLocations
- type CRConfigBypassDestination
- type CRConfigConfig
- type CRConfigDeliveryService
- type CRConfigDeliveryServiceProtocol
- type CRConfigDispersion
- type CRConfigGeoEnabled
- type CRConfigLatitudeLongitude
- type CRConfigLatitudeLongitudeShort
- type CRConfigMonitor
- type CRConfigRouter
- type CRConfigRouterStatus
- type CRConfigServerStatus
- type CRConfigStaticDNSEntry
- type CRConfigStats
- type CRConfigTTL
- type CRConfigTopology
- type CRConfigTrafficOpsServer
- type CRSStats
- type CRSStatsApp
- type CRSStatsStat
- type CRSStatsStats
- type CRStates
- type CRStatesDeliveryService
- type CacheGroup
- type CacheGroupDetailResponse
- type CacheGroupDetailResponseV5
- type CacheGroupDetailResponseV50
- type CacheGroupName
- type CacheGroupNullable
- type CacheGroupNullableV5
- type CacheGroupNullableV50
- type CacheGroupParameterdeprecated
- type CacheGroupParameterNullabledeprecated
- type CacheGroupParameterRequestdeprecated
- type CacheGroupParametersListdeprecated
- type CacheGroupParametersNullabledeprecated
- type CacheGroupParametersPostResponsedeprecated
- type CacheGroupParametersResponsedeprecated
- type CacheGroupParametersResponseNullabledeprecated
- type CacheGroupPostDSResp
- type CacheGroupPostDSRespResponse
- type CacheGroupV5
- type CacheGroupV50
- type CacheGroupsNullableResponse
- type CacheGroupsNullableResponseV5
- type CacheGroupsNullableResponseV50
- type CacheGroupsResponse
- type CacheGroupsResponseV5
- type CacheGroupsResponseV50
- type CacheName
- type CacheStatus
- type CacheType
- type CachegroupPostDSReq
- type CachegroupQueueUpdatesRequest
- type CachegroupQueueUpdatesRequestV5
- type CachegroupQueueUpdatesRequestV50
- type CachegroupTrimmedName
- type CachegroupTrimmedNameV5
- type CachegroupTrimmedNameV50
- type CapabilitiesResponse
- type Capability
- type CommonAPIData
- type CommonCheckFields
- type CommonServerProperties
- type ConfigFileName
- type Coordinate
- type CoordinateNullable
- type CoordinateResponse
- type CoordinateResponseV5
- type CoordinateV5
- type CoordinateV50
- type CoordinatesResponse
- type CoordinatesResponseV5
- type CoverageZoneFile
- type CoverageZoneLocation
- type CreateCDNFederationResponse
- type CreateDeliveryServiceNullableResponsedeprecated
- type CreateUserResponse
- type CreateUserResponseV4
- type CurrentStatsResponse
- type CurrentUserUpdateRequest
- type CurrentUserUpdateRequestUser
- type DNSSECKey
- type DNSSECKeyDSRecord
- type DNSSECKeyDSRecordRiak
- type DNSSECKeyDSRecordV11
- type DNSSECKeySet
- type DNSSECKeySetV11
- type DNSSECKeyV11
- type DNSSECKeys
- type DNSSECKeysRiakdeprecated
- type DNSSECKeysTrafficVault
- type DNSSECKeysV11
- type DSMatchType
- type DSRChangeType
- type DSSMapResponsedeprecated
- type DSSReplaceResponsedeprecated
- type DSServerdeprecated
- type DSServerBasedeprecated
- type DSServerBaseV4deprecated
- type DSServerIDs
- type DSServerResponseV30deprecated
- type DSServerResponseV4deprecated
- type DSServerResponseV40deprecated
- type DSServerResponseV5deprecated
- type DSServerResponseV50deprecated
- type DSServerV11deprecated
- type DSServerV4deprecated
- type DSServerV5deprecated
- type DSServerV50deprecated
- type DSServersResponsedeprecated
- type DSType
- type DSTypeCategory
- type DeepCachingType
- type DeleteCDNDNSSECKeysResponse
- type DeleteCDNFederationResponse
- type DeleteDeliveryServiceResponse
- type DeleteTenantResponsedeprecated
- type DeleteUserResponse
- type DeliveryServicedeprecated
- type DeliveryServiceAcmeSSLKeysReq
- type DeliveryServiceActiveState
- type DeliveryServiceAddSSLKeysReq
- type DeliveryServiceCacheGroup
- type DeliveryServiceCapacity
- type DeliveryServiceCapacityResponse
- type DeliveryServiceFederationResolverMapping
- type DeliveryServiceFederationResolverMappingRequest
- type DeliveryServiceFieldsV13deprecated
- type DeliveryServiceFieldsV14deprecated
- type DeliveryServiceFieldsV15deprecated
- type DeliveryServiceFieldsV30deprecated
- type DeliveryServiceFieldsV31deprecated
- type DeliveryServiceGenSSLKeysReq
- type DeliveryServiceHealth
- type DeliveryServiceHealthResponse
- type DeliveryServiceIDRegex
- type DeliveryServiceIDRegexResponse
- type DeliveryServiceIDs
- type DeliveryServiceMatch
- type DeliveryServiceName
- type DeliveryServiceNullabledeprecated
- type DeliveryServiceNullableFieldsV11deprecated
- type DeliveryServiceNullableV11deprecated
- type DeliveryServiceNullableV12deprecated
- type DeliveryServiceNullableV13deprecated
- type DeliveryServiceNullableV14deprecated
- type DeliveryServiceNullableV15deprecated
- type DeliveryServiceNullableV30deprecated
- type DeliveryServiceRegex
- type DeliveryServiceRegexPost
- type DeliveryServiceRegexResponse
- type DeliveryServiceRegexes
- type DeliveryServiceRegexesTest
- type DeliveryServiceRemovedFieldsV11deprecated
- type DeliveryServiceRequestdeprecated
- type DeliveryServiceRequestComment
- type DeliveryServiceRequestCommentNullable
- type DeliveryServiceRequestCommentV5
- type DeliveryServiceRequestCommentV50
- type DeliveryServiceRequestCommentsResponse
- type DeliveryServiceRequestCommentsResponseV5
- type DeliveryServiceRequestCommentsResponseV50
- type DeliveryServiceRequestDetailsdeprecated
- type DeliveryServiceRequestNullabledeprecated
- type DeliveryServiceRequestRequestdeprecated
- type DeliveryServiceRequestResponseV4
- type DeliveryServiceRequestResponseV40
- type DeliveryServiceRequestResponseV5
- type DeliveryServiceRequestV4
- type DeliveryServiceRequestV40
- func (dsr DeliveryServiceRequestV40) Downgrade() DeliveryServiceRequestNullable
- func (dsr DeliveryServiceRequestV40) IsClosed() bool
- func (dsr DeliveryServiceRequestV40) IsOpen() bool
- func (dsr *DeliveryServiceRequestV40) SetXMLID()
- func (dsr DeliveryServiceRequestV40) String() string
- func (dsrV40 DeliveryServiceRequestV40) Upgrade() DeliveryServiceRequestV41
- type DeliveryServiceRequestV41
- type DeliveryServiceRequestV5
- type DeliveryServiceRequestV50
- type DeliveryServiceRequestsResponseV4
- type DeliveryServiceRequestsResponseV40
- type DeliveryServiceRequestsResponseV5
- type DeliveryServiceResponseV5
- type DeliveryServiceSSLKeys
- type DeliveryServiceSSLKeysCertificate
- type DeliveryServiceSSLKeysGenerationResponse
- type DeliveryServiceSSLKeysReq
- type DeliveryServiceSSLKeysResponse
- type DeliveryServiceSSLKeysV15
- type DeliveryServiceSSLKeysV4
- type DeliveryServiceSSLKeysV40
- type DeliveryServiceSafeUpdateRequest
- type DeliveryServiceSafeUpdateResponse
- type DeliveryServiceSafeUpdateResponseV30
- type DeliveryServiceSafeUpdateResponseV4
- type DeliveryServiceSafeUpdateResponseV40
- type DeliveryServiceServerdeprecated
- type DeliveryServiceServerResponsedeprecated
- type DeliveryServiceServerResponseV5
- type DeliveryServiceServerResponseV50
- type DeliveryServiceServerV5
- type DeliveryServiceServerV50
- type DeliveryServiceServersdeprecated
- type DeliveryServiceUserPostdeprecated
- type DeliveryServiceV11deprecated
- type DeliveryServiceV13deprecated
- type DeliveryServiceV30deprecated
- type DeliveryServiceV31deprecated
- type DeliveryServiceV4
- func (ds DeliveryServiceV4) DowngradeToV31() DeliveryServiceNullableV30
- func (ds *DeliveryServiceV4) RemoveLD1AndLD2() DeliveryServiceV4
- func (ds *DeliveryServiceV4) Scan(src interface{}) error
- func (ds DeliveryServiceV4) Upgrade() DeliveryServiceV5
- func (ds *DeliveryServiceV4) Value() (driver.Value, error)
- type DeliveryServiceV40
- type DeliveryServiceV41
- type DeliveryServiceV5
- type DeliveryServiceV50
- type DeliveryServicesNullableResponsedeprecated
- type DeliveryServicesRequiredCapabilitiesResponse
- type DeliveryServicesRequiredCapability
- type DeliveryServicesResponseV30
- type DeliveryServicesResponseV4
- type DeliveryServicesResponseV40
- type DeliveryServicesResponseV41
- type DeliveryServicesResponseV5
- type DeliveryserviceserverResponse
- type Division
- type DivisionNullable
- type DivisionResponse
- type DivisionResponseV5
- type DivisionResponseV50
- type DivisionV5
- type DivisionV50
- type DivisionsResponse
- type DivisionsResponseV5
- type DivisionsResponseV50
- type Domain
- type DomainNullable
- type DomainsResponse
- type ErrorConstant
- type FederationDSPost
- type FederationDeliveryServiceNullable
- type FederationDeliveryServicesResponse
- type FederationFederationResolversResponse
- type FederationMapping
- type FederationNullable
- type FederationResolver
- type FederationResolverMapping
- type FederationResolverResponse
- type FederationResolverResponseV5
- type FederationResolverResponseV50
- type FederationResolverType
- type FederationResolverV5
- type FederationResolverV50
- type FederationResolversResponse
- type FederationResolversResponseV5
- type FederationResolversResponseV50
- type FederationUser
- type FederationUserPost
- type FederationUsersResponse
- type FederationsResponse
- type Filterdeprecated
- type GenerateCDNDNSSECKeysResponse
- type GenericServerCheck
- type GeoLimitCountriesType
- type GetTenantsResponse
- type GetTenantsResponseV5
- type GetTenantsResponseV50
- type HWInfo
- type HWInfoResponse
- type HealthData
- type HealthDataCacheGroup
- type HealthThreshold
- type HealthThresholdJSONParameters
- type IAllFederation
- type IDNoMod
- type InterfaceName
- type InvalidationJob
- type InvalidationJobCreateV4
- type InvalidationJobCreateV40
- type InvalidationJobInput
- type InvalidationJobV4
- type InvalidationJobV40
- type InvalidationJobsResponse
- type InvalidationJobsResponseV4
- type IsAvailable
- type JWKSMap
- type Jobdeprecated
- type JobRequestdeprecated
- type JobRequestAPIdeprecated
- type LegacyDeliveryServiceFederationResolverMappingRequest
- type LegacyInterfaceDetailsdeprecated
- func (lid LegacyInterfaceDetails) String() string
- func (lid *LegacyInterfaceDetails) ToInterfaces(ipv4IsService, ipv6IsService bool) ([]ServerInterfaceInfo, error)deprecated
- func (lid *LegacyInterfaceDetails) ToInterfacesV4(ipv4IsService, ipv6IsService bool, routerName, routerPort *string) ([]ServerInterfaceInfoV40, error)deprecated
- type LegacyStatsdeprecated
- type LegacyTMConfigResponsedeprecated
- type LegacyTrafficDSStatsSummarydeprecated
- type LegacyTrafficMonitorConfig
- type LegacyTrafficMonitorConfigMapdeprecated
- type LegacyTrafficServerdeprecated
- type LocalizationMethod
- type Log
- type LogV5
- type LogV50
- type LogsResponse
- type LogsResponseV5
- type LogsResponseV50
- type MatchList
- type MatchSet
- type MonitoringCoordinates
- type MultipleServersCapabilities
- type NewLogCountResp
- type OSVersionsAPIResponse
- type OSVersionsResponse
- type Origin
- type OriginDetailResponse
- type OriginDetailResponseV5
- type OriginDetailResponseV50
- type OriginHeaders
- type OriginV5
- type OriginV50
- type OriginsResponse
- type OriginsResponseV5
- type OriginsResponseV50
- type Parameter
- type ParameterName
- type ParameterNullable
- type ParameterNullableV5
- type ParameterNullableV50
- type ParameterV5
- type ParameterV50
- type ParametersResponse
- type ParametersResponseV5
- type ParametersResponseV50
- type PhysLocation
- type PhysLocationNullable
- type PhysLocationNullableV5
- type PhysLocationNullableV50
- type PhysLocationResponse
- type PhysLocationResponseV5
- type PhysLocationResponseV50
- type PhysLocationTrimmed
- type PhysLocationV5
- type PhysLocationV50
- type PhysLocationsResponse
- type PhysLocationsResponseV5
- type PhysLocationsResponseV50
- type Plugin
- type PluginsResponse
- type PostParamProfile
- type PostProfileParam
- type Profile
- type ProfileCopy
- type ProfileCopyResponse
- type ProfileExportImportNullable
- type ProfileExportImportParameterNullable
- type ProfileExportResponse
- type ProfileImportRequest
- type ProfileImportResponse
- type ProfileImportResponseObj
- type ProfileNullable
- type ProfileParam
- type ProfileParamV5
- type ProfileParamV50
- type ProfileParameter
- type ProfileParameterByName
- type ProfileParameterByNamePost
- type ProfileParameterByNameV5
- type ProfileParameterByNameV50
- type ProfileParameterCreationRequest
- type ProfileParameterNullable
- type ProfileParameterPostResp
- type ProfileParameterPostRespObj
- type ProfileParameterResponse
- type ProfileParameterResponseV5
- type ProfileParameterV5
- type ProfileParameterV50
- type ProfileParametersAPIResponse
- type ProfileParametersAPIResponseV5
- type ProfileParametersAPIResponseV50
- type ProfileParametersByNamePost
- type ProfileParametersNullable
- type ProfileParametersNullableResponse
- type ProfileParametersNullableV5
- type ProfileParametersNullableV50
- type ProfileParametersResponse
- type ProfileParametersResponseV5
- type ProfileResponse
- type ProfileV5
- type ProfilesResponse
- type ProfilesResponseV5
- type Protocoldeprecated
- type PutSnapshotResponse
- type QStringIgnore
- type RefreshDNSSECKeysResponse
- type Region
- type RegionName
- type RegionNameDivision
- type RegionNameResponse
- type RegionV5
- type RegionV50
- type RegionsResponse
- type RegionsResponseV5
- type RegionsResponseV50
- type RequestStatus
- func (r RequestStatus) MarshalJSON() ([]byte, error)
- func (r *RequestStatus) Scan(src interface{}) error
- func (r RequestStatus) String() string
- func (r *RequestStatus) UnmarshalJSON(b []byte) error
- func (r RequestStatus) ValidTransition(to RequestStatus) error
- func (r *RequestStatus) Value() (driver.Value, error)
- type ResolverMapping
- type ResultStatVal
- type Role
- type RoleResponse
- type RoleResponseV4
- type RoleV11deprecated
- type RoleV4
- type RoleV40
- type RolesResponse
- type RolesResponseV4
- type Routing
- type SOA
- type SSLKeyExpirationGetResponse
- type SSLKeyExpirationInformation
- type SSLKeyRequestFields
- type SSLKeysAddResponse
- type Serverdeprecated
- type ServerCapabilitiesResponse
- type ServerCapabilitiesResponseV41
- type ServerCapabilitiesResponseV5
- type ServerCapabilitiesResponseV50
- type ServerCapability
- type ServerCapabilityDetailResponse
- type ServerCapabilityDetailResponseV41
- type ServerCapabilityDetailResponseV5
- type ServerCapabilityDetailResponseV50
- type ServerCapabilityV4
- type ServerCapabilityV41
- type ServerCapabilityV5
- type ServerCapabilityV50
- type ServerCheckColumns
- type ServerCheckExtensionID
- type ServerCheckExtensionNullable
- type ServerCheckExtensionPostResponse
- type ServerCheckExtensionResponse
- type ServerDetaildeprecated
- type ServerDetailV11
- type ServerDetailV30
- type ServerDetailV40
- type ServerIPAddress
- type ServerInfo
- type ServerInterfaceInfo
- func (inf ServerInterfaceInfo) Copy() ServerInterfaceInfo
- func (i *ServerInterfaceInfo) GetDefaultAddress() (string, string)
- func (i *ServerInterfaceInfo) GetDefaultAddressOrCIDR() (string, string)
- func (sii *ServerInterfaceInfo) Scan(src interface{}) error
- func (sii *ServerInterfaceInfo) Value() (driver.Value, error)
- type ServerInterfaceInfoV40
- type ServerNullabledeprecated
- type ServerNullableV11
- type ServerNullableV2deprecated
- type ServerPutStatus
- type ServerQueueUpdate
- type ServerQueueUpdateRequest
- type ServerQueueUpdateResponse
- type ServerServerCapabilitiesResponse
- type ServerServerCapabilitiesResponseV5
- type ServerServerCapabilitiesResponseV50
- type ServerServerCapability
- type ServerServerCapabilityV5
- type ServerServerCapabilityV50
- type ServerStats
- type ServerUpdateStatusdeprecated
- type ServerUpdateStatusResponseV4
- type ServerUpdateStatusResponseV40
- type ServerUpdateStatusResponseV5
- type ServerUpdateStatusResponseV50
- type ServerUpdateStatusV4
- type ServerUpdateStatusV40
- type ServerUpdateStatusV5
- type ServerUpdateStatusV50
- type ServerV30deprecated
- type ServerV4
- type ServerV40
- type ServerV5
- type ServerV50
- type ServerV5Response
- type Servercheck
- type ServercheckAPIResponse
- type ServercheckPost
- type ServercheckPostResponse
- type ServercheckRequestNullable
- type ServerchecksResponse
- type ServersDetailResponse
- type ServersResponse
- type ServersV1DetailResponse
- type ServersV3DetailResponse
- type ServersV3Response
- type ServersV4DetailResponse
- type ServersV4Response
- type ServersV5Response
- type ServiceCategoriesResponse
- type ServiceCategoriesResponseV5
- type ServiceCategoriesResponseV50
- type ServiceCategory
- type ServiceCategoryResponse
- type ServiceCategoryResponseV5
- type ServiceCategoryResponseV50
- type ServiceCategoryV5
- type ServiceCategoryV50
- type SnapshotResponse
- type StaticDNSEntriesResponse
- type StaticDNSEntriesResponseV5
- type StaticDNSEntriesResponseV50
- type StaticDNSEntry
- type StaticDNSEntryNullable
- type StaticDNSEntryV5
- type StaticDNSEntryV50
- type Stats
- type StatsSummary
- type StatsSummaryLastUpdated
- type StatsSummaryLastUpdatedAPIResponse
- type StatsSummaryLastUpdatedAPIResponseV5
- type StatsSummaryLastUpdatedAPIResponseV50
- type StatsSummaryLastUpdatedResponsedeprecated
- type StatsSummaryLastUpdatedV5
- type StatsSummaryLastUpdatedV50
- type StatsSummaryResponse
- type StatsSummaryResponseV5
- type StatsSummaryResponseV50
- type StatsSummaryV5
- type StatsSummaryV50
- type Status
- type StatusChangeRequest
- type StatusNullable
- type StatusResponse
- type StatusResponseV5
- type StatusV5
- type StatusV50
- type StatusesResponse
- type StatusesResponseV5
- type StatusesResponseV50
- type Steering
- type SteeringFilter
- type SteeringResponse
- type SteeringSteeringTarget
- type SteeringTargetdeprecated
- type SteeringTargetNullable
- type SteeringTargetsResponse
- type SteeringType
- type SystemInfo
- type TMCacheGroup
- type TMConfigResponse
- type TMDeliveryService
- type TMParameters
- type TMProfile
- type TOExtensionID
- type TOExtensionNullable
- type TOExtensionPostResponse
- type TOExtensionResponse
- type TSDeliveryService
- type Tenant
- type TenantAlertdeprecated
- type TenantNullable
- type TenantResponse
- type TenantResponseV5
- type TenantResponseV50
- type TenantV5
- type TenantV50
- type Time
- type TimeNoModdeprecated
- func NewTimeNoMod() *TimeNoModdeprecated
- func TimeNoModFromTime(t time.Time) *TimeNoModdeprecated
- type TimeStampdeprecated
- type TopologiesQueueUpdate
- type TopologiesQueueUpdateRequest
- type TopologiesQueueUpdateResponse
- type TopologiesResponse
- type TopologiesResponseV5
- type TopologiesResponseV50
- type Topology
- type TopologyName
- type TopologyNode
- type TopologyNodeV5
- type TopologyNodeV50
- type TopologyResponse
- type TopologyResponseV5
- type TopologyResponseV50
- type TopologyV5
- type TopologyV50
- type TrafficCacheStatsConfig
- type TrafficDSStatsConfig
- type TrafficDSStatsResponse
- type TrafficDSStatsSummary
- type TrafficMonitor
- type TrafficMonitorConfig
- type TrafficMonitorConfigMap
- type TrafficMonitorName
- type TrafficServer
- type TrafficStatsCDNStats
- type TrafficStatsCDNStatsResponse
- type TrafficStatsCDNsStats
- type TrafficStatsConfig
- type TrafficStatsExclude
- type TrafficStatsOrderable
- type TrafficStatsResponse
- type TrafficStatsSeries
- type TrafficStatsSummary
- type TrafficStatsTotalStats
- type TrafficVaultPing
- type TrafficVaultPingResponse
- type Type
- type TypeNullable
- type TypeV5
- type TypeV50
- type TypesResponse
- type TypesResponseV5
- type TypesResponseV50
- type URLSigKeys
- type URLSignatureKeysResponse
- type UpdateCDNFederationResponse
- type UpdateDeliveryServiceNullableResponsedeprecated
- type UpdateUserResponse
- type UpdateUserResponseV4
- type User
- type UserCredentials
- type UserCurrent
- type UserCurrentResponse
- type UserCurrentResponseV4
- type UserDeliveryServiceDeleteResponse
- type UserDeliveryServicePostResponsedeprecated
- type UserInvalidationJob
- type UserInvalidationJobInput
- type UserPasswordResetRequest
- type UserRegistrationRequest
- type UserRegistrationRequestV4
- type UserRegistrationRequestV40
- type UserResponse
- type UserResponseV4
- type UserToken
- type UserV4
- type UserV40
- type UsersResponse
- type UsersResponseV4
Examples ¶
- Alerts.AddAlert
- Alerts.AddAlerts
- Alerts.AddNewAlert
- Alerts.ErrorString
- Alerts.ToStrings
- CreateAlerts
- CreateErrorAlerts
- DSRChangeType.UnmarshalJSON
- DeliveryServiceRequestV40.SetXMLID
- DeliveryServiceRequestV40.String
- DeliveryServiceRequestV5.SetXMLID
- DeliveryServiceRequestV5.String
- FederationResolver.Validate
- HealthThreshold.String
- InvalidationJobInput.TTLHours (Duration)
- InvalidationJobInput.TTLHours (Number)
- InvalidationJobV4.String
- LegacyInterfaceDetails.String
- LegacyInterfaceDetails.ToInterfaces
- LegacyTrafficMonitorConfigMap.Upgrade
- LegacyTrafficServer.Upgrade
- ServerIPAddress.Copy
- ServerInterfaceInfoV40.Copy
- ServerV50.RevalidationPending
- ServerV50.UpdatePending
- TMParameters.UnmarshalJSON
- TrafficMonitorConfigMap.Valid
- TrafficServer.IPv4
- TrafficServer.IPv6
Constants ¶
const ( // Key-signing key. DNSSECKSKType = "ksk" // Zone-signing key. DNSSECZSKType = "zsk" )
Types of keys used in DNSSEC and stored in Traffic Vault.
const ( DNSSECKeyStatusNew = "new" DNSSECKeyStatusExpired = "expired" DNSSECStatusExisting = "existing" )
The various allowable statuses for DNSSEC keys being inserted into or retrieved from Traffic Vault.
const ( // The state as parsed from a raw string did not represent a valid RequestStatus. RequestStatusInvalid = RequestStatus("invalid") // The DSR is a draft that is not ready for review. RequestStatusDraft = RequestStatus("draft") // The DSR has been submitted for review. RequestStatusSubmitted = RequestStatus("submitted") // The DSR was rejected by a reviewer. RequestStatusRejected = RequestStatus("rejected") // The DSR has been approved by a reviewer and is pending fullfillment. RequestStatusPending = RequestStatus("pending") // The DSR has been approved and fully implemented. RequestStatusComplete = RequestStatus("complete") )
The various Statuses a Delivery Service Request (DSR) may have.
const ( // The original Delivery Service is being modified to match the requested // one. DSRChangeTypeUpdate = DSRChangeType("update") // The requested Delivery Service is being created. DSRChangeTypeCreate = DSRChangeType("create") // The requested Delivery Service is being deleted. DSRChangeTypeDelete = DSRChangeType("delete") )
These are the valid values for Delivery Service Request Change Types.
const ( SelfSignedCertAuthType = "Self Signed" CertificateAuthorityCertAuthType = "Certificate Authority" LetsEncryptAuthType = "Lets Encrypt" )
Authentication methods used for signing Delivery Service SSL certificates.
const ( ReservedConsistentHashingQueryParameterFormat = "format" ReservedConsistentHashingQueryParameterTRRED = "trred" ReservedConsistentHashingQueryParameterFakeClientIPAddress = "fakeClientIpAddress" )
These names of URL query string parameters are not allowed to be in a Delivery Service's "ConsistentHashQueryParams" set, because they collide with query string parameters reserved for use by Traffic Router.
const ( // Traffic Router routes clients for this Delivery Service and cache // servers are configured to serve its content. DSActiveStateActive = DeliveryServiceActiveState("ACTIVE") // Traffic Router does not route for this Delivery Service and cache // servers cannot serve its content. DSActiveStateInactive = DeliveryServiceActiveState("INACTIVE") // Traffic Router does not route for this Delivery Service, but cache // servers are configured to serve its content. DSActiveStatePrimed = DeliveryServiceActiveState("PRIMED") )
A DeliveryServiceActiveState describes the availability of Delivery Service content from the perspective of caching servers and Traffic Routers.
const ( // Deprecated: TLS version 1.0 is known to be insecure. TLSVersion10 = "1.0" // Deprecated: TLS version 1.1 is known to be insecure. TLSVersion11 = "1.1" TLSVersion12 = "1.2" TLSVersion13 = "1.3" )
These are the TLS Versions known by Apache Traffic Control to exist.
const ( // CacheTypeEdge represents an edge-tier cache server. CacheTypeEdge = CacheType("EDGE") // CacheTypeMid represents a mid-tier cache server. CacheTypeMid = CacheType("MID") // CacheTypeInvalid represents an CacheType. Note this is the default // construction for a CacheType. CacheTypeInvalid = CacheType("") )
The allowable values for a CacheType.
const ( CacheGroupEdgeTypeName = EdgeTypePrefix + "_LOC" CacheGroupMidTypeName = MidTypePrefix + "_LOC" CacheGroupOriginTypeName = OriginTypeName + "_LOC" )
These are the Names of the Types that must be used by various kinds of Cache Groups to ensure proper behavior.
Note that there is, in general, no guarantee that a Type with any of these names exist in Traffic Ops at any given time.
Note also that there is no enforcement in Traffic Control that a particular Type of Cache Group contains only or any of a particular Type or Types of server(s).
const ( QueryStringIgnoreUseInCacheKeyAndPassUp = 0 QueryStringIgnoreIgnoreInCacheKeyAndPassUp = 1 QueryStringIgnoreDropAtEdge = 2 )
The allowed values for a Delivery Service's Query String Handling.
These are prefixed "QueryStringIgnore" even though the values don't always indicate ignoring, because the database column is named "qstring_ignore".
const ( RangeRequestHandlingDontCache = 0 RangeRequestHandlingBackgroundFetch = 1 RangeRequestHandlingCacheRangeRequest = 2 RangeRequestHandlingSlice = 3 )
The allowed values for a Delivery Service's Range Request Handling.
const ( // DSTypeCategoryHTTP represents an HTTP-routed Delivery Service. DSTypeCategoryHTTP = DSTypeCategory("http") // DSTypeCategoryDNS represents a DNS-routed Delivery Service. DSTypeCategoryDNS = DSTypeCategory("dns") // DSTypeCategoryInvalid represents an invalid Delivery Service routing // type. Note this is the default construction for a DSTypeCategory. DSTypeCategoryInvalid = DSTypeCategory("") )
const ( SigningAlgorithmURLSig = "url_sig" SigningAlgorithmURISigning = "uri_signing" )
These are the allowable values for the Signing Algorithm property of a Delivery Service.
const ( // Indicates content will only be served using the unsecured HTTP Protocol. DSProtocolHTTP = 0 // Indicates content will only be served using the secured HTTPS Protocol. DSProtocolHTTPS = 1 // Indicates content will only be served over both HTTP and HTTPS. DSProtocolHTTPAndHTTPS = 2 // Indicates content will only be served using the secured HTTPS Protocol, // and that unsecured HTTP requests will be directed to use HTTPS instead. DSProtocolHTTPToHTTPS = 3 )
These are the allowable values for the Protocol property of a Delivery Service.
const ( // CacheStatusAdminDown represents a cache server which has been // administratively marked as "down", but which should still appear in the // CDN. CacheStatusAdminDown = CacheStatus("ADMIN_DOWN") // CacheStatusOnline represents a cache server which should always be // considered online/available/healthy, irrespective of monitoring. // Non-cache servers also typically use this Status instead of REPORTED. CacheStatusOnline = CacheStatus("ONLINE") // CacheStatusOffline represents a cache server which should always be // considered offline/unavailable/unhealthy, irrespective of monitoring. CacheStatusOffline = CacheStatus("OFFLINE") // CacheStatusReported represents a cache server which is polled for health // by Traffic Monitor. The vast majority of cache servers should have this // Status. CacheStatusReported = CacheStatus("REPORTED") // CacheStatusPreProd represents a cache server that is not deployed to "production", // but is ready for it. CacheStatusPreProd = CacheStatus("PRE_PROD") // CacheStatusInvalid represents an unrecognized Status value. Note that // this is not actually "invalid", because Statuses may have any unique // name, not just those captured as CacheStatus values in this package. CacheStatusInvalid = CacheStatus("") )
These are the allowable values of a CacheStatus.
Note that there is no guarantee that a Status by any of these Names exists in Traffic Ops at any given time, nor that such a Status - should it exist - have any given Description or ID.
const ( // ProtocolHTTP represents the HTTP/1.1 protocol as specified in RFC2616. ProtocolHTTP = Protocol("http") // ProtocolHTTPS represents the HTTP/1.1 protocol over a TCP connection secured by TLS. ProtocolHTTPS = Protocol("https") // ProtocolHTTPtoHTTPS represents a redirection of unsecured HTTP requests to HTTPS. ProtocolHTTPtoHTTPS = Protocol("http to https") // ProtocolHTTPandHTTPS represents the use of both HTTP and HTTPS. ProtocolHTTPandHTTPS = Protocol("http and https") // ProtocolInvalid represents an invalid Protocol. ProtocolInvalid = Protocol("") )
The allowable values of a Protocol.
Deprecated: These do not accurately model the Protocol of a Delivery Service, use DSProtocolHTTP, DSProtocolHTTPS, DSProtocolHTTPToHTTPS, and DSProtocolHTTPAndHTTPS instead.
const ( LocalizationMethodCZ = LocalizationMethod("CZ") LocalizationMethodDeepCZ = LocalizationMethod("DEEP_CZ") LocalizationMethodGeo = LocalizationMethod("GEO") LocalizationMethodInvalid = LocalizationMethod("INVALID") )
These are the allowable values of a LocalizationMethod.
const ( DeepCachingTypeNever = DeepCachingType("") // default value DeepCachingTypeAlways = DeepCachingType("ALWAYS") DeepCachingTypeInvalid = DeepCachingType("INVALID") )
These are the allowable values of a DeepCachingType. Note that unlike most "enumerated" constants exported by this package, the default construction yields a valid value.
const ( FederationResolverType4 = FederationResolverType("RESOLVE4") FederationResolverType6 = FederationResolverType("RESOLVE6") FederationResolverTypeInvalid = FederationResolverType("") )
These are the allowable values of a FederationResolverType.
Note that, in general, there is no guarantee that a Type by any of these Names exists in Traffic Ops at any given time, nor that any such Types - should they exist - will have any particular UseInTable value, nor that the Types assigned to Federation Resolver Mappings will be representable by these values.
const ( REFRESH = "REFRESH" REFETCH = "REFETCH" )
These are the allowed values for the InvalidationType of an InvalidationJobCreateV4/InvalidationJobV4.
const ( CacheServerProfileType = "ATS_PROFILE" DeliveryServiceProfileType = "DS_PROFILE" ElasticSearchProfileType = "ES_PROFILE" GroveProfileType = "GROVE_PROFILE" InfluxdbProfileType = "INFLUXDB_PROFILE" KafkaProfileType = "KAFKA_PROFILE" LogstashProfileType = "LOGSTASH_PROFILE" OriginProfileType = "ORG_PROFILE" // RiakProfileType is the type of a Profile used on the legacy RiakKV system // which used to be used as a back-end for Traffic Vault. // // Deprecated: Support for Riak as a Traffic Vault back-end is being dropped // in the near future. Profiles of type UnknownProfileType should be used on // PostgreSQL database servers instead. RiakProfileType = "RIAK_PROFILE" SplunkProfileType = "SPLUNK_PROFILE" TrafficMonitorProfileType = "TM_PROFILE" TrafficPortalProfileType = "TP_PROFILE" TrafficRouterProfileType = "TR_PROFILE" TrafficStatsProfileType = "TS_PROFILE" UnkownProfileType = "UNK_PROFILE" )
These are the valid values for the Type property of a Profile. No other values will be accepted, and these are not configurable.
const ( StatNameKBPS = "kbps" StatNameMaxKBPS = "maxKbps" StatNameBandwidth = "bandwidth" )
These are the names of statistics that can be used in thresholds for server health.
const AdminRoleName = "admin"
AdminRoleName is the Name of the special "admin" Role.
This Role must always exist; it cannot be modified or deleted, and is guaranteed to exist in all valid ATC environments.
const AlgorithmConsistentHash = "consistent_hash"
AlgorithmConsistentHash is the name of the Multi-Site Origin hashing algorithm that performs consistent hashing on a set of parents.
const CachegroupCoordinateNamePrefix = "from_cachegroup_"
CachegroupCoordinateNamePrefix is a string that all cache group coordinate names are prefixed with.
const CoverageZonePollingPrefix = "coveragezone.polling."
CoverageZonePollingPrefix is the prefix of all Names of Parameters used to define coverage zone polling parameters.
const CoverageZonePollingURL = CoverageZonePollingPrefix + "url"
const CrConfigTTLNS = "tld.ttls.NS"
const CrConfigTTLSOA = "tld.ttls.SOA"
const DSTypeLiveNationalSuffix = "_LIVE_NATNL"
DSTypeLiveNationalSuffix is the suffix that Delivery Services which are both "live" and "national" MUST have at the end of the Name(s) of the Type(s) they use in order to be treated properly by ATC.
Deprecated: Use DSType.IsLive and DSType.IsNational instead.
const DSTypeLiveSuffix = "_LIVE"
DSTypeLiveSuffix is the suffix that Delivery Services which are "live" - but not "national" (maybe?) - MUST have at the end of the Name(s) of the Type(s) they use in order to be treated properly by ATC.
Deprecated: Use DSType.IsLive and DSType.IsNational instead.
const DefaultHealthThresholdComparator = "<"
DefaultHealthThresholdComparator is the comparator used for health thresholds when one is not explicitly provided in the Value of a Parameter used to define a Threshold.
const DefaultMaxRequestHeaderBytes = 0
DefaultMaxRequestHeaderBytes is the Max Header Bytes given to Delivery Services upon creation through the Traffic Ops API if Max Request Header Bytes is not specified in the request body.
const DefaultRoutingName = "cdn"
DefaultRoutingName is the Routing Name given to Delivery Services upon creation through the Traffic Ops API if a Routing Name is not specified in the request body.
const EdgeTypePrefix = "EDGE"
EdgeTypePrefix is a prefix which MUST appear on the Names of Types used by edge-tier cache servers in order for them to be recognized as edge-tier cache servers by ATC.
const EmptyAddressCannotBeAServiceAddressError = ErrorConstant("an empty IP or IPv6 address cannot be marked as a service address")
EmptyAddressCannotBeAServiceAddressError is the client-facing error returned from the Traffic Ops API's /servers endpoint when the client is attempting to update or create a server that has an IP address marked as the "service address" which was not provided in the request (although the other address family address may have been provided).
Deprecated: This error's wording is only used in a deprecated version of the API.
const GlobalConfigFileName = ConfigFileName("global")
GlobalConfigFileName is ConfigFile value which can cause a Parameter to be handled specially by Traffic Control components under certain circumstances.
Note that there is no guarantee that a Parameter with this ConfigFile value exists in Traffic Ops at any given time, nor that any particular number of such Parameters is allowed or forbidden, nor that any such existing Parameters will have or not have any particular Name or Secure or Value value, nor that should such a Parameter exist that its value will match or not match any given pattern, nor that it will or will not be assigned to any particular Profile or Profiles or Cache Groups.
const GlobalProfileName = "GLOBAL"
GlobalProfileName is the Name of a Profile that is treated specially in some respects by some components of ATC.
Note that there is, in general, no guarantee that a Profile with this Name exists in Traffic Ops at any given time, nor that it will have or not have any particular set of assigned Parameters, nor that any set of Parameters that do happen to be assigned to it should it exist will have or not have particular ConfigFile or Secure or Value values, nor that any such Parameters should they exist would have Values that match any given pattern, nor that it has any particular Profile Type, nor that it is or is not assigned to any Delivery Service or server or server(s), nor that those servers be or not be of any particular Type should they exist. Traffic Ops promises much, but guarantees little.
const JobRequestTimeFormat = `2006-01-02 15:04:05`
JobRequestTimeFormat is a Go reference time format, for use with time.Format, of the format used by the Perl version of the /jobs and /user/current/jobs endpoints.
Deprecated: Since job inputs no longer strictly require this format, an RFC 3339 format or a timestamp in milliseconds should be used instead.
const JobTimeFormat = `2006-01-02 15:04:05-07`
JobTimeFormat is a Go reference time format, for use with time.Format.
Deprecated: this format is the same as TimeLayout - which should be used instead.
const MaxRangeSliceBlockSize = 33554432
MaxRangeSliceBlockSize is the maximum allowed value for a Delivery Service's Range Slice Block Size, in bytes. This is 32MiB.
const MaxTTL = math.MaxInt64 / 3600000000000
MaxTTL is the maximum value of TTL representable as a time.Duration object, which is used internally by InvalidationJobInput objects to store the TTL.
const MidTypePrefix = "MID"
MidTypePrefix is a prefix which MUST appear on the Names of Types used by mid-tier cache servers in order for them to be recognized as mid-tier cache servers by ATC.
const MinRangeSliceBlockSize = 262144
MinRangeSliceBlockSize is the minimum allowed value for a Delivery Service's Range Slice Block Size, in bytes. This is 256KiB.
const MonitorProfilePrefix = "RASCAL"
MonitorProfilePrefix is a prefix which MUST appear on the Names of Profiles used by Traffic Monitor instances as servers in Traffic Ops, or they may not be treated properly.
"Rascal" is a legacy name for Traffic Monitor.
Deprecated: This should not be a requirement for TM instances to be treated properly, and new code should not check this.
const MonitorTypeName = "RASCAL"
MonitorTypeName is the Name of the Type which must be assigned to a server for it to be treated as a Traffic Monitor instance by ATC.
"Rascal" is a legacy name for Traffic Monitor.
Note that there is, in general, no guarantee that a Type with this name exists in Traffic Ops at any given time.
const NeedsAtLeastOneIPError = ErrorConstant("both IP and IP6 addresses are empty")
NeedsAtLeastOneIPError is the client-facing error returned from the Traffic Ops API's /servers endpoint when the client is attempting to update or create a server without an IPv4 or IPv6 address.
Deprecated: This error's wording is only used in a deprecated version of the API.
const NeedsAtLeastOneServiceAddressError = ErrorConstant("at least one address must be marked as a service address")
NeedsAtLeastOneServiceAddressError is the client-facing error returned from the Traffic Ops API's /servers endpoint when the client is attempting to update or create a server without an IP address marked as its "service address".
Deprecated: This error's wording is only used in a deprecated version of the API.
const NilTenantError = ErrorConstant("tenancy is enabled but request tenantID is nil")
NilTenantError can used when a Tenantable object finds that TentantID in the request is nil.
const OriginLocationType = "ORG_LOC"
OriginLocationType is the Name of a Cache Group which represents an "Origin Location".
There is no enforcement in Traffic Control anywhere that ensures than an ORG_LOC-Type Cache Group will only actually contain Origin servers.
Deprecated: Prefer CacheGroupOriginTypeName for consistency.
const OriginTypeName = "ORG"
OriginTypeName is the Name of the Type which must be assigned to a server for it to be treated as an Origin server by ATC.
Note that there is, in general, no guarantee that a Type with this name exists in Traffic Ops at any given time.
const PermCDNLocksDeleteOthers = "CDN-LOCK:DELETE-OTHERS"
PermCDNLocksDeleteOthers is a string representing the permission to be able to delete other users' CDN locks.
const PermICDNUCDNOverride = "ICDN:UCDN-OVERRIDE"
PermICDNUCDNOverride is a string representing the permission to be able to override the ucdn parameter.
const PermParameterSecureRead = "PARAMETER:SECURE-READ"
PermParameterSecureRead is a string representing the permission to be able to read secure parameters.
const PermSecureServerRead = "SECURE-SERVER:READ"
PermSecureServerRead is a string representing the permission to be able to read secure server properties.
const RefetchEnabled = ParameterName("refetch_enabled")
RefetchEnabled is the name of a Parameter used to determine if the Refetch feature is enabled. If enabled, this allows a consumer of the TO API to submit Refetch InvalidationJob types. These will subsequently be treated as a MISS by cache servers. Previously, the only capability was Refresh which was, in turn, treated as a STALE by cache servers. This value should be used with caution, since coupled with regex, could cause significant performance impacts by implementing cache servers if used incorrectly.
Note that there is no guarantee that a Parameter with this name exists in Traffic Ops at any given time, and while it's implementation relies on a boolean Value, this it not gauranteed either.
const RouterTypeName = "CCR"
RouterTypeName is the Name of the Type which must be assigned to a server for it to be treated as a Traffic Router instance by ATC.
"CCR" is an acronym for a legacy name for Traffic Router.
Note that there is, in general, no guarantee that a Type with this name exists in Traffic Ops at any given time.
const TenantDSUserNotAuthError = ErrorConstant("user not authorized for requested delivery service tenant")
TenantDSUserNotAuthError is used when a user does not have access to a requested resource tenant for a delivery service.
const TenantUserNotAuthError = ErrorConstant("user not authorized for requested tenant")
TenantUserNotAuthError is used when a user does not have access to a requested resource tenant.
const ThresholdPrefix = "health.threshold."
ThresholdPrefix is the prefix of all Names of Parameters used to define monitoring thresholds.
const TimeLayout = "2006-01-02 15:04:05-07"
TimeLayout is the format used in lastUpdated fields in Traffic Ops.
Deprecated: New code should use RFC3339 (with optional nanosecond precision).
const UseRevalPendingParameterName = ParameterName("use_reval_pending")
UseRevalPendingParameterName is the name of a Parameter which tells whether or not Traffic Ops should use pending content invalidation jobs separately from traditionally "queued updates".
Note that there is no guarantee that a Parameter with this name exists in Traffic Ops at any given time, nor that it will have or not have any particular ConfigFile or Secure or Value value, nor that should such a Parameter exist that its value will match or not match any given pattern, nor that it will or will not be assigned to any particular Profile or Profiles or Cache Groups.
Deprecated: UseRevalPending was a feature flag introduced for ATC version 2, and newer code should just assume that pending revalidations are going to be fetched by t3c.
const X_MM_CLIENT_IP = "X-MM-Client-IP"
X_MM_CLIENT_IP is an optional HTTP header that causes Traffic Router to use its value as the client IP address.
Variables ¶
var EmailTemplate = template.Must(template.New("Email Template").Parse(`<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8"/>
<title>Delivery Service Request for {{.Customer}}</title>
<style>
aside {
padding: 0 1em;
color: #6A737D;
border-left: .25em solid #DFE2E5;
}
body {
font-family: sans;
background-color: white;
}
pre {
padding: 5px;
background-color: lightgray;
}
</style>
</head>
<body>
<h1>Delivery Service Request for {{.Customer}}</h1>
<p>{{.ServiceDesc}}</p>
<section>
<details>
<summary><h2>Service Description</h2></summary>
<h3>Content Type</h3>
<p>{{.ContentType}}</p>
<h3>Delivery Protocol</h3>
<p>{{.DeliveryProtocol.String}}</p>
<h3>Routing Type</h3>
<p>{{.RoutingType.String}}</p>
</details>
</section>
<section>
<details>
<summary><h2>Traffic & Library Estimates</h2></summary>
<h3>Peak Bandwidth Estimate</h3>
<p>{{.PeakBPSEstimate}}Bps</p>
<h3>Peak Transactions per Second Estimate</h3>
<p>{{.PeakTPSEstimate}}Tps</p>
<h3>Max Library Size Estimate</h3>
<p>{{.MaxLibrarySizeEstimate}}GB</p>
</details>
</section>
<section>
<details>
<summary><h2>Origin Security</h2></summary>
<h3>Origin Server URL</h3>
<p><a href="{{.OriginURL}}">{{.OriginURL}}</a></p>
<h3>Origin Dynamic Remap</h3>
<p>{{.HasOriginDynamicRemap}}</p>
<h3>Origin Test File</h3>
<p>{{.OriginTestFile}}</p>
<h3>ACL/Whitelist to Access Origin</h3>
<p>{{.HasOriginACLWhitelist}}</p>
{{if .OriginHeaders}}<h3>Header(s) to Access Origin</h3>
<ul>{{range .OriginHeaders}}
<li>{{.}}</li>{{end}}
</ul>{{end}}
<h3>Other Origin Security</h3>
<p>{{if .OtherOriginSecurity}}{{.OtherOriginSecurity}}{{else}}None{{end}}</p>
</details>
</section>
<section>
<details>
<summary><h2>Core Features</h2></summary>
<h3>Query String Handling</h3>
<p>{{.QueryStringHandling}}</p>
<h3>Range Request Handling</h3>
<p>{{.RangeRequestHandling}}</p>
<h3>Signed URLs / URL Tokenization</h3>
<p>{{.HasSignedURLs}}</p>
<h3>Negative Caching Customization</h3>
<p>{{.HasNegativeCachingCustomization}}</p>
{{if or .HasNegativeCachingCustomization .NegativeCachingCustomizationNote }}<aside>
<p>{{.NegativeCachingCustomizationNote}}</p>
</aside>{{else if .HasNegativeCachingCustomization}}<aside>
<p><b>No instructions given!</b></p>
</aside>{{end}}
{{if .ServiceAliases}}<h3>Service Aliases</h3>
<ul>{{range .ServiceAliases}}
<li>{{.}}</li>{{end}}
</ul>{{end}}
</details>
</section>
{{if or .RateLimitingGBPS .RateLimitingTPS .OverflowService}}<section>
<details>
<summary><h2>Service Limits</h2></summary>
{{if .RateLimitingGBPS}}<h3>Bandwidth Limit</h3>
<p>{{.RateLimitingGBPS}}GBps</p>{{end}}
{{if .RateLimitingTPS}}<h3>Transactions per Second Limit</h3>
<p>{{.RateLimitingTPS}}Tps</p>{{end}}
{{if .OverflowService}}<h3>Overflow Service</h3>
<p>{{.OverflowService}}</p>{{end}}
</details>
</section>{{end}}
{{if or .HeaderRewriteEdge .HeaderRewriteMid .HeaderRewriteRedirectRouter}}<section>
<details>
<summary><h2>Header Customization</h2></summary>
{{if .HeaderRewriteEdge}}<h3>Header Rewrite - Edge Tier</h3>
<pre>{{.HeaderRewriteEdge}}</pre>{{end}}
{{if .HeaderRewriteMid}}<h3>Header Rewrite - Mid Tier</h3>
<pre>{{.HeaderRewriteMid}}</pre>{{end}}
{{if .HeaderRewriteRedirectRouter}}<h3>Header Rewrite - Router</h3>
<pre>{{.HeaderRewriteRedirectRouter}}</pre>{{end}}
</details>
</section>{{end}}
{{if .Notes}}<section>
<details>
<summary><h2>Additional Notes</h2></summary>
<p>{{.Notes}}</p>
</details>
</section>{{end}}
</body>
</html>
`))
EmailTemplate is an html/template.Template for formatting DeliveryServiceRequestRequests into text/html email bodies. Its direct use is discouraged, instead use DeliveryServiceRequestRequest.Format.
Deprecated: Delivery Services Requests have been deprecated in favor of Delivery Service Requests, and will be removed from the Traffic Ops API at some point in the future.
var RequestStatuses = []RequestStatus{
"draft",
"submitted",
"rejected",
"pending",
"complete",
}
RequestStatuses -- user-visible string associated with each of the above.
var StatusKey = "status"
StatusKey holds the text of the status key of a Request Context.
var TrafficStatsDurationPattern = regexp.MustCompile(`^\d+[mhdw]$`)
TrafficStatsDurationPattern reflects all the possible durations that can be requested via the /deliveryservice_stats endpoint.
var ValidJobRegexPrefix = regexp.MustCompile(`^\?/.*$`)
ValidJobRegexPrefix matches the only valid prefixes for a relative-path Content Invalidation Job regular expression.
Functions ¶
func CDNExistsByName ¶
CDNExistsByName returns whether a cdn with the given name exists, and any error. TODO move to helper package.
func CRStatesMarshall ¶
CRStatesMarshall serializes the given CRStates into bytes.
func DurationLiteralToSeconds ¶
DurationLiteralToSeconds returns the number of seconds to which an InfluxQL duration literal is equivalent. For invalid objects, it returns -1 - otherwise it will always, of course be > 0.
func GetDSTypeCategory ¶
GetDSTypeCategory returns the delivery service type category (either HTTP or DNS) of the given delivery service type.
func GetRenewalKid ¶
func GetTypeData ¶
GetTypeData returns the type's name and use_in_table, true/false if the query returned data, and any error.
TODO: Move this to the DB helpers package.
func IsReservedStatus ¶
IsReservedStatus returns true if the passed in status name is reserved, and false if it isn't. Currently, the reserved statuses are OFFLINE, ONLINE, REPORTED, PRE_PROD and ADMIN_DOWN.
func IsValidCacheType ¶
IsValidCacheType returns true if the given string represents a valid cache type.
func LegacyMonitorConfigValid
deprecated
func LegacyMonitorConfigValid(cfg *LegacyTrafficMonitorConfigMap) error
LegacyMonitorConfigValid checks the validity of the passed LegacyTrafficMonitorConfigMap, returning an error if it is invalid.
Deprecated: LegacyTrafficMonitorConfigMap is deprecated, new code should use TrafficMonitorConfigMap instead.
func MessagesToString ¶
MessagesToString converts a set of messages from an InfluxDB node into a single, print-able string.
func ParamExists ¶
ParamExists returns whether a parameter with the given id exists, and any error. TODO move to helper package.
func ParamsExist ¶
ParamsExist returns whether parameters exist for all the given ids, and any error. TODO move to helper package.
func ProfileExistsByID ¶
ProfileExistsByID returns whether a profile with the given id exists, and any error. TODO move to helper package.
func ProfileExistsByName ¶
ProfileExistsByName returns whether a profile with the given name exists, and any error. TODO move to helper package.
func ProfilesExistByIDs ¶
ProfilesExistByIDs returns whether profiles exist for all the given ids, and any error. TODO move to helper package.
func ValidateJobUniqueness ¶
func ValidateJobUniqueness(tx *sql.Tx, dsID uint, startTime time.Time, assetURL string, ttlHours uint) []string
ValidateJobUniqueness returns a message describing each overlap between existing content invalidation jobs for the same assetURL as the one passed.
TODO: This doesn't belong in the lib, and it swallows errors because it can't log them.
func ValidateTypeID ¶
ValidateTypeID validates that the typeID references a type with the expected use_in_table string and returns "" and an error if the typeID is invalid. If valid, the type's name is returned.
TODO: Move this to the DB helpers package.
Types ¶
type APICapability ¶
type APICapability struct { ID int `json:"id" db:"id"` HTTPMethod string `json:"httpMethod" db:"http_method"` Route string `json:"httpRoute" db:"route"` Capability string `json:"capability" db:"capability"` LastUpdated TimeNoMod `json:"lastUpdated" db:"last_updated"` }
APICapability represents an association between a Traffic Ops API route and a required capability.
type APICapabilityResponse ¶
type APICapabilityResponse struct { Response []APICapability `json:"response"` Alerts }
APICapabilityResponse represents an HTTP response to an API Capability request.
type ASN ¶
type ASN struct { // The ASN to retrieve // // Autonomous System Numbers per APNIC for identifying a service provider // required: true ASN int `json:"asn" db:"asn"` // Related cachegroup name // Cachegroup string `json:"cachegroup" db:"cachegroup"` // Related cachegroup id // CachegroupID int `json:"cachegroupId" db:"cachegroup_id"` // ID of the ASN // // required: true ID int `json:"id" db:"id"` // LastUpdated // LastUpdated string `json:"lastUpdated" db:"last_updated"` }
ASN contains info relating to a single Autonomous System Number (see RFC 1930).
type ASNNullable ¶
type ASNNullable struct { // The ASN to retrieve // // Autonomous System Numbers per APNIC for identifying a service provider // required: true ASN *int `json:"asn" db:"asn"` // Related cachegroup name // Cachegroup *string `json:"cachegroup" db:"cachegroup"` // Related cachegroup id // CachegroupID *int `json:"cachegroupId" db:"cachegroup_id"` // ID of the ASN // // required: true ID *int `json:"id" db:"id"` // LastUpdated // LastUpdated *TimeNoMod `json:"lastUpdated" db:"last_updated"` }
ASNNullable contains info related to a single Autonomous System Number (see RFC 1930). Unlike ASN, ASNNullable's fields are nullable.
type ASNResponse ¶
ASNResponse is a single ASN response for Update and Create to depict what changed. swagger:response ASNResponse in: body
type ASNResponseV5 ¶
type ASNResponseV5 = ASNResponseV50
ASNResponseV5 is an alias for the ASN struct response used for the latest minor version associated with api major version 5.
type ASNResponseV50 ¶
ASNResponseV50 is a single ASN response for Update and Create to depict what changed. swagger:response ASNResponse in: body
type ASNV5 ¶
type ASNV5 = ASNV50
ASNV5 is an alias for the ASN struct response used for the latest minor version associated with api major version 5.
type ASNV50 ¶
type ASNV50 struct { // The ASN to retrieve // // Autonomous System Numbers per APNIC for identifying a service provider // required: true ASN int `json:"asn" db:"asn"` // Related cachegroup name // Cachegroup string `json:"cachegroup" db:"cachegroup"` // Related cachegroup id // CachegroupID int `json:"cachegroupId" db:"cachegroup_id"` // ID of the ASN // // required: true ID int `json:"id" db:"id"` // LastUpdated // LastUpdated time.Time `json:"lastUpdated" db:"last_updated"` }
ASNV50 is used for RFC3339 format timestamp
type ASNsResponse ¶
ASNsResponse is a list of ASNs (Autonomous System Numbers) as a response. swagger:response ASNsResponse in: body
type ASNsResponseV5 ¶
type ASNsResponseV5 = ASNsResponseV50
ASNsResponseV5 is an alias for the list of ASN struct response used for the latest minor version associated with api major version 5.
type ASNsResponseV50 ¶
ASNsResponseV50 is a list of ASNs (Autonomous System Numbers) as a response. swagger:response ASNsResponse in: body
type ASNsV11 ¶
type ASNsV11 struct {
ASNs []interface{} `json:"asns"`
}
ASNsV11 is used for the Traffic OPS API version 1.1, which lists ASNs (Autonomous System Numbers) under its own key in the response and does not validate structure. The Traffic Ops API uses its own TOASNV11 instead.
type AcmeAccount ¶
type AcmeAccount struct { Email *string `json:"email" db:"email"` PrivateKey *string `json:"privateKey" db:"private_key"` Uri *string `json:"uri" db:"uri"` Provider *string `json:"provider" db:"provider"` }
AcmeAccount is the information needed to access an account with an ACME provider.
type Alert ¶
type Alert struct { // Text is the actual message being conveyed. Text string `json:"text"` // Level describes what kind of message is being relayed. In practice, it should be the string // representation of one of ErrorLevel, WarningLevel, InfoLevel or SuccessLevel. Level string `json:"level"` }
Alert represents an informational message, typically returned through the Traffic Ops API.
type AlertLevel ¶
type AlertLevel int
AlertLevel is used for specifying or comparing different levels of alerts.
const ( // SuccessLevel indicates that an action is successful. SuccessLevel AlertLevel = iota // InfoLevel indicates that the message is supplementary and is not directly // the result of the user's request. InfoLevel // WarnLevel indicates dangerous but non-failing conditions. WarnLevel // ErrorLevel indicates that the request failed. ErrorLevel )
func (AlertLevel) String ¶
func (a AlertLevel) String() string
String returns the string representation of an AlertLevel.
type Alerts ¶
type Alerts struct {
Alerts []Alert `json:"alerts"`
}
Alerts is merely a collection of arbitrary "Alert"s for ease of use in other structures, most notably those used in Traffic Ops API responses.
func CreateAlerts ¶
func CreateAlerts(level AlertLevel, messages ...string) Alerts
CreateAlerts creates and returns an Alerts structure filled with "Alert"s that are all of the provided level, each having one of messages as text in turn.
Example ¶
alerts := CreateAlerts(InfoLevel, "foo", "bar") fmt.Printf("%d\n", len(alerts.Alerts)) fmt.Printf("Level: %s, Text: %s\n", alerts.Alerts[0].Level, alerts.Alerts[0].Text) fmt.Printf("Level: %s, Text: %s\n", alerts.Alerts[1].Level, alerts.Alerts[1].Text)
Output: 2 Level: info, Text: foo Level: info, Text: bar
func CreateErrorAlerts ¶
CreateErrorAlerts creates and returns an Alerts structure filled with ErrorLevel-level "Alert"s using the errors to provide text.
Example ¶
alerts := CreateErrorAlerts(errors.New("foo")) fmt.Printf("%v\n", alerts)
Output: {[{foo error}]}
func (*Alerts) AddAlert ¶
AddAlert appends an alert to the Alerts structure.
Example ¶
var alerts Alerts fmt.Printf("%d\n", len(alerts.Alerts)) alert := Alert{ Level: InfoLevel.String(), Text: "foo", } alerts.AddAlert(alert) fmt.Printf("%d\n", len(alerts.Alerts)) fmt.Printf("Level: %s, Text: %s\n", alerts.Alerts[0].Level, alerts.Alerts[0].Text)
Output: 0 1 Level: info, Text: foo
func (*Alerts) AddAlerts ¶
AddAlerts appends all of the "Alert"s in the given Alerts structure to this Alerts structure.
Example ¶
alerts1 := Alerts{ []Alert{ { Level: InfoLevel.String(), Text: "foo", }, }, } alerts2 := Alerts{ []Alert{ { Level: ErrorLevel.String(), Text: "bar", }, }, } alerts1.AddAlerts(alerts2) fmt.Printf("%d\n", len(alerts1.Alerts)) fmt.Printf("Level: %s, Text: %s\n", alerts1.Alerts[0].Level, alerts1.Alerts[0].Text) fmt.Printf("Level: %s, Text: %s\n", alerts1.Alerts[1].Level, alerts1.Alerts[1].Text)
Output: 2 Level: info, Text: foo Level: error, Text: bar
func (*Alerts) AddNewAlert ¶
func (self *Alerts) AddNewAlert(level AlertLevel, text string)
AddNewAlert constructs a new Alert with the given Level and Text and appends it to the Alerts structure.
Example ¶
var alerts Alerts fmt.Printf("%d\n", len(alerts.Alerts)) alerts.AddNewAlert(InfoLevel, "foo") fmt.Printf("%d\n", len(alerts.Alerts)) fmt.Printf("Level: %s, Text: %s\n", alerts.Alerts[0].Level, alerts.Alerts[0].Text)
Output: 0 1 Level: info, Text: foo
func (Alerts) ErrorString ¶
ErrorString concatenates any and all Error-Level alerts in the Alerts to make one string representative of any reported errors.
Example ¶
alerts := CreateErrorAlerts(errors.New("foo"), errors.New("bar")) fmt.Println(alerts.ErrorString()) alerts = CreateAlerts(WarnLevel, "test") alerts.AddAlert(Alert{Level: InfoLevel.String(), Text: "quest"}) fmt.Println(alerts.ErrorString())
Output: foo; bar
func (*Alerts) ToStrings ¶
ToStrings converts Alerts to a slice of strings that are their messages. Note that this return value doesn't contain their Levels anywhere.
Example ¶
alerts := CreateAlerts(InfoLevel, "foo", "bar") strs := alerts.ToStrings() fmt.Printf("%d\n%s\n%s\n", len(strs), strs[0], strs[1])
Output: 2 foo bar
type AllCacheGroupParametersResponse
deprecated
type AllCacheGroupParametersResponse struct { Response CacheGroupParametersList `json:"response"` Alerts }
AllCacheGroupParametersResponse is a Cache Group Parameter response body.
Deprecated: Cache Group Parameter associations have been removed in APIv4.
type AllDeliveryServiceFederationsMapping ¶
type AllDeliveryServiceFederationsMapping struct { Mappings []FederationResolverMapping `json:"mappings"` DeliveryService DeliveryServiceName `json:"deliveryService"` }
AllDeliveryServiceFederationsMapping is a structure that contains identifying information for a Delivery Service as well as any and all Federation Resolver mapping assigned to it (or all those getting assigned to it).
func (AllDeliveryServiceFederationsMapping) IsAllFederations ¶
func (a AllDeliveryServiceFederationsMapping) IsAllFederations() bool
IsAllFederations implements the IAllFederation interface. Always returns true.
type AllFederationCDN ¶
type AllFederationCDN struct {
CDNName *CDNName `json:"cdnName"`
}
AllFederationCDN is the structure of a response from Traffic Ops to a GET request made to its /federations/all endpoint.
func (AllFederationCDN) IsAllFederations ¶
func (a AllFederationCDN) IsAllFederations() bool
IsAllFederations implements the IAllFederation interface. Always returns true.
type AssignFederationFederationResolversResponse ¶
type AssignFederationFederationResolversResponse struct { Response AssignFederationResolversRequest `json:"response"` Alerts }
AssignFederationFederationResolversResponse represents an API response for assigning a Federation Resolver to a Federation.
type AssignFederationResolversRequest ¶
type AssignFederationResolversRequest struct { Replace bool `json:"replace"` FedResolverIDs []int `json:"fedResolverIds"` }
AssignFederationResolversRequest represents an API request/response for assigning Federation Resolvers to a Federation.
type AssignedDsResponse ¶
type AssignedDsResponse struct { ServerID int `json:"serverId"` DSIds []int `json:"dsIds"` Replace bool `json:"replace"` }
AssignedDsResponse is the type of the `response` property of a response from Traffic Ops to a POST request made to its /servers/{{ID}}/deliveryservices API endpoint.
type AsyncStatus ¶
type AsyncStatus struct { // Id is the integral, unique identifier for the asynchronous job status. Id int `json:"id,omitempty" db:"id"` // Status is the status of the asynchronous job. This will be PENDING, SUCCEEDED, or FAILED. Status string `json:"status,omitempty" db:"status"` // StartTime is the time the asynchronous job was started. StartTime time.Time `json:"start_time,omitempty" db:"start_time"` // EndTime is the time the asynchronous job completed. This will be null if it has not completed yet. EndTime *time.Time `json:"end_time,omitempty" db:"end_time"` // Message is the message about the job status. Message *string `json:"message,omitempty" db:"message"` }
AsyncStatus represents an async job status.
type AsyncStatusResponse ¶
type AsyncStatusResponse struct { Response AsyncStatus `json:"response"` Alerts }
AsyncStatusResponse represents the response from the GET /async_status/{id} API.
type CDN ¶
type CDN struct { // The CDN to retrieve // // enables Domain Name Security Extensions on the specified CDN // // required: true DNSSECEnabled bool `json:"dnssecEnabled" db:"dnssec_enabled"` // DomainName of the CDN // // required: true DomainName string `json:"domainName" db:"domain_name"` // ID of the CDN // // required: true ID int `json:"id" db:"id"` // LastUpdated // LastUpdated TimeNoMod `json:"lastUpdated" db:"last_updated"` // Name of the CDN // // required: true Name string `json:"name" db:"name"` // TTLOverride // TTLOverride int `json:"ttlOverride,omitempty" db:"ttl_override"` }
A CDN represents a set of configuration and hardware that can be used to serve content within a specific top-level domain.
type CDNDNSSECGenerateReq ¶
type CDNDNSSECGenerateReq struct { // Key is the CDN name, as documented in the API documentation. Key *string `json:"key"` TTL *util.JSONIntStr `json:"ttl"` KSKExpirationDays *util.JSONIntStr `json:"kskExpirationDays"` ZSKExpirationDays *util.JSONIntStr `json:"zskExpirationDays"` EffectiveDateUnix *CDNDNSSECGenerateReqDate `json:"effectiveDate"` }
A CDNDNSSECGenerateReq is the structure used to request generation of CDN DNSSEC Keys through the Traffic Ops API's /cdns/dnsseckeys/generate endpoint.
type CDNDNSSECGenerateReqDate ¶
type CDNDNSSECGenerateReqDate int64
CDNDNSSECGenerateReqDate is the date accepted by CDNDNSSECGenerateReq. This will unmarshal a UNIX epoch integer, a RFC3339 string, the old format string used by Perl '2018-08-21+14:26:06', and the old format string sent by the Portal '2018-08-21 14:14:42'. This exists to fix a critical bug, see https://github.com/apache/trafficcontrol/issues/2723 - it SHOULD NOT be used by any other endpoint.
func (*CDNDNSSECGenerateReqDate) UnmarshalJSON ¶
func (i *CDNDNSSECGenerateReqDate) UnmarshalJSON(d []byte) error
UnmarshalJSON implements the encoding/json.Unmarshaler interface.
type CDNDNSSECKeysResponse ¶
type CDNDNSSECKeysResponse struct { Response DNSSECKeys `json:"response"` Alerts }
CDNDNSSECKeysResponse is the type of a response from Traffic Ops to GET requests made to its /cdns/name/{{name}}/dnsseckeys API endpoint.
type CDNFederation ¶
type CDNFederation struct { ID *int `json:"id" db:"id"` CName *string `json:"cname" db:"cname"` TTL *int `json:"ttl" db:"ttl"` Description *string `json:"description" db:"description"` LastUpdated *TimeNoMod `json:"lastUpdated" db:"last_updated"` // omitempty only works with primitive types and pointers *DeliveryServiceIDs `json:"deliveryService,omitempty"` }
CDNFederation represents a Federation.
type CDNFederationDeliveryService ¶
type CDNFederationDeliveryService = struct { ID int `json:"id" db:"ds_id"` XMLID string `json:"xmlID" db:"xml_id"` }
CDNFederationDeliveryService holds information about an assigned Delivery Service within a CDNFederationV5 structure.
type CDNFederationResponse ¶
type CDNFederationResponse struct { Response []CDNFederation `json:"response"` Alerts }
CDNFederationResponse represents a Traffic Ops API response to a request for one or more of a CDN's Federations.
type CDNFederationV5 ¶
type CDNFederationV5 struct { ID int `json:"id" db:"id"` CName string `json:"cname" db:"cname"` TTL int `json:"ttl" db:"ttl"` Description *string `json:"description" db:"description"` LastUpdated time.Time `json:"lastUpdated" db:"last_updated"` DeliveryService *CDNFederationDeliveryService `json:"deliveryService,omitempty"` }
CDNFederationV5 represents a Federation of some CDN as it appears in version 5 of the Traffic Ops API.
type CDNFederationV5Response ¶
type CDNFederationV5Response struct { Response CDNFederationV5 `json:"response"` Alerts }
CDNFederationV5Response represents a Traffic Ops APIv5 response to a request for a single CDN's Federations.
type CDNFederationsV5Response ¶
type CDNFederationsV5Response struct { Response []CDNFederationV5 `json:"response"` Alerts }
CDNFederationsV5Response represents a Traffic Ops APIv5 response to a request for one or more of a CDN's Federations.
type CDNGenerateKSKReq ¶
type CDNGenerateKSKReq struct { ExpirationDays *uint64 `json:"expirationDays"` EffectiveDate *time.Time `json:"effectiveDate"` }
A CDNGenerateKSKReq is a request to generate Key-Signing Keys for CDNs for use in DNSSEC operations, and is the structure required for the bodies of POST requests made to the /cdns/{{Name}}/dnsseckeys/ksk/generate endpoint of the Traffic Ops API.
func (*CDNGenerateKSKReq) Sanitize ¶
func (r *CDNGenerateKSKReq) Sanitize()
Sanitize ensures that the CDNGenerateKSKReq's EffectiveDate is not nil.
If it was nil, this will set it to the current time.
type CDNLock ¶
type CDNLock struct { UserName string `json:"userName" db:"username"` CDN string `json:"cdn" db:"cdn"` Message *string `json:"message" db:"message"` Soft *bool `json:"soft" db:"soft"` LastUpdated time.Time `json:"lastUpdated" db:"last_updated"` }
CDNLock is a struct to store the details of a lock that a user wishes to acquire on a CDN.
type CDNLockCreateResponse ¶
CDNLockCreateResponse is a struct to store the response of a CREATE operation on a lock.
type CDNLockDeleteResponse ¶
type CDNLockDeleteResponse CDNLockCreateResponse
CDNLockDeleteResponse is a struct to store the response of a DELETE operation on a lock.
type CDNLocksGetResponse ¶
CDNLocksGetResponse is a struct to store the response of a GET operation on locks.
type CDNNotification ¶
type CDNNotification struct { ID int `json:"id" db:"id"` CDN string `json:"cdn" db:"cdn"` LastUpdated time.Time `json:"lastUpdated" db:"last_updated"` Notification string `json:"notification" db:"notification"` User string `json:"user" db:"user"` }
CDNNotification is a notification created for a specific CDN.
type CDNNotificationRequest ¶
type CDNNotificationRequest struct { CDN string `json:"cdn"` Notification string `json:"notification"` }
CDNNotificationRequest encodes the request data for the POST cdn_notifications endpoint.
type CDNNotificationsResponse ¶
type CDNNotificationsResponse struct { Response []CDNNotification `json:"response"` Alerts }
CDNNotificationsResponse is a list of CDN notifications as a response.
type CDNNullable ¶
type CDNNullable struct { // The CDN to retrieve // // enables Domain Name Security Extensions on the specified CDN // // required: true DNSSECEnabled *bool `json:"dnssecEnabled" db:"dnssec_enabled"` // DomainName of the CDN // // required: true DomainName *string `json:"domainName" db:"domain_name"` // ID of the CDN // // required: true ID *int `json:"id" db:"id"` // LastUpdated // LastUpdated *TimeNoMod `json:"lastUpdated" db:"last_updated"` // Name of the CDN // // required: true Name *string `json:"name" db:"name"` // TTLOverride // TTLOverride *int `json:"ttlOverride,omitempty" db:"ttl_override"` }
CDNNullable is identical to CDN except that its fields are reference values, which allows them to be nil.
type CDNQueueUpdateRequest ¶
type CDNQueueUpdateRequest ServerQueueUpdateRequest
CDNQueueUpdateRequest encodes the request data for the POST cdns/{{ID}}/queue_update endpoint.
type CDNQueueUpdateResponse ¶
CDNQueueUpdateResponse encodes the response data for the POST cdns/{{ID}}/queue_update endpoint.
type CDNResponse ¶
CDNResponse is a single CDN response for Update and Create to depict what changed. swagger:response CDNResponse in: body
type CDNSSLKey ¶
type CDNSSLKey struct { DeliveryService string `json:"deliveryservice"` HostName string `json:"hostname"` Certificate CDNSSLKeyCert `json:"certificate"` }
CDNSSLKey structures represent an SSL key/certificate pair used by a CDN. This is the structure used by each entry of the `response` array property of responses from Traffic Ops to GET requests made to its /cdns/name/{{Name}}/sslkeys API endpoint.
type CDNSSLKeyCert ¶
A CDNSSLKeyCert represents an SSL key/certificate pair used by a CDN, without any other associated data.
type CDNSSLKeys ¶
type CDNSSLKeys struct { DeliveryService string `json:"deliveryservice"` Certificate CDNSSLKeysCertificate `json:"certificate"` Hostname string `json:"hostname"` }
CDNSSLKeys is an SSL key/certificate pair for a certain Delivery Service.
type CDNSSLKeysCertificate ¶
CDNSSLKeysCertificate is an SSL key/certificate pair.
type CDNSSLKeysResp
deprecated
type CDNSSLKeysResp []CDNSSLKey
CDNSSLKeysResp is a slice of CDNSSLKeys.
Deprecated: This is not used by any known ATC code and has no known purpose. Therefore, it's probably just technical debt subject to removal in the near future.
type CDNSSLKeysResponse ¶
type CDNSSLKeysResponse struct { Response []CDNSSLKeys `json:"response"` Alerts }
CDNSSLKeysResponse is the structure of the Traffic Ops API's response to requests made to its /cdns/name/{{name}}/sslkeys endpoint.
type CDNV5 ¶
type CDNV5 struct { // The CDN to retrieve // // enables Domain Name Security Extensions on the specified CDN // // required: true DNSSECEnabled bool `json:"dnssecEnabled" db:"dnssec_enabled"` // DomainName of the CDN // // required: true DomainName string `json:"domainName" db:"domain_name"` // ID of the CDN // // required: true ID int `json:"id" db:"id"` // LastUpdated // LastUpdated time.Time `json:"lastUpdated" db:"last_updated"` // Name of the CDN // // required: true Name string `json:"name" db:"name"` // TTLOverride // TTLOverride *int `json:"ttlOverride,omitempty" db:"ttl_override"` }
A CDNV5 represents a set of configuration and hardware that can be used to serve content within a specific top-level domain.
type CDNsResponse ¶
CDNsResponse is a list of CDNs as a response. swagger:response CDNsResponse in: body
type CDNsV5Response ¶
CDNsV5Response is a list of CDNs as a response. swagger:response CDNsResponse in: body
type CRConfig ¶
type CRConfig struct { // Config is mostly a map of string values, but may contain an 'soa' key which is a map[string]string, and may contain a 'ttls' key with a value map[string]string. It might not contain these values, so they must be checked for, and all values must be checked by the user and an error returned if the type is unexpected. Be aware, neither the language nor the API provides any guarantees about the type! Config map[string]interface{} `json:"config,omitempty"` ContentServers map[string]CRConfigTrafficOpsServer `json:"contentServers,omitempty"` ContentRouters map[string]CRConfigRouter `json:"contentRouters,omitempty"` DeliveryServices map[string]CRConfigDeliveryService `json:"deliveryServices,omitempty"` EdgeLocations map[string]CRConfigLatitudeLongitude `json:"edgeLocations,omitempty"` RouterLocations map[string]CRConfigLatitudeLongitude `json:"trafficRouterLocations,omitempty"` Monitors map[string]CRConfigMonitor `json:"monitors,omitempty"` Stats CRConfigStats `json:"stats,omitempty"` Topologies map[string]CRConfigTopology `json:"topologies,omitempty"` }
CRConfig is JSON-serializable as the CRConfig used by Traffic Control.
type CRConfigBackupLocations ¶
type CRConfigBackupLocations struct { FallbackToClosest bool `json:"fallbackToClosest,string"` List []string `json:"list,omitempty"` }
CRConfigBackupLocations defines how a Traffic Router should handle traffic normally bound for a given CRConfigLatitudeLongitude in the event that said CRConfigLatitudeLongitude becomes unavailable, named with "CRConfig" for legacy reasons.
type CRConfigBypassDestination ¶
type CRConfigBypassDestination struct { IP *string `json:"ip,omitempty"` // only used by DNS DSes IP6 *string `json:"ip6,omitempty"` // only used by DNS DSes CName *string `json:"cname,omitempty"` // only used by DNS DSes TTL *int `json:"ttl,omitempty"` // only used by DNS DSes FQDN *string `json:"fqdn,omitempty"` // only used by HTTP DSes Port *string `json:"port,omitempty"` // only used by HTTP DSes }
CRConfigBypassDestination is a network location to which excess traffic requesting a Delivery Service's content will be directed when the Service's ability to deliver content is deemed to be saturated, named with "CRConfig" for legacy reasons.
This is generated based on the Delivery Service's Type (specifically whether it is DNS-routed or HTTP-routed) and its HTTP Bypass FQDN, DNS Bypass CNAME, DNS Bypass IP, DNS Bypass IPv6, and DNS Bypass TTL properties.
type CRConfigConfig ¶
type CRConfigConfig struct { APICacheControlMaxAge *string `json:"api.cache-control.max-age,omitempty"` ConsistentDNSRouting *string `json:"consistent.dns.routing,omitempty"` CoverageZonePollingIntervalSeconds *string `json:"coveragezone.polling.interval,omitempty"` CoverageZonePollingURL *string `json:"coveragezone.polling.url,omitempty"` DNSSecDynamicResponseExpiration *string `json:"dnssec.dynamic.response.expiration,omitempty"` DNSSecEnabled *string `json:"dnssec.enabled,omitempty"` DomainName *string `json:"domain_name,omitempty"` FederationMappingPollingIntervalSeconds *string `json:"federationmapping.polling.interval,omitempty"` FederationMappingPollingURL *string `json:"federationmapping.polling.url"` GeoLocationPollingInterval *string `json:"geolocation.polling.interval,omitempty"` GeoLocationPollingURL *string `json:"geolocation.polling.url,omitempty"` KeyStoreMaintenanceIntervalSeconds *string `json:"keystore.maintenance.interval,omitempty"` NeustarPollingIntervalSeconds *string `json:"neustar.polling.interval,omitempty"` NeustarPollingURL *string `json:"neustar.polling.url,omitempty"` SOA *SOA `json:"soa,omitempty"` DNSSecInceptionSeconds *string `json:"dnssec.inception,omitempty"` Ttls *CRConfigTTL `json:"ttls,omitempty"` Weight *string `json:"weight,omitempty"` ZoneManagerCacheMaintenanceIntervalSeconds *string `json:"zonemanager.cache.maintenance.interval,omitempty"` ZoneManagerThreadpoolScale *string `json:"zonemanager.threadpool.scale,omitempty"` }
CRConfigConfig used to be the type of CRConfig's Config field, though CRConfigConfig is no longer used.
type CRConfigDeliveryService ¶
type CRConfigDeliveryService struct { AnonymousBlockingEnabled *string `json:"anonymousBlockingEnabled,omitempty"` BypassDestination map[string]*CRConfigBypassDestination `json:"bypassDestination,omitempty"` ConsistentHashQueryParams []string `json:"consistentHashQueryParams,omitempty"` ConsistentHashRegex *string `json:"consistentHashRegex,omitempty"` CoverageZoneOnly bool `json:"coverageZoneOnly,string"` DeepCachingType *DeepCachingType `json:"deepCachingType"` Dispersion *CRConfigDispersion `json:"dispersion,omitempty"` Domains []string `json:"domains,omitempty"` EcsEnabled *bool `json:"ecsEnabled,string,omitempty"` GeoEnabled []CRConfigGeoEnabled `json:"geoEnabled,omitempty"` GeoLimitRedirectURL *string `json:"geoLimitRedirectURL,omitempty"` GeoLocationProvider *string `json:"geolocationProvider,omitempty"` IP6RoutingEnabled *bool `json:"ip6RoutingEnabled,string,omitempty"` MatchSets []*MatchSet `json:"matchsets,omitempty"` MaxDNSIPsForLocation *int `json:"maxDnsIpsForLocation,omitempty"` MissLocation *CRConfigLatitudeLongitudeShort `json:"missLocation,omitempty"` Protocol *CRConfigDeliveryServiceProtocol `json:"protocol,omitempty"` RegionalGeoBlocking *string `json:"regionalGeoBlocking,omitempty"` RequestHeaders []string `json:"requestHeaders,omitempty"` RequiredCapabilities []string `json:"requiredCapabilities,omitempty"` ResponseHeaders map[string]string `json:"responseHeaders,omitempty"` RoutingName *string `json:"routingName,omitempty"` Soa *SOA `json:"soa,omitempty"` SSLEnabled bool `json:"sslEnabled,string"` StaticDNSEntries []CRConfigStaticDNSEntry `json:"staticDnsEntries,omitempty"` Topology *string `json:"topology,omitempty"` TTL *int `json:"ttl,omitempty"` TTLs *CRConfigTTL `json:"ttls,omitempty"` }
CRConfigDeliveryService represents a Delivery Service as they appear in CDN Snapshots, named with "CRConfig" for legacy reasons.
type CRConfigDeliveryServiceProtocol ¶
type CRConfigDeliveryServiceProtocol struct { AcceptHTTP *bool `json:"acceptHttp,string,omitempty"` AcceptHTTPS bool `json:"acceptHttps,string"` RedirectOnHTTPS bool `json:"redirectToHttps,string"` }
CRConfigDeliveryServiceProtocol is used in CDN Snapshots to define the protocols used to access Delivery Service content, named with "CRConfig" for legacy reasons.
This is generated for Delivery Services based on their Protocol property.
type CRConfigDispersion ¶
CRConfigDispersion defines for a Delivery Service appearing in a CDN Snapshot the number of cache servers to which its content is initially distributed, named with "CRConfig" for legacy reasons.
This is generated from a Delivery Service's Initial Dispersion property.
type CRConfigGeoEnabled ¶
type CRConfigGeoEnabled struct {
CountryCode string `json:"countryCode"`
}
CRConfigGeoEnabled is a structure that contains information describing a geographical location allowed to access a Delivery Service's content, named with "CRConfig" for legacy reasons.
Presently, each CRConfigGeoEnabled in a CDN Snapshot's Delivery Service's GeoEnabled property is a single entry in the underlying, actual Delivery Service's Geo Limit Countries array.
type CRConfigLatitudeLongitude ¶
type CRConfigLatitudeLongitude struct { Lat float64 `json:"latitude"` Lon float64 `json:"longitude"` BackupLocations CRConfigBackupLocations `json:"backupLocations,omitempty"` LocalizationMethods []LocalizationMethod `json:"localizationMethods,omitempty"` }
CRConfigLatitudeLongitude structures are geographical locations for routing purpose that can contain either edge-tier cache servers or Traffic Routers (but not a mixture of both), named with "CRConfig" for legacy reasons.
In general, any given CRConfigLatitudeLongitude represents a Cache Group object.
type CRConfigLatitudeLongitudeShort ¶
CRConfigLatitudeLongitudeShort is a geographical location where clients will be assumed to be located if determining their location fails (a "Geo Miss"), named with "CRConfig" for legacy reasons.
These are generated for Delivery Services in CDN Snapshots from their Geo Miss Default Latitude and Geo Miss Default Longitude properties.
type CRConfigMonitor ¶
type CRConfigMonitor struct { FQDN *string `json:"fqdn,omitempty"` HTTPSPort *int `json:"httpsPort,omitempty"` IP *string `json:"ip,omitempty"` IP6 *string `json:"ip6,omitempty"` Location *string `json:"location,omitempty"` Port *int `json:"port,omitempty"` Profile *string `json:"profile,omitempty"` ServerStatus *CRConfigServerStatus `json:"status,omitempty"` }
CRConfigMonitor structures are used in CDN Snapshots to represent Traffic Monitors, named with "CRConfig" for legacy reasons.
type CRConfigRouter ¶
type CRConfigRouter struct { APIPort *string `json:"api.port,omitempty"` FQDN *string `json:"fqdn,omitempty"` HTTPSPort *int `json:"httpsPort"` HashCount *int `json:"hashCount,omitempty"` IP *string `json:"ip,omitempty"` IP6 *string `json:"ip6,omitempty"` Location *string `json:"location,omitempty"` Port *int `json:"port,omitempty"` Profile *string `json:"profile,omitempty"` SecureAPIPort *string `json:"secure.api.port,omitempty"` ServerStatus *CRConfigRouterStatus `json:"status,omitempty"` }
CRConfigRouter represents a Traffic Router as defined within a CDN Snapshot, named with "CRConfig" for legacy reasons.
type CRConfigRouterStatus ¶
type CRConfigRouterStatus string
CRConfigRouterStatus is the name of the Status of a Traffic Router server object. This is only used in the context of CDN Snapshots, and has no special nuance or behavior not afforded to a regular string - so in general it is suggested that a string be used instead where possible, to keep compatibility with Server/ServerV4/ServerNullable etc. structures.
type CRConfigServerStatus ¶
type CRConfigServerStatus string
CRConfigServerStatus is the name of the Status of a server object. This is only used in the context of CDN Snapshots, and has no special nuance or behavior not afforded to a regular string - so in general it is suggested that a string be used instead where possible, to keep compatibility with Server/ServerV4/ServerNullable etc. structures.
type CRConfigStaticDNSEntry ¶
type CRConfigStaticDNSEntry struct { Name string `json:"name"` TTL int `json:"ttl"` Type string `json:"type"` Value string `json:"value"` }
CRConfigStaticDNSEntry structures encode a Static DNS Entry for a Delivery Service in a CDN Snapshot, named with "CRConfig" for legacy reasons.
type CRConfigStats ¶
type CRConfigStats struct { CDNName *string `json:"CDN_name,omitempty"` DateUnixSeconds *int64 `json:"date,omitempty"` TMHost *string `json:"tm_host,omitempty"` // Deprecated: Don't ever use this for anything. It's been removed from APIv4 responses. TMPath *string `json:"tm_path,omitempty"` TMUser *string `json:"tm_user,omitempty"` TMVersion *string `json:"tm_version,omitempty"` }
CRConfigStats is the type of the 'stats' property of a CDN Snapshot.
type CRConfigTTL ¶
type CRConfigTTL struct { // A records ASeconds *string `json:"A,omitempty"` // AAAA records AAAASeconds *string `json:"AAAA,omitempty"` // DNSKEY records DNSkeySeconds *string `json:"DNSKEY,omitempty"` // DS records DSSeconds *string `json:"DS,omitempty"` // NS records NSSeconds *string `json:"NS,omitempty"` // SOA records SOASeconds *string `json:"SOA,omitempty"` }
CRConfigTTL defines the Time-To-Live (TTL) of various record types served by Traffic Router.
Each TTL given is an optional field containing a number of seconds encoded as a string. If a field is nil, the CRConfigTTL is instructing Traffic Router to use its configured default for records of that type.
type CRConfigTopology ¶
type CRConfigTopology struct {
Nodes []string `json:"nodes"`
}
CRConfigTopology is the format in which Topologies are represented in a CDN Snapshot, named with "CRConfig" for legacy reasons.
CRConfigTopology structures do not include the Topologies' Names, because in a CDN Snapshot they are stored in a mapping of their Names to this structure.
type CRConfigTrafficOpsServer ¶
type CRConfigTrafficOpsServer struct { CacheGroup *string `json:"cacheGroup,omitempty"` Capabilities []string `json:"capabilities,omitempty"` Fqdn *string `json:"fqdn,omitempty"` HashCount *int `json:"hashCount,omitempty"` HashId *string `json:"hashId,omitempty"` HttpsPort *int `json:"httpsPort,omitempty"` InterfaceName *string `json:"interfaceName"` Ip *string `json:"ip,omitempty"` Ip6 *string `json:"ip6,omitempty"` LocationId *string `json:"locationId,omitempty"` Port *int `json:"port"` Profile *string `json:"profile,omitempty"` ServerStatus *CRConfigServerStatus `json:"status,omitempty"` ServerType *string `json:"type,omitempty"` DeliveryServices map[string][]string `json:"deliveryServices,omitempty"` RoutingDisabled int64 `json:"routingDisabled"` }
CRConfigTrafficOpsServer represents a Traffic Ops instance as defined within a CDN Snapshot, named with "CRConfig" for legacy reasons.
type CRSStats ¶
type CRSStats struct { App CRSStatsApp `json:"app"` Stats CRSStatsStats `json:"stats"` }
CRSStats is the returned data from TRs stats endpoint.
type CRSStatsApp ¶
type CRSStatsApp struct { BuildTimestamp string `json:"buildTimestamp"` Name string `json:"name"` DeployDir string `json:"deploy-dir"` GitRevision string `json:"git-revision"` Version string `json:"version"` }
CRSStatsApp represents metadata about a given TR.
type CRSStatsStat ¶
type CRSStatsStat struct { CZCount uint64 `json:"czCount"` GeoCount uint64 `json:"geoCount"` DeepCZCount uint64 `json:"deepCzCount"` MissCount uint64 `json:"missCount"` DSRCount uint64 `json:"dsrCount"` ErrCount uint64 `json:"errCount"` StaticRouteCount uint64 `json:"staticRouteCount"` FedCount uint64 `json:"fedCount"` RegionalDeniedCount uint64 `json:"regionalDeniedCount"` RegionalAlternateCount uint64 `json:"regionalAlternateCount"` }
CRSStatsStat represents an individual stat.
type CRSStatsStats ¶
type CRSStatsStats struct { DNSMap map[string]CRSStatsStat HTTPMap map[string]CRSStatsStat }
CRSStatsStats represents stats about a given TR.
type CRStates ¶
type CRStates struct { Caches map[CacheName]IsAvailable `json:"caches"` DeliveryService map[DeliveryServiceName]CRStatesDeliveryService `json:"deliveryServices"` }
CRStates includes availability data for caches and delivery services, as gathered and aggregated by this Traffic Monitor. It is designed to be served at an API endpoint primarily for Traffic Routers (Content Router) to consume.
func CRStatesUnMarshall ¶
CRStatesUnMarshall takes bytes of a JSON string, and unmarshals them into a CRStates object.
func NewCRStates ¶
NewCRStates creates a new CR states object, initializing pointer members.
func (CRStates) Copy ¶
Copy creates a deep copy of this object. It does not mutate, and is thus safe for multiple goroutines.
func (CRStates) CopyCaches ¶
func (a CRStates) CopyCaches() map[CacheName]IsAvailable
CopyCaches creates a deep copy of the cache availability data. It does not mutate, and is thus safe for multiple goroutines.
func (CRStates) CopyDeliveryServices ¶
func (a CRStates) CopyDeliveryServices() map[DeliveryServiceName]CRStatesDeliveryService
CopyDeliveryServices creates a deep copy of the delivery service availability data. It does not mutate, and is thus safe for multiple goroutines.
type CRStatesDeliveryService ¶
type CRStatesDeliveryService struct { DisabledLocations []CacheGroupName `json:"disabledLocations"` IsAvailable bool `json:"isAvailable"` }
CRStatesDeliveryService contains data about the availability of a particular delivery service, and which caches in that delivery service have been marked as unavailable.
type CacheGroup ¶
type CacheGroup struct { ID int `json:"id" db:"id"` Name string `json:"name" db:"name"` ShortName string `json:"shortName" db:"short_name"` Latitude float64 `json:"latitude" db:"latitude"` Longitude float64 `json:"longitude" db:"longitude"` ParentName string `json:"parentCachegroupName" db:"parent_cachegroup_name"` ParentCachegroupID int `json:"parentCachegroupId" db:"parent_cachegroup_id"` SecondaryParentName string `json:"secondaryParentCachegroupName" db:"secondary_parent_cachegroup_name"` SecondaryParentCachegroupID int `json:"secondaryParentCachegroupId" db:"secondary_parent_cachegroup_id"` FallbackToClosest bool `json:"fallbackToClosest" db:"fallback_to_closest"` LocalizationMethods []LocalizationMethod `json:"localizationMethods" db:"localization_methods"` Type string `json:"typeName" db:"type_name"` // aliased to type_name to disambiguate struct scans due to join on 'type' table TypeID int `json:"typeId" db:"type_id"` // aliased to type_id to disambiguate struct scans due join on 'type' table LastUpdated TimeNoMod `json:"lastUpdated" db:"last_updated"` Fallbacks []string `json:"fallbacks" db:"fallbacks"` }
CacheGroup contains information about a given cache group in Traffic Ops.
type CacheGroupDetailResponse ¶
type CacheGroupDetailResponse struct { Response CacheGroupNullable `json:"response"` Alerts }
CacheGroupDetailResponse is the JSON object returned for a single Cache Group.
type CacheGroupDetailResponseV5 ¶
type CacheGroupDetailResponseV5 = CacheGroupDetailResponseV50
CacheGroupDetailResponseV5 is the type of response from the cachegroups Traffic Ops endpoint. It always points to the type for the latest minor version of CacheGroupDetailResponseV5x APIv5.
type CacheGroupDetailResponseV50 ¶
type CacheGroupDetailResponseV50 struct { Response CacheGroupNullableV50 `json:"response"` Alerts }
CacheGroupDetailResponseV50 is the JSON object returned for a single Cache Group.
type CacheGroupNullable ¶
type CacheGroupNullable struct { ID *int `json:"id" db:"id"` Name *string `json:"name" db:"name"` ShortName *string `json:"shortName" db:"short_name"` Latitude *float64 `json:"latitude" db:"latitude"` Longitude *float64 `json:"longitude" db:"longitude"` ParentName *string `json:"parentCachegroupName" db:"parent_cachegroup_name"` ParentCachegroupID *int `json:"parentCachegroupId" db:"parent_cachegroup_id"` SecondaryParentName *string `json:"secondaryParentCachegroupName" db:"secondary_parent_cachegroup_name"` SecondaryParentCachegroupID *int `json:"secondaryParentCachegroupId" db:"secondary_parent_cachegroup_id"` FallbackToClosest *bool `json:"fallbackToClosest" db:"fallback_to_closest"` LocalizationMethods *[]LocalizationMethod `json:"localizationMethods" db:"localization_methods"` Type *string `json:"typeName" db:"type_name"` // aliased to type_name to disambiguate struct scans due to join on 'type' table TypeID *int `json:"typeId" db:"type_id"` // aliased to type_id to disambiguate struct scans due join on 'type' table LastUpdated *TimeNoMod `json:"lastUpdated" db:"last_updated"` Fallbacks *[]string `json:"fallbacks" db:"fallbacks"` }
CacheGroupNullable contains information about a given cache group in Traffic Ops. Unlike CacheGroup, CacheGroupNullable's fields are nullable.
type CacheGroupNullableV5 ¶
type CacheGroupNullableV5 = CacheGroupNullableV50
CacheGroupNullableV5 always points to the type for the latest minor version of CacheGroupNullableV5x APIv5.
type CacheGroupNullableV50 ¶
type CacheGroupNullableV50 struct { ID *int `json:"id" db:"id"` Name *string `json:"name" db:"name"` ShortName *string `json:"shortName" db:"short_name"` Latitude *float64 `json:"latitude" db:"latitude"` Longitude *float64 `json:"longitude" db:"longitude"` ParentName *string `json:"parentCachegroupName" db:"parent_cachegroup_name"` ParentCachegroupID *int `json:"parentCachegroupId" db:"parent_cachegroup_id"` SecondaryParentName *string `json:"secondaryParentCachegroupName" db:"secondary_parent_cachegroup_name"` SecondaryParentCachegroupID *int `json:"secondaryParentCachegroupId" db:"secondary_parent_cachegroup_id"` FallbackToClosest *bool `json:"fallbackToClosest" db:"fallback_to_closest"` LocalizationMethods *[]LocalizationMethod `json:"localizationMethods" db:"localization_methods"` Type *string `json:"typeName" db:"type_name"` // aliased to type_name to disambiguate struct scans due to join on 'type' table TypeID *int `json:"typeId" db:"type_id"` // aliased to type_id to disambiguate struct scans due join on 'type' table LastUpdated *time.Time `json:"lastUpdated" db:"last_updated"` Fallbacks *[]string `json:"fallbacks" db:"fallbacks"` }
CacheGroupNullableV50 contains information about a given cache group in Traffic Ops. Unlike CacheGroup, CacheGroupNullable's fields are nullable.
type CacheGroupParameter
deprecated
type CacheGroupParameter struct { ConfigFile string `json:"configFile"` ID int `json:"id"` LastUpdated TimeNoMod `json:"lastUpdated"` Name string `json:"name"` Secure bool `json:"secure"` Value string `json:"value"` }
A CacheGroupParameter is an object that represents a Parameter, but also implies that it is associated with a Cache Group rather than (or in addition to) a Profile.
Deprecated: Cache Group Parameter associations have been removed in APIv4.
type CacheGroupParameterNullable
deprecated
type CacheGroupParameterNullable struct { ConfigFile *string `json:"configFile" db:"config_file"` ID *int `json:"id" db:"id"` LastUpdated *TimeNoMod `json:"lastUpdated" db:"last_updated"` Name *string `json:"name" db:"name"` Secure *bool `json:"secure" db:"secure"` Value *string `json:"value" db:"value"` }
A CacheGroupParameterNullable is an object that represents a Parameter, but also implies that it is associated with a Cache Group rather than (or in addition to) a Profile.
The only substantial difference between this and a CacheGroupParameter is that Go client methods unmarshal Traffic Ops responses into a CacheGroupParameter, while those responses are generated by marshalling data stored in CacheGroupParameterNullables.
Deprecated: Cache Group Parameter associations have been removed in APIv4.
type CacheGroupParameterRequest
deprecated
type CacheGroupParametersList
deprecated
type CacheGroupParametersList struct {
CacheGroupParameters []CacheGroupParametersResponseNullable `json:"cachegroupParameters"`
}
CacheGroupParametersList is the type of the `response` property of Traffic Ops's responses to its /cachegroupparameters API endpoint.
Deprecated: Cache Group Parameter associations have been removed in APIv4.
type CacheGroupParametersNullable
deprecated
type CacheGroupParametersNullable struct { CacheGroup *int `json:"cacheGroupId" db:"cachegroup"` CacheGroupName *string `json:"cachegroup,omitempty"` Parameter *int `json:"parameterId" db:"parameter"` LastUpdated *TimeNoMod `json:"lastUpdated,omitempty" db:"last_updated"` }
CacheGroupParametersNullable is the type of a response from Traffic Ops to a POST request made to its /cachegroupparameters API endpoint.
Deprecated: Cache Group Parameter associations have been removed in APIv4.
type CacheGroupParametersPostResponse
deprecated
type CacheGroupParametersPostResponse struct { Response []CacheGroupParameterRequest `json:"response"` Alerts }
CacheGroupParametersPostResponse Response body when Posting to associate a Parameter with a Cache Group.
Deprecated: Cache Group Parameter associations have been removed in APIv4.
type CacheGroupParametersResponse
deprecated
type CacheGroupParametersResponse struct { Response []CacheGroupParameter `json:"response"` Alerts }
CacheGroupParametersResponse is a Cache Group Parameter response body.
Deprecated: Cache Group Parameter associations have been removed in APIv4.
type CacheGroupParametersResponseNullable
deprecated
type CacheGroupParametersResponseNullable struct { CacheGroup *string `json:"cachegroup" db:"cachegroup"` Parameter *int `json:"parameter" db:"parameter"` LastUpdated *TimeNoMod `json:"last_updated,omitempty" db:"last_updated"` }
CacheGroupParametersResponseNullable is the type of each entry in the `cachegroupParameters` property of the response from Traffic Ops to requests made to its /cachegroupparameters endpoint.
Deprecated: Cache Group Parameter associations have been removed in APIv4.
func FormatForResponse
deprecated
func FormatForResponse(param CacheGroupParametersNullable) CacheGroupParametersResponseNullable
FormatForResponse converts a CacheGroupParametersNullable to CacheGroupParametersResponseNullable in order to format the output the same as the Perl endpoint.
Deprecated: Cache Group Parameter associations have been removed in APIv4.
type CacheGroupPostDSResp ¶
type CacheGroupPostDSResp struct { ID util.JSONIntStr `json:"id"` ServerNames []CacheName `json:"serverNames"` DeliveryServices []int `json:"deliveryServices"` }
CacheGroupPostDSResp is the type of the `response` property of a response from Traffic Ops to a POST request made to its /cachegroups/{{ID}}/deliveryservices API endpoint.
type CacheGroupPostDSRespResponse ¶
type CacheGroupPostDSRespResponse struct { Alerts Response CacheGroupPostDSResp `json:"response"` }
CacheGroupPostDSRespResponse is the type of a response from Traffic Ops to a POST request made to its /cachegroups/{{ID}}/deliveryservices API endpoint.
type CacheGroupV5 ¶
type CacheGroupV5 = CacheGroupV50
CacheGroupV5 always points to the type for the latest minor version of CacheGroupV5x APIv5.
type CacheGroupV50 ¶
type CacheGroupV50 struct { ID int `json:"id" db:"id"` Name string `json:"name" db:"name"` ShortName string `json:"shortName" db:"short_name"` Latitude float64 `json:"latitude" db:"latitude"` Longitude float64 `json:"longitude" db:"longitude"` ParentName string `json:"parentCachegroupName" db:"parent_cachegroup_name"` ParentCachegroupID int `json:"parentCachegroupId" db:"parent_cachegroup_id"` SecondaryParentName string `json:"secondaryParentCachegroupName" db:"secondary_parent_cachegroup_name"` SecondaryParentCachegroupID int `json:"secondaryParentCachegroupId" db:"secondary_parent_cachegroup_id"` FallbackToClosest bool `json:"fallbackToClosest" db:"fallback_to_closest"` LocalizationMethods []LocalizationMethod `json:"localizationMethods" db:"localization_methods"` Type string `json:"typeName" db:"type_name"` // aliased to type_name to disambiguate struct scans due to join on 'type' table TypeID int `json:"typeId" db:"type_id"` // aliased to type_id to disambiguate struct scans due join on 'type' table LastUpdated time.Time `json:"lastUpdated" db:"last_updated"` Fallbacks []string `json:"fallbacks" db:"fallbacks"` }
CacheGroupV50 contains information about a given cache group in Traffic Ops.
type CacheGroupsNullableResponse ¶
type CacheGroupsNullableResponse struct { Response []CacheGroupNullable `json:"response"` Alerts }
CacheGroupsNullableResponse is a response with a list of CacheGroupNullables. Traffic Ops API responses instead uses an interface hold a list of TOCacheGroups.
type CacheGroupsNullableResponseV5 ¶
type CacheGroupsNullableResponseV5 = CacheGroupsNullableResponseV50
CacheGroupsNullableResponseV5 is the type of response from the cachegroups Traffic Ops endpoint. It always points to the type for the latest minor version of CacheGroupsNullableResponseV5x APIv5.
type CacheGroupsNullableResponseV50 ¶
type CacheGroupsNullableResponseV50 struct { Response []CacheGroupNullableV50 `json:"response"` Alerts }
CacheGroupsNullableResponseV50 is a response with a list of CacheGroupNullables. Traffic Ops API responses instead uses an interface hold a list of TOCacheGroups.
type CacheGroupsResponse ¶
type CacheGroupsResponse struct { Response []CacheGroup `json:"response"` Alerts }
CacheGroupsResponse is a list of CacheGroups as a response.
type CacheGroupsResponseV5 ¶
type CacheGroupsResponseV5 = CacheGroupsResponseV50
CacheGroupsResponseV5 is the type of response from the cachegroups Traffic Ops endpoint. It always points to the type for the latest minor version of CacheGroupsResponseV5x APIv5.
type CacheGroupsResponseV50 ¶
type CacheGroupsResponseV50 struct { Response []CacheGroupV50 `json:"response"` Alerts }
CacheGroupsResponseV50 is a list of CacheGroups as a response.
type CacheStatus ¶
type CacheStatus string
CacheStatus is a Name of some Status.
More specifically, it is used here to enumerate the Statuses that are understood and acted upon in specific ways by Traffic Monitor.
Note that the Statuses captured in this package as CacheStatus values are in no way restricted to use by cache servers, despite the name.
func CacheStatusFromString ¶
func CacheStatusFromString(s string) CacheStatus
CacheStatusFromString returns a CacheStatus from its string representation, or CacheStatusInvalid if the string is not a valid CacheStatus.
func (CacheStatus) String ¶
func (t CacheStatus) String() string
String returns a string representation of this CacheStatus, implementing the fmt.Stringer interface.
type CacheType ¶
type CacheType string
CacheType is the type (or tier) of a cache server.
func CacheTypeFromString ¶
CacheTypeFromString returns a CacheType structure from its string representation, or CacheTypeInvalid if the string is not a valid CacheType.
type CachegroupPostDSReq ¶
type CachegroupPostDSReq struct {
DeliveryServices []int `json:"deliveryServices"`
}
A CachegroupPostDSReq is a request to associate some Cache Group with a set of zero or more Delivery Services.
type CachegroupQueueUpdatesRequest ¶
type CachegroupQueueUpdatesRequest struct { Action string `json:"action"` CDN *CDNName `json:"cdn"` CDNID *util.JSONIntStr `json:"cdnId"` }
CachegroupQueueUpdatesRequest holds info relating to the cachegroups/{{ID}}/queue_update TO route.
type CachegroupQueueUpdatesRequestV5 ¶
type CachegroupQueueUpdatesRequestV5 = CachegroupQueueUpdatesRequestV50
CachegroupQueueUpdatesRequestV5 is the type of request to the cachegroups Traffic Ops endpoint. It always points to the type for the latest minor version of CachegroupQueueUpdatesRequestV5x APIv5.
type CachegroupQueueUpdatesRequestV50 ¶
type CachegroupQueueUpdatesRequestV50 struct { Action string `json:"action"` CDN *CDNName `json:"cdn"` CDNID *util.JSONIntStr `json:"cdnId"` }
CachegroupQueueUpdatesRequestV50 holds info relating to the cachegroups/{{ID}}/queue_update TO route.
type CachegroupTrimmedName ¶
type CachegroupTrimmedName struct {
Name string `json:"name"`
}
CachegroupTrimmedName is useful when the only info about a cache group you want to return is its name.
type CachegroupTrimmedNameV5 ¶
type CachegroupTrimmedNameV5 = CachegroupTrimmedNameV50
CachegroupTrimmedNameV5 always points to the type for the latest minor version of CachegroupTrimmedNameV5x APIv5.
type CachegroupTrimmedNameV50 ¶
type CachegroupTrimmedNameV50 struct {
Name string `json:"name"`
}
CachegroupTrimmedNameV50 is useful when the only info about a cache group you want to return is its name.
type CapabilitiesResponse ¶
type CapabilitiesResponse struct { Response []Capability `json:"response"` Alerts }
CapabilitiesResponse models the structure of a minimal response from the Capabilities API in Traffic Ops.
type Capability ¶
type Capability struct { Description string `json:"description" db:"description"` LastUpdated TimeNoMod `json:"lastUpdated" db:"last_updated"` Name string `json:"name" db:"name"` }
Capability reflects the ability of a user in ATC to perform some operation.
In practice, they are assigned to relevant Traffic Ops API endpoints - to describe the capabilities of said endpoint - and to user permission Roles - to describe the capabilities afforded by said Role. Note that enforcement of Capability-based permissions is not currently implemented.
type CommonAPIData ¶
CommonAPIData contains generic data common to most Traffic Monitor API endpoints.
type CommonCheckFields ¶
type CommonCheckFields struct { // AdminState is the server's status - called "AdminState" for legacy reasons. AdminState string `json:"adminState"` // CacheGroup is the name of the Cache Group to which the server belongs. CacheGroup string `json:"cacheGroup"` // ID is the integral, unique identifier of the server. ID int `json:"id"` // HostName of the checked server. HostName string `json:"hostName"` // RevalPending is a flag that indicates if revalidations are pending for the checked server. RevalPending bool `json:"revalPending"` // Profile is the name of the Profile used by the checked server. Profile string `json:"profile"` // Type is the name of the server's Type. Type string `json:"type"` // UpdPending is a flag that indicates if updates are pending for the checked server. UpdPending bool `json:"updPending"` }
CommonCheckFields is a structure containing all of the fields common to both Serverchecks and GenericServerChecks.
type CommonServerProperties ¶
type CommonServerProperties struct { Cachegroup *string `json:"cachegroup" db:"cachegroup"` CachegroupID *int `json:"cachegroupId" db:"cachegroup_id"` CDNID *int `json:"cdnId" db:"cdn_id"` CDNName *string `json:"cdnName" db:"cdn_name"` DeliveryServices *map[string][]string `json:"deliveryServices,omitempty"` DomainName *string `json:"domainName" db:"domain_name"` FQDN *string `json:"fqdn,omitempty"` FqdnTime time.Time `json:"-"` GUID *string `json:"guid" db:"guid"` HostName *string `json:"hostName" db:"host_name"` HTTPSPort *int `json:"httpsPort" db:"https_port"` ID *int `json:"id" db:"id"` ILOIPAddress *string `json:"iloIpAddress" db:"ilo_ip_address"` ILOIPGateway *string `json:"iloIpGateway" db:"ilo_ip_gateway"` ILOIPNetmask *string `json:"iloIpNetmask" db:"ilo_ip_netmask"` ILOPassword *string `json:"iloPassword" db:"ilo_password"` ILOUsername *string `json:"iloUsername" db:"ilo_username"` LastUpdated *TimeNoMod `json:"lastUpdated" db:"last_updated"` // Deprecated: In the future, management interfaces must be configured as // interfaces within the Interfaces of the server, not separately on these // properties. MgmtIPAddress *string `json:"mgmtIpAddress" db:"mgmt_ip_address"` // Deprecated: In the future, management interfaces must be configured as // interfaces within the Interfaces of the server, not separately on these // properties. MgmtIPGateway *string `json:"mgmtIpGateway" db:"mgmt_ip_gateway"` // Deprecated: In the future, management interfaces must be configured as // interfaces within the Interfaces of the server, not separately on these // properties. MgmtIPNetmask *string `json:"mgmtIpNetmask" db:"mgmt_ip_netmask"` OfflineReason *string `json:"offlineReason" db:"offline_reason"` PhysLocation *string `json:"physLocation" db:"phys_location"` PhysLocationID *int `json:"physLocationId" db:"phys_location_id"` Profile *string `json:"profile" db:"profile"` // Deprecated: In API versions 4 and later, Profile descriptions must be // taken from the Profiles themselves, and Servers only contain identifying // information for their Profiles. ProfileDesc *string `json:"profileDesc" db:"profile_desc"` // Deprecated: In API versions 4 and later, Servers identify their Profiles // by Name, not ID. ProfileID *int `json:"profileId" db:"profile_id"` Rack *string `json:"rack" db:"rack"` // Deprecated: In APIv5 and later, this extraneous field is not calculated // by Traffic Ops; the information is available by comparing RevalUpdateTime // to RevalApplyTime. RevalPending *bool `json:"revalPending" db:"reval_pending"` Status *string `json:"status" db:"status"` StatusID *int `json:"statusId" db:"status_id"` TCPPort *int `json:"tcpPort" db:"tcp_port"` Type string `json:"type" db:"server_type"` TypeID *int `json:"typeId" db:"server_type_id"` // Deprecated: In APIv5 and later, this extraneous field is not calculated // by Traffic Ops; the information is available by comparing // ConfigUpdateTime to ConfigApplyTime. UpdPending *bool `json:"updPending" db:"upd_pending"` XMPPID *string `json:"xmppId" db:"xmpp_id"` XMPPPasswd *string `json:"xmppPasswd" db:"xmpp_passwd"` }
CommonServerProperties is just the collection of properties which are shared by all servers across API versions.
type ConfigFileName ¶
type ConfigFileName string
ConfigFileName is a Parameter ConfigFile value.
This has no additional attached semantics, and so while it is known to most frequently refer to a Parameter's ConfigFile, it may also be used to refer to the name of a literal configuration file within or without the context of Traffic Control, with unknown specificity (relative or absolute path? file:// URL?) and/or restrictions.
type Coordinate ¶
type Coordinate struct { // The Coordinate to retrieve // // ID of the Coordinate // // required: true ID int `json:"id" db:"id"` // Name of the Coordinate // // required: true Name string `json:"name" db:"name"` // the latitude of the Coordinate // // required: true Latitude float64 `json:"latitude" db:"latitude"` // the latitude of the Coordinate // // required: true Longitude float64 `json:"longitude" db:"longitude"` // LastUpdated // LastUpdated TimeNoMod `json:"lastUpdated" db:"last_updated"` }
Coordinate is a representation of a Coordinate as it relates to the Traffic Ops data model. Deprecated: In newer API versions, coordinates are represented by the CoordinateV5 structures.
type CoordinateNullable ¶
type CoordinateNullable struct { // The Coordinate to retrieve // // ID of the Coordinate // // required: true ID *int `json:"id" db:"id"` // Name of the Coordinate // // required: true Name *string `json:"name" db:"name"` // the latitude of the Coordinate // // required: true Latitude *float64 `json:"latitude" db:"latitude"` // the latitude of the Coordinate // // required: true Longitude *float64 `json:"longitude" db:"longitude"` // LastUpdated // LastUpdated *TimeNoMod `json:"lastUpdated" db:"last_updated"` }
CoordinateNullable is identical to Coordinate except that its fields are reference values, which allows them to be nil. Deprecated: In newer API versions, coordinates are represented by the CoordinateV5 structures.
type CoordinateResponse ¶
type CoordinateResponse struct { // in: body Response Coordinate `json:"response"` Alerts }
CoordinateResponse is a single Coordinate response for Update and Create to depict what changed. Deprecated: In newer API versions, coordinates are represented by the CoordinateResponseV5 structures. swagger:response CoordinateResponse in: body
type CoordinateResponseV5 ¶
type CoordinateResponseV5 struct { Alerts Response CoordinateV5 }
CoordinateResponseV5 is the type of a response from the /coordinates endpoint in the latest minor version of APIv5.
type CoordinateV5 ¶
type CoordinateV5 = CoordinateV50
CoordinateV5 is the representation of a Coordinate used in the latest minor version of APIv5.
type CoordinateV50 ¶
type CoordinateV50 struct { // The integral, unique identifier of a Coordinate. ID *int `json:"id" db:"id"` // The Coordinate's name. Name string `json:"name" db:"name"` // The latitude of the Coordinate. Latitude float64 `json:"latitude" db:"latitude"` // The longitude of the Coordinate. Longitude float64 `json:"longitude" db:"longitude"` // The time and date at which the Coordinate was last modified. LastUpdated time.Time `json:"lastUpdated" db:"last_updated"` }
CoordinateV50 is the representation of a Coordinate used in API v5.0.
type CoordinatesResponse ¶
type CoordinatesResponse struct { // in: body Response []Coordinate `json:"response"` Alerts }
CoordinatesResponse is a list of Coordinates as a response. Deprecated: In newer API versions, coordinates are represented by the CoordinatesResponseV5 structures. swagger:response CoordinatesResponse in: body
type CoordinatesResponseV5 ¶
type CoordinatesResponseV5 struct { Alerts Response []CoordinateV5 }
CoordinatesResponseV5 is the type of a response from the /coordinates endpoint in the latest minor version of APIv5.
type CoverageZoneFile ¶
type CoverageZoneFile struct {
CoverageZones map[string]CoverageZoneLocation `json:"coverageZones,omitempty"`
}
CoverageZoneFile is used for unmarshalling a Coverage Zone File.
type CoverageZoneLocation ¶
type CoverageZoneLocation struct { Network []string `json:"network,omitempty"` Network6 []string `json:"network6,omitempty"` }
func (*CoverageZoneLocation) GetFirstIPAddressOfType ¶
func (c *CoverageZoneLocation) GetFirstIPAddressOfType(isIPv4 bool) string
type CreateCDNFederationResponse ¶
type CreateCDNFederationResponse struct { Response CDNFederation `json:"response"` Alerts }
CreateCDNFederationResponse represents a Traffic Ops API response to a request to create a new Federation for a CDN.
type CreateDeliveryServiceNullableResponse
deprecated
type CreateDeliveryServiceNullableResponse struct { Response []DeliveryServiceNullable `json:"response"` Alerts }
CreateDeliveryServiceNullableResponse roughly models the structure of responses from Traffic Ops to POST requests made to its /deliveryservices API endpoint.
"Roughly" because although that's what it's used for, this type cannot actually represent those accurately, because its representation is tied to a version of the API that no longer exists - DO NOT USE THIS, it WILL drop data that the API returns.
Deprecated: Please only use the versioned structures.
type CreateUserResponse ¶
CreateUserResponse can hold a Traffic Ops API response to a POST request to create a user.
type CreateUserResponseV4 ¶
CreateUserResponseV4 can hold a Traffic Ops API response to a POST request to create a user in api v4.
type CurrentStatsResponse ¶
type CurrentStatsResponse = TrafficStatsCDNStatsResponse
CurrentStatsResponse is the type of a response from Traffic Ops to a request to its /current_stats endpoint.
type CurrentUserUpdateRequest ¶
type CurrentUserUpdateRequest struct { // User, for whatever reason, contains all of the actual data. User *CurrentUserUpdateRequestUser `json:"user"` }
CurrentUserUpdateRequest differs from a regular User/UserCurrent in that many of its fields are *parsed* but not *unmarshaled*. This allows a handler to distinguish between "null" and "undefined" values.
type CurrentUserUpdateRequestUser ¶
type CurrentUserUpdateRequestUser struct { AddressLine1 json.RawMessage `json:"addressLine1"` AddressLine2 json.RawMessage `json:"addressLine2"` City json.RawMessage `json:"city"` Company json.RawMessage `json:"company"` ConfirmLocalPasswd *string `json:"confirmLocalPasswd"` Country json.RawMessage `json:"country"` Email json.RawMessage `json:"email"` FullName json.RawMessage `json:"fullName"` GID json.RawMessage `json:"gid"` ID json.RawMessage `json:"id"` LocalPasswd *string `json:"localPasswd"` PhoneNumber json.RawMessage `json:"phoneNumber"` PostalCode json.RawMessage `json:"postalCode"` PublicSSHKey json.RawMessage `json:"publicSshKey"` Role json.RawMessage `json:"role"` StateOrProvince json.RawMessage `json:"stateOrProvince"` TenantID json.RawMessage `json:"tenantId"` UID json.RawMessage `json:"uid"` Username json.RawMessage `json:"username"` }
CurrentUserUpdateRequestUser holds all of the actual data in a request to update the current user.
func (*CurrentUserUpdateRequestUser) UnmarshalAndValidate ¶
func (u *CurrentUserUpdateRequestUser) UnmarshalAndValidate(user *User) error
UnmarshalAndValidate validates the request and returns a User into which the request's information has been unmarshalled.
type DNSSECKey ¶
type DNSSECKey struct { DNSSECKeyV11 DSRecord *DNSSECKeyDSRecord `json:"dsRecord,omitempty"` }
A DNSSECKey is a DNSSEC Key (Key-Signing or Zone-Signing) and all associated data - computed data as well as data that is actually stored by Traffic Vault.
type DNSSECKeyDSRecord ¶
type DNSSECKeyDSRecord struct { DNSSECKeyDSRecordV11 Text string `json:"text"` }
DNSSECKeyDSRecord structures are used by the Traffic Ops API after version 1.1, and they contain all the same information as well as an additional "Text" property of unknown purpose.
type DNSSECKeyDSRecordRiak ¶
type DNSSECKeyDSRecordRiak DNSSECKeyDSRecordV11
DNSSECKeyDSRecordRiak is a DNSSEC key DS record, as stored in Riak. This is specifically the key data, without the DS record text (which can be computed), and is also the format used in API 1.1 through 1.3.
type DNSSECKeyDSRecordV11 ¶
type DNSSECKeyDSRecordV11 struct { Algorithm int64 `json:"algorithm,string"` DigestType int64 `json:"digestType,string"` Digest string `json:"digest"` }
DNSSECKeyDSRecordV11 structures contain meta information for Key-Signing DNSSEC Keys (KSKs) used by Delivery Services.
type DNSSECKeySet ¶
A DNSSECKeySet is a set of keys used for DNSSEC zone and key signing.
type DNSSECKeySetV11 ¶
type DNSSECKeySetV11 struct { ZSK []DNSSECKeyV11 `json:"zsk"` KSK []DNSSECKeyV11 `json:"ksk"` }
DNSSECKeySetV11 is a DNSSEC key set (ZSK and KSK), as stored in Traffic Vault. This is specifically the key data, without the DS record text (which can be computed), and was also the format used in API 1.1 through 1.3.
type DNSSECKeyV11 ¶
type DNSSECKeyV11 struct { InceptionDateUnix int64 `json:"inceptionDate"` ExpirationDateUnix int64 `json:"expirationDate"` Name string `json:"name"` TTLSeconds uint64 `json:"ttl,string"` Status string `json:"status"` EffectiveDateUnix int64 `json:"effectiveDate"` Public string `json:"public"` Private string `json:"private"` DSRecord *DNSSECKeyDSRecordV11 `json:"dsRecord,omitempty"` }
A DNSSECKeyV11 represents a DNSSEC Key (Key-Signing or Zone-Signing) as it appeared in Traffic Ops API version 1.1. This structure still exists because it is used by modern structures, but in general should not be used on its own, and github.com/apache/trafficcontrol/v8/lib/go-tc.DNSSECKey should usually be used instead.
type DNSSECKeys ¶
type DNSSECKeys map[string]DNSSECKeySet
DNSSECKeys is the DNSSEC keys as stored in Traffic Vault, plus the DS record text.
type DNSSECKeysRiak
deprecated
type DNSSECKeysRiak DNSSECKeysV11
DNSSECKeysRiak is the structure in which DNSSECKeys are stored in the Riak backend for Traffic Vault.
Deprecated: use DNSSECKeysTrafficVault instead.
type DNSSECKeysTrafficVault ¶
type DNSSECKeysTrafficVault DNSSECKeysV11
A DNSSECKeysTrafficVault is a mapping of CDN Names and/or Delivery Service XMLIDs to sets of keys used for DNSSEC with that CDN or Delivery Service.
type DNSSECKeysV11 ¶
type DNSSECKeysV11 map[string]DNSSECKeySetV11
DNSSECKeysV11 is the DNSSEC keys object stored in Traffic Vault. The map key strings are both DeliveryServiceNames and CDNNames.
type DSMatchType ¶
type DSMatchType string
A DSMatchType is the Name of a Type of a Regular Expression ("Regex") used by a Delivery Service.
const ( DSMatchTypeHostRegex DSMatchType = "HOST_REGEXP" DSMatchTypePathRegex DSMatchType = "PATH_REGEXP" DSMatchTypeSteeringRegex DSMatchType = "STEERING_REGEXP" DSMatchTypeHeaderRegex DSMatchType = "HEADER_REGEXP" DSMatchTypeInvalid DSMatchType = "" )
These are the allowed values for a DSMatchType.
Note that, in general, there is no guarantee that a Type by any of these Names exists in Traffic Ops at any given time, nor that any such Types - should they exist - will have any particular UseInTable value, nor that the Types assigned to Delivery Service Regexes will be representable by these values.
func DSMatchTypeFromString ¶
func DSMatchTypeFromString(s string) DSMatchType
DSMatchTypeFromString returns a DSMatchType from its string representation, or DSMatchTypeInvalid if the string is not a valid type.
func (DSMatchType) String ¶
func (t DSMatchType) String() string
String returns a string representation of this DSMatchType, implementing the fmt.Stringer interface.
type DSRChangeType ¶
type DSRChangeType string
DSRChangeType is an "enumerated" string type that encodes the legal values of a Delivery Service Request's Change Type.
func DSRChangeTypeFromString ¶
func DSRChangeTypeFromString(s string) (DSRChangeType, error)
DSRChangeTypeFromString converts the passed string to a DSRChangeType (case-insensitive), returning an error if the string is not a valid Delivery Service Request Change Type.
func (DSRChangeType) MarshalJSON ¶
func (dsrct DSRChangeType) MarshalJSON() ([]byte, error)
MarshalJSON implements the encoding/json.Marshaller interface.
func (DSRChangeType) String ¶
func (dsrct DSRChangeType) String() string
String implements the fmt.Stringer interface, returning a textual representation of the DSRChangeType.
func (*DSRChangeType) UnmarshalJSON ¶
func (dsrct *DSRChangeType) UnmarshalJSON(b []byte) error
UnmarshalJSON implements the encoding/json.Unmarshaller interface.
Example ¶
var dsrct DSRChangeType raw := `"CREATE"` if err := json.Unmarshal([]byte(raw), &dsrct); err != nil { fmt.Printf("Error: %v\n", err) return } fmt.Printf("Parsed DSRCT: '%s'\n", dsrct.String()) raw = `"something invalid"` if err := json.Unmarshal([]byte(raw), &dsrct); err != nil { fmt.Printf("Error: %v\n", err) return } fmt.Printf("Parsed DSRCT: '%s'\n", dsrct.String())
Output: Parsed DSRCT: 'create' Error: invalid Delivery Service Request changeType: 'something invalid'
type DSSMapResponse
deprecated
type DSSMapResponse struct { DsId int `json:"dsId"` Replace bool `json:"replace"` Servers []int `json:"servers"` }
DSSMapResponse is the type of the `response` property of a response from Traffic Ops to a PUT request made to the /deliveryserviceserver endpoint of its API.
Deprecated: Direct server-to-DS assignments are deprecated in favor of Topology usage.
type DSSReplaceResponse
deprecated
type DSSReplaceResponse struct { Alerts Response DSSMapResponse `json:"response"` }
DSSReplaceResponse is the type of a response from Traffic Ops to a PUT request made to the /deliveryserviceserver endpoint of its API.
Deprecated: Direct server-to-DS assignments are deprecated in favor of Topology usage.
type DSServer
deprecated
type DSServer struct { DSServerBase ServerInterfaces *[]ServerInterfaceInfo `json:"interfaces" db:"interfaces"` }
DSServer contains information for a Delivery Service Server.
Deprecated: Direct server-to-DS assignments are deprecated in favor of Topology usage.
type DSServerBase
deprecated
type DSServerBase struct { Cachegroup *string `json:"cachegroup" db:"cachegroup"` CachegroupID *int `json:"cachegroupId" db:"cachegroup_id"` CDNID *int `json:"cdnId" db:"cdn_id"` CDNName *string `json:"cdnName" db:"cdn_name"` DeliveryServices *map[string][]string `json:"deliveryServices,omitempty"` DomainName *string `json:"domainName" db:"domain_name"` FQDN *string `json:"fqdn,omitempty"` FqdnTime time.Time `json:"-"` GUID *string `json:"guid" db:"guid"` HostName *string `json:"hostName" db:"host_name"` HTTPSPort *int `json:"httpsPort" db:"https_port"` ID *int `json:"id" db:"id"` ILOIPAddress *string `json:"iloIpAddress" db:"ilo_ip_address"` ILOIPGateway *string `json:"iloIpGateway" db:"ilo_ip_gateway"` ILOIPNetmask *string `json:"iloIpNetmask" db:"ilo_ip_netmask"` ILOPassword *string `json:"iloPassword" db:"ilo_password"` ILOUsername *string `json:"iloUsername" db:"ilo_username"` LastUpdated *TimeNoMod `json:"lastUpdated" db:"last_updated"` MgmtIPAddress *string `json:"mgmtIpAddress" db:"mgmt_ip_address"` MgmtIPGateway *string `json:"mgmtIpGateway" db:"mgmt_ip_gateway"` MgmtIPNetmask *string `json:"mgmtIpNetmask" db:"mgmt_ip_netmask"` OfflineReason *string `json:"offlineReason" db:"offline_reason"` PhysLocation *string `json:"physLocation" db:"phys_location"` PhysLocationID *int `json:"physLocationId" db:"phys_location_id"` Profile *string `json:"profile" db:"profile"` ProfileDesc *string `json:"profileDesc" db:"profile_desc"` ProfileID *int `json:"profileId" db:"profile_id"` Rack *string `json:"rack" db:"rack"` RouterHostName *string `json:"routerHostName" db:"router_host_name"` RouterPortName *string `json:"routerPortName" db:"router_port_name"` Status *string `json:"status" db:"status"` StatusID *int `json:"statusId" db:"status_id"` TCPPort *int `json:"tcpPort" db:"tcp_port"` Type string `json:"type" db:"server_type"` TypeID *int `json:"typeId" db:"server_type_id"` UpdPending *bool `json:"updPending" db:"upd_pending"` ServerCapabilities []string `json:"-" db:"server_capabilities"` DeliveryServiceCapabilities []string `json:"-" db:"deliveryservice_capabilities"` }
DSServerBase contains the base information for a Delivery Service Server.
Deprecated: Direct server-to-DS assignments are deprecated in favor of Topology usage.
func (DSServerBase) ToDSServerBaseV4 ¶
func (oldBase DSServerBase) ToDSServerBaseV4() DSServerBaseV4
ToDSServerBaseV4 upgrades the DSServerBase to the structure used by the latest minor version of version 4 of Traffic Ops's API.
type DSServerBaseV4
deprecated
type DSServerBaseV4 struct { Cachegroup *string `json:"cachegroup" db:"cachegroup"` CachegroupID *int `json:"cachegroupId" db:"cachegroup_id"` CDNID *int `json:"cdnId" db:"cdn_id"` CDNName *string `json:"cdnName" db:"cdn_name"` DeliveryServices *map[string][]string `json:"deliveryServices,omitempty"` DomainName *string `json:"domainName" db:"domain_name"` FQDN *string `json:"fqdn,omitempty"` FqdnTime time.Time `json:"-"` GUID *string `json:"guid" db:"guid"` HostName *string `json:"hostName" db:"host_name"` HTTPSPort *int `json:"httpsPort" db:"https_port"` ID *int `json:"id" db:"id"` ILOIPAddress *string `json:"iloIpAddress" db:"ilo_ip_address"` ILOIPGateway *string `json:"iloIpGateway" db:"ilo_ip_gateway"` ILOIPNetmask *string `json:"iloIpNetmask" db:"ilo_ip_netmask"` ILOPassword *string `json:"iloPassword" db:"ilo_password"` ILOUsername *string `json:"iloUsername" db:"ilo_username"` LastUpdated *TimeNoMod `json:"lastUpdated" db:"last_updated"` MgmtIPAddress *string `json:"mgmtIpAddress" db:"mgmt_ip_address"` MgmtIPGateway *string `json:"mgmtIpGateway" db:"mgmt_ip_gateway"` MgmtIPNetmask *string `json:"mgmtIpNetmask" db:"mgmt_ip_netmask"` OfflineReason *string `json:"offlineReason" db:"offline_reason"` PhysLocation *string `json:"physLocation" db:"phys_location"` PhysLocationID *int `json:"physLocationId" db:"phys_location_id"` ProfileNames []string `json:"profileNames" db:"profile_name"` Rack *string `json:"rack" db:"rack"` Status *string `json:"status" db:"status"` StatusID *int `json:"statusId" db:"status_id"` TCPPort *int `json:"tcpPort" db:"tcp_port"` Type string `json:"type" db:"server_type"` TypeID *int `json:"typeId" db:"server_type_id"` UpdPending *bool `json:"updPending" db:"upd_pending"` ServerCapabilities []string `json:"-" db:"server_capabilities"` DeliveryServiceCapabilities []string `json:"-" db:"deliveryservice_capabilities"` }
DSServerBaseV4 contains the base information for a Delivery Service Server.
Deprecated: Direct server-to-DS assignments are deprecated in favor of Topology usage.
func (DSServerBaseV4) ToDSServerBase ¶
func (baseV4 DSServerBaseV4) ToDSServerBase(routerHostName, routerPort, pDesc *string, pID *int) DSServerBase
ToDSServerBase downgrades the DSServerBaseV4 to the structure used by the Traffic Ops API in versions earlier than 4.0.
type DSServerIDs ¶
type DSServerIDs struct { DeliveryServiceID *int `json:"dsId" db:"deliveryservice"` ServerIDs []int `json:"servers"` Replace *bool `json:"replace"` }
A DSServerIDs is a description of relationships between a Delivery Service and zero or more servers, as well as how that relationship may have been recently modified.
type DSServerResponseV30
deprecated
DSServerResponseV30 is the type of a response from Traffic Ops to a request for servers assigned to a Delivery Service - in API version 3.0.
Deprecated: Direct server-to-DS assignments are deprecated in favor of Topology usage.
type DSServerResponseV4
deprecated
type DSServerResponseV4 = DSServerResponseV40
DSServerResponseV4 is the type of a response from Traffic Ops to a request for servers assigned to a Delivery Service - in the latest minor version of API version 4.
Deprecated: Direct server-to-DS assignments are deprecated in favor of Topology usage.
type DSServerResponseV40
deprecated
type DSServerResponseV40 struct { Response []DSServerV4 `json:"response"` Alerts }
DSServerResponseV40 is the type of a response from Traffic Ops to a request for servers assigned to a Delivery Service - in API version 4.0.
Deprecated: Direct server-to-DS assignments are deprecated in favor of Topology usage.
type DSServerResponseV5
deprecated
type DSServerResponseV5 = DSServerResponseV50
DSServerResponseV5 is an alias for the latest minor version of the major version 5.
Deprecated: Direct server-to-DS assignments are deprecated in favor of Topology usage.
type DSServerResponseV50
deprecated
type DSServerResponseV50 struct { Response []DSServerV50 `json:"response"` Alerts }
DSServerResponseV50 is response from Traffic Ops to a request for servers assigned to a Delivery Service - in the latest minor version APIv50.
Deprecated: Direct server-to-DS assignments are deprecated in favor of Topology usage.
type DSServerV11
deprecated
type DSServerV11 struct { DSServerBase LegacyInterfaceDetails }
DSServerV11 contains the legacy format for a Delivery Service Server.
Deprecated: Direct server-to-DS assignments are deprecated in favor of Topology usage.
type DSServerV4
deprecated
type DSServerV4 struct { DSServerBaseV4 ServerInterfaces *[]ServerInterfaceInfoV40 `json:"interfaces" db:"interfaces"` }
DSServerV4 contains information for a V4.x Delivery Service Server.
Deprecated: Direct server-to-DS assignments are deprecated in favor of Topology usage.
func (DSServerV4) Upgrade ¶
func (server DSServerV4) Upgrade() DSServerV5
ToDSServerV5 convert DSServerV4 lastUpdated time format to RFC3339 for DSServerV5 and also assign V4 values to V5
type DSServerV5
deprecated
type DSServerV5 = DSServerV50
DSServerV5 is an alias for the latest minor version of the major version 5.
Deprecated: Direct server-to-DS assignments are deprecated in favor of Topology usage.
type DSServerV50
deprecated
type DSServerV50 struct { ServerV5 DeliveryServices map[string][]string `json:"deliveryServices,omitempty"` ServerCapabilities []string `json:"-" db:"server_capabilities"` DeliveryServiceCapabilities []string `json:"-" db:"deliveryservice_capabilities"` }
DSServerV50 contains information about a server associated with some Delivery Service Server.
Deprecated: Direct server-to-DS assignments are deprecated in favor of Topology usage.
type DSServersResponse
deprecated
type DSServersResponse struct { Response DeliveryServiceServers `json:"response"` Alerts }
DSServersResponse is the type of a response from Traffic Ops to a POST request made to the /deliveryservices/{{XML ID}}/servers endpoint of its API.
Deprecated: Direct server-to-DS assignments are deprecated in favor of Topology usage.
type DSType ¶
type DSType string
DSType is the Name of a Type used by a Delivery Service.
const ( DSTypeClientSteering DSType = "CLIENT_STEERING" DSTypeDNS DSType = "DNS" DSTypeDNSLive DSType = "DNS_LIVE" DSTypeDNSLiveNational DSType = "DNS_LIVE_NATNL" DSTypeHTTP DSType = "HTTP" DSTypeHTTPLive DSType = "HTTP_LIVE" DSTypeHTTPLiveNational DSType = "HTTP_LIVE_NATNL" DSTypeHTTPNoCache DSType = "HTTP_NO_CACHE" DSTypeSteering DSType = "STEERING" DSTypeAnyMap DSType = "ANY_MAP" DSTypeInvalid DSType = "" )
These are the allowable values for a DSType.
Note that, in general, there is no guarantee that a Type by any of these Names exists in Traffic Ops at any given time, nor that any such Types - should they exist - will have any particular UseInTable value, nor that the Types assigned to Delivery Services will be representable by these values.
func DSTypeFromString ¶
DSTypeFromString returns a DSType from its string representation, or DSTypeInvalid if the string is not a valid DSType.
func (DSType) HasSSLKeys ¶
HasSSLKeys returns whether Dlivery Services of this Type can have SSL keys.
func (DSType) IsDNS ¶
IsDNS returns whether a Delivery Service of a Type that has a Name that is this DSType is DNS-routed.
func (DSType) IsHTTP ¶
IsHTTP returns whether a Delivery Service of a Type that has a Name that is this DSType is HTTP-routed.
func (DSType) IsNational ¶
IsNational returns whether Delivery Services of this Type are "national".
func (DSType) IsSteering ¶
IsSteering returns whether a Delivery Service of a Type that has a Name that is this DSType is Steering-routed.
func (DSType) String ¶
String returns a string representation of this DSType, implementing the fmt.Stringer interface.
func (DSType) UsesDNSSECKeys ¶
UsesDNSSECKeys returns whether a Delivery Service of a Type that has a Name that is this DSType uses or needs DNSSEC keys.
func (DSType) UsesMidCache ¶
UsesMidCache returns whether Delivery Services of this Type use mid-tier cache servers.
type DSTypeCategory ¶
type DSTypeCategory string
A DSTypeCategory defines the routing method for a Delivery Service, i.e. HTTP or DNS.
func DSTypeCategoryFromString ¶
func DSTypeCategoryFromString(s string) DSTypeCategory
DSTypeCategoryFromString returns a DSTypeCategory from its string representation, or DSTypeCategoryInvalid if the string is not a valid DSTypeCategory.
This is cAsE-iNsEnSiTiVe.
func (DSTypeCategory) String ¶
func (t DSTypeCategory) String() string
String returns a string representation of this DSTypeCategory, implementing the fmt.Stringer interface.
type DeepCachingType ¶
type DeepCachingType string
DeepCachingType represents a Delivery Service's Deep Caching Type. The string values of this type should match the Traffic Ops values.
func DeepCachingTypeFromString ¶
func DeepCachingTypeFromString(s string) DeepCachingType
DeepCachingTypeFromString returns a DeepCachingType from its string representation, or DeepCachingTypeInvalid if the string is not a valid DeepCachingTypeFromString.
func (DeepCachingType) MarshalJSON ¶
func (t DeepCachingType) MarshalJSON() ([]byte, error)
MarshalJSON marshals into a JSON representation, implementing the encoding/json.Marshaler interface.
func (DeepCachingType) String ¶
func (t DeepCachingType) String() string
String returns a string representation of this DeepCachingType, implementing the fmt.Stringer interface.
func (*DeepCachingType) UnmarshalJSON ¶
func (t *DeepCachingType) UnmarshalJSON(data []byte) error
UnmarshalJSON unmarshals a JSON representation of a DeepCachingType (i.e. a string) or returns an error if the DeepCachingType is invalid.
This implements the encoding/json.Unmarshaler interface.
type DeleteCDNDNSSECKeysResponse ¶
type DeleteCDNDNSSECKeysResponse GenerateCDNDNSSECKeysResponse
DeleteCDNDNSSECKeysResponse is the type of a response from Traffic Ops to DELETE requests made to its /cdns/name/{{name}}/dnsseckeys API endpoint.
type DeleteCDNFederationResponse ¶
type DeleteCDNFederationResponse struct {
Alerts
}
DeleteCDNFederationResponse represents a Traffic Ops API response to a request to remove a Federation from a CDN.
type DeleteDeliveryServiceResponse ¶
type DeleteDeliveryServiceResponse struct {
Alerts
}
DeleteDeliveryServiceResponse is the type of a response from Traffic Ops to DELETE requests made to its /deliveryservices/{{ID}} API endpoint.
type DeleteTenantResponse
deprecated
type DeleteTenantResponse struct {
Alerts []TenantAlert `json:"alerts"`
}
DeleteTenantResponse is a legacy structure used to represent responses to DELETE requests made to Traffic Ops's /tenants API endpoint.
Deprecated: This uses a deprecated type for its Alerts property and drops information returned by the TO API - new code should use TenantResponse instead.
type DeleteUserResponse ¶
type DeleteUserResponse struct {
Alerts
}
DeleteUserResponse can theoretically hold a Traffic Ops API response to a DELETE request to update a user. It is unused.
type DeliveryService
deprecated
type DeliveryService struct { DeliveryServiceV13 MaxOriginConnections int `json:"maxOriginConnections" db:"max_origin_connections"` ConsistentHashRegex string `json:"consistentHashRegex"` ConsistentHashQueryParams []string `json:"consistentHashQueryParams"` }
DeliveryService structures represent a Delivery Service as it is exposed through the Traffic Ops API at version 1.4 - which no longer exists.
DO NOT USE THIS - it ONLY still exists because it is used in the DeliveryServiceRequest type that is still in use by Traffic Ops's Go client for API versions 2 and 3 - and even that is incorrect and DOES DROP DATA.
Deprecated: Instead use the appropriate structure for the version of the Traffic Ops API being worked with, e.g. DeliveryServiceV4.
type DeliveryServiceAcmeSSLKeysReq ¶
type DeliveryServiceAcmeSSLKeysReq struct {
DeliveryServiceSSLKeysReq
}
DeliveryServiceAcmeSSLKeysReq structures are requests to generate new key/certificate pairs for a Delivery Service using an ACME provider, and are the type of structures required for POST request bodies to the /deliveryservices/sslkeys/generate/letsencrypt endpoint of the Traffic Ops API.
type DeliveryServiceActiveState ¶
type DeliveryServiceActiveState string
DeliveryServiceActiveState is an "enumerated" type which encodes the valid values of a Delivery Service's 'Active' property (v3.0+).
type DeliveryServiceAddSSLKeysReq ¶
type DeliveryServiceAddSSLKeysReq struct {
DeliveryServiceSSLKeysReq
}
DeliveryServiceAddSSLKeysReq structures are requests to import key/certificate pairs for a Delivery Service directly, and are the type of structures required for POST request bodies to the /deliveryservices/sslkeys/add endpoint of the Traffic Ops API.
type DeliveryServiceCacheGroup ¶
type DeliveryServiceCacheGroup struct { Online int `json:"online"` Offline int `json:"offline"` // The name of the Cache Group represented by this data. Name string `json:"name"` }
DeliveryServiceCacheGroup breaks down the "health" of a Delivery Service by the number of cache servers responsible for serving its content within a specific Cache Group that are determined to be "online"/"healthy" and "offline"/"unhealthy".
type DeliveryServiceCapacity ¶
type DeliveryServiceCapacity struct { // The portion of cache servers that are ready, willing, and able to // service client requests. AvailablePercent float64 `json:"availablePercent"` // service client requests, generally because Traffic Monitor deems them // "unhealthy". UnavailablePercent float64 `json:"unavailablePercent"` // The portion of cache servers that are actively involved in the flow of // Delivery Service content. UtilizedPercent float64 `json:"utilizedPercent"` // The portion of cache servers that are not yet ready to service client // requests because they are undergoing maintenance. MaintenancePercent float64 `json:"maintenancePercent"` }
DeliveryServiceCapacity represents the "capacity" of a Delivery Service as the portions of the pool of cache servers responsible for serving its content that are available for servicing client requests.
type DeliveryServiceCapacityResponse ¶
type DeliveryServiceCapacityResponse struct { Response DeliveryServiceCapacity `json:"response"` Alerts }
DeliveryServiceCapacityResponse is the type of a response from Traffic Ops to a request for a Delivery Service's "capacity".
type DeliveryServiceFederationResolverMapping ¶
type DeliveryServiceFederationResolverMapping struct { DeliveryService string `json:"deliveryService"` Mappings ResolverMapping `json:"mappings"` }
DeliveryServiceFederationResolverMapping structures represent resolvers to which a Delivery Service maps "federated" CDN traffic.
type DeliveryServiceFederationResolverMappingRequest ¶
type DeliveryServiceFederationResolverMappingRequest []DeliveryServiceFederationResolverMapping
DeliveryServiceFederationResolverMappingRequest is the format of a request to create (or modify) the Federation Resolver mappings of one or more Delivery Services. Use this when working only with API versions 1.4 and newer.
type DeliveryServiceFieldsV13
deprecated
type DeliveryServiceFieldsV13 struct { // DeepCachingType may only legally point to 'ALWAYS' or 'NEVER', which // define whether "deep caching" may or may not be used for this Delivery // Service, respectively. DeepCachingType *DeepCachingType `json:"deepCachingType" db:"deep_caching_type"` // FQPacingRate sets the maximum bytes per second a cache server will deliver // on any single TCP connection for this Delivery Service. This may never // legally point to a value less than zero. FQPacingRate *int `json:"fqPacingRate" db:"fq_pacing_rate"` // SigningAlgorithm is the name of the algorithm used to sign CDN URIs for // this Delivery Service's content, or nil if no URI signing is done for the // Delivery Service. This may only point to the values "url_sig" or // "uri_signing". SigningAlgorithm *string `json:"signingAlgorithm" db:"signing_algorithm"` // Tenant is the Tenant to which the Delivery Service belongs. Tenant *string `json:"tenant"` // TRResponseHeaders is a set of headers (separated by CRLF pairs as per the // HTTP spec) and their values (separated by a colon as per the HTTP spec) // which will be sent by Traffic Router in HTTP responses to client requests // for this Delivery Service's content. This has no effect on DNS-routed or // un-routed Delivery Service Types. TRResponseHeaders *string `json:"trResponseHeaders"` // TRRequestHeaders is an "array" of HTTP headers which should be logged // from client HTTP requests for this Delivery Service's content by Traffic // Router, separated by newlines. This has no effect on DNS-routed or // un-routed Delivery Service Types. TRRequestHeaders *string `json:"trRequestHeaders"` }
DeliveryServiceFieldsV13 contains additions to Delivery Services introduced in Traffic Ops API v1.3.
Deprecated: API version 1.3 no longer exists, this type ONLY still exists because newer structures nest it, so removing it would be a breaking change - please upgrade to DeliveryServiceV4.
type DeliveryServiceFieldsV14
deprecated
type DeliveryServiceFieldsV14 struct { // ConsistentHashRegex is used by Traffic Router to extract meaningful parts // of a client's request URI for HTTP-routed Delivery Services before // hashing the request to find a cache server to which to direct the client. ConsistentHashRegex *string `json:"consistentHashRegex"` // ConsistentHashQueryParams is a list of al of the query string parameters // which ought to be considered by Traffic Router in client request URIs for // HTTP-routed Delivery Services in the hashing process. ConsistentHashQueryParams []string `json:"consistentHashQueryParams"` // MaxOriginConnections defines the total maximum number of connections // that the highest caching layer ("Mid-tier" in a non-Topology context) is // allowed to have concurrently open to the Delivery Service's Origin. This // may never legally point to a value less than 0. MaxOriginConnections *int `json:"maxOriginConnections" db:"max_origin_connections"` }
DeliveryServiceFieldsV14 contains additions to Delivery Services introduced in Traffic Ops API v1.4.
Deprecated: API version 1.4 no longer exists, this type ONLY still exists because newer structures nest it, so removing it would be a breaking change - please upgrade to DeliveryServiceV4.
type DeliveryServiceFieldsV15
deprecated
type DeliveryServiceFieldsV15 struct { // EcsEnabled describes whether or not the Traffic Router's EDNS0 Client // Subnet extensions should be enabled when serving DNS responses for this // Delivery Service. Even if this is true, the Traffic Router may still // have the extensions unilaterally disabled in its own configuration. EcsEnabled bool `json:"ecsEnabled" db:"ecs_enabled"` // RangeSliceBlockSize defines the size of range request blocks - or // "slices" - used by the "slice" plugin. This has no effect if // RangeRequestHandling does not point to exactly 3. This may never legally // point to a value less than zero. RangeSliceBlockSize *int `json:"rangeSliceBlockSize" db:"range_slice_block_size"` }
DeliveryServiceFieldsV15 contains additions to Delivery Services introduced in Traffic Ops API v1.5.
Deprecated: API version 1.5 no longer exists, this type ONLY still exists because newer structures nest it, so removing it would be a breaking change - please upgrade to DeliveryServiceV4.
type DeliveryServiceFieldsV30
deprecated
type DeliveryServiceFieldsV30 struct { // FirstHeaderRewrite is a "header rewrite rule" used by ATS at the first // caching layer encountered in the Delivery Service's Topology, or nil if // there is no such rule. This has no effect on Delivery Services that don't // employ Topologies. FirstHeaderRewrite *string `json:"firstHeaderRewrite" db:"first_header_rewrite"` // InnerHeaderRewrite is a "header rewrite rule" used by ATS at all caching // layers encountered in the Delivery Service's Topology except the first // and last, or nil if there is no such rule. This has no effect on Delivery // Services that don't employ Topologies. InnerHeaderRewrite *string `json:"innerHeaderRewrite" db:"inner_header_rewrite"` // LastHeaderRewrite is a "header rewrite rule" used by ATS at the first // caching layer encountered in the Delivery Service's Topology, or nil if // there is no such rule. This has no effect on Delivery Services that don't // employ Topologies. LastHeaderRewrite *string `json:"lastHeaderRewrite" db:"last_header_rewrite"` // ServiceCategory defines a category to which a Delivery Service may // belong, which will cause HTTP Responses containing content for the // Delivery Service to have the "X-CDN-SVC" header with a value that is the // XMLID of the Delivery Service. ServiceCategory *string `json:"serviceCategory" db:"service_category"` // Topology is the name of the Topology used by the Delivery Service, or nil // if no Topology is used. Topology *string `json:"topology" db:"topology"` }
DeliveryServiceFieldsV30 contains additions to Delivery Services introduced in API v3.0.
Deprecated: API version 3.0 is deprecated - upgrade to DeliveryServiceV4.
type DeliveryServiceFieldsV31
deprecated
type DeliveryServiceFieldsV31 struct { // MaxRequestHeaderBytes is the maximum size (in bytes) of the request // header that is allowed for this Delivery Service. MaxRequestHeaderBytes *int `json:"maxRequestHeaderBytes" db:"max_request_header_bytes"` }
DeliveryServiceFieldsV31 contains additions to DeliverySservices introduced in API v3.1.
Deprecated: API version 3.1 is deprecated.
type DeliveryServiceGenSSLKeysReq ¶
type DeliveryServiceGenSSLKeysReq struct {
DeliveryServiceSSLKeysReq
}
DeliveryServiceGenSSLKeysReq structures are requests to generate new key/certificate pairs for a Delivery Service, and are the type of structures required for POST request bodies to the /deliveryservices/sslkeys/generate endpoint of the Traffic Ops API.
type DeliveryServiceHealth ¶
type DeliveryServiceHealth struct { TotalOnline int `json:"totalOnline"` TotalOffline int `json:"totalOffline"` CacheGroups []DeliveryServiceCacheGroup `json:"cacheGroups"` }
DeliveryServiceHealth represents the "health" of a Delivery Service by the number of cache servers responsible for serving its content that are determined to be "online"/"healthy" and "offline"/"unhealthy".
type DeliveryServiceHealthResponse ¶
type DeliveryServiceHealthResponse struct { Response DeliveryServiceHealth `json:"response"` Alerts }
DeliveryServiceHealthResponse is the type of a response from Traffic Ops to a request for a Delivery Service's "health".
type DeliveryServiceIDRegex ¶
type DeliveryServiceIDRegex struct { ID int `json:"id"` Type int `json:"type"` TypeName string `json:"typeName"` SetNumber int `json:"setNumber"` Pattern string `json:"pattern"` }
DeliveryServiceIDRegex holds information relating to a single routing regular expression of a delivery service, e.g., one of those listed at the deliveryservices/{{ID}}/regexes TO API route.
type DeliveryServiceIDRegexResponse ¶
type DeliveryServiceIDRegexResponse struct { Response []DeliveryServiceIDRegex `json:"response"` Alerts }
DeliveryServiceIDRegexResponse is a list of DeliveryServiceIDRegexes.
type DeliveryServiceIDs ¶
type DeliveryServiceIDs struct { DsId *int `json:"id,omitempty" db:"ds_id"` XmlId *string `json:"xmlId,omitempty" db:"xml_id"` }
DeliveryServiceIDs are pairs of identifiers for Delivery Services.
type DeliveryServiceMatch ¶
type DeliveryServiceMatch struct { Type DSMatchType `json:"type"` SetNumber int `json:"setNumber"` Pattern string `json:"pattern"` }
DeliveryServiceMatch structures are the type of each entry in a Delivery Service's Match List.
type DeliveryServiceName ¶
type DeliveryServiceName string
DeliveryServiceName is the name of a Delivery Service.
This has no attached semantics, and so it may be encountered in situations where it is the actual Display Name, but most often (as far as this author knows), it actually refers to a Delivery Service's XMLID.
func (DeliveryServiceName) String ¶
func (d DeliveryServiceName) String() string
String implements the fmt.Stringer interface.
type DeliveryServiceNullable
deprecated
type DeliveryServiceNullable DeliveryServiceNullableV15
DeliveryServiceNullable represents a Delivery Service as they appeared in version 1.5 - and coincidentally also version 2.0 - of the Traffic Ops API.
Deprecated: All API versions for which this could be used to represent structures are deprecated - upgrade to DeliveryServiceV4.
func (*DeliveryServiceNullable) Scan ¶
func (ds *DeliveryServiceNullable) Scan(src interface{}) error
Scan implements the database/sql.Scanner interface.
This expects src to be an encoding/json.RawMessage and unmarshals that into the DeliveryServiceNullable.
type DeliveryServiceNullableFieldsV11
deprecated
type DeliveryServiceNullableFieldsV11 struct { // Active dictates whether the Delivery Service is routed by Traffic Router. Active *bool `json:"active" db:"active"` // AnonymousBlockingEnabled sets whether or not anonymized IP addresses // (e.g. Tor exit nodes) should be restricted from accessing the Delivery // Service's content. AnonymousBlockingEnabled *bool `json:"anonymousBlockingEnabled" db:"anonymous_blocking_enabled"` // CCRDNSTTL sets the Time-to-Live - in seconds - for DNS responses for this // Delivery Service from Traffic Router. CCRDNSTTL *int `json:"ccrDnsTtl" db:"ccr_dns_ttl"` // CDNID is the integral, unique identifier for the CDN to which the // Delivery Service belongs. CDNID *int `json:"cdnId" db:"cdn_id"` // CDNName is the name of the CDN to which the Delivery Service belongs. CDNName *string `json:"cdnName"` // CheckPath is a path which may be requested of the Delivery Service's // origin to ensure it's working properly. CheckPath *string `json:"checkPath" db:"check_path"` // DisplayName is a human-friendly name that might be used in some UIs // somewhere. DisplayName *string `json:"displayName" db:"display_name"` // DNSBypassCNAME is a fully qualified domain name to be used in a CNAME // record presented to clients in bypass scenarios. DNSBypassCNAME *string `json:"dnsBypassCname" db:"dns_bypass_cname"` // DNSBypassIP is an IPv4 address to be used in an A record presented to // clients in bypass scenarios. DNSBypassIP *string `json:"dnsBypassIp" db:"dns_bypass_ip"` // DNSBypassIP6 is an IPv6 address to be used in an AAAA record presented to // clients in bypass scenarios. DNSBypassIP6 *string `json:"dnsBypassIp6" db:"dns_bypass_ip6"` // DNSBypassTTL sets the Time-to-Live - in seconds - of DNS responses from // the Traffic Router that contain records for bypass destinations. DNSBypassTTL *int `json:"dnsBypassTtl" db:"dns_bypass_ttl"` // DSCP sets the Differentiated Services Code Point for IP packets // transferred between clients, origins, and cache servers when obtaining // and serving content for this Delivery Service. // See Also: https://en.wikipedia.org/wiki/Differentiated_services DSCP *int `json:"dscp" db:"dscp"` // EdgeHeaderRewrite is a "header rewrite rule" used by ATS at the Edge-tier // of caching. This has no effect on Delivery Services that don't use a // Topology. EdgeHeaderRewrite *string `json:"edgeHeaderRewrite" db:"edge_header_rewrite"` // ExampleURLs is a list of all of the URLs from which content may be // requested from the Delivery Service. ExampleURLs []string `json:"exampleURLs"` // GeoLimit defines whether or not access to a Delivery Service's content // should be limited based on the requesting client's geographic location. // Despite that this is a pointer to an arbitrary integer, the only valid // values are 0 (which indicates that content should not be limited // geographically), 1 (which indicates that content should only be served to // clients whose IP addresses can be found within a Coverage Zone File), and // 2 (which indicates that content should be served to clients whose IP // addresses can be found within a Coverage Zone File OR are allowed access // according to the "array" in GeoLimitCountries). GeoLimit *int `json:"geoLimit" db:"geo_limit"` // GeoLimitCountries is an "array" of "country codes" that itemizes the // countries within which the Delivery Service's content ought to be made // available. This has no effect if GeoLimit is not a pointer to exactly the // value 2. GeoLimitCountries *string `json:"geoLimitCountries" db:"geo_limit_countries"` // GeoLimitRedirectURL is a URL to which clients will be redirected if their // access to the Delivery Service's content is blocked by GeoLimit rules. GeoLimitRedirectURL *string `json:"geoLimitRedirectURL" db:"geolimit_redirect_url"` // GeoProvider names the type of database to be used for providing IP // address-to-geographic-location mapping for this Delivery Service. The // only valid values to which it may point are 0 (which indicates the use of // a MaxMind GeoIP2 database) and 1 (which indicates the use of a Neustar // GeoPoint IP address database). GeoProvider *int `json:"geoProvider" db:"geo_provider"` // GlobalMaxMBPS defines a maximum number of MegaBytes Per Second which may // be served for the Delivery Service before redirecting clients to bypass // locations. GlobalMaxMBPS *int `json:"globalMaxMbps" db:"global_max_mbps"` // GlobalMaxTPS defines a maximum number of Transactions Per Second which // may be served for the Delivery Service before redirecting clients to // bypass locations. GlobalMaxTPS *int `json:"globalMaxTps" db:"global_max_tps"` // HTTPBypassFQDN is a network location to which clients will be redirected // in bypass scenarios using HTTP "Location" headers and appropriate // redirection response codes. HTTPBypassFQDN *string `json:"httpBypassFqdn" db:"http_bypass_fqdn"` // ID is an integral, unique identifier for the Delivery Service. ID *int `json:"id" db:"id"` // InfoURL is a URL to which operators or clients may be directed to obtain // further information about a Delivery Service. InfoURL *string `json:"infoUrl" db:"info_url"` // InitialDispersion sets the number of cache servers within the first // caching layer ("Edge-tier" in a non-Topology context) across which // content will be dispersed per Cache Group. InitialDispersion *int `json:"initialDispersion" db:"initial_dispersion"` // IPV6RoutingEnabled controls whether or not routing over IPv6 should be // done for this Delivery Service. IPV6RoutingEnabled *bool `json:"ipv6RoutingEnabled" db:"ipv6_routing_enabled"` // LastUpdated is the time and date at which the Delivery Service was last // updated. LastUpdated *TimeNoMod `json:"lastUpdated" db:"last_updated"` // LogsEnabled controls nothing. It is kept only for legacy compatibility. LogsEnabled *bool `json:"logsEnabled" db:"logs_enabled"` // LongDesc is a description of the Delivery Service, having arbitrary // length. LongDesc *string `json:"longDesc" db:"long_desc"` // LongDesc1 is a description of the Delivery Service, having arbitrary // length. LongDesc1 *string `json:"longDesc1,omitempty" db:"long_desc_1"` // LongDesc2 is a description of the Delivery Service, having arbitrary // length. LongDesc2 *string `json:"longDesc2,omitempty" db:"long_desc_2"` // MatchList is a list of Regular Expressions used for routing the Delivery // Service. Order matters, and the array is not allowed to be sparse. MatchList *[]DeliveryServiceMatch `json:"matchList"` // MaxDNSAnswers sets the maximum number of records which should be returned // by Traffic Router in DNS responses to requests for resolving names for // this Delivery Service. MaxDNSAnswers *int `json:"maxDnsAnswers" db:"max_dns_answers"` // MidHeaderRewrite is a "header rewrite rule" used by ATS at the Mid-tier // of caching. This has no effect on Delivery Services that don't use a // Topology. MidHeaderRewrite *string `json:"midHeaderRewrite" db:"mid_header_rewrite"` // MissLat is a latitude to default to for clients of this Delivery Service // when geolocation attempts fail. MissLat *float64 `json:"missLat" db:"miss_lat"` // MissLong is a longitude to default to for clients of this Delivery // Service when geolocation attempts fail. MissLong *float64 `json:"missLong" db:"miss_long"` // MultiSiteOrigin determines whether or not the Delivery Service makes use // of "Multi-Site Origin". MultiSiteOrigin *bool `json:"multiSiteOrigin" db:"multi_site_origin"` // OriginShield is a field that does nothing. It is kept only for legacy // compatibility reasons. OriginShield *string `json:"originShield" db:"origin_shield"` // OrgServerFQDN is the URL - NOT Fully Qualified Domain Name - of the // origin of the Delivery Service's content. OrgServerFQDN *string `json:"orgServerFqdn" db:"org_server_fqdn"` // ProfileDesc is the Description of the Profile used by the Delivery // Service, if any. ProfileDesc *string `json:"profileDescription"` // ProfileID is the integral, unique identifier of the Profile used by the // Delivery Service, if any. ProfileID *int `json:"profileId" db:"profile"` // ProfileName is the Name of the Profile used by the Delivery Service, if // any. ProfileName *string `json:"profileName"` // Protocol defines the protocols by which caching servers may communicate // with clients. The valid values to which it may point are 0 (which implies // that only HTTP may be used), 1 (which implies that only HTTPS may be // used), 2 (which implies that either HTTP or HTTPS may be used), and 3 // (which implies that clients using HTTP must be redirected to use HTTPS, // while communications over HTTPS may proceed as normal). Protocol *int `json:"protocol" db:"protocol"` // QStringIgnore sets how query strings in HTTP requests to cache servers // from clients are treated. The only valid values to which it may point are // 0 (which implies that all caching layers will pass query strings in // upstream requests and use them in the cache key), 1 (which implies that // all caching layers will pass query strings in upstream requests, but not // use them in cache keys), and 2 (which implies that the first encountered // caching layer - "Edge-tier" in a non-Topology context - will strip query // strings, effectively preventing them from being passed in upstream // requests, and not use them in the cache key). QStringIgnore *int `json:"qstringIgnore" db:"qstring_ignore"` // RangeRequestHandling defines how HTTP GET requests with a Range header // will be handled by cache servers serving the Delivery Service's content. // The only valid values to which it may point are 0 (which implies that // Range requests will not be cached at all), 1 (which implies that the // background_fetch plugin will be used to service the range request while // caching the whole object), 2 (which implies that the cache_range_requests // plugin will be used to cache ranges as unique objects), and 3 (which // implies that the slice plugin will be used to slice range based requests // into deterministic chunks.) RangeRequestHandling *int `json:"rangeRequestHandling" db:"range_request_handling"` // Regex Remap is a raw line to be inserted into "regex_remap.config" on the // cache server. Care is necessitated in its use, because the input is in no // way restricted, validated, or limited in scope to the Delivery Service. RegexRemap *string `json:"regexRemap" db:"regex_remap"` // RegionalGeoBlocking defines whether or not whatever Regional Geo Blocking // rules are configured on the Traffic Router serving content for this // Delivery Service will have an effect on the traffic of this Delivery // Service. RegionalGeoBlocking *bool `json:"regionalGeoBlocking" db:"regional_geo_blocking"` // RemapText is raw text to insert in "remap.config" on the cache servers // serving content for this Delivery Service. Care is necessitated in its // use, because the input is in no way restricted, validated, or limited in // scope to the Delivery Service. RemapText *string `json:"remapText" db:"remap_text"` // RoutingName defines the lowest-level DNS label used by the Delivery // Service, e.g. if trafficcontrol.apache.org were a Delivery Service, it // would have a RoutingName of "trafficcontrol". RoutingName *string `json:"routingName" db:"routing_name"` // Signed is a legacy field. It is allowed to be `true` if and only if // SigningAlgorithm is not nil. Signed bool `json:"signed"` // SSLKeyVersion incremented whenever Traffic Portal generates new SSL keys // for the Delivery Service, effectively making it a "generational" marker. SSLKeyVersion *int `json:"sslKeyVersion" db:"ssl_key_version"` // TenantID is the integral, unique identifier for the Tenant to which the // Delivery Service belongs. TenantID *int `json:"tenantId" db:"tenant_id"` // Type describes how content is routed and cached for this Delivery Service // as well as what other properties have any meaning. Type *DSType `json:"type"` // TypeID is an integral, unique identifier for the Tenant to which the // Delivery Service belongs. TypeID *int `json:"typeId" db:"type"` // XMLID is a unique identifier that is also the second lowest-level DNS // label used by the Delivery Service. For example, if a Delivery Service's // content may be requested from video.demo1.mycdn.ciab.test, it may be // inferred that the Delivery Service's XMLID is demo1. XMLID *string `json:"xmlId" db:"xml_id"` }
DeliveryServiceNullableFieldsV11 contains properties that Delivery Services as they appeared in Traffic Ops API v1.1 had, AND were not removed by ANY later API version.
Deprecated: API version 1.1 no longer exists, this type ONLY still exists because newer structures nest it, so removing it would be a breaking change - please upgrade to DeliveryServiceV4.
type DeliveryServiceNullableV11
deprecated
type DeliveryServiceNullableV11 struct { DeliveryServiceNullableFieldsV11 DeliveryServiceRemovedFieldsV11 }
DeliveryServiceNullableV11 represents a Delivery Service as they appeared in version 1.1 of the Traffic Ops API - which no longer exists.
Deprecated: API version 1.1 no longer exists, this type ONLY still exists because newer structures nest it, so removing it would be a breaking change - please upgrade to DeliveryServiceV4.
type DeliveryServiceNullableV12
deprecated
type DeliveryServiceNullableV12 struct {
DeliveryServiceNullableV11
}
DeliveryServiceNullableV12 represents a Delivery Service as they appeared in version 1.2 of the Traffic Ops API - which no longer exists.
Deprecated: API version 1.2 no longer exists, this type ONLY still exists because newer structures nest it, so removing it would be a breaking change - please upgrade to DeliveryServiceV4.
type DeliveryServiceNullableV13
deprecated
type DeliveryServiceNullableV13 struct { DeliveryServiceNullableV12 DeliveryServiceFieldsV13 }
DeliveryServiceNullableV13 represents a Delivery Service as they appeared in version 1.3 of the Traffic Ops API - which no longer exists.
Deprecated: API version 1.3 no longer exists, this type ONLY still exists because newer structures nest it, so removing it would be a breaking change - please upgrade to DeliveryServiceV4.
type DeliveryServiceNullableV14
deprecated
type DeliveryServiceNullableV14 struct { DeliveryServiceNullableV13 DeliveryServiceFieldsV14 }
DeliveryServiceNullableV14 represents a Delivery Service as they appeared in version 1.4 of the Traffic Ops API - which no longer exists.
Deprecated: API version 1.4 no longer exists, this type ONLY still exists because newer structures nest it, so removing it would be a breaking change - please upgrade to DeliveryServiceV4.
type DeliveryServiceNullableV15
deprecated
type DeliveryServiceNullableV15 struct { DeliveryServiceNullableV14 DeliveryServiceFieldsV15 }
DeliveryServiceNullableV15 represents a Delivery Service as they appeared in version 1.5 of the Traffic Ops API - which no longer exists.
Because the structure of Delivery Services did not change between Traffic Ops API versions 1.5 and 2.0, this is also used in many places to represent an APIv2 Delivery Service.
Deprecated: All API versions for which this could be used to represent structures are deprecated - upgrade to DeliveryServiceV4.
type DeliveryServiceNullableV30
deprecated
type DeliveryServiceNullableV30 DeliveryServiceV31
DeliveryServiceNullableV30 is the aliased structure that we should be using for all API 3.x Delivery Service operations.
Again, this type is an alias that refers to the LATEST MINOR VERSION of API version 3 - NOT API version 3.0 as the name might imply.
This type should always alias the latest 3.x minor version struct. For example, if you wanted to create a DeliveryServiceV32 struct, you would do the following:
type DeliveryServiceNullableV30 DeliveryServiceV32 DeliveryServiceV32 = DeliveryServiceV31 + the new fields.
Deprecated: API version 3 is deprecated - upgrade to DeliveryServiceV4.
func (DeliveryServiceNullableV30) UpgradeToV4 ¶
func (ds DeliveryServiceNullableV30) UpgradeToV4() DeliveryServiceV4
UpgradeToV4 converts the 3.x DS to a 4.x DS.
type DeliveryServiceRegex ¶
type DeliveryServiceRegex struct { Type string `json:"type"` SetNumber int `json:"setNumber"` Pattern string `json:"pattern"` }
DeliveryServiceRegex is a regular expression used for routing to a Delivery Service.
type DeliveryServiceRegexPost ¶
type DeliveryServiceRegexPost struct { Type int `json:"type"` SetNumber int `json:"setNumber"` Pattern string `json:"pattern"` }
DeliveryServiceRegexPost holds all of the information necessary to create a new routing regular expression for a delivery service.
type DeliveryServiceRegexResponse ¶
type DeliveryServiceRegexResponse struct { Response []DeliveryServiceRegexes `json:"response"` Alerts }
DeliveryServiceRegexResponse is the type of a Traffic Ops API response to the /deliveryservices_regexes endpoint - in all API verions (at the time of this writing).
type DeliveryServiceRegexes ¶
type DeliveryServiceRegexes struct { Regexes []DeliveryServiceRegex `json:"regexes"` // The XMLID of the Delivery Service to which the Regexes belong - NOT its // Display Name. DSName string `json:"dsName"` }
DeliveryServiceRegexes structures associate a set of Delivery Service Regular Expressions (Delivery Service "Regexes") with a particular Delivery Service.
type DeliveryServiceRegexesTest ¶
type DeliveryServiceRegexesTest struct { DSName string `json:"dsName"` DSID int DeliveryServiceIDRegex }
DeliveryServiceRegexesTest is used to represent the entire deliveryservice_regex for testing.
This is ONLY meant to be used by testing code internal to ATC, do NOT use this to represent real CDN objects of any kind.
type DeliveryServiceRemovedFieldsV11
deprecated
type DeliveryServiceRemovedFieldsV11 struct {
CacheURL *string `json:"cacheurl" db:"cacheurl"`
}
DeliveryServiceRemovedFieldsV11 contains properties of Delivery Services as they appeared in version 1.1 of the Traffic Ops API that were later removed in some other API version.
Deprecated: API version 1.1 no longer exists, this type ONLY still exists because newer structures nest it, so removing it would be a breaking change - please upgrade to DeliveryServiceV4.
type DeliveryServiceRequest
deprecated
type DeliveryServiceRequest struct { AssigneeID int `json:"assigneeId,omitempty"` Assignee string `json:"assignee,omitempty"` AuthorID IDNoMod `json:"authorId"` Author string `json:"author"` ChangeType string `json:"changeType"` CreatedAt *TimeNoMod `json:"createdAt"` ID int `json:"id"` LastEditedBy string `json:"lastEditedBy,omitempty"` LastEditedByID IDNoMod `json:"lastEditedById,omitempty"` LastUpdated *TimeNoMod `json:"lastUpdated"` DeliveryService DeliveryService `json:"deliveryService"` // TODO version DeliveryServiceRequest Status RequestStatus `json:"status"` XMLID string `json:"-" db:"xml_id"` }
DeliveryServiceRequest is used as part of the workflow to create, modify, or delete a delivery service.
Deprecated: Don't ever use this, even in legacy code if you can help it. It shouldn't still exist already, but will nevertheless be removed soon.
type DeliveryServiceRequestComment ¶
type DeliveryServiceRequestComment struct { AuthorID IDNoMod `json:"authorId" db:"author_id"` Author string `json:"author"` DeliveryServiceRequestID int `json:"deliveryServiceRequestId" db:"deliveryservice_request_id"` ID int `json:"id" db:"id"` LastUpdated TimeNoMod `json:"lastUpdated" db:"last_updated"` Value string `json:"value" db:"value"` XMLID string `json:"xmlId" db:"xml_id"` }
DeliveryServiceRequestComment is a struct containing the fields for a delivery service request comment.
type DeliveryServiceRequestCommentNullable ¶
type DeliveryServiceRequestCommentNullable struct { AuthorID *IDNoMod `json:"authorId" db:"author_id"` Author *string `json:"author"` DeliveryServiceRequestID *int `json:"deliveryServiceRequestId" db:"deliveryservice_request_id"` ID *int `json:"id" db:"id"` LastUpdated *TimeNoMod `json:"lastUpdated" db:"last_updated"` Value *string `json:"value" db:"value"` XMLID *string `json:"xmlId" db:"xml_id"` }
DeliveryServiceRequestCommentNullable is a nullable struct containing the fields for a delivery service request comment.
type DeliveryServiceRequestCommentV5 ¶
type DeliveryServiceRequestCommentV5 DeliveryServiceRequestCommentV50
DeliveryServiceRequestCommentV5 is a Delivery Service Request Comment as it appears in version 5 of the Traffic Ops API - it always points to the highest minor version in APIv5.
type DeliveryServiceRequestCommentV50 ¶
type DeliveryServiceRequestCommentV50 struct { AuthorID IDNoMod `json:"authorId" db:"author_id"` Author string `json:"author"` DeliveryServiceRequestID int `json:"deliveryServiceRequestId" db:"deliveryservice_request_id"` ID int `json:"id" db:"id"` LastUpdated time.Time `json:"lastUpdated" db:"last_updated"` Value string `json:"value" db:"value"` XMLID string `json:"xmlId" db:"xml_id"` }
DeliveryServiceRequestCommentV50 is a struct containing the fields for a delivery service request comment, for API version 5.0.
type DeliveryServiceRequestCommentsResponse ¶
type DeliveryServiceRequestCommentsResponse struct { Response []DeliveryServiceRequestComment `json:"response"` Alerts }
DeliveryServiceRequestCommentsResponse is a list of DeliveryServiceRequestComments as a response.
type DeliveryServiceRequestCommentsResponseV5 ¶
type DeliveryServiceRequestCommentsResponseV5 DeliveryServiceRequestCommentsResponseV50
DeliveryServiceRequestCommentsResponseV5 is a Delivery Service Request Comment Response as it appears in version 5 of the Traffic Ops API - it always points to the highest minor version in APIv5.
type DeliveryServiceRequestCommentsResponseV50 ¶
type DeliveryServiceRequestCommentsResponseV50 struct { Response []DeliveryServiceRequestCommentV5 `json:"response"` Alerts }
DeliveryServiceRequestCommentsResponseV50 is a list of DeliveryServiceRequestCommentsV5 as a response, for API version 5.0.
type DeliveryServiceRequestDetails
deprecated
type DeliveryServiceRequestDetails struct { // ContentType is the type of content to be delivered, e.g. "static", "VOD" etc. ContentType string `json:"contentType"` // Customer is the requesting customer - typically this is a Tenant. Customer string `json:"customer"` // DeepCachingType represents whether or not the Delivery Service should use Deep Caching. DeepCachingType *DeepCachingType `json:"deepCachingType"` // Delivery Protocol is the protocol clients should use to connect to the Delivery Service. DeliveryProtocol *Protocol `json:"deliveryProtocol"` // HasNegativeCachingCustomization indicates whether or not the resulting Delivery Service should // customize the use of negative caching. When this is `true`, NegativeCachingCustomizationNote // should be consulted for instructions on the customization. HasNegativeCachingCustomization *bool `json:"hasNegativeCachingCustomization"` // HasOriginACLWhitelist indicates whether or not the Origin has an ACL whitelist. When this is // `true`, Notes should ideally contain the actual whitelist (or viewing instructions). HasOriginACLWhitelist *bool `json:"hasOriginACLWhitelist"` // Has OriginDynamicRemap indicates whether or not the OriginURL can dynamically map to multiple // different actual origin servers. HasOriginDynamicRemap *bool `json:"hasOriginDynamicRemap"` // HasSignedURLs indicates whether or not the resulting Delivery Service should sign its URLs. HasSignedURLs *bool `json:"hasSignedURLs"` // HeaderRewriteEdge is an optional HeaderRewrite rule to apply at the Edge tier. HeaderRewriteEdge *string `json:"headerRewriteEdge"` // HeaderRewriteMid is an optional HeaderRewrite rule to apply at the Mid tier. HeaderRewriteMid *string `json:"headerRewriteMid"` // HeaderRewriteRedirectRouter is an optional HeaderRewrite rule to apply at routing time by // the Traffic Router. HeaderRewriteRedirectRouter *string `json:"headerRewriteRedirectRouter"` // MaxLibrarySizeEstimate is an estimation of the total size of content that will be delivered // through the resulting Delivery Service. MaxLibrarySizeEstimate string `json:"maxLibrarySizeEstimate"` // NegativeCachingCustomizationNote is an optional note describing the customization to be // applied to Negative Caching. This should never be `nil` (or empty) if // HasNegativeCachingCustomization is `true`, but in that case the recipient ought to contact // Customer for instructions. NegativeCachingCustomizationNote *string `json:"negativeCachingCustomizationNote"` // Notes is an optional set of extra information supplied to describe the requested Delivery // Service. Notes *string `json:"notes"` // OriginHeaders is an optional list of HTTP headers that must be sent in requests to the Origin. When // parsing from JSON, this field can be either an actual array of headers, or a string containing // a comma-delimited list of said headers. OriginHeaders *OriginHeaders `json:"originHeaders"` // OriginTestFile is the path to a file on the origin that can be requested to test the server's // operational readiness, e.g. '/test.xml'. OriginTestFile string `json:"originTestFile"` // OriginURL is the URL of the origin server that has the content to be served by the requested // Delivery Service. OriginURL string `json:"originURL"` // OtherOriginSecurity is an optional note about any and all other Security employed by the origin // server (beyond an ACL whitelist, which has its own field: HasOriginACLWhitelist). OtherOriginSecurity *string `json:"otherOriginSecurity"` // OverflowService is an optional IP Address or URL to which clients should be redirected when // the requested Delivery Service exceeds its operational capacity. OverflowService *string `json:"overflowService"` // PeakBPSEstimate is an estimate of the bytes per second expected at peak operation. PeakBPSEstimate string `json:"peakBPSEstimate"` // PeakTPSEstimate is an estimate of the transactions per second expected at peak operation. PeakTPSEstimate string `json:"peakTPSEstimate"` // QueryStringHandling describes the manner in which the CDN should handle query strings in client // requests. Generally one of "use", "drop", or "ignore-in-cache-key-and-pass-up". QueryStringHandling string `json:"queryStringHandling"` // RangeRequestHandling describes the manner in which HTTP requests are handled. RangeRequestHandling string `json:"rangeRequestHandling"` // RateLimitingGBPS is an optional rate limit for the requested Delivery Service in gigabytes per // second. RateLimitingGBPS *uint `json:"rateLimitingGBPS"` // RateLimitingTPS is an optional rate limit for the requested Delivery Service in transactions // per second. RateLimitingTPS *uint `json:"rateLimitingTPS"` // RoutingName is the top-level DNS label under which the Delivery Service should be requested. RoutingName string `json:"routingName"` // RoutingType is the type of routing Traffic Router should perform for the requested Delivery // Service. RoutingType *DSType `json:"routingType"` // ServiceAliases is an optional list of alternative names for the requested Delivery Service. ServiceAliases []string `json:"serviceAliases"` // ServiceDesc is a basic description of the requested Delivery Service. ServiceDesc string `json:"serviceDesc"` }
DeliveryServiceRequestDetails holds information about what a user is trying to change, with respect to a delivery service.
Deprecated: Delivery Services Requests have been deprecated in favor of Delivery Service Requests, and will be removed from the Traffic Ops API at some point in the future.
func (DeliveryServiceRequestDetails) Format ¶
func (d DeliveryServiceRequestDetails) Format() (string, error)
Format formats the DeliveryServiceRequestDetails into the text/html body of an email. The template used is EmailTemplate.
type DeliveryServiceRequestNullable
deprecated
type DeliveryServiceRequestNullable struct { AssigneeID *int `json:"assigneeId,omitempty" db:"assignee_id"` Assignee *string `json:"assignee,omitempty"` AuthorID *IDNoMod `json:"authorId" db:"author_id"` Author *string `json:"author"` ChangeType *string `json:"changeType" db:"change_type"` CreatedAt *TimeNoMod `json:"createdAt" db:"created_at"` ID *int `json:"id" db:"id"` LastEditedBy *string `json:"lastEditedBy"` LastEditedByID *IDNoMod `json:"lastEditedById" db:"last_edited_by_id"` LastUpdated *TimeNoMod `json:"lastUpdated" db:"last_updated"` DeliveryService *DeliveryServiceNullableV30 `json:"deliveryService" db:"deliveryservice"` Status *RequestStatus `json:"status" db:"status"` XMLID *string `json:"-" db:"xml_id"` }
DeliveryServiceRequestNullable is used as part of the workflow to create, modify, or delete a delivery service.
Deprecated: This structure is only used in legacy API versions.
func (DeliveryServiceRequestNullable) Upgrade ¶
func (dsr DeliveryServiceRequestNullable) Upgrade() DeliveryServiceRequestV40
Upgrade coerces the DeliveryServiceRequestNullable to the newer DeliveryServiceRequestV40 structure.
All reference properties are "deep"-copied so they may be modified without affecting the original. However, DeliveryService is constructed as a "deep" copy, but the properties of the underlying DeliveryServiceNullableV30 are "shallow" copied, and so modifying them *can* affect the original and vice-versa.
type DeliveryServiceRequestRequest
deprecated
type DeliveryServiceRequestRequest struct { // EmailTo is the email address that is ultimately the destination of a formatted DeliveryServiceRequestRequest. EmailTo string `json:"emailTo"` // Details holds the actual request in a data structure. Details DeliveryServiceRequestDetails `json:"details"` }
DeliveryServiceRequestRequest is a literal request to make a Delivery Service.
Deprecated: Delivery Services Requests have been deprecated in favor of Delivery Service Requests, and will be removed from the Traffic Ops API at some point in the future.
func (*DeliveryServiceRequestRequest) Validate ¶
func (d *DeliveryServiceRequestRequest) Validate() error
Validate validates that the delivery service request has all of the required fields. In some cases, e.g. the top-level EmailTo field, the format is also checked for correctness.
type DeliveryServiceRequestResponseV4 ¶
type DeliveryServiceRequestResponseV4 = DeliveryServiceRequestResponseV40
DeliveryServiceRequestResponseV4 is the type of a response from Traffic Ops when creating, updating, or deleting a Delivery Service Request using the latest minor version of API version 4.
type DeliveryServiceRequestResponseV40 ¶
type DeliveryServiceRequestResponseV40 struct { Response DeliveryServiceRequestV40 `json:"response"` Alerts }
DeliveryServiceRequestResponseV40 is the type of a response from Traffic Ops when creating, updating, or deleting a Delivery Service Request using API version 4.0.
type DeliveryServiceRequestResponseV5 ¶
type DeliveryServiceRequestResponseV5 struct { Response DeliveryServiceRequestV5 `json:"response"` Alerts }
DeliveryServiceRequestResponseV50 is the type of a response from Traffic Ops when creating, updating, or deleting a Delivery Service Request using the latest minor version of API version 5.
type DeliveryServiceRequestV4 ¶
type DeliveryServiceRequestV4 = DeliveryServiceRequestV41
DeliveryServiceRequestV4 is the type of a Delivery Service Request as it appears in API version 4.
func (DeliveryServiceRequestV4) Upgrade ¶
func (dsr DeliveryServiceRequestV4) Upgrade() DeliveryServiceRequestV5
Upgrade coerces the DeliveryServiceRequestV4 to the newer DeliveryServiceRequestV5 structure.
"XMLID" will be copied directly, not determined from Requested or Original.
All reference properties are "deep"-copied so they may be modified without affecting the original. Delivery Service properties (i.e. Requested and Original) are copied using the DeliveryServiceV4.Upgrade method (which is also deep).
type DeliveryServiceRequestV40 ¶
type DeliveryServiceRequestV40 struct { // Assignee is the username of the user assigned to the Delivery Service // Request, if any. Assignee *string `json:"assignee"` // AssigneeID is the integral, unique identifier of the user assigned to the // Delivery Service Request, if any. AssigneeID *int `json:"-" db:"assignee_id"` // Author is the username of the user who created the Delivery Service // Request. Author string `json:"author"` // AuthorID is the integral, unique identifier of the user who created the // Delivery Service Request, if/when it is known. AuthorID *int `json:"-" db:"author_id"` // ChangeType represents the type of change being made, must be one of // "create", "change" or "delete". ChangeType DSRChangeType `json:"changeType" db:"change_type"` // CreatedAt is the date/time at which the Delivery Service Request was // created. CreatedAt time.Time `json:"createdAt" db:"created_at"` // ID is the integral, unique identifier for the Delivery Service Request // if/when it is known. ID *int `json:"id" db:"id"` // LastEditedBy is the username of the user by whom the Delivery Service // Request was last edited. LastEditedBy string `json:"lastEditedBy"` // LastEditedByID is the integral, unique identifier of the user by whom the // Delivery Service Request was last edited, if/when it is known. LastEditedByID *int `json:"-" db:"last_edited_by_id"` // LastUpdated is the date/time at which the Delivery Service was last // modified. LastUpdated time.Time `json:"lastUpdated" db:"last_updated"` // Original is the original Delivery Service for which changes are // requested. This is present in responses only for ChangeTypes 'change' and // 'delete', and is only required in requests where ChangeType is 'delete'. Original *DeliveryServiceV40 `json:"original,omitempty" db:"original"` // Requested is the set of requested changes. This is present in responses // only for ChangeTypes 'change' and 'create', and is only required in // requests in those cases. Requested *DeliveryServiceV40 `json:"requested,omitempty" db:"deliveryservice"` // Status is the status of the Delivery Service Request. Status RequestStatus `json:"status" db:"status"` // Used internally to define the affected Delivery Service. XMLID string `json:"-"` }
DeliveryServiceRequestV40 is the type of a Delivery Service Request in Traffic Ops API version 4.0.
func (DeliveryServiceRequestV40) Downgrade ¶
func (dsr DeliveryServiceRequestV40) Downgrade() DeliveryServiceRequestNullable
Downgrade coerces the DeliveryServiceRequestV40 to the older DeliveryServiceRequestNullable structure.
"XMLID" will be copied directly if it is non-empty, otherwise determined from the DeliveryService (if it's not 'nil').
All reference properties are "deep"-copied so they may be modified without affecting the original. However, DeliveryService is constructed as a "deep" copy of "Requested", but the properties of the underlying DeliveryServiceNullableV30 are "shallow" copied, and so modifying them *can* affect the original and vice-versa.
func (DeliveryServiceRequestV40) IsClosed ¶
func (dsr DeliveryServiceRequestV40) IsClosed() bool
IsClosed returns whether or not the Delivery Service Request has been "closed", by being either rejected or completed.
func (DeliveryServiceRequestV40) IsOpen ¶
func (dsr DeliveryServiceRequestV40) IsOpen() bool
IsOpen returns whether or not the Delivery Service Request is still "open" - i.e. has not been rejected or completed.
func (*DeliveryServiceRequestV40) SetXMLID ¶
func (dsr *DeliveryServiceRequestV40) SetXMLID()
SetXMLID sets the DeliveryServiceRequestV40's XMLID based on its DeliveryService.
Example ¶
var dsr DeliveryServiceRequestV40 fmt.Println(dsr.XMLID == "") dsr.Requested = new(DeliveryServiceV40) dsr.Requested.XMLID = new(string) *dsr.Requested.XMLID = "test" dsr.SetXMLID() fmt.Println(dsr.XMLID)
Output: true test
func (DeliveryServiceRequestV40) String ¶
func (dsr DeliveryServiceRequestV40) String() string
String encodes the DeliveryServiceRequestV40 as a string, in the format "DeliveryServiceRequestV40({{Property}}={{Value}}[, {{Property}}={{Value}}]+)".
If a property is a pointer value, then its dereferenced value is used - unless it's nil, in which case "<nil>" is used as the value. DeliveryService is omitted, because of how large it is. Times are formatted in RFC3339 format.
Example ¶
var dsr DeliveryServiceRequestV40 fmt.Println(dsr.String())
Output: DeliveryServiceRequestV40(Assignee=<nil>, AssigneeID=<nil>, Author="", AuthorID=<nil>, ChangeType="", CreatedAt=0001-01-01T00:00:00Z, ID=<nil>, LastEditedBy="", LastEditedByID=<nil>, LastUpdated=0001-01-01T00:00:00Z, Status="")
func (DeliveryServiceRequestV40) Upgrade ¶
func (dsrV40 DeliveryServiceRequestV40) Upgrade() DeliveryServiceRequestV41
Upgrade will convert an instance of DeliveryServiceRequestV40 to DeliveryServiceRequestV41. Note that this function does a shallow copy of the requested and original Delivery Service structures.
type DeliveryServiceRequestV41 ¶
type DeliveryServiceRequestV41 struct { // Assignee is the username of the user assigned to the Delivery Service // Request, if any. Assignee *string `json:"assignee"` // AssigneeID is the integral, unique identifier of the user assigned to the // Delivery Service Request, if any. AssigneeID *int `json:"-" db:"assignee_id"` // Author is the username of the user who created the Delivery Service // Request. Author string `json:"author"` // AuthorID is the integral, unique identifier of the user who created the // Delivery Service Request, if/when it is known. AuthorID *int `json:"-" db:"author_id"` // ChangeType represents the type of change being made, must be one of // "create", "change" or "delete". ChangeType DSRChangeType `json:"changeType" db:"change_type"` // CreatedAt is the date/time at which the Delivery Service Request was // created. CreatedAt time.Time `json:"createdAt" db:"created_at"` // ID is the integral, unique identifier for the Delivery Service Request // if/when it is known. ID *int `json:"id" db:"id"` // LastEditedBy is the username of the user by whom the Delivery Service // Request was last edited. LastEditedBy string `json:"lastEditedBy"` // LastEditedByID is the integral, unique identifier of the user by whom the // Delivery Service Request was last edited, if/when it is known. LastEditedByID *int `json:"-" db:"last_edited_by_id"` // LastUpdated is the date/time at which the Delivery Service was last // modified. LastUpdated time.Time `json:"lastUpdated" db:"last_updated"` // Original is the original Delivery Service for which changes are // requested. This is present in responses only for ChangeTypes 'change' and // 'delete', and is only required in requests where ChangeType is 'delete'. Original *DeliveryServiceV41 `json:"original,omitempty" db:"original"` // Requested is the set of requested changes. This is present in responses // only for ChangeTypes 'change' and 'create', and is only required in // requests in those cases. Requested *DeliveryServiceV41 `json:"requested,omitempty" db:"deliveryservice"` // Status is the status of the Delivery Service Request. Status RequestStatus `json:"status" db:"status"` // Used internally to define the affected Delivery Service. XMLID string `json:"-"` }
DeliveryServiceRequestV41 is the type of a Delivery Service Request in Traffic Ops API version 4.1.
func (DeliveryServiceRequestV41) Downgrade ¶
func (dsr DeliveryServiceRequestV41) Downgrade() DeliveryServiceRequestV40
Downgrade will convert an instance of DeliveryServiceRequestV41 to DeliveryServiceRequestV40. Note that this function does a shallow copy of the requested and original Delivery Service structures.
type DeliveryServiceRequestV5 ¶
type DeliveryServiceRequestV5 = DeliveryServiceRequestV50
DeliveryServiceRequestV5 is the type of a Delivery Service Request as it appears in API version 5.
func (DeliveryServiceRequestV5) Downgrade ¶
func (dsr DeliveryServiceRequestV5) Downgrade() DeliveryServiceRequestV4
Downgrade coerces the DeliveryServiceRequestV50 to the older DeliveryServiceRequestV40 structure.
"XMLID" will be copied directly, not determined from Requested or Original.
All reference properties are "deep"-copied so they may be modified without affecting the original. Delivery Service properties (i.e. Requested and Original) are copied using the DeliveryServiceV5.Downgrade method (which is also deep).
func (DeliveryServiceRequestV5) IsClosed ¶
func (dsr DeliveryServiceRequestV5) IsClosed() bool
IsClosed returns whether or not the Delivery Service Request has been "closed", by being either rejected or completed.
func (DeliveryServiceRequestV5) IsOpen ¶
func (dsr DeliveryServiceRequestV5) IsOpen() bool
IsOpen returns whether or not the Delivery Service Request is still "open" - i.e. has not been rejected or completed.
func (*DeliveryServiceRequestV5) SetXMLID ¶
func (dsr *DeliveryServiceRequestV5) SetXMLID()
SetXMLID sets the DeliveryServiceRequestV5's XMLID based on its DeliveryService.
Example ¶
var dsr DeliveryServiceRequestV5 fmt.Println(dsr.XMLID == "") dsr.Requested = new(DeliveryServiceV5) dsr.Requested.XMLID = "test" dsr.SetXMLID() fmt.Println(dsr.XMLID)
Output: true test
func (DeliveryServiceRequestV5) String ¶
func (dsr DeliveryServiceRequestV5) String() string
String encodes the DeliveryServiceRequestV5 as a string, in the format "DeliveryServiceRequestV5({{Property}}={{Value}}[, {{Property}}={{Value}}]+)".
If a property is a pointer value, then its dereferenced value is used - unless it's nil, in which case "<nil>" is used as the value. DeliveryService is omitted, because of how large it is. Times are formatted in RFC3339 format.
Example ¶
var dsr DeliveryServiceRequestV50 fmt.Println(dsr.String())
Output: DeliveryServiceRequestV5(Assignee=<nil>, AssigneeID=<nil>, Author="", AuthorID=<nil>, ChangeType="", CreatedAt=0001-01-01T00:00:00Z, ID=<nil>, LastEditedBy="", LastEditedByID=<nil>, LastUpdated=0001-01-01T00:00:00Z, Status="")
type DeliveryServiceRequestV50 ¶
type DeliveryServiceRequestV50 struct { // Assignee is the username of the user assigned to the Delivery Service // Request, if any. Assignee *string `json:"assignee"` // AssigneeID is the integral, unique identifier of the user assigned to the // Delivery Service Request, if any. AssigneeID *int `json:"-" db:"assignee_id"` // Author is the username of the user who created the Delivery Service // Request. Author string `json:"author"` // AuthorID is the integral, unique identifier of the user who created the // Delivery Service Request, if/when it is known. AuthorID *int `json:"-" db:"author_id"` // ChangeType represents the type of change being made, must be one of // "create", "change" or "delete". ChangeType DSRChangeType `json:"changeType" db:"change_type"` // CreatedAt is the date/time at which the Delivery Service Request was // created. CreatedAt time.Time `json:"createdAt" db:"created_at"` // ID is the integral, unique identifier for the Delivery Service Request // if/when it is known. ID *int `json:"id" db:"id"` // LastEditedBy is the username of the user by whom the Delivery Service // Request was last edited. LastEditedBy string `json:"lastEditedBy"` // LastEditedByID is the integral, unique identifier of the user by whom the // Delivery Service Request was last edited, if/when it is known. LastEditedByID *int `json:"-" db:"last_edited_by_id"` // LastUpdated is the date/time at which the Delivery Service was last // modified. LastUpdated time.Time `json:"lastUpdated" db:"last_updated"` // Original is the original Delivery Service for which changes are // requested. This is present in responses only for ChangeTypes 'change' and // 'delete', and is only required in requests where ChangeType is 'delete'. Original *DeliveryServiceV5 `json:"original,omitempty" db:"original"` // Requested is the set of requested changes. This is present in responses // only for ChangeTypes 'change' and 'create', and is only required in // requests in those cases. Requested *DeliveryServiceV5 `json:"requested,omitempty" db:"deliveryservice"` // Status is the status of the Delivery Service Request. Status RequestStatus `json:"status" db:"status"` // Used internally to define the affected Delivery Service. XMLID string `json:"-"` }
DeliveryServiceRequestV50 is the type of a Delivery Service Request in Traffic Ops API version 5.0.
type DeliveryServiceRequestsResponseV4 ¶
type DeliveryServiceRequestsResponseV4 = DeliveryServiceRequestsResponseV40
DeliveryServiceRequestsResponseV4 is the type of a response from Traffic Ops for Delivery Service Requests using the latest minor version of API version 4.
type DeliveryServiceRequestsResponseV40 ¶
type DeliveryServiceRequestsResponseV40 struct { Response []DeliveryServiceRequestV40 `json:"response"` Alerts }
DeliveryServiceRequestsResponseV40 is the type of a response from Traffic Ops for Delivery Service Requests using API version 4.0.
type DeliveryServiceRequestsResponseV5 ¶
type DeliveryServiceRequestsResponseV5 struct { Response []DeliveryServiceRequestV5 `json:"response"` Alerts }
DeliveryServiceRequestsResponseV5 is the type of a response from Traffic Ops for Delivery Service Requests using the latest minor version of API version 5.
type DeliveryServiceResponseV5 ¶
type DeliveryServiceResponseV5 struct { Alerts Response DeliveryServiceV5 `json:"response"` }
DeliveryServiceResponseV5 is the type of a response for API endponts returning a single Delivery Service in Traffic Ops API version 5.
type DeliveryServiceSSLKeys ¶
type DeliveryServiceSSLKeys struct { AuthType string `json:"authType,omitempty"` CDN string `json:"cdn,omitempty"` DeliveryService string `json:"deliveryservice,omitempty"` BusinessUnit string `json:"businessUnit,omitempty"` City string `json:"city,omitempty"` Organization string `json:"organization,omitempty"` Hostname string `json:"hostname,omitempty"` Country string `json:"country,omitempty"` State string `json:"state,omitempty"` Key string `json:"key"` Version util.JSONIntStr `json:"version"` Certificate DeliveryServiceSSLKeysCertificate `json:"certificate,omitempty"` }
DeliveryServiceSSLKeys contains information about an SSL key and certificate used by a Delivery Service to secure its HTTP-delivered content.
type DeliveryServiceSSLKeysCertificate ¶
type DeliveryServiceSSLKeysCertificate struct { Crt string `json:"crt"` Key string `json:"key"` CSR string `json:"csr"` }
DeliveryServiceSSLKeysCertificate contains an SSL key/certificate pair for a Delivery Service, as well as the Certificate Signing Request associated with them.
type DeliveryServiceSSLKeysGenerationResponse ¶
DeliveryServiceSSLKeysGenerationResponse is the type of a response from Traffic Ops to a request for generation of SSL Keys for a Delivery Service.
type DeliveryServiceSSLKeysReq ¶
type DeliveryServiceSSLKeysReq struct { AuthType *string `json:"authType,omitempty"` CDN *string `json:"cdn,omitempty"` DeliveryService *string `json:"deliveryservice,omitempty"` BusinessUnit *string `json:"businessUnit,omitempty"` City *string `json:"city,omitempty"` Organization *string `json:"organization,omitempty"` HostName *string `json:"hostname,omitempty"` Country *string `json:"country,omitempty"` State *string `json:"state,omitempty"` // Key is the XMLID of the delivery service Key *string `json:"key"` Version *util.JSONIntStr `json:"version"` Certificate *DeliveryServiceSSLKeysCertificate `json:"certificate,omitempty"` }
DeliveryServiceSSLKeysReq structures are requests for the generation of SSL key certificate pairs for a Delivery Service, and this is, in fact, the structure required for POST request bodies to the /deliveryservices/sslkeys/generate Traffic Ops API endpoint.
func (*DeliveryServiceSSLKeysReq) Sanitize ¶
func (r *DeliveryServiceSSLKeysReq) Sanitize()
Sanitize ensures that if either the DeliveryService or Key property of a DeliveryServiceSSLKeysReq is nil, it will be set to a reference to a copy of the value of the other property (if that is not nil).
This does NOT ensure that both fields are not nil, nor does it ensure that they match.
type DeliveryServiceSSLKeysResponse ¶
type DeliveryServiceSSLKeysResponse struct { Response DeliveryServiceSSLKeys `json:"response"` Alerts }
DeliveryServiceSSLKeysResponse is the type of a response from Traffic Ops to GET requests made to its /deliveryservices/xmlId/{{XML ID}}/sslkeys API endpoint.
type DeliveryServiceSSLKeysV15 ¶
type DeliveryServiceSSLKeysV15 struct { DeliveryServiceSSLKeys Expiration time.Time `json:"expiration,omitempty"` }
DeliveryServiceSSLKeysV15 structures contain information about an SSL key certificate pair used by a Delivery Service.
"V15" is used because this structure was first introduced in version 1.5 of the Traffic Ops API.
This is, ostensibly, an updated version of DeliveryServiceSSLKeys, but beware that this may not be completely accurate as the predecessor structure appears to be used in many more contexts than this structure.
type DeliveryServiceSSLKeysV4 ¶
type DeliveryServiceSSLKeysV4 = DeliveryServiceSSLKeysV40
DeliveryServiceSSLKeysV4 is the representation of a DeliveryServiceSSLKeys in the latest minor version of version 4 of the Traffic Ops API.
type DeliveryServiceSSLKeysV40 ¶
type DeliveryServiceSSLKeysV40 struct { DeliveryServiceSSLKeysV15 Sans []string `json:"sans,omitempty"` }
DeliveryServiceSSLKeysV41 structures contain information about an SSL key certificate pair used by a Delivery Service.
"V41" is used because this structure was first introduced in version 4.1 of the Traffic Ops API.
type DeliveryServiceSafeUpdateRequest ¶
type DeliveryServiceSafeUpdateRequest struct { DisplayName *string `json:"displayName"` InfoURL *string `json:"infoUrl"` LongDesc *string `json:"longDesc"` LongDesc1 *string `json:"longDesc1,omitempty"` }
DeliveryServiceSafeUpdateRequest represents a request to update the "safe" fields of a Delivery Service.
type DeliveryServiceSafeUpdateResponse ¶
type DeliveryServiceSafeUpdateResponse struct { Alerts // Response contains the representation of the Delivery Service after it has been updated. Response []DeliveryServiceNullable `json:"response"` }
DeliveryServiceSafeUpdateResponse represents Traffic Ops's response to a PUT request to its /deliveryservices/{{ID}}/safe endpoint. Deprecated: Please only use versioned structures.
type DeliveryServiceSafeUpdateResponseV30 ¶
type DeliveryServiceSafeUpdateResponseV30 struct { Alerts // Response contains the representation of the Delivery Service after it has // been updated. Response []DeliveryServiceNullableV30 `json:"response"` }
DeliveryServiceSafeUpdateResponseV30 represents Traffic Ops's response to a PUT request to its /api/3.0/deliveryservices/{{ID}}/safe endpoint.
type DeliveryServiceSafeUpdateResponseV4 ¶
type DeliveryServiceSafeUpdateResponseV4 = DeliveryServiceSafeUpdateResponseV40
DeliveryServiceSafeUpdateResponseV4 represents TrafficOps's response to a PUT request to its /api/4.x/deliveryservices/{{ID}}/safe endpoint. This is always a type alias for the structure of a response in the latest minor APIv4 version.
type DeliveryServiceSafeUpdateResponseV40 ¶
type DeliveryServiceSafeUpdateResponseV40 struct { Alerts // Response contains the representation of the Delivery Service after it has // been updated. Response []DeliveryServiceV40 `json:"response"` }
DeliveryServiceSafeUpdateResponseV40 represents Traffic Ops's response to a PUT request to its /api/4.0/deliveryservices/{{ID}}/safe endpoint.
type DeliveryServiceServer
deprecated
type DeliveryServiceServer struct { Server *int `json:"server" db:"server"` DeliveryService *int `json:"deliveryService" db:"deliveryservice"` LastUpdated *TimeNoMod `json:"lastUpdated" db:"last_updated"` }
DeliveryServiceServer is the type of each entry in the `response` array property of responses from Traffic Ops to GET requests made to the /deliveryserviceservers endpoint of its API.
Deprecated: Direct server-to-DS assignments are deprecated in favor of Topology usage.
type DeliveryServiceServerResponse
deprecated
type DeliveryServiceServerResponse struct { Orderby string `json:"orderby"` Response []DeliveryServiceServer `json:"response"` Size int `json:"size"` Limit int `json:"limit"` Alerts }
DeliveryServiceServerResponse is the type of a response from Traffic Ops to a GET request to the /deliveryserviceserver endpoint.
Deprecated: Direct server-to-DS assignments are deprecated in favor of Topology usage.
type DeliveryServiceServerResponseV5 ¶
type DeliveryServiceServerResponseV5 = DeliveryServiceServerResponseV50
DeliveryServiceServerResponseV5 is the type of a response from Traffic Ops to a GET request to the /deliveryserviceserver endpoint, for the latest minor version of api v5.x.
type DeliveryServiceServerResponseV50 ¶
type DeliveryServiceServerResponseV50 struct { Orderby string `json:"orderby"` Response []DeliveryServiceServerV5 `json:"response"` Size int `json:"size"` Limit int `json:"limit"` Alerts }
DeliveryServiceServerResponseV50 is the type of a response from Traffic Ops to a GET request to the /deliveryserviceserver endpoint for API v5.0.
type DeliveryServiceServerV5 ¶
type DeliveryServiceServerV5 = DeliveryServiceServerV50
DeliveryServiceServerV5 is the struct used to represent a delivery service server, in the latest minor version for API 5.x.
type DeliveryServiceServerV50 ¶
type DeliveryServiceServerV50 struct { Server *int `json:"server" db:"server"` DeliveryService *int `json:"deliveryService" db:"deliveryservice"` LastUpdated *time.Time `json:"lastUpdated" db:"last_updated"` }
DeliveryServiceServerV50 is the type of each entry in the `response` array property of responses from Traffic Ops to GET requests made to the /deliveryserviceservers endpoint of its API, for api version 5.0.
type DeliveryServiceServers
deprecated
type DeliveryServiceUserPost
deprecated
type DeliveryServiceUserPost struct { UserID *int `json:"userId"` DeliveryServices *[]int `json:"deliveryServices"` Replace *bool `json:"replace"` }
DeliveryServiceUserPost represents a legacy concept that no longer exists in Apache Traffic Control.
DO NOT USE THIS - it ONLY still exists because it is still in use by Traffic Ops's Go client for API versions 2 and 3, despite that those API versions do not include the concepts and functionality for which this structure was created.
Deprecated: All Go clients for API versions that still erroneously link to this symbol are deprecated, and this structure serves no known purpose.
type DeliveryServiceV11
deprecated
type DeliveryServiceV11 struct { Active bool `json:"active"` AnonymousBlockingEnabled bool `json:"anonymousBlockingEnabled"` CacheURL string `json:"cacheurl"` CCRDNSTTL int `json:"ccrDnsTtl"` CDNID int `json:"cdnId"` CDNName string `json:"cdnName"` CheckPath string `json:"checkPath"` DeepCachingType DeepCachingType `json:"deepCachingType"` DisplayName string `json:"displayName"` DNSBypassCname string `json:"dnsBypassCname"` DNSBypassIP string `json:"dnsBypassIp"` DNSBypassIP6 string `json:"dnsBypassIp6"` DNSBypassTTL int `json:"dnsBypassTtl"` DSCP int `json:"dscp"` EdgeHeaderRewrite string `json:"edgeHeaderRewrite"` ExampleURLs []string `json:"exampleURLs"` GeoLimit int `json:"geoLimit"` GeoProvider int `json:"geoProvider"` GlobalMaxMBPS int `json:"globalMaxMbps"` GlobalMaxTPS int `json:"globalMaxTps"` HTTPBypassFQDN string `json:"httpBypassFqdn"` ID int `json:"id"` InfoURL string `json:"infoUrl"` InitialDispersion float32 `json:"initialDispersion"` IPV6RoutingEnabled bool `json:"ipv6RoutingEnabled"` LastUpdated *TimeNoMod `json:"lastUpdated" db:"last_updated"` LogsEnabled bool `json:"logsEnabled"` LongDesc string `json:"longDesc"` LongDesc1 string `json:"longDesc1"` LongDesc2 string `json:"longDesc2"` MatchList []DeliveryServiceMatch `json:"matchList,omitempty"` MaxDNSAnswers int `json:"maxDnsAnswers"` MidHeaderRewrite string `json:"midHeaderRewrite"` MissLat float64 `json:"missLat"` MissLong float64 `json:"missLong"` MultiSiteOrigin bool `json:"multiSiteOrigin"` OrgServerFQDN string `json:"orgServerFqdn"` ProfileDesc string `json:"profileDescription"` ProfileID int `json:"profileId,omitempty"` ProfileName string `json:"profileName"` Protocol int `json:"protocol"` QStringIgnore int `json:"qstringIgnore"` RangeRequestHandling int `json:"rangeRequestHandling"` RegexRemap string `json:"regexRemap"` RegionalGeoBlocking bool `json:"regionalGeoBlocking"` RemapText string `json:"remapText"` RoutingName string `json:"routingName"` Signed bool `json:"signed"` TypeID int `json:"typeId"` Type DSType `json:"type"` TRResponseHeaders string `json:"trResponseHeaders"` TenantID int `json:"tenantId"` XMLID string `json:"xmlId"` }
DeliveryServiceV11 contains the information relating to a Delivery Service that was around in version 1.1 of the Traffic Ops API.
DO NOT USE THIS - it ONLY still exists because it is nested within the structure of the DeliveryServiceV13 type.
Deprecated: Instead, use the appropriate structure for the version of the Traffic Ops API being worked with, e.g. DeliveryServiceV4.
type DeliveryServiceV13
deprecated
type DeliveryServiceV13 struct { DeliveryServiceV11 DeepCachingType DeepCachingType `json:"deepCachingType"` FQPacingRate int `json:"fqPacingRate,omitempty"` SigningAlgorithm string `json:"signingAlgorithm" db:"signing_algorithm"` Tenant string `json:"tenant"` TRRequestHeaders string `json:"trRequestHeaders,omitempty"` TRResponseHeaders string `json:"trResponseHeaders,omitempty"` }
DeliveryServiceV13 structures represent a Delivery Service as it is exposed through the Traffic Ops API at version 1.3 - which no longer exists.
DO NOT USE THIS - it ONLY still exists because it is nested within the structure of the DeliveryService type.
Deprecated: Instead, use the appropriate structure for the version of the Traffic Ops API being worked with, e.g. DeliveryServiceV4.
type DeliveryServiceV30
deprecated
type DeliveryServiceV30 struct { DeliveryServiceNullableV15 DeliveryServiceFieldsV30 }
DeliveryServiceV30 represents a Delivery Service as they appear in version 3.0 of the Traffic Ops API.
Deprecated: API version 3.0 is deprecated - upgrade to DeliveryServiceV4.
type DeliveryServiceV31
deprecated
type DeliveryServiceV31 struct { DeliveryServiceV30 DeliveryServiceFieldsV31 }
DeliveryServiceV31 represents a Delivery Service as they appear in version 3.1 of the Traffic Ops API.
Deprecated: API version 3.1 is deprecated - upgrade to DeliveryServiceV4.
type DeliveryServiceV4 ¶
type DeliveryServiceV4 = DeliveryServiceV41
DeliveryServiceV4 is a Delivery Service as it appears in version 4 of the Traffic Ops API - it always points to the highest minor version in APIv4.
func (DeliveryServiceV4) DowngradeToV31 ¶
func (ds DeliveryServiceV4) DowngradeToV31() DeliveryServiceNullableV30
DowngradeToV31 converts a 4.x DS to a 3.1 DS.
func (*DeliveryServiceV4) RemoveLD1AndLD2 ¶
func (ds *DeliveryServiceV4) RemoveLD1AndLD2() DeliveryServiceV4
RemoveLD1AndLD2 removes the Long Description 1 and Long Description 2 fields from a V 4.x DS, and returns the resulting struct.
func (*DeliveryServiceV4) Scan ¶
func (ds *DeliveryServiceV4) Scan(src interface{}) error
Scan implements the database/sql.Scanner interface.
This expects src to be an encoding/json.RawMessage and unmarshals that into the DeliveryServiceV4.
func (DeliveryServiceV4) Upgrade ¶
func (ds DeliveryServiceV4) Upgrade() DeliveryServiceV5
Upgrade upgrades an APIv4 Delivery Service into an APIv5 Delivery Service of the latest minor version.
type DeliveryServiceV40 ¶
type DeliveryServiceV40 struct { DeliveryServiceFieldsV31 DeliveryServiceFieldsV30 DeliveryServiceFieldsV15 DeliveryServiceFieldsV14 DeliveryServiceFieldsV13 DeliveryServiceNullableFieldsV11 // TLSVersions is the list of explicitly supported TLS versions for cache // servers serving the Delivery Service's content. TLSVersions []string `json:"tlsVersions" db:"tls_versions"` GeoLimitCountries GeoLimitCountriesType `json:"geoLimitCountries"` }
DeliveryServiceV40 is a Delivery Service as it appears in version 4.0 of the Traffic Ops API.
func (*DeliveryServiceV40) RemoveLD1AndLD2 ¶
func (ds *DeliveryServiceV40) RemoveLD1AndLD2() DeliveryServiceV40
RemoveLD1AndLD2 removes the Long Description 1 and Long Description 2 fields from a V4.0 Delivery Service, and returns the resulting struct.
func (DeliveryServiceV40) TLSVersionsAlerts ¶
func (ds DeliveryServiceV40) TLSVersionsAlerts() Alerts
TLSVersionsAlerts generates warning-level alerts for the Delivery Service's TLS versions array. It will warn if newer versions are disallowed while older, less secure versions are allowed, if there are unrecognized versions present, if the Delivery Service's Protocol does not make use of TLS Versions, and whenever TLSVersions are explicitly set at all.
This does NOT verify that the Delivery Service's TLS versions are _valid_, it ONLY creates warnings based on conditions that are possibly detrimental to CDN operation, but can, in fact, work.
type DeliveryServiceV41 ¶
type DeliveryServiceV41 struct { DeliveryServiceV40 // Regional indicates whether the Delivery Service's MaxOriginConnections is // only per Cache Group, rather than divided over all Cache Servers in child // Cache Groups of the Origin. Regional bool `json:"regional" db:"regional"` RequiredCapabilities []string `json:"requiredCapabilities" db:"required_capabilities"` }
DeliveryServiceV41 is a Delivery Service as it appears in version 4.1 of the Traffic Ops API.
func (DeliveryServiceV41) TLSVersionsAlerts ¶
func (ds DeliveryServiceV41) TLSVersionsAlerts() Alerts
TLSVersionsAlerts generates warning-level alerts for the Delivery Service's TLS versions array. It will warn if newer versions are disallowed while older, less secure versions are allowed, if there are unrecognized versions present, if the Delivery Service's Protocol does not make use of TLS Versions, and whenever TLSVersions are explicitly set at all.
This does NOT verify that the Delivery Service's TLS versions are _valid_, it ONLY creates warnings based on conditions that are possibly detrimental to CDN operation, but can, in fact, work.
type DeliveryServiceV5 ¶
type DeliveryServiceV5 = DeliveryServiceV50
DeliveryServiceV5 is the type of a Delivery Service as it appears in the latest minor version of Traffic Ops API version 5.
func (DeliveryServiceV5) Downgrade ¶
func (ds DeliveryServiceV5) Downgrade() DeliveryServiceV4
Downgrade downgrades an APIv5 Delivery Service into an APIv4 Delivery Service of the latest minor version.
func (*DeliveryServiceV5) Scan ¶
func (ds *DeliveryServiceV5) Scan(src interface{}) error
Scan implements the database/sql.Scanner interface.
This expects src to be an encoding/json.RawMessage and unmarshals that into the DeliveryServiceV5.
func (DeliveryServiceV5) TLSVersionsAlerts ¶
func (ds DeliveryServiceV5) TLSVersionsAlerts() Alerts
TLSVersionsAlerts generates warning-level alerts for the Delivery Service's TLS versions array. It will warn if newer versions are disallowed while older, less secure versions are allowed, if there are unrecognized versions present, if the Delivery Service's Protocol does not make use of TLS Versions, and whenever TLSVersions are explicitly set at all.
This does NOT verify that the Delivery Service's TLS versions are _valid_, it ONLY creates warnings based on conditions that are possibly detrimental to CDN operation, but can, in fact, work.
type DeliveryServiceV50 ¶
type DeliveryServiceV50 struct { // Active dictates whether the Delivery Service is routed by Traffic Router, // and whether cache servers have its configuration downloaded. Active DeliveryServiceActiveState `json:"active" db:"active"` // AnonymousBlockingEnabled sets whether or not anonymized IP addresses // (e.g. Tor exit nodes) should be restricted from accessing the Delivery // Service's content. AnonymousBlockingEnabled bool `json:"anonymousBlockingEnabled" db:"anonymous_blocking_enabled"` // CCRDNSTTL sets the Time-to-Live - in seconds - for DNS responses for this // Delivery Service from Traffic Router. CCRDNSTTL *int `json:"ccrDnsTtl" db:"ccr_dns_ttl"` // CDNID is the integral, unique identifier for the CDN to which the // Delivery Service belongs. CDNID int `json:"cdnId" db:"cdn_id"` // CDNName is the name of the CDN to which the Delivery Service belongs. CDNName *string `json:"cdnName"` // CheckPath is a path which may be requested of the Delivery Service's // origin to ensure it's working properly. CheckPath *string `json:"checkPath" db:"check_path"` // ConsistentHashQueryParams is a list of al of the query string parameters // which ought to be considered by Traffic Router in client request URIs for // HTTP-routed Delivery Services in the hashing process. ConsistentHashQueryParams []string `json:"consistentHashQueryParams"` // ConsistentHashRegex is used by Traffic Router to extract meaningful parts // of a client's request URI for HTTP-routed Delivery Services before // hashing the request to find a cache server to which to direct the client. ConsistentHashRegex *string `json:"consistentHashRegex"` // DeepCachingType may only be 'ALWAYS' or 'NEVER', which // define whether "deep caching" may or may not be used for this Delivery // Service, respectively. DeepCachingType DeepCachingType `json:"deepCachingType" db:"deep_caching_type"` // DisplayName is a human-friendly name that might be used in some UIs // somewhere. DisplayName string `json:"displayName" db:"display_name"` // DNSBypassCNAME is a fully qualified domain name to be used in a CNAME // record presented to clients in bypass scenarios. DNSBypassCNAME *string `json:"dnsBypassCname" db:"dns_bypass_cname"` // DNSBypassIP is an IPv4 address to be used in an A record presented to // clients in bypass scenarios. DNSBypassIP *string `json:"dnsBypassIp" db:"dns_bypass_ip"` // DNSBypassIP6 is an IPv6 address to be used in an AAAA record presented to // clients in bypass scenarios. DNSBypassIP6 *string `json:"dnsBypassIp6" db:"dns_bypass_ip6"` // DNSBypassTTL sets the Time-to-Live - in seconds - of DNS responses from // the Traffic Router that contain records for bypass destinations. DNSBypassTTL *int `json:"dnsBypassTtl" db:"dns_bypass_ttl"` // DSCP sets the Differentiated Services Code Point for IP packets // transferred between clients, origins, and cache servers when obtaining // and serving content for this Delivery Service. // See Also: https://en.wikipedia.org/wiki/Differentiated_services DSCP int `json:"dscp" db:"dscp"` // EcsEnabled describes whether or not the Traffic Router's EDNS0 Client // Subnet extensions should be enabled when serving DNS responses for this // Delivery Service. Even if this is true, the Traffic Router may still // have the extensions unilaterally disabled in its own configuration. EcsEnabled bool `json:"ecsEnabled" db:"ecs_enabled"` // EdgeHeaderRewrite is a "header rewrite rule" used by ATS at the Edge-tier<