tc

package
v5.1.1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2021 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 25 Imported by: 0

Documentation

Overview

Package tc provides structures, constants, and functions that are used throughout the components of Apache Traffic Control.

enum.go contains enumerations and strongly typed names.

These enums 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.

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.

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 FromString() conversion function, to convert input data to enums. Conversion functions should usually be case-insensitive, and may ignore underscores or hyphens, depending on the use case.

Index

Examples

Constants

View Source
const (
	// RequestStatusInvalid -- invalid state
	RequestStatusInvalid = RequestStatus("invalid")
	// RequestStatusDraft -- newly created; not ready to be reviewed
	RequestStatusDraft = RequestStatus("draft")
	// RequestStatusSubmitted -- newly created; ready to be reviewed
	RequestStatusSubmitted = RequestStatus("submitted")
	// RequestStatusRejected -- reviewed, but problems found
	RequestStatusRejected = RequestStatus("rejected")
	// RequestStatusPending -- reviewed and locked; ready to be implemented
	RequestStatusPending = RequestStatus("pending")
	// RequestStatusComplete -- implemented and locked
	RequestStatusComplete = RequestStatus("complete")
)
View Source
const (
	SelfSignedCertAuthType           = "Self Signed"
	CertificateAuthorityCertAuthType = "Certificate Authority"
	LetsEncryptAuthType              = "Lets Encrypt"
)
View Source
const (
	// CacheTypeEdge represents an edge cache.
	CacheTypeEdge = CacheType("EDGE")
	// CacheTypeMid represents a mid cache.
	CacheTypeMid = CacheType("MID")
	// CacheTypeInvalid represents an cache type enumeration. Note this is the default construction for a CacheType.
	CacheTypeInvalid = CacheType("")
)
View Source
const (
	CacheGroupEdgeTypeName   = EdgeTypePrefix + "_LOC"
	CacheGroupMidTypeName    = MidTypePrefix + "_LOC"
	CacheGroupOriginTypeName = OriginTypeName + "_LOC"
)
View Source
const (
	// DSTypeCategoryHTTP represents an HTTP delivery service
	DSTypeCategoryHTTP = DSTypeCategory("http")
	// DSTypeCategoryDNS represents a DNS delivery service
	DSTypeCategoryDNS = DSTypeCategory("dns")
	// DSTypeCategoryInvalid represents an invalid delivery service type enumeration. Note this is the default construction for a DSTypeCategory.
	DSTypeCategoryInvalid = DSTypeCategory("")
)
View Source
const (
	// CacheStatusAdminDown represents a cache which has been administratively marked as down, but which should still appear in the CDN (Traffic Server, Traffic Monitor, Traffic Router).
	CacheStatusAdminDown = CacheStatus("ADMIN_DOWN")
	// CacheStatusOnline represents a cache which has been marked as Online in Traffic Ops, irrespective of monitoring. Traffic Monitor will always flag these caches as available.
	CacheStatusOnline = CacheStatus("ONLINE")
	// CacheStatusOffline represents a cache which has been marked as Offline in Traffic Ops. These caches will not be returned in any endpoint, and Traffic Monitor acts like they don't exist.
	CacheStatusOffline = CacheStatus("OFFLINE")
	// CacheStatusReported represents a cache which has been marked as Reported in Traffic Ops. These caches are polled for health and returned in endpoints as available or unavailable based on bandwidth, response time, and other factors. The vast majority of caches should be Reported.
	CacheStatusReported = CacheStatus("REPORTED")
	// CacheStatusInvalid represents an invalid status enumeration.
	CacheStatusInvalid = CacheStatus("")
)
View Source
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("")
)
View Source
const (
	LocalizationMethodCZ      = LocalizationMethod("CZ")
	LocalizationMethodDeepCZ  = LocalizationMethod("DEEP_CZ")
	LocalizationMethodGeo     = LocalizationMethod("GEO")
	LocalizationMethodInvalid = LocalizationMethod("INVALID")
)
View Source
const (
	DeepCachingTypeNever   = DeepCachingType("") // default value
	DeepCachingTypeAlways  = DeepCachingType("ALWAYS")
	DeepCachingTypeInvalid = DeepCachingType("INVALID")
)
View Source
const (
	FederationResolverType4       = FederationResolverType("RESOLVE4")
	FederationResolverType6       = FederationResolverType("RESOLVE6")
	FederationResolverTypeInvalid = FederationResolverType("")
)
View Source
const (
	// ThresholdPrefix is the prefix of all Names of Parameters used to define
	// monitoring thresholds.
	ThresholdPrefix   = "health.threshold."
	StatNameKBPS      = "kbps"
	StatNameMaxKBPS   = "maxKbps"
	StatNameBandwidth = "bandwidth"
)
View Source
const ATSConfigMetaDataConfigFileScopeCDNs = ATSConfigMetaDataConfigFileScope("cdns")
View Source
const ATSConfigMetaDataConfigFileScopeInvalid = ATSConfigMetaDataConfigFileScope("")
View Source
const ATSConfigMetaDataConfigFileScopeProfiles = ATSConfigMetaDataConfigFileScope("profiles")
View Source
const ATSConfigMetaDataConfigFileScopeServers = ATSConfigMetaDataConfigFileScope("servers")
View Source
const AlgorithmConsistentHash = "consistent_hash"
View Source
const CachegroupCoordinateNamePrefix = "from_cachegroup_"

CachegroupCoordinateNamePrefix is a string that all cache group coordinate names are prefixed with.

View Source
const DBError = ErrorConstant("database access error")

DBError is an error message for database errors.

View Source
const DNSSECKSKType = "ksk"
View Source
const DNSSECKeyStatusExpired = "expired"
View Source
const DNSSECKeyStatusNew = "new"
View Source
const DNSSECStatusExisting = "existing"
View Source
const DNSSECZSKType = "zsk"
View Source
const DSProtocolHTTP = 0
View Source
const DSProtocolHTTPAndHTTPS = 2
View Source
const DSProtocolHTTPS = 1
View Source
const DSProtocolHTTPToHTTPS = 3
View Source
const DSTypeLiveNationalSuffix = "_LIVE_NATNL"
View Source
const DSTypeLiveSuffix = "_LIVE"
View Source
const DefaultHealthThresholdComparator = "<"
View Source
const DefaultMaxRequestHeaderBytes = 0
View Source
const DefaultRoutingName = "cdn"
View Source
const EdgeTypePrefix = "EDGE"
View Source
const EmptyAddressCannotBeAServiceAddressError = ErrorConstant("an empty IP or IPv6 address cannot be marked as a service address")
View Source
const GlobalConfigFileName = ConfigFileName("global")

GlobalConfigFileName is the name of the global Traffic Ops config file.

View Source
const GlobalProfileName = "GLOBAL"
View Source
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

View Source
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.

View Source
const MaxRangeSliceBlockSize = 33554432 // 32Mib
View Source
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.

View Source
const MidTypePrefix = "MID"
View Source
const MinRangeSliceBlockSize = 262144 // 265Kib
View Source
const MonitorProfilePrefix = "RASCAL"
View Source
const MonitorTypeName = "RASCAL"
View Source
const NeedsAtLeastOneIPError = ErrorConstant("both IP and IP6 addresses are empty")
View Source
const NeedsAtLeastOneServiceAddressError = ErrorConstant("at least one address must be marked as a service address")
View Source
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.

View Source
const OriginLocationType = "ORG_LOC"
View Source
const OriginTypeName = "ORG"
View Source
const QueryStringIgnoreDropAtEdge = 2
View Source
const QueryStringIgnoreIgnoreInCacheKeyAndPassUp = 1
View Source
const QueryStringIgnoreUseInCacheKeyAndPassUp = 0
View Source
const RangeRequestHandlingBackgroundFetch = 1
View Source
const RangeRequestHandlingCacheRangeRequest = 2
View Source
const RangeRequestHandlingDontCache = 0
View Source
const RangeRequestHandlingSlice = 3
View Source
const RouterTypeName = "CCR"
View Source
const SigningAlgorithmURISigning = "uri_signing"
View Source
const SigningAlgorithmURLSig = "url_sig"
View Source
const TRAFFIC_STATS_SOURCE = "TrafficStats"

TRAFFIC_STATS_SOURCE is the value of the "source" field in an API response. Perl always returned source="TrafficStats", so we do too

View Source
const TRAFFIC_STATS_VERSION = "1.2"

TRAFFIC_STATS_VERSION was supposed to be the "API version", but actually the plugin (this route used to be a plugin in Perl) always returned this static value

View Source
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.

View Source
const TenantUserNotAuthError = ErrorConstant("user not authorized for requested tenant")

TenantUserNotAuthError is used when a user does not have access to a requested resource tenant.

View Source
const TimeLayout = "2006-01-02 15:04:05-07"

TimeLayout is the format used in lastUpdated fields in Traffic Ops

View Source
const UseRevalPendingParameterName = ParameterName("use_reval_pending")

UseRevalPendingParameterName is the name of a parameter which tells whether or not Traffic Ops should use pending revalidation jobs.

Variables

View Source
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 &amp; 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.

View Source
var RequestStatuses = []RequestStatus{

	"draft",
	"submitted",
	"rejected",
	"pending",
	"complete",
}

RequestStatuses -- user-visible string associated with each of the above

View Source
var StatusKey = "status"

StatusKey holds the text of the status key of a Request Context.

View Source
var TrafficStatsDurationPattern = regexp.MustCompile(`^\d+[mhdw]$`)

TrafficStatsDurationPattern reflects all the possible durations that can be requested via the deliveryservice_stats endpoint

View Source
var ValidJobRegexPrefix = regexp.MustCompile(`^\?/.*$`)

ValidJobRegexPrefix matches the only valid prefixes for a relative-path Content Invalidation Job regex

Functions

func CDNExistsByName

func CDNExistsByName(name string, tx *sql.Tx) (bool, error)

CDNExistsByName returns whether a cdn with the given name exists, and any error. TODO move to helper package.

func CRStatesMarshall

func CRStatesMarshall(states CRStates) ([]byte, error)

CRStatesMarshall serializes the given CRStates into bytes.

func DurationLiteralToSeconds

func DurationLiteralToSeconds(d string) (int64, error)

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 GetHandleErrorsFunc deprecated

func GetHandleErrorsFunc(w http.ResponseWriter, r *http.Request) func(status int, errs ...error)

GetHandleErrorsFunc is used to provide an error-handling function. The error handler provides a response to an HTTP request made to the Traffic Ops API and accepts a response code and a set of errors to display as alerts.

Deprecated: Traffic Ops API handlers should use github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/api.HandleErr instead.

func GetTypeData

func GetTypeData(tx *sql.Tx, id int) (string, string, bool, error)

GetTypeData returns the type's name and use_in_table, true/false if the query returned data, and any error

func LegacyMonitorConfigValid

func LegacyMonitorConfigValid(cfg *LegacyTrafficMonitorConfigMap) error

func MessagesToString

func MessagesToString(msgs []influx.Message) string

MessagesToString converts a set of messages from an InfluxDB node into a single, print-able string

func ParamExists

func ParamExists(id int64, tx *sql.Tx) (bool, error)

ParamExists returns whether a parameter with the given id exists, and any error. TODO move to helper package.

func ParamsExist

func ParamsExist(ids []int64, tx *sql.Tx) (bool, error)

ParamsExist returns whether parameters exist for all the given ids, and any error. TODO move to helper package.

func ParseOrgServerFQDN

func ParseOrgServerFQDN(orgServerFQDN string) (*string, *string, *string, error)

func ProfileExistsByID

func ProfileExistsByID(id int64, tx *sql.Tx) (bool, error)

ProfileExistsByID returns whether a profile with the given id exists, and any error. TODO move to helper package.

func ProfileExistsByName

func ProfileExistsByName(name string, tx *sql.Tx) (bool, error)

ProfileExistsByName returns whether a profile with the given name exists, and any error. TODO move to helper package.

func ProfilesExistByIDs

func ProfilesExistByIDs(ids []int64, tx *sql.Tx) (bool, error)

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

func ValidateTypeID

func ValidateTypeID(tx *sql.Tx, typeID *int, expectedUseInTable string) (string, error)

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.

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

type ASNResponse struct {
	// in: body
	Response ASN `json:"response"`
	Alerts
}

ASNResponse is a single ASN response for Update and Create to depict what changed. swagger:response ASNResponse in: body

type ASNsResponse

type ASNsResponse struct {
	// in: body
	Response []ASN `json:"response"`
	Alerts
}

ASNsResponse 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 ATSConfigMetaData

type ATSConfigMetaData struct {
	Info        ATSConfigMetaDataInfo         `json:"info"`
	ConfigFiles []ATSConfigMetaDataConfigFile `json:"configFiles"`
}

ATSConfigMetaData contains metadata and information relating to files for a single cache server.

type ATSConfigMetaDataConfigFile

type ATSConfigMetaDataConfigFile struct {
	FileNameOnDisk string `json:"fnameOnDisk"`
	Location       string `json:"location"`
	APIURI         string `json:"apiUri,omitempty"` // APIURI is deprecated, do not use.
	URL            string `json:"url,omitempty"`    // URL is deprecated, do not use.
	Scope          string `json:"scope"`
}

type ATSConfigMetaDataConfigFileScope

type ATSConfigMetaDataConfigFileScope string

func ATSConfigMetaDataConfigFileScopeFromString

func ATSConfigMetaDataConfigFileScopeFromString(s string) ATSConfigMetaDataConfigFileScope

func (ATSConfigMetaDataConfigFileScope) String

type ATSConfigMetaDataInfo

type ATSConfigMetaDataInfo struct {
	CDNID             int    `json:"cdnId"`
	CDNName           string `json:"cdnName"`
	ServerID          int    `json:"serverId"`
	ServerName        string `json:"serverName"`
	ServerPort        int    `json:"serverTcpPort"`
	ProfileID         int    `json:"profileId"`
	ProfileName       string `json:"profileName"`
	TOReverseProxyURL string `json:"toRevProxyUrl"`
	TOURL             string `json:"toUrl"`
}

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.

func (*AcmeAccount) Validate

func (aa *AcmeAccount) Validate(tx *sql.Tx) error

Validate validates the AcmeAccount request is valid for creation or update.

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

func CreateErrorAlerts(errs ...error) Alerts

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

func (self *Alerts) AddAlert(alert Alert)

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

func (self *Alerts) AddAlerts(alerts Alerts)

AddAlerts appends all of the "Alert"s in the given Alerts structure to this Alerts structure.

Example
alerts1 := Alerts{
	[]Alert{
		Alert{
			Level: InfoLevel.String(),
			Text:  "foo",
		},
	},
}
alerts2 := Alerts{
	[]Alert{
		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) HasAlerts

func (self *Alerts) HasAlerts() bool

HasAlerts returns if the Alerts contains any "alert"s.

func (*Alerts) ToStrings

func (alerts *Alerts) ToStrings() []string

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

type AllCacheGroupParametersResponse struct {
	Response CacheGroupParametersList `json:"response"`
	Alerts
}

CacheGroupParametersResponse is a Cache Group Parameter response body.

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 JSON object returned by /api/1.x/federations?all&cdnName=my-cdn-name.

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"`
}

type BypassDestination

type BypassDestination struct {
	FQDN string `json:"fqdn"`
	Type string `json:"type"`
	Port int    `json:"Port"`
}

BypassDestination ...

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"`
}

CDN ...

type CDNConfig

type CDNConfig struct {
	Name *string `json:"name"`
	ID   *int    `json:"id"`
}

CDNConfig includes the name and ID of a single CDN configuration.

type CDNDNSSECGenerateReq

type CDNDNSSECGenerateReq struct {
	// Key is the CDN name, as documented in the API documentation.
	Key *string `json:"key"`
	// Name is the CDN domain, as documented in the API documentation.
	Name              *string                   `json:"name"`
	TTL               *util.JSONIntStr          `json:"ttl"`
	KSKExpirationDays *util.JSONIntStr          `json:"kskExpirationDays"`
	ZSKExpirationDays *util.JSONIntStr          `json:"zskExpirationDays"`
	EffectiveDateUnix *CDNDNSSECGenerateReqDate `json:"effectiveDate"`
}

func (CDNDNSSECGenerateReq) Validate

func (r CDNDNSSECGenerateReq) Validate(tx *sql.Tx) error

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

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"`
}

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 CDNGenerateKSKReq

type CDNGenerateKSKReq struct {
	ExpirationDays *uint64    `json:"expirationDays"`
	EffectiveDate  *time.Time `json:"effectiveDate"`
}

func (*CDNGenerateKSKReq) Sanitize

func (r *CDNGenerateKSKReq) Sanitize()

func (*CDNGenerateKSKReq) Validate

func (r *CDNGenerateKSKReq) Validate(tx *sql.Tx) error

type CDNName

type CDNName string

CDNName is the name of a CDN in Traffic Control.

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"`
}

CDNNullable ...

type CDNQueueUpdateRequest

type CDNQueueUpdateRequest ServerQueueUpdateRequest

CDNQueueUpdateRequest encodes the request data for the POST cdns/{{ID}}/queue_update endpoint.

type CDNQueueUpdateResponse

type CDNQueueUpdateResponse struct {
	Action string `json:"action"`
	CDNID  int64  `json:"cdnId"`
}

CDNQueueUpdateResponse encodes the response data for the POST cdns/{{ID}}/queue_update endpoint.

type CDNResponse

type CDNResponse struct {
	// in: body
	Response CDN `json:"response"`
	Alerts
}

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"`
}

type CDNSSLKeyCert

type CDNSSLKeyCert struct {
	Crt string `json:"crt"`
	Key string `json:"key"`
}

type CDNSSLKeys

type CDNSSLKeys struct {
	DeliveryService string                `json:"deliveryservice"`
	Certificate     CDNSSLKeysCertificate `json:"certificate"`
	Hostname        string                `json:"hostname"`
}

CDNSSLKeys ...

type CDNSSLKeysCertificate

type CDNSSLKeysCertificate struct {
	Crt string `json:"crt"`
	Key string `json:"key"`
}

CDNSSLKeysCertificate ...

type CDNSSLKeysResp

type CDNSSLKeysResp []CDNSSLKey

type CDNSSLKeysResponse

type CDNSSLKeysResponse struct {
	Response []CDNSSLKeys `json:"response"`
}

CDNSSLKeysResponse ...

type CDNsResponse

type CDNsResponse struct {
	// in: body
	Response []CDN `json:"response"`
	Alerts
}

CDNsResponse 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"`
}

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
}

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"`
}

TODO: drichardson - reconcile this with the DeliveryService struct in deliveryservices.go

type CRConfigDeliveryServiceProtocol

type CRConfigDeliveryServiceProtocol struct {
	AcceptHTTP      *bool `json:"acceptHttp,string,omitempty"`
	AcceptHTTPS     bool  `json:"acceptHttps,string"`
	RedirectOnHTTPS bool  `json:"redirectToHttps,string"`
}

type CRConfigDispersion

type CRConfigDispersion struct {
	Limit    int  `json:"limit"`
	Shuffled bool `json:"shuffled,string"`
}

type CRConfigGeoEnabled

type CRConfigGeoEnabled struct {
	CountryCode string `json:"countryCode"`
}

type CRConfigLatitudeLongitude

type CRConfigLatitudeLongitude struct {
	Lat                 float64                 `json:"latitude"`
	Lon                 float64                 `json:"longitude"`
	BackupLocations     CRConfigBackupLocations `json:"backupLocations,omitempty"`
	LocalizationMethods []LocalizationMethod    `json:"localizationMethods"`
}

type CRConfigLatitudeLongitudeShort

type CRConfigLatitudeLongitudeShort struct {
	Lat float64 `json:"lat"`
	Lon float64 `json:"long"`
}

type CRConfigMonitor

type CRConfigMonitor struct {
	FQDN         *string               `json:"fqdn,omitempty"`
	HTTPSPort    *int                  `json:"httpsPort"`
	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"`
}

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"`
}

type CRConfigRouterStatus

type CRConfigRouterStatus string

type CRConfigServerStatus

type CRConfigServerStatus string

type CRConfigStaticDNSEntry

type CRConfigStaticDNSEntry struct {
	Name  string `json:"name"`
	TTL   int    `json:"ttl"`
	Type  string `json:"type"`
	Value string `json:"value"`
}

type CRConfigStats

type CRConfigStats struct {
	CDNName         *string `json:"CDN_name,omitempty"`
	DateUnixSeconds *int64  `json:"date,omitempty"`
	TMHost          *string `json:"tm_host,omitempty"`
	TMPath          *string `json:"tm_path,omitempty"`
	TMUser          *string `json:"tm_user,omitempty"`
	TMVersion       *string `json:"tm_version,omitempty"`
}

type CRConfigTTL

type CRConfigTTL struct {
	ASeconds      *string `json:"A,omitempty"`
	AAAASeconds   *string `json:"AAAA,omitempty"`
	DNSkeySeconds *string `json:"DNSKEY,omitempty"`
	DSSeconds     *string `json:"DS,omitempty"`
	NSSeconds     *string `json:"NS,omitempty"`
	SOASeconds    *string `json:"SOA,omitempty"`
}

type CRConfigTopology

type CRConfigTopology struct {
	Nodes []string `json:"nodes"`
}

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"`
	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"`
}

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
	TotalDNSCount    uint64                `json:"totalDnsCount"`
	TotalHTTPCount   uint64                `json:"totalHttpCount"`
	TotalDSMissCount uint64                `json:"totalDsMissCount"`
	AppStartTime     uint64                `json:"appStartTime"`
	AverageDnsTime   uint64                `json:"averageDnsTime"`
	AverageHttpTime  uint64                `json:"averageHttpTime"`
	UpdateTracker    CRSStatsUpdateTracker `json:"updateTracker"`
}

CRSStatsStats represents stats about a given TR.

type CRSStatsUpdateTracker

type CRSStatsUpdateTracker struct {
	LastHttpsCertificatesCheck           uint64 `json:"lastHttpsCertificatesCheck"`
	LastGeolocationDatabaseUpdaterUpdate uint64 `json:"lastGeolocationDatabaseUpdaterUpdate"`
	LastCacheStateCheck                  uint64 `json:"lastCacheStateCheck"`
	LastCacheStateChange                 uint64 `json:"lastCacheStateChange"`
	LastNetworkUpdaterUpdate             uint64 `json:"lastNetworkUpdaterUpdate"`
	LastHTTPSCertificatesUpdate          uint64 `json:"lastHttpsCertificatesUpdate"`
	LastConfigCheck                      uint64 `json:"lastConfigCheck"`
	LastConfigChange                     uint64 `json:"lastConfigChange"`
	LastHTTPSCertificatesFetchFail       uint64 `json:"lastHttpsCertificatesFetchFail"`
	LastNetworkUpdaterCheck              uint64 `json:"lastNetworkUpdaterCheck"`
	NewDNSSECKeysFound                   uint64 `json:"newDnsSecKeysFound"`
	LastGeolocationDatabaseUpdaterCheck  uint64 `json:"lastGeolocationDatabaseUpdaterCheck"`
	LastHTTPSCertificatesFetchSuccess    uint64 `json:"lastHttpsCertificatesFetchSuccess"`
	LastSteeringWatcherCheck             uint64 `json:"lastSteeringWatcherCheck"`
	LastDNSSECKeysCheck                  uint64 `json:"lastDnsSecKeysCheck"`
	LastFederationsWatcherCheck          uint64 `json:"lastFederationsWatcherCheck"`
	LastHTTPSCertificatesFetchAttempt    uint64 `json:"lastHttpsCertificatesFetchAttempt"`
}

CRSStatsUpdateTracker ...

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

func CRStatesUnMarshall(body []byte) (CRStates, error)

CRStatesUnMarshall takes bytes of a JSON string, and unmarshals them into a CRStates object.

func NewCRStates

func NewCRStates() CRStates

NewCRStates creates a new CR states object, initializing pointer members.

func (CRStates) Copy

func (a CRStates) Copy() CRStates

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 CacheGroup

type CacheGroupFallback

type CacheGroupFallback struct {
	PrimaryCgId int `json:"primaryId" db:"primary_cg"`
	BackupCgId  int `json:"backupId" db:"backup_cg"`
	SetOrder    int `json:"setOrder" db:"set_order"`
}

CacheGroupFallback ...

type CacheGroupFallbackNullable

type CacheGroupFallbackNullable struct {
	PrimaryCgId *int `json:"primaryId" db:"primary_cg"`
	BackupCgId  *int `json:"backupId" db:"backup_cg"`
	SetOrder    *int `json:"setOrder" db:"set_order"`
}

CacheGroupFallbackNullable ...

type CacheGroupFallbackResponse

type CacheGroupFallbackResponse struct {
	// in: body
	Response CacheGroupFallback `json:"response"`
}

CacheGroupFallbackResponse is a single CacheGroupFallback response for Update and Create to depict what changed. swagger:response CacheGroupFallbackResponse in: body

type CacheGroupFallbacksResponse

type CacheGroupFallbacksResponse struct {
	// in: body
	Response []CacheGroupFallback `json:"response"`
}

CacheGroupFallbacksResponse is a list of CacheGroupFallbacks as a response. swagger:response CacheGroupFallbacksResponse in: body

type CacheGroupName

type CacheGroupName string

CacheGroupName is the name of a CDN cachegroup.

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 CacheGroupParameter

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"`
}

CacheGroupParameter ...

type CacheGroupParameterNullable

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"`
}

CacheGroupParameterNullable ...

type CacheGroupParameterRequest

type CacheGroupParameterRequest struct {
	CacheGroupID int `json:"cacheGroupId"`
	ParameterID  int `json:"parameterId"`
}

CacheGroupParameterRequest Cache Group Parameter request body

type CacheGroupParameters

type CacheGroupParameters 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"`
}

CacheGroupParameter ...

type CacheGroupParametersList

type CacheGroupParametersList struct {
	CacheGroupParameters []CacheGroupParametersResponseNullable `json:"cachegroupParameters"`
}

CacheGroupParametersList ...

type CacheGroupParametersNullable

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"`
}

CacheGroupParameterNullable ...

type CacheGroupParametersPostResponse

type CacheGroupParametersPostResponse struct {
	Response []CacheGroupParameterRequest `json:"response"`
	Alerts
}

CacheGroupParametersPostResponse Response body when Posting to associate a Parameter with a Cache Group.

type CacheGroupParametersResponse

type CacheGroupParametersResponse struct {
	Response []CacheGroupParameter `json:"response"`
	Alerts
}

CacheGroupParametersResponse is a Cache Group Parameter response body.

type CacheGroupParametersResponseNullable

type CacheGroupParametersResponseNullable struct {
	CacheGroup  *string    `json:"cachegroup"  db:"cachegroup"`
	Parameter   *int       `json:"parameter"  db:"parameter"`
	LastUpdated *TimeNoMod `json:"last_updated,omitempty"  db:"last_updated"`
}

CacheGroupParameterResponseNullable ...

func FormatForResponse

FormatForResponse converts a CacheGroupParametersNullable to CacheGroupParametersResponseNullable in order to format the output the same as the Perl endpoint.

type CacheGroupPostDSResp

type CacheGroupPostDSResp struct {
	ID               util.JSONIntStr `json:"id"`
	ServerNames      []CacheName     `json:"serverNames"`
	DeliveryServices []int           `json:"deliveryServices"`
}

type CacheGroupPostDSRespResponse

type CacheGroupPostDSRespResponse struct {
	Alerts
	Response CacheGroupPostDSResp `json:"response"`
}

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 CacheGroupsResponse

type CacheGroupsResponse struct {
	Response []CacheGroup `json:"response"`
	Alerts
}

CacheGroupsResponse is a list of CacheGroups as a response.

type CacheName

type CacheName string

CacheName is the hostname of a CDN cache.

func (CacheName) String

func (c CacheName) String() string

type CacheStatus

type CacheStatus string

CacheStatus represents the Traffic Server status set in Traffic Ops (online, offline, admin_down, reported). The string values of this type should match the Traffic Ops values.

func CacheStatusFromString

func CacheStatusFromString(s string) CacheStatus

CacheStatusFromString returns a CacheStatus from its string representation, or CacheStatusInvalid if the string is not a valid type.

func (CacheStatus) String

func (t CacheStatus) String() string

String returns a string representation of this cache status

type CacheType

type CacheType string

CacheType is the type (or tier) of a CDN cache.

func CacheTypeFromString

func CacheTypeFromString(s string) CacheType

CacheTypeFromString returns a cache type object from its string representation, or CacheTypeInvalid if the string is not a valid type.

func (CacheType) String

func (t CacheType) String() string

String returns a string representation of this cache type.

type CachegroupPostDSReq

type CachegroupPostDSReq struct {
	DeliveryServices []int `json:"deliveryServices"`
}

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 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 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 capabilites of said endpoint - and to user permission Roles - to describe the capabilities afforded by said Role. Note that enforcement of Capability-based permisions is not currently implemented.

type CommonAPIData

type CommonAPIData struct {
	QueryParams string `json:"pp"`
	DateStr     string `json:"date"`
}

CommonAPIData contains generic data common to most 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"`
	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"`
	RevalPending     *bool                `json:"revalPending" db:"reval_pending"`
	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"`
	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 represents the name of a Traffic Ops config file.

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 ...

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 ...

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. swagger:response CoordinateResponse in: body

type CoordinatesResponse

type CoordinatesResponse struct {
	// in: body
	Response []Coordinate `json:"response"`
	Alerts
}

CoordinatesResponse is a list of Coordinates as a response. swagger:response CoordinatesResponse in: body

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

type CreateDeliveryServiceNullableResponse struct {
	Response []DeliveryServiceNullable `json:"response"`
	Alerts
}

CreateDeliveryServiceNullableResponse ... Deprecated: Please only use the versioned structures.

type CreateDeliveryServiceResponse

type CreateDeliveryServiceResponse struct {
	Response []DeliveryService `json:"response"`
	Alerts
}

CreateDeliveryServiceResponse ... Deprecated: use CreateDeliveryServiceNullableResponse instead

type CreateUserResponse

type CreateUserResponse struct {
	Response User `json:"response"`
	Alerts
}

CreateUserResponse can hold a Traffic Ops API response to a POST request to create a user.

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"`
}

type DNSSECKeyDSRecord

type DNSSECKeyDSRecord struct {
	DNSSECKeyDSRecordV11
	Text string `json:"text"`
}

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"`
}

type DNSSECKeySet

type DNSSECKeySet struct {
	ZSK []DNSSECKey `json:"zsk"`
	KSK []DNSSECKey `json:"ksk"`
}

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 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 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"`
}

type DNSSECKeys

type DNSSECKeys map[string]DNSSECKeySet

DNSSECKeys is the DNSSEC keys as stored in Riak, plus the DS record text.

type DNSSECKeysRiak

type DNSSECKeysRiak DNSSECKeysV11

type DNSSECKeysV11

type DNSSECKeysV11 map[string]DNSSECKeySetV11

type DSMatchType

type DSMatchType string
const (
	DSMatchTypeHostRegex     DSMatchType = "HOST_REGEXP"
	DSMatchTypePathRegex     DSMatchType = "PATH_REGEXP"
	DSMatchTypeSteeringRegex DSMatchType = "STEERING_REGEXP"
	DSMatchTypeHeaderRegex   DSMatchType = "HEADER_REGEXP"
	DSMatchTypeInvalid       DSMatchType = ""
)

func DSMatchTypeFromString

func DSMatchTypeFromString(s string) DSMatchType

DSMatchTypeFromString returns a delivery service match type object 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 delivery service match type.

type DSSMapResponse

type DSSMapResponse struct {
	DsId    int   `json:"dsId"`
	Replace bool  `json:"replace"`
	Servers []int `json:"servers"`
}

type DSSReplaceResponse

type DSSReplaceResponse struct {
	Alerts
	Response DSSMapResponse `json:"response"`
}

type DSServer

type DSServer struct {
	DSServerBase
	ServerInterfaces *[]ServerInterfaceInfo `json:"interfaces" db:"interfaces"`
}

DSServer contains information for a Delivery Service Server.

type DSServerBase

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.

type DSServerIDs

type DSServerIDs struct {
	DeliveryServiceID *int  `json:"dsId" db:"deliveryservice"`
	ServerIDs         []int `json:"servers"`
	Replace           *bool `json:"replace"`
}

type DSServerV11

type DSServerV11 struct {
	DSServerBase
	LegacyInterfaceDetails
}

DSServerV11 contains the legacy format for a Delivery Service Server.

type DSServersResponse

type DSServersResponse struct {
	Response DeliveryServiceServers `json:"response"`
	Alerts
}

type DSType

type DSType string

DSType is the Delivery Service type.

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 = ""
)

func DSTypeFromString

func DSTypeFromString(s string) DSType

DSTypeFromString returns a delivery service type object from its string representation, or DSTypeInvalid if the string is not a valid type.

func (DSType) HasSSLKeys

func (t DSType) HasSSLKeys() bool

HasSSLKeys returns whether delivery services of this type have SSL keys.

func (DSType) IsDNS

func (t DSType) IsDNS() bool

IsDNS returns whether the DSType is a DNS category.

func (DSType) IsHTTP

func (t DSType) IsHTTP() bool

IsHTTP returns whether the DSType is an HTTP category.

func (DSType) IsLive

func (t DSType) IsLive() bool

IsLive returns whether delivery services of this type are "live".

func (DSType) IsNational

func (t DSType) IsNational() bool

IsNational returns whether delivery services of this type are "national".

func (DSType) IsSteering

func (t DSType) IsSteering() bool

IsSteering returns whether the DSType is a Steering category

func (DSType) String

func (t DSType) String() string

String returns a string representation of this delivery service type.

func (DSType) UsesMidCache

func (t DSType) UsesMidCache() bool

UsesMidCache returns whether delivery services of this type use mid-tier caches

type DSTypeCategory

type DSTypeCategory string

DSTypeCategory is the Delivery Service type category: HTTP or DNS

func DSTypeCategoryFromString

func DSTypeCategoryFromString(s string) DSTypeCategory

DSTypeCategoryFromString returns a delivery service type object from its string representation, or DSTypeCategoryInvalid if the string is not a valid type.

func (DSTypeCategory) String

func (t DSTypeCategory) String() string

String returns a string representation of this delivery service type.

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 type.

func (DeepCachingType) MarshalJSON

func (t DeepCachingType) MarshalJSON() ([]byte, error)

MarshalJSON marshals into a JSON representation

func (DeepCachingType) String

func (t DeepCachingType) String() string

String returns a string representation of this deep caching type

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

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 ...

type DeleteTenantResponse

type DeleteTenantResponse struct {
	Alerts []TenantAlert `json:"alerts"`
}

DeleteTenantResponse ...

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"`
}

Deprecated: use DeliveryServiceNullable instead

type DeliveryServiceAddSSLKeysReq

type DeliveryServiceAddSSLKeysReq struct {
	DeliveryServiceSSLKeysReq
}

func (*DeliveryServiceAddSSLKeysReq) Validate

func (r *DeliveryServiceAddSSLKeysReq) Validate(tx *sql.Tx) error

type DeliveryServiceCacheGroup

type DeliveryServiceCacheGroup struct {
	Online  int    `json:"online"`
	Offline int    `json:"offline"`
	Name    string `json:"name"`
}

DeliveryServiceCacheGroup ...

type DeliveryServiceCapacity

type DeliveryServiceCapacity struct {
	AvailablePercent   float64 `json:"availablePercent"`
	UnavailablePercent float64 `json:"unavailablePercent"`
	UtilizedPercent    float64 `json:"utilizedPercent"`
	MaintenancePercent float64 `json:"maintenancePercent"`
}

DeliveryServiceCapacity ...

type DeliveryServiceCapacityResponse

type DeliveryServiceCapacityResponse struct {
	Response DeliveryServiceCapacity `json:"response"`
}

DeliveryServiceCapacityResponse ...

type DeliveryServiceDestination

type DeliveryServiceDestination struct {
	Location string `json:"location"`
	Type     string `json:"type"`
}

DeliveryServiceDestination ...

type DeliveryServiceFailover

type DeliveryServiceFailover struct {
	Locations   []string                   `json:"locations"`
	Destination DeliveryServiceDestination `json:"destination"`
	Configured  bool                       `json:"configured"`
	Enabled     bool                       `json:"enabled"`
}

DeliveryServiceFailover ...

type DeliveryServiceFederationResolverMapping

type DeliveryServiceFederationResolverMapping struct {
	DeliveryService string          `json:"deliveryService"`
	Mappings        ResolverMapping `json:"mappings"`
}

func (*DeliveryServiceFederationResolverMapping) Validate

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.

func (*DeliveryServiceFederationResolverMappingRequest) Validate

Validate implements the github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/api.ParseValidator interface.

type DeliveryServiceGenSSLKeysReq

type DeliveryServiceGenSSLKeysReq struct {
	DeliveryServiceSSLKeysReq
}

func (*DeliveryServiceGenSSLKeysReq) Validate

func (r *DeliveryServiceGenSSLKeysReq) Validate(tx *sql.Tx) error

type DeliveryServiceHealth

type DeliveryServiceHealth struct {
	TotalOnline  int                         `json:"totalOnline"`
	TotalOffline int                         `json:"totalOffline"`
	CacheGroups  []DeliveryServiceCacheGroup `json:"cacheGroups"`
}

DeliveryServiceHealth ...

type DeliveryServiceHealthResponse

type DeliveryServiceHealthResponse struct {
	Response DeliveryServiceHealth `json:"response"`
}

DeliveryServiceHealthResponse ...

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"`
}

DeliveryServiceIDRegexResponse is a list of DeliveryServiceIDRegexes. It is unused.

type DeliveryServiceIDs

type DeliveryServiceIDs struct {
	DsId  *int    `json:"id,omitempty" db:"ds_id"`
	XmlId *string `json:"xmlId,omitempty" db:"xml_id"`
}

type DeliveryServiceLetsEncryptSSLKeysReq

type DeliveryServiceLetsEncryptSSLKeysReq struct {
	DeliveryServiceSSLKeysReq
}

func (*DeliveryServiceLetsEncryptSSLKeysReq) Validate

type DeliveryServiceMatch

type DeliveryServiceMatch struct {
	Type      DSMatchType `json:"type"`
	SetNumber int         `json:"setNumber"`
	Pattern   string      `json:"pattern"`
}

DeliveryServiceMatch ...

type DeliveryServiceMatchesResp

type DeliveryServiceMatchesResp []DeliveryServicePatterns

type DeliveryServiceMatchesResponse

type DeliveryServiceMatchesResponse struct {
	Response []DeliveryServicePatterns `json:"response"`
}

type DeliveryServiceName

type DeliveryServiceName string

DeliveryServiceName is the name of a CDN delivery service.

func (DeliveryServiceName) String

func (d DeliveryServiceName) String() string

type DeliveryServiceNullable deprecated

type DeliveryServiceNullable DeliveryServiceNullableV15

Deprecated: Use versioned structures only from now on.

func (*DeliveryServiceNullable) Scan

func (ds *DeliveryServiceNullable) Scan(src interface{}) error

Scan implements the sql.Scanner interface -- expects json.RawMessage and unmarshals to a DeliveryServiceNullable struct.

func (*DeliveryServiceNullable) Value

func (ds *DeliveryServiceNullable) Value() (driver.Value, error)

Value implements the driver.Valuer interface -- marshals struct to json to pass back as a json.RawMessage.

type DeliveryServiceNullableV11

type DeliveryServiceNullableV11 struct {
	// NOTE: the db: struct tags are used for testing to map to their equivalent database column (if there is one)
	//
	Active                   *bool                   `json:"active" db:"active"`
	AnonymousBlockingEnabled *bool                   `json:"anonymousBlockingEnabled" db:"anonymous_blocking_enabled"`
	CacheURL                 *string                 `json:"cacheurl" db:"cacheurl"`
	CCRDNSTTL                *int                    `json:"ccrDnsTtl" db:"ccr_dns_ttl"`
	CDNID                    *int                    `json:"cdnId" db:"cdn_id"`
	CDNName                  *string                 `json:"cdnName"`
	CheckPath                *string                 `json:"checkPath" db:"check_path"`
	DisplayName              *string                 `json:"displayName" db:"display_name"`
	DNSBypassCNAME           *string                 `json:"dnsBypassCname" db:"dns_bypass_cname"`
	DNSBypassIP              *string                 `json:"dnsBypassIp" db:"dns_bypass_ip"`
	DNSBypassIP6             *string                 `json:"dnsBypassIp6" db:"dns_bypass_ip6"`
	DNSBypassTTL             *int                    `json:"dnsBypassTtl" db:"dns_bypass_ttl"`
	DSCP                     *int                    `json:"dscp" db:"dscp"`
	EdgeHeaderRewrite        *string                 `json:"edgeHeaderRewrite" db:"edge_header_rewrite"`
	GeoLimit                 *int                    `json:"geoLimit" db:"geo_limit"`
	GeoLimitCountries        *string                 `json:"geoLimitCountries" db:"geo_limit_countries"`
	GeoLimitRedirectURL      *string                 `json:"geoLimitRedirectURL" db:"geolimit_redirect_url"`
	GeoProvider              *int                    `json:"geoProvider" db:"geo_provider"`
	GlobalMaxMBPS            *int                    `json:"globalMaxMbps" db:"global_max_mbps"`
	GlobalMaxTPS             *int                    `json:"globalMaxTps" db:"global_max_tps"`
	HTTPBypassFQDN           *string                 `json:"httpBypassFqdn" db:"http_bypass_fqdn"`
	ID                       *int                    `json:"id" db:"id"`
	InfoURL                  *string                 `json:"infoUrl" db:"info_url"`
	InitialDispersion        *int                    `json:"initialDispersion" db:"initial_dispersion"`
	IPV6RoutingEnabled       *bool                   `json:"ipv6RoutingEnabled" db:"ipv6_routing_enabled"`
	LastUpdated              *TimeNoMod              `json:"lastUpdated" db:"last_updated"`
	LogsEnabled              *bool                   `json:"logsEnabled" db:"logs_enabled"`
	LongDesc                 *string                 `json:"longDesc" db:"long_desc"`
	LongDesc1                *string                 `json:"longDesc1" db:"long_desc_1"`
	LongDesc2                *string                 `json:"longDesc2" db:"long_desc_2"`
	MatchList                *[]DeliveryServiceMatch `json:"matchList"`
	MaxDNSAnswers            *int                    `json:"maxDnsAnswers" db:"max_dns_answers"`
	MidHeaderRewrite         *string                 `json:"midHeaderRewrite" db:"mid_header_rewrite"`
	MissLat                  *float64                `json:"missLat" db:"miss_lat"`
	MissLong                 *float64                `json:"missLong" db:"miss_long"`
	MultiSiteOrigin          *bool                   `json:"multiSiteOrigin" db:"multi_site_origin"`
	OriginShield             *string                 `json:"originShield" db:"origin_shield"`
	OrgServerFQDN            *string                 `json:"orgServerFqdn" db:"org_server_fqdn"`
	ProfileDesc              *string                 `json:"profileDescription"`
	ProfileID                *int                    `json:"profileId" db:"profile"`
	ProfileName              *string                 `json:"profileName"`
	Protocol                 *int                    `json:"protocol" db:"protocol"`
	QStringIgnore            *int                    `json:"qstringIgnore" db:"qstring_ignore"`
	RangeRequestHandling     *int                    `json:"rangeRequestHandling" db:"range_request_handling"`
	RegexRemap               *string                 `json:"regexRemap" db:"regex_remap"`
	RegionalGeoBlocking      *bool                   `json:"regionalGeoBlocking" db:"regional_geo_blocking"`
	RemapText                *string                 `json:"remapText" db:"remap_text"`
	RoutingName              *string                 `json:"routingName" db:"routing_name"`
	Signed                   bool                    `json:"signed"`
	SSLKeyVersion            *int                    `json:"sslKeyVersion" db:"ssl_key_version"`
	TenantID                 *int                    `json:"tenantId" db:"tenant_id"`
	Type                     *DSType                 `json:"type"`
	TypeID                   *int                    `json:"typeId" db:"type"`
	XMLID                    *string                 `json:"xmlId" db:"xml_id"`
	ExampleURLs              []string                `json:"exampleURLs"`
}

DeliveryServiceNullableV11 is a version of the deliveryservice that allows for all fields to be null. TODO move contents to DeliveryServiceNullableV12, fix references, and remove

type DeliveryServiceNullableV12

type DeliveryServiceNullableV12 struct {
	DeliveryServiceNullableV11
}

type DeliveryServiceNullableV13

type DeliveryServiceNullableV13 struct {
	DeliveryServiceNullableV12
	DeepCachingType   *DeepCachingType `json:"deepCachingType" db:"deep_caching_type"`
	FQPacingRate      *int             `json:"fqPacingRate" db:"fq_pacing_rate"`
	SigningAlgorithm  *string          `json:"signingAlgorithm" db:"signing_algorithm"`
	Tenant            *string          `json:"tenant"`
	TRResponseHeaders *string          `json:"trResponseHeaders"`
	TRRequestHeaders  *string          `json:"trRequestHeaders"`
}

type DeliveryServiceNullableV14

type DeliveryServiceNullableV14 struct {
	DeliveryServiceNullableV13
	ConsistentHashRegex       *string  `json:"consistentHashRegex"`
	ConsistentHashQueryParams []string `json:"consistentHashQueryParams"`
	MaxOriginConnections      *int     `json:"maxOriginConnections" db:"max_origin_connections"`
}

type DeliveryServiceNullableV15

type DeliveryServiceNullableV15 struct {
	DeliveryServiceNullableV14
	EcsEnabled          bool `json:"ecsEnabled" db:"ecs_enabled"`
	RangeSliceBlockSize *int `json:"rangeSliceBlockSize" db:"range_slice_block_size"`
}

type DeliveryServiceNullableV30

type DeliveryServiceNullableV30 DeliveryServiceV31

DeliveryServiceNullableV30 is the aliased structure that we should be using for all api 3.x delivery structure operations This type should always alias the latest 3.x minor version struct. For ex, if you wanted to create a DeliveryServiceV32 struct, you would do the following: type DeliveryServiceNullableV30 DeliveryServiceV32 DeliveryServiceV32 = DeliveryServiceV31 + the new fields

func (*DeliveryServiceNullableV30) Sanitize

func (ds *DeliveryServiceNullableV30) Sanitize()

func (*DeliveryServiceNullableV30) Scan

func (ds *DeliveryServiceNullableV30) Scan(src interface{}) error

Scan implements the sql.Scanner interface -- expects json.RawMessage and unmarshals to a DeliveryServiceNullableV30 struct.

func (*DeliveryServiceNullableV30) Validate

func (ds *DeliveryServiceNullableV30) Validate(tx *sql.Tx) error

func (*DeliveryServiceNullableV30) Value

Value implements the driver.Valuer interface -- marshals struct to json to pass back as a json.RawMessage.

type DeliveryServicePatterns

type DeliveryServicePatterns struct {
	Patterns []string            `json:"patterns"`
	DSName   DeliveryServiceName `json:"dsName"`
}

type DeliveryServiceRegex

type DeliveryServiceRegex struct {
	Type      string `json:"type"`
	SetNumber int    `json:"setNumber"`
	Pattern   string `json:"pattern"`
}

DeliveryServiceRegex ...

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 ...

type DeliveryServiceRegexes

type DeliveryServiceRegexes struct {
	Regexes []DeliveryServiceRegex `json:"regexes"`
	DSName  string                 `json:"dsName"`
}

DeliveryServiceRegexes ...

type DeliveryServiceRegexesTest

type DeliveryServiceRegexesTest struct {
	DSName string `json:"dsName"`
	DSID   int
	DeliveryServiceIDRegex
}

Used to represent the entire deliveryservice_regex for testing

type DeliveryServiceRequest

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.

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 DeliveryServiceRequestCommentsResponse

type DeliveryServiceRequestCommentsResponse struct {
	Response []DeliveryServiceRequestComment `json:"response"`
	Alerts
}

DeliveryServiceRequestCommentsResponse is a list of DeliveryServiceRequestComments as a response.

type DeliveryServiceRequestDetails

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.

func (DeliveryServiceRequestDetails) Format

Format formats the DeliveryServiceRequestDetails into the text/html body of an email. The template used is EmailTemplate.

type DeliveryServiceRequestNullable

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.

type DeliveryServiceRequestRequest

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.

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 DeliveryServiceRouting

type DeliveryServiceRouting struct {
	StaticRoute       int     `json:"staticRoute"`
	Miss              int     `json:"miss"`
	Geo               float64 `json:"geo"`
	Err               int     `json:"err"`
	CZ                float64 `json:"cz"`
	DSR               float64 `json:"dsr"`
	Fed               int     `json:"fed"`
	RegionalAlternate int     `json:"regionalAlternate"`
	RegionalDenied    int     `json:"regionalDenied"`
}

DeliveryServiceRouting ...

type DeliveryServiceRoutingResponse

type DeliveryServiceRoutingResponse struct {
	Response DeliveryServiceRouting `json:"response"`
}

DeliveryServiceRoutingResponse ...

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 ...

type DeliveryServiceSSLKeysCertificate

type DeliveryServiceSSLKeysCertificate struct {
	Crt string `json:"crt"`
	Key string `json:"key"`
	CSR string `json:"csr"`
}

DeliveryServiceSSLKeysCertificate ...

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"`
}

func (*DeliveryServiceSSLKeysReq) Sanitize

func (r *DeliveryServiceSSLKeysReq) Sanitize()

type DeliveryServiceSSLKeysResponse

type DeliveryServiceSSLKeysResponse struct {
	Response DeliveryServiceSSLKeys `json:"response"`
	Alerts
}

DeliveryServiceSSLKeysResponse ...

type DeliveryServiceSSLKeysV15

type DeliveryServiceSSLKeysV15 struct {
	DeliveryServiceSSLKeys
	Expiration time.Time `json:"expiration,omitempty"`
}

type DeliveryServiceSafeUpdateRequest

type DeliveryServiceSafeUpdateRequest struct {
	DisplayName *string `json:"displayName"`
	InfoURL     *string `json:"infoUrl"`
	LongDesc    *string `json:"longDesc"`
	LongDesc1   *string `json:"longDesc1"`
}

DeliveryServiceSafeUpdateRequest represents a request to update the "safe" fields of a Delivery Service.

func (*DeliveryServiceSafeUpdateRequest) Validate

Validate implements the github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/api.ParseValidator interface.

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"`
}

DeliveryServiceSafeUpdateResponse represents Traffic Ops's response to a PUT request to its /api/3.0/deliveryservices/{{ID}}/safe endpoint.

type DeliveryServiceServer

type DeliveryServiceServer struct {
	Server          *int       `json:"server" db:"server"`
	DeliveryService *int       `json:"deliveryService" db:"deliveryservice"`
	LastUpdated     *TimeNoMod `json:"lastUpdated" db:"last_updated"`
}

DeliveryServiceServer ...

type DeliveryServiceServerResponse

type DeliveryServiceServerResponse struct {
	Orderby  string                  `json:"orderby"`
	Response []DeliveryServiceServer `json:"response"`
	Size     int                     `json:"size"`
	Limit    int                     `json:"limit"`
}

DeliveryServiceServerResponse ...

type DeliveryServiceServers

type DeliveryServiceServers struct {
	ServerNames []string `json:"serverNames"`
	XmlId       string   `json:"xmlId"`
}

type DeliveryServiceState

type DeliveryServiceState struct {
	Enabled  bool                    `json:"enabled"`
	Failover DeliveryServiceFailover `json:"failover"`
}

DeliveryServiceState ...

type DeliveryServiceStateResponse

type DeliveryServiceStateResponse struct {
	Response DeliveryServiceState `json:"response"`
}

DeliveryServiceStateResponse ...

type DeliveryServiceUserPost

type DeliveryServiceUserPost struct {
	UserID           *int   `json:"userId"`
	DeliveryServices *[]int `json:"deliveryServices"`
	Replace          *bool  `json:"replace"`
}

type DeliveryServiceV11

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 API. TODO move contents to DeliveryServiceV12, fix references, and remove

type DeliveryServiceV13

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"`
}

type DeliveryServiceV30

type DeliveryServiceV30 struct {
	DeliveryServiceNullableV15
	Topology           *string `json:"topology" db:"topology"`
	FirstHeaderRewrite *string `json:"firstHeaderRewrite" db:"first_header_rewrite"`
	InnerHeaderRewrite *string `json:"innerHeaderRewrite" db:"inner_header_rewrite"`
	LastHeaderRewrite  *string `json:"lastHeaderRewrite" db:"last_header_rewrite"`
	ServiceCategory    *string `json:"serviceCategory" db:"service_category"`
}

type DeliveryServiceV31

type DeliveryServiceV31 struct {
	DeliveryServiceV30
	MaxRequestHeaderBytes *int `json:"maxRequestHeaderBytes" db:"max_request_header_bytes"`
}

type DeliveryServicesNullableResponse

type DeliveryServicesNullableResponse struct {
	Response []DeliveryServiceNullable `json:"response"`
	Alerts
}

DeliveryServicesNullableResponse ... Deprecated: Please only use the versioned structures.

type DeliveryServicesRequiredCapability

type DeliveryServicesRequiredCapability struct {
	LastUpdated        *TimeNoMod `json:"lastUpdated" db:"last_updated"`
	DeliveryServiceID  *int       `json:"deliveryServiceID" db:"deliveryservice_id"`
	RequiredCapability *string    `json:"requiredCapability" db:"required_capability"`
	XMLID              *string    `json:"xmlID,omitempty" db:"xml_id"`
}

DeliveryServicesRequiredCapability represents an association between a required capability and a delivery service.

type DeliveryServicesResponse

type DeliveryServicesResponse struct {
	Response []DeliveryService `json:"response"`
	Alerts
}

DeliveryServicesResponse ... Deprecated: use DeliveryServicesNullableResponse instead

type DeliveryServicesResponseV30

type DeliveryServicesResponseV30 struct {
	Response []DeliveryServiceNullableV30 `json:"response"`
	Alerts
}

DeliveryServicesResponseV30 is the type of a response from the /api/3.0/deliveryservices Traffic Ops endpoint. TODO: Move these into the respective clients?

type Division

type Division struct {

	// Division ID
	//
	ID int `json:"id" db:"id"`

	// LastUpdated
	//
	LastUpdated TimeNoMod `json:"lastUpdated" db:"last_updated"`

	// Division Name
	//
	// required: true
	Name string `json:"name" db:"name"`
}

Division ...

type DivisionNullable

type DivisionNullable struct {
	ID          *int       `json:"id" db:"id"`
	LastUpdated *TimeNoMod `json:"lastUpdated" db:"last_updated"`
	Name        *string    `json:"name" db:"name"`
}

DivisionNullable is a nullable struct that holds info about a division, which is a group of regions.

type DivisionResponse

type DivisionResponse struct {
	// in: body
	Response Division `json:"response"`
}

DivisionResponse is a single Division response for Update and Create to depict what changed. swagger:response DivisionResponse in: body

type DivisionsResponse

type DivisionsResponse struct {
	// in: body
	Response []Division `json:"response"`
	Alerts
}

DivisionsResponse is a list of Divisions as a response. swagger:response DivisionsResponse

type Domain

type Domain struct {
	ProfileID int `json:"profileId" db:"profile_id"`

	ParameterID int `json:"parameterId" db:"parameter_id"`

	ProfileName string `json:"profileName" db:"profile_name"`

	ProfileDescription string `json:"profileDescription" db:"profile_description"`

	// DomainName of the CDN
	DomainName string `json:"domainName" db:"domain_name"`
}

Domain contains information about a single domain and its profile.

type DomainNullable

type DomainNullable struct {
	ProfileID          *int    `json:"profileId" db:"profile_id"`
	ParameterID        *int    `json:"parameterId" db:"parameter_id"`
	ProfileName        *string `json:"profileName" db:"profile_name"`
	ProfileDescription *string `json:"profileDescription" db:"profile_description"`
	DomainName         *string `json:"domainName" db:"domain_name"`
}

DomainNullable - a struct version that allows for all fields to be null, mostly used by the API side

type DomainsResponse

type DomainsResponse struct {
	Response []Domain `json:"response"`
	Alerts
}

DomainsResponse is a list of Domains as a response.

type ErrorConstant

type ErrorConstant string

ErrorConstant is used for error messages.

func (ErrorConstant) Error

func (e ErrorConstant) Error() string

Error converts ErrorConstants to a string.

type FederationDSPost

type FederationDSPost struct {
	DSIDs []int `json:"dsIds"`
	// Replace indicates whether existing Federation-to-Delivery Service associations should be
	// replaced by the ones defined by this request, or otherwise merely augmented with them.
	Replace *bool `json:"replace"`
}

FederationDSPost is the format of a request to associate a Federation with any number of Delivery Services.

func (*FederationDSPost) Validate

func (f *FederationDSPost) Validate(tx *sql.Tx) error

type FederationDeliveryServiceNullable

type FederationDeliveryServiceNullable struct {
	ID    *int    `json:"id" db:"id"`
	CDN   *string `json:"cdn" db:"cdn"`
	Type  *string `json:"type" db:"type"`
	XMLID *string `json:"xmlId" db:"xml_id"`
}

type FederationFederationResolversResponse

type FederationFederationResolversResponse struct {
	Response []FederationResolver `json:"response"`
}

FederationFederationResolversResponse represents an API response containing Federation Resolvers for a given Federation.

type FederationMapping

type FederationMapping struct {
	CName string `json:"cname"`
	TTL   int    `json:"ttl"`
}

type FederationNullable

type FederationNullable struct {
	Mappings        []FederationMapping `json:"mappings"`
	DeliveryService *string             `json:"deliveryService"`
}

type FederationResolver

type FederationResolver struct {
	ID          *uint      `json:"id" db:"id"`
	IPAddress   *string    `json:"ipAddress" db:"ip_address"`
	LastUpdated *TimeNoMod `json:"lastUpdated,omitempty" db:"last_updated"`
	Type        *string    `json:"type"`
	TypeID      *uint      `json:"typeId,omitempty" db:"type"`
}

FederationResolver represents a resolver record for a CDN Federation.

func (*FederationResolver) Validate

func (fr *FederationResolver) Validate(tx *sql.Tx) error

Validate implements the github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/api.ParseValidator interface.

Example
var typeID uint = 1
var IPAddress string = "0.0.0.0"
fr := FederationResolver{
	TypeID:    &typeID,
	IPAddress: &IPAddress,
}

fmt.Printf("%v\n", fr.Validate(nil))

IPAddress = "0.0.0.0/24"
fmt.Printf("%v\n", fr.Validate(nil))

IPAddress = "::1"
fmt.Printf("%v\n", fr.Validate(nil))

IPAddress = "dead::babe/63"
fmt.Printf("%v\n", fr.Validate(nil))

IPAddress = "1.2.3.4/33"
fmt.Printf("%v\n", fr.Validate(nil))

IPAddress = "w.x.y.z"
fmt.Printf("%v\n", fr.Validate(nil))

IPAddress = "::f1d0:f00d/129"
fmt.Printf("%v\n", fr.Validate(nil))

IPAddress = "test::quest"
fmt.Printf("%v\n", fr.Validate(nil))

IPAddress = ""
fmt.Printf("%v\n", fr.Validate(nil))

fr.IPAddress = nil
fmt.Printf("%v\n", fr.Validate(nil))

fr.TypeID = nil
fmt.Printf("%v\n", fr.Validate(nil))
Output:

<nil>
<nil>
<nil>
<nil>
ipAddress: invalid network IP or CIDR-notation subnet.
ipAddress: invalid network IP or CIDR-notation subnet.
ipAddress: invalid network IP or CIDR-notation subnet.
ipAddress: invalid network IP or CIDR-notation subnet.
ipAddress: cannot be blank.
ipAddress: cannot be blank.
ipAddress: cannot be blank; typeId: cannot be blank.

type FederationResolverMapping

type FederationResolverMapping struct {
	// TTL is the Time-to-Live of a DNS response to a request to resolve this Federation's CNAME
	TTL   *int    `json:"ttl"`
	CName *string `json:"cname"`
	ResolverMapping
}

FederationResolverMapping is the set of all resolvers - both IPv4 and IPv6 - for a specific Federation.

type FederationResolverType

type FederationResolverType string

func FederationResolverTypeFromString

func FederationResolverTypeFromString(s string) FederationResolverType

func (FederationResolverType) String

func (t FederationResolverType) String() string

type FederationUser

type FederationUser struct {
	Company  *string `json:"company" db:"company"`
	Email    *string `json:"email" db:"email"`
	FullName *string `json:"fullName" db:"full_name"`
	ID       *int    `json:"id" db:"id"`
	Role     *string `json:"role" db:"role_name"`
	Username *string `json:"username" db:"username"`
}

FederationUser represents Federation Users

type FederationUserPost

type FederationUserPost struct {
	IDs     []int `json:"userIds"`
	Replace *bool `json:"replace"`
}

FederationUserPost represents POST body for assigning Users to Federations

func (*FederationUserPost) Validate

func (f *FederationUserPost) Validate(tx *sql.Tx) error

Validate validates FederationUserPost

type Filter

type Filter int
const (
	Assigned Filter = iota
	Unassigned
	Eligible
)

type GenericServerCheck

type GenericServerCheck struct {
	CommonCheckFields

	// Checks maps arbitrary checks - up to one per "column" (whatever those mean)
	// done on the server to their values.
	Checks map[string]*int `json:"checks,omitempty"`
}

GenericServerCheck represents a server with some associated meta data presented along with its arbitrary "checks". This is unlike a Servercheck in that the represented checks are not known before the time a request is made, and checks with no value are not presented.

type GetDeliveryServiceResponse

type GetDeliveryServiceResponse struct {
	Response []DeliveryService `json:"response"`
}

GetDeliveryServiceResponse is deprecated use DeliveryServicesResponse...

type GetTenantsResponse

type GetTenantsResponse struct {
	Response []Tenant `json:"response"`
	Alerts
}

GetTenantsResponse is the response for a request for a group of tenants

type HWInfo

type HWInfo struct {
	Description    string    `json:"description" db:"description"`
	ID             int       `json:"-" db:"id"`
	LastUpdated    TimeNoMod `json:"lastUpdated" db:"last_updated"`
	ServerHostName string    `json:"serverHostName" db:"serverhostname"`
	ServerID       int       `json:"serverId" db:"serverid"`
	Val            string    `json:"val" db:"val"`
}

HWInfo can be used to return information about a server's hardware, but the corresponding Traffic Ops API route is deprecated and unusable without alteration.

type HWInfoResponse

type HWInfoResponse struct {
	Response []HWInfo `json:"response"`
}

HWInfoResponse is a list of HWInfos as a response.

type Hardware

type Hardware struct {
	ID          int    `json:"serverId"`
	HostName    string `json:"serverHostName"`
	LastUpdated string `json:"lastUpdated"`
	Value       string `json:"val"`
	Description string `json:"description"`
}

Hardware ...

type HardwareResponse

type HardwareResponse struct {
	Limit    int        `json:"limit"`
	Response []Hardware `json:"response"`
}

HardwareResponse ...

type HealthData

type HealthData struct {
	TotalOffline uint64                 `json:"totalOffline"`
	TotalOnline  uint64                 `json:"totalOnline"`
	CacheGroups  []HealthDataCacheGroup `json:"cachegroups"`
}

type HealthDataCacheGroup

type HealthDataCacheGroup struct {
	Offline int64          `json:"offline"`
	Online  int64          `json:"online"`
	Name    CacheGroupName `json:"name"`
}

type HealthThreshold

type HealthThreshold struct {
	// Val is the actual, numeric, threshold value.
	Val float64
	// Comparator is the comparator used to compare the Val to the monitored
	// value. One of '=', '>', '<', '>=', or '<=' - other values are invalid.
	Comparator string // TODO change to enum?
}

HealthThreshold describes some value against which to compare health measurements to determine if a cache server is healthy.

func (HealthThreshold) String

func (t HealthThreshold) String() string

String implements the fmt.Stringer interface.

Example
ht := HealthThreshold{Comparator: ">=", Val: 500}
fmt.Println(ht)
Output:

>=500.000000

type IAllFederation

type IAllFederation interface {
	IsAllFederations() bool
}

IAllFederation is an interface for the disparate objects returned by /api/1.x/federations?all. Adds additional safety, allowing functions to only return one of the valid object types for the endpoint.

type IDNoMod

type IDNoMod int

IDNoMod type is used to suppress JSON unmarshalling

func (*IDNoMod) UnmarshalJSON

func (a *IDNoMod) UnmarshalJSON([]byte) error

UnmarshalJSON implements the json.Unmarshaller interface to suppress unmarshalling for IDNoMod

type InterfaceName

type InterfaceName string

InterfaceName is the name of the server interface

type InvalidationJob

type InvalidationJob struct {
	AssetURL        *string `json:"assetUrl"`
	CreatedBy       *string `json:"createdBy"`
	DeliveryService *string `json:"deliveryService"`
	ID              *uint64 `json:"id"`
	Keyword         *string `json:"keyword"`
	Parameters      *string `json:"parameters"`

	// StartTime is the time at which the job will come into effect. Must be in the future, but will
	// fail to Validate if it is further in the future than two days.
	StartTime *Time `json:"startTime"`
}

InvalidationJob represents a content invalidation job as returned by the API.

func (*InvalidationJob) TTLHours

func (job *InvalidationJob) TTLHours() uint

TTLHours will parse job.Parameters to find TTL, returns an int representing number of hours. Returns 0 in case of issue (0 is an invalid TTL)

func (*InvalidationJob) Validate

func (job *InvalidationJob) Validate() error

Validate checks that the InvalidationJob is valid, by ensuring all of its fields are well-defined.

This returns an error describing any and all problematic fields encountered during validation.

type InvalidationJobInput

type InvalidationJobInput struct {

	// DeliveryService needs to be an identifier for a Delivery Service. It can be either a string - in which
	// case it is treated as an XML_ID - or a float64 (because that's the type used by encoding/json
	// to represent all JSON numbers) - in which case it's treated as an integral, unique identifier
	// (and any fractional part is discarded, i.e. 2.34 -> 2)
	DeliveryService *interface{} `json:"deliveryService"`

	// Regex is a regular expression which not only must be valid, but should also start with '/'
	// (or escaped: '\/')
	Regex *string `json:"regex"`

	// StartTime is the time at which the job will come into effect. Must be in the future.
	StartTime *Time `json:"startTime"`

	// TTL indicates the Time-to-Live of the job. This can be either a valid string for
	// time.ParseDuration, or a float64 indicating the number of hours. Note that regardless of the
	// actual value here, Traffic Ops will only consider it rounded down to the nearest natural
	// number
	TTL *interface{} `json:"ttl"`
	// contains filtered or unexported fields
}

InvalidationJobInput represents user input intending to create or modify a content invalidation job.

func (*InvalidationJobInput) DSID

func (j *InvalidationJobInput) DSID(tx *sql.Tx) (uint, error)

DSID gets the integral, unique identifier of the Delivery Service identified by InvalidationJobInput.DeliveryService

This requires a transaction connected to a Traffic Ops database, because if DeliveryService is an xml_id, a database lookup will be necessary to get the unique, integral identifier. Thus, this method also checks for the existence of the identified Delivery Service, and will return an error if it does not exist.

func (*InvalidationJobInput) TTLHours

func (j *InvalidationJobInput) TTLHours() (uint, error)

TTLHours gets the number of hours of the job's TTL - rounded down to the nearest natural number, or an error if it is an invalid value.

Example (Duration)
j := InvalidationJobInput{nil, nil, nil, util.InterfacePtr("121m"), nil, nil}
ttl, e := j.TTLHours()
if e != nil {
	fmt.Printf("Error: %v\n", e)
}
fmt.Println(ttl)
Output:

2
Example (Number)
j := InvalidationJobInput{nil, nil, nil, util.InterfacePtr(2.1), nil, nil}
ttl, e := j.TTLHours()
if e != nil {
	fmt.Printf("Error: %v\n", e)
}
fmt.Println(ttl)
Output:

2

func (*InvalidationJobInput) Validate

func (job *InvalidationJobInput) Validate(tx *sql.Tx) error

Validate validates that the user input is correct, given a transaction connected to the Traffic Ops database. In particular, it enforces the constraints described on each field, as well as ensuring they actually exist. This method calls InvalidationJobInput.DSID to validate the DeliveryService field.

This returns an error describing any and all problematic fields encountered during validation.

type IsAvailable

type IsAvailable struct {
	IsAvailable   bool `json:"isAvailable"`
	Ipv4Available bool `json:"ipv4Available"`
	Ipv6Available bool `json:"ipv6Available"`
}

IsAvailable contains whether the given cache or delivery service is available. It is designed for JSON serialization, namely in the Traffic Monitor 1.0 API.

type Job deprecated

type Job struct {
	Parameters      string `json:"parameters"`
	Keyword         string `json:"keyword"`
	AssetURL        string `json:"assetUrl"`
	CreatedBy       string `json:"createdBy"`
	StartTime       string `json:"startTime"`
	ID              int64  `json:"id"`
	DeliveryService string `json:"deliveryService"`
}

Job represents a content invalidation job as stored in the database.

Deprecated: Use InvalidationJob instead, as it's more flexible

type JobRequest deprecated

type JobRequest struct {
	TTL               time.Duration
	StartTime         time.Time
	DeliveryServiceID int64
	Regex             string
	Urgent            bool
}

JobRequest contains the data to create a job. Note this is a convenience struct for posting users; the actual JSON object is a JobRequestAPI

Deprecated: Use InvalidationJobInput instead, as it's more flexible

func (JobRequest) MarshalJSON

func (jr JobRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements the encoding/json.Marshaler interface.

func (*JobRequest) UnmarshalJSON

func (jr *JobRequest) UnmarshalJSON(b []byte) error

UnmarshalJSON implements the encoding/json Unmarshaler interface.

type JobRequestAPI deprecated

type JobRequestAPI struct {
	TTLSeconds int64  `json:"ttl"`
	StartTime  string `json:"startTime"`
	DSID       int64  `json:"dsId"`
	Regex      string `json:"regex"`
	Urgent     bool   `json:"urgent"`
}

JobRequestAPI represents the JSON input accepted by the API for creating new content invalidation jobs.

Deprecated: This structure is technically incorrect, and has been superseded by the InvalidationJobInput structure.

type LastUpdated

type LastUpdated struct {
	Version  string `json:"version"`
	Response struct {
		SummaryTime string `json:"summaryTime"`
	} `json:"response"`
}

type LegacyDeliveryServiceFederationResolverMappingRequest

type LegacyDeliveryServiceFederationResolverMappingRequest struct {
	Federations []DeliveryServiceFederationResolverMapping `json:"federations"`
}

LegacyDeliveryServiceFederationResolverMappingRequest is the legacy format for a request to create (or modify) the Federation Resolver mappings of one or more Delivery Services. Use this for compatibility with API versions 1.3 and older.

func (*LegacyDeliveryServiceFederationResolverMappingRequest) Validate

Validate implements the github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/api.ParseValidator interface.

type LegacyInterfaceDetails

type LegacyInterfaceDetails struct {
	InterfaceMtu  *int    `json:"interfaceMtu" db:"interface_mtu"`
	InterfaceName *string `json:"interfaceName" db:"interface_name"`
	IP6Address    *string `json:"ip6Address" db:"ip6_address"`
	IP6Gateway    *string `json:"ip6Gateway" db:"ip6_gateway"`
	IPAddress     *string `json:"ipAddress" db:"ip_address"`
	IPGateway     *string `json:"ipGateway" db:"ip_gateway"`
	IPNetmask     *string `json:"ipNetmask" db:"ip_netmask"`
}

LegacyInterfaceDetails is the details for interfaces on servers for API v1 and v2.

func InterfaceInfoToLegacyInterfaces

func InterfaceInfoToLegacyInterfaces(serverInterfaces []ServerInterfaceInfo) (LegacyInterfaceDetails, error)

InterfaceInfoToLegacyInterfaces converts a ServerInterfaceInfo to an equivalent LegacyInterfaceDetails structure. It does this by creating the IP address fields using the "service" interface's IP addresses. All others are discarded, as the legacy format is incapable of representing them.

func (LegacyInterfaceDetails) String

func (lid LegacyInterfaceDetails) String() string

String implements the fmt.Stringer interface.

Example
ipv4 := "192.0.2.0"
ipv6 := "2001:DB8::/64"
name := "test"
mtu := 9000

lid := LegacyInterfaceDetails{
	InterfaceMtu:  &mtu,
	InterfaceName: &name,
	IP6Address:    &ipv6,
	IP6Gateway:    nil,
	IPAddress:     &ipv4,
	IPGateway:     nil,
	IPNetmask:     nil,
}

fmt.Println(lid.String())
Output:

LegacyInterfaceDetails(InterfaceMtu=9000, InterfaceName='test', IP6Address='2001:DB8::/64', IP6Gateway=nil, IPAddress='192.0.2.0', IPGateway=nil, IPNetmask=nil)

func (*LegacyInterfaceDetails) ToInterfaces

func (lid *LegacyInterfaceDetails) ToInterfaces(ipv4IsService, ipv6IsService bool) ([]ServerInterfaceInfo, error)

ToInterfaces converts a LegacyInterfaceDetails to a slice of ServerInterfaceInfo structures. No interfaces will be marked for monitoring, and it will generate service addresses according to the passed indicators for each address family.

Example
lid := LegacyInterfaceDetails{
	InterfaceMtu:  new(int),
	InterfaceName: new(string),
	IP6Address:    new(string),
	IP6Gateway:    new(string),
	IPAddress:     new(string),
	IPGateway:     new(string),
	IPNetmask:     new(string),
}
*lid.InterfaceMtu = 9000
*lid.InterfaceName = "test"
*lid.IP6Address = "::14/64"
*lid.IP6Gateway = "::15"
*lid.IPAddress = "1.2.3.4"
*lid.IPGateway = "4.3.2.1"
*lid.IPNetmask = "255.255.255.252"

ifaces, err := lid.ToInterfaces(true, false)
if err != nil {
	fmt.Printf(err.Error())
	return
}

for _, iface := range ifaces {
	fmt.Printf("name=%s, monitor=%t\n", iface.Name, iface.Monitor)
	for _, ip := range iface.IPAddresses {
		fmt.Printf("\taddr=%s, gateway=%s, service address=%t\n", ip.Address, *ip.Gateway, ip.ServiceAddress)
	}
}
Output:

name=test, monitor=false
	addr=1.2.3.4/30, gateway=4.3.2.1, service address=true
	addr=::14/64, gateway=::15, service address=false

type LegacyStats

type LegacyStats struct {
	CommonAPIData
	Caches map[CacheName]map[string][]ResultStatVal `json:"caches"`
}

type LegacyTMConfigResponse

type LegacyTMConfigResponse struct {
	Response LegacyTrafficMonitorConfig `json:"response"`
}

LegacyTMConfigResponse was the response to requests made to the cdns/{{Name}}/configs/montoring endpoint of the Traffic Ops API in older API versions.

type LegacyTrafficDSStatsSummary

type LegacyTrafficDSStatsSummary struct {
	TrafficStatsSummary
	// TotalBytes is the total number of kilobytes served when the "metric type" requested is "kbps"
	// (or actually just contains "kbps"). If this is not nil, TotalTransactions *should* always be
	// nil.
	TotalBytes *float64 `json:"totalBytes"`
	// Totaltransactions is the total number of transactions within the requested window. Whenever
	// the requested metric doesn't contain "kbps", it assumed to be some kind of transactions
	// measurement. In that case, this will not be nil - otherwise it will be nil. If this not nil,
	// TotalBytes *should* always be nil.
	TotalTransactions *float64 `json:"totalTransactions"`
}

type LegacyTrafficMonitorConfig

type LegacyTrafficMonitorConfig struct {
	TrafficServers   []LegacyTrafficServer  `json:"trafficServers,omitempty"`
	CacheGroups      []TMCacheGroup         `json:"cacheGroups,omitempty"`
	Config           map[string]interface{} `json:"config,omitempty"`
	TrafficMonitors  []TrafficMonitor       `json:"trafficMonitors,omitempty"`
	DeliveryServices []TMDeliveryService    `json:"deliveryServices,omitempty"`
	Profiles         []TMProfile            `json:"profiles,omitempty"`
}

LegacyTrafficMonitorConfig represents TrafficMonitorConfig for ATC versions before 5.0.

func (*LegacyTrafficMonitorConfig) Upgrade

Upgrade converts a legacy TM Config to the newer structure.

type LegacyTrafficMonitorConfigMap

type LegacyTrafficMonitorConfigMap struct {
	TrafficServer   map[string]LegacyTrafficServer
	CacheGroup      map[string]TMCacheGroup
	Config          map[string]interface{}
	TrafficMonitor  map[string]TrafficMonitor
	DeliveryService map[string]TMDeliveryService
	Profile         map[string]TMProfile
}

LegacyTrafficMonitorConfigMap ...

func LegacyTrafficMonitorTransformToMap

func LegacyTrafficMonitorTransformToMap(tmConfig *LegacyTrafficMonitorConfig) (*LegacyTrafficMonitorConfigMap, error)

func (*LegacyTrafficMonitorConfigMap) Upgrade

Upgrade returns a TrafficMonitorConfigMap that is equivalent to this legacy configuration map.

Note that all fields except TrafficServer are "shallow" copies, so modifying the original will impact the upgraded copy.

Example
lcm := LegacyTrafficMonitorConfigMap{
	CacheGroup: map[string]TMCacheGroup{
		"test": {
			Name: "test",
			Coordinates: MonitoringCoordinates{
				Latitude:  0,
				Longitude: 0,
			},
		},
	},
	Config: map[string]interface{}{
		"foo": "bar",
	},
	DeliveryService: map[string]TMDeliveryService{
		"test": {
			XMLID:              "test",
			TotalTPSThreshold:  -1,
			ServerStatus:       "testStatus",
			TotalKbpsThreshold: -1,
		},
	},
	Profile: map[string]TMProfile{
		"test": {
			Parameters: TMParameters{
				HealthConnectionTimeout: -1,
				HealthPollingURL:        "testURL",
				HealthPollingFormat:     "astats",
				HealthPollingType:       "http",
				HistoryCount:            -1,
				MinFreeKbps:             -1,
				Thresholds: map[string]HealthThreshold{
					"availableBandwidthInKbps": {
						Comparator: "<",
						Val:        -1,
					},
				},
			},
			Name: "test",
			Type: "testType",
		},
	},
	TrafficMonitor: map[string]TrafficMonitor{
		"test": {
			Port:         -1,
			IP6:          "::1",
			IP:           "0.0.0.0",
			HostName:     "test",
			FQDN:         "test.quest",
			Profile:      "test",
			Location:     "test",
			ServerStatus: "testStatus",
		},
	},
	TrafficServer: map[string]LegacyTrafficServer{
		"test": {
			CacheGroup:       "test",
			DeliveryServices: []tsdeliveryService{},
			FQDN:             "test.quest",
			HashID:           "test",
			HostName:         "test",
			HTTPSPort:        -1,
			InterfaceName:    "testInterface",
			IP:               "0.0.0.1",
			IP6:              "::2",
			Port:             -1,
			Profile:          "test",
			ServerStatus:     "testStatus",
			Type:             "testType",
		},
	},
}

cm := lcm.Upgrade()
fmt.Println("# of Cachegroups:", len(cm.CacheGroup))
fmt.Println("Cachegroup Name:", cm.CacheGroup["test"].Name)
fmt.Printf("Cachegroup Coordinates: (%v,%v)\n", cm.CacheGroup["test"].Coordinates.Latitude, cm.CacheGroup["test"].Coordinates.Longitude)
fmt.Println("# of Config parameters:", len(cm.Config))
fmt.Println(`Config["foo"]:`, cm.Config["foo"])
fmt.Println("# of DeliveryServices:", len(cm.DeliveryService))
fmt.Println("DeliveryService XMLID:", cm.DeliveryService["test"].XMLID)
fmt.Println("DeliveryService TotalTPSThreshold:", cm.DeliveryService["test"].TotalTPSThreshold)
fmt.Println("DeliveryService ServerStatus:", cm.DeliveryService["test"].ServerStatus)
fmt.Println("DeliveryService TotalKbpsThreshold:", cm.DeliveryService["test"].TotalKbpsThreshold)
fmt.Println("# of Profiles:", len(cm.Profile))
fmt.Println("Profile Name:", cm.Profile["test"].Name)
fmt.Println("Profile Type:", cm.Profile["test"].Type)
fmt.Println("Profile HealthConnectionTimeout:", cm.Profile["test"].Parameters.HealthConnectionTimeout)
fmt.Println("Profile HealthPollingURL:", cm.Profile["test"].Parameters.HealthPollingURL)
fmt.Println("Profile HealthPollingFormat:", cm.Profile["test"].Parameters.HealthPollingFormat)
fmt.Println("Profile HealthPollingType:", cm.Profile["test"].Parameters.HealthPollingType)
fmt.Println("Profile HistoryCount:", cm.Profile["test"].Parameters.HistoryCount)
fmt.Println("Profile MinFreeKbps:", cm.Profile["test"].Parameters.MinFreeKbps)
fmt.Println("# of Profile Thresholds:", len(cm.Profile["test"].Parameters.Thresholds))
fmt.Println("Profile availableBandwidthInKbps Threshold:", cm.Profile["test"].Parameters.Thresholds["availableBandwidthInKbps"])
fmt.Println("# of TrafficMonitors:", len(cm.TrafficMonitor))
fmt.Println("TrafficMonitor Port:", cm.TrafficMonitor["test"].Port)
fmt.Println("TrafficMonitor IP6:", cm.TrafficMonitor["test"].IP6)
fmt.Println("TrafficMonitor IP:", cm.TrafficMonitor["test"].IP)
fmt.Println("TrafficMonitor HostName:", cm.TrafficMonitor["test"].HostName)
fmt.Println("TrafficMonitor FQDN:", cm.TrafficMonitor["test"].FQDN)
fmt.Println("TrafficMonitor Profile:", cm.TrafficMonitor["test"].Profile)
fmt.Println("TrafficMonitor Location:", cm.TrafficMonitor["test"].Location)
fmt.Println("TrafficMonitor ServerStatus:", cm.TrafficMonitor["test"].ServerStatus)
fmt.Println("# of TrafficServers:", len(cm.TrafficServer))
fmt.Println("TrafficServer CacheGroup:", cm.TrafficServer["test"].CacheGroup)
fmt.Println("TrafficServer # of DeliveryServices:", len(cm.TrafficServer["test"].DeliveryServices))
fmt.Println("TrafficServer FQDN:", cm.TrafficServer["test"].FQDN)
fmt.Println("TrafficServer HashID:", cm.TrafficServer["test"].HashID)
fmt.Println("TrafficServer HostName:", cm.TrafficServer["test"].HostName)
fmt.Println("TrafficServer HTTPSPort:", cm.TrafficServer["test"].HTTPSPort)
fmt.Println("TrafficServer # of Interfaces:", len(cm.TrafficServer["test"].Interfaces))
fmt.Println("TrafficServer Interface Name:", cm.TrafficServer["test"].Interfaces[0].Name)
fmt.Println("TrafficServer # of Interface IP Addresses:", len(cm.TrafficServer["test"].Interfaces[0].IPAddresses))
fmt.Println("TrafficServer first IP Address:", cm.TrafficServer["test"].Interfaces[0].IPAddresses[0].Address)
fmt.Println("TrafficServer second IP Address:", cm.TrafficServer["test"].Interfaces[0].IPAddresses[1].Address)
fmt.Println("TrafficServer Port:", cm.TrafficServer["test"].Port)
fmt.Println("TrafficServer Profile:", cm.TrafficServer["test"].Profile)
fmt.Println("TrafficServer ServerStatus:", cm.TrafficServer["test"].ServerStatus)
fmt.Println("TrafficServer Type:", cm.TrafficServer["test"].Type)
Output:

# of Cachegroups: 1
Cachegroup Name: test
Cachegroup Coordinates: (0,0)
# of Config parameters: 1
Config["foo"]: bar
# of DeliveryServices: 1
DeliveryService XMLID: test
DeliveryService TotalTPSThreshold: -1
DeliveryService ServerStatus: testStatus
DeliveryService TotalKbpsThreshold: -1
# of Profiles: 1
Profile Name: test
Profile Type: testType
Profile HealthConnectionTimeout: -1
Profile HealthPollingURL: testURL
Profile HealthPollingFormat: astats
Profile HealthPollingType: http
Profile HistoryCount: -1
Profile MinFreeKbps: -1
# of Profile Thresholds: 1
Profile availableBandwidthInKbps Threshold: <-1.000000
# of TrafficMonitors: 1
TrafficMonitor Port: -1
TrafficMonitor IP6: ::1
TrafficMonitor IP: 0.0.0.0
TrafficMonitor HostName: test
TrafficMonitor FQDN: test.quest
TrafficMonitor Profile: test
TrafficMonitor Location: test
TrafficMonitor ServerStatus: testStatus
# of TrafficServers: 1
TrafficServer CacheGroup: test
TrafficServer # of DeliveryServices: 0
TrafficServer FQDN: test.quest
TrafficServer HashID: test
TrafficServer HostName: test
TrafficServer HTTPSPort: -1
TrafficServer # of Interfaces: 1
TrafficServer Interface Name: testInterface
TrafficServer # of Interface IP Addresses: 2
TrafficServer first IP Address: 0.0.0.1
TrafficServer second IP Address: ::2
TrafficServer Port: -1
TrafficServer Profile: test
TrafficServer ServerStatus: testStatus
TrafficServer Type: testType

type LegacyTrafficServer

type LegacyTrafficServer struct {
	CacheGroup       string              `json:"cacheGroup"`
	DeliveryServices []tsdeliveryService `json:"deliveryServices,omitempty"` // the deliveryServices key does not exist on mids
	FQDN             string              `json:"fqdn"`
	HashID           string              `json:"hashId"`
	HostName         string              `json:"hostName"`
	HTTPSPort        int                 `json:"httpsPort,omitempty"`
	InterfaceName    string              `json:"interfaceName"`
	IP               string              `json:"ip"`
	IP6              string              `json:"ip6"`
	Port             int                 `json:"port"`
	Profile          string              `json:"profile"`
	ServerStatus     string              `json:"status"`
	Type             string              `json:"type"`
}

LegacyTrafficServer ...

func (LegacyTrafficServer) Upgrade

func (s LegacyTrafficServer) Upgrade() TrafficServer

Upgrade upgrades the LegacyTrafficServer into its modern-day equivalent.

Note that the DeliveryServices slice is a "shallow" copy of the original, so making changes to the original slice will affect the upgraded copy.

Example
lts := LegacyTrafficServer{
	CacheGroup:       "testCG",
	DeliveryServices: []tsdeliveryService{},
	FQDN:             "test.quest",
	HashID:           "test",
	HostName:         "test",
	HTTPSPort:        -1,
	InterfaceName:    "testInterface",
	IP:               "198.0.2.0",
	IP6:              "2001:DB8::1",
	Port:             -1,
	Profile:          "testProfile",
	ServerStatus:     "testStatus",
	Type:             "testType",
}

ts := lts.Upgrade()
fmt.Println("CacheGroup:", ts.CacheGroup)
fmt.Println("# of DeliveryServices:", len(ts.DeliveryServices))
fmt.Println("FQDN:", ts.FQDN)
fmt.Println("HashID:", ts.HashID)
fmt.Println("HostName:", ts.HostName)
fmt.Println("HTTPSPort:", ts.HTTPSPort)
fmt.Println("# of Interfaces:", len(ts.Interfaces))
fmt.Println("Interface Name:", ts.Interfaces[0].Name)
fmt.Println("# of Interface IP Addresses:", len(ts.Interfaces[0].IPAddresses))
fmt.Println("first IP Address:", ts.Interfaces[0].IPAddresses[0].Address)
fmt.Println("second IP Address:", ts.Interfaces[0].IPAddresses[1].Address)
fmt.Println("Port:", ts.Port)
fmt.Println("Profile:", ts.Profile)
fmt.Println("ServerStatus:", ts.ServerStatus)
fmt.Println("Type:", ts.Type)
Output:

CacheGroup: testCG
# of DeliveryServices: 0
FQDN: test.quest
HashID: test
HostName: test
HTTPSPort: -1
# of Interfaces: 1
Interface Name: testInterface
# of Interface IP Addresses: 2
first IP Address: 198.0.2.0
second IP Address: 2001:DB8::1
Port: -1
Profile: testProfile
ServerStatus: testStatus
Type: testType

type LocalizationMethod

type LocalizationMethod string

LocalizationMethod represents an enabled localization method for a cachegroup. The string values of this type should match the Traffic Ops values.

func LocalizationMethodFromString

func LocalizationMethodFromString(s string) LocalizationMethod

func (LocalizationMethod) MarshalJSON

func (m LocalizationMethod) MarshalJSON() ([]byte, error)

func (*LocalizationMethod) Scan

func (m *LocalizationMethod) Scan(value interface{}) error

func (LocalizationMethod) String

func (m LocalizationMethod) String() string

String returns a string representation of this localization method

func (*LocalizationMethod) UnmarshalJSON

func (m *LocalizationMethod) UnmarshalJSON(data []byte) error

type Log

type Log struct {
	ID          *int    `json:"id"`
	LastUpdated *Time   `json:"lastUpdated"`
	Level       *string `json:"level"`
	Message     *string `json:"message"`
	TicketNum   *int    `json:"ticketNum"`
	User        *string `json:"user"`
}

Log contains a change that has been made to the Traffic Control system.

type LogsResponse

type LogsResponse struct {
	Response []Log `json:"response"`
}

LogsResponse is a list of Logs as a response.

type MatchList

type MatchList struct {
	Regex     string `json:"regex"`
	MatchType string `json:"match-type"`
}

MatchList ...

type MatchSet

type MatchSet struct {
	Protocol  string      `json:"protocol"`
	MatchList []MatchList `json:"matchlist"`
}

MatchSet ...

type MissLocation

type MissLocation struct {
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
}

MissLocation ...

type MonitoringCoordinates

type MonitoringCoordinates struct {
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
}

MonitoringCoordinates holds a coordinate pair for inclusion as a field in TMCacheGroup.

type NewLogCountResp

type NewLogCountResp struct {
	NewLogCount uint64 `json:"newLogcount"`
}

NewLogCountResp is the response returned when the total number of new changes made to the Traffic Control system is requested. "New" means since the last time this information was requested.

type OSVersionsResponse

type OSVersionsResponse map[string]string

OSVersionsResponse is the JSON representation of the OS versions data for ISO generation.

type Origin

type Origin struct {
	Cachegroup        *string    `json:"cachegroup" db:"cachegroup"`
	CachegroupID      *int       `json:"cachegroupId" db:"cachegroup_id"`
	Coordinate        *string    `json:"coordinate" db:"coordinate"`
	CoordinateID      *int       `json:"coordinateId" db:"coordinate_id"`
	DeliveryService   *string    `json:"deliveryService" db:"deliveryservice"`
	DeliveryServiceID *int       `json:"deliveryServiceId" db:"deliveryservice_id"`
	FQDN              *string    `json:"fqdn" db:"fqdn"`
	ID                *int       `json:"id" db:"id"`
	IP6Address        *string    `json:"ip6Address" db:"ip6_address"`
	IPAddress         *string    `json:"ipAddress" db:"ip_address"`
	IsPrimary         *bool      `json:"isPrimary" db:"is_primary"`
	LastUpdated       *TimeNoMod `json:"lastUpdated" db:"last_updated"`
	Name              *string    `json:"name" db:"name"`
	Port              *int       `json:"port" db:"port"`
	Profile           *string    `json:"profile" db:"profile"`
	ProfileID         *int       `json:"profileId" db:"profile_id"`
	Protocol          *string    `json:"protocol" db:"protocol"`
	Tenant            *string    `json:"tenant" db:"tenant"`
	TenantID          *int       `json:"tenantId" db:"tenant_id"`
}

Origin contains information relating to an origin server.

type OriginDetailResponse

type OriginDetailResponse struct {
	Response Origin `json:"response"`
	Alerts
}

OriginDetailResponse is the JSON object returned for a single origin

type OriginHeaders

type OriginHeaders []string

OriginHeaders represents a list of the headers that must be sent to the Origin.

func (*OriginHeaders) UnmarshalJSON

func (o *OriginHeaders) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

type OriginsResponse

type OriginsResponse struct {
	Response []Origin `json:"response"`
	Alerts
}

OriginsResponse is a list of Origins as a response.

type Parameter

type Parameter 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"`
	Profiles    json.RawMessage `json:"profiles" db:"profiles"`
	Secure      bool            `json:"secure" db:"secure"`
	Value       string          `json:"value" db:"value"`
}

Parameter ...

type ParameterName

type ParameterName string

ParameterName represents the name of a Traffic Ops parameter meant to belong in a Traffic Ops config file.

type ParameterNullable

type ParameterNullable struct {
	//
	// NOTE: the db: struct tags are used for testing to map to their equivalent database column (if there is one)
	//
	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"`
	Profiles    json.RawMessage `json:"profiles" db:"profiles"`
	Secure      *bool           `json:"secure" db:"secure"`
	Value       *string         `json:"value" db:"value"`
}

ParameterNullable - a struct version that allows for all fields to be null, mostly used by the API side

type ParametersResponse

type ParametersResponse struct {
	Response []Parameter `json:"response"`
	Alerts
}

ParametersResponse ...

type PhysLocation

type PhysLocation struct {

	//
	// The Street Address of the physical location
	//
	// required: true
	Address string `json:"address" db:"address"`

	//
	// The Address of the physical location
	//
	// required: true
	City string `json:"city" db:"city"`

	//
	// comments are additional details about the physical location
	//
	Comments string `json:"comments" db:"comments"`

	//
	// The email address for the Point of Contact at the physical location
	//
	Email string `json:"email" db:"email"`

	//
	// The name of the physical location
	//
	// required: true
	ID int `json:"id" db:"id"`

	// Timestamp of the last time this row was updated
	//
	LastUpdated TimeNoMod `json:"lastUpdated" db:"last_updated"`

	//
	// The name of the physical location
	//
	// required: true
	Name string `json:"name" db:"name"`

	//
	// The phone number of the physical location
	//
	// required: true
	Phone string `json:"phone" db:"phone"`

	//
	// The Point Of Contact at the physical location
	//
	// required: true
	POC string `json:"poc" db:"poc"`

	//
	// The RegionID associated to this physical location
	//
	// required: true
	RegionID int `json:"regionId" db:"region"`

	//
	// The Region Name for the region associated to this physical location
	//
	RegionName string `json:"region" db:"region_name"`

	//
	// The shortName for the physical location (like an alias)
	//
	// required: true
	ShortName string `json:"shortName" db:"short_name"`

	//
	// The State for the physical location
	//
	// required: true
	State string `json:"state" db:"state"`

	//
	// The Zipcode for the physical location
	//
	// required: true
	Zip string `json:"zip" db:"zip"`
}

PhysLocation contains the physical location of a cache group.

type PhysLocationNullable

type PhysLocationNullable struct {
	//
	// The Street Address of the physical location
	//
	// required: true
	Address *string `json:"address" db:"address"`

	//
	// The Address of the physical location
	//
	// required: true
	City *string `json:"city" db:"city"`

	//
	// comments are additional details about the physical location
	//
	Comments *string `json:"comments" db:"comments"`

	//
	// The email address for the Point of Contact at the physical location
	//
	Email *string `json:"email" db:"email"`

	//
	// The name of the physical location
	//
	// required: true
	ID *int `json:"id" db:"id"`

	// Timestamp of the last time this row was updated
	//
	LastUpdated *TimeNoMod `json:"lastUpdated" db:"last_updated"`

	//
	// The name of the physical location
	//
	// required: true
	Name *string `json:"name" db:"name"`

	//
	// The phone number of the physical location
	//
	// required: true
	Phone *string `json:"phone" db:"phone"`

	//
	// The Point Of Contact at the physical location
	//
	// required: true
	POC *string `json:"poc" db:"poc"`

	//
	// The RegionID associated to this physical location
	//
	// required: true
	RegionID *int `json:"regionId" db:"region"`

	//
	// The Region Name for the region associated to this physical location
	//
	RegionName *string `json:"region" db:"region_name"`

	//
	// The shortName for the physical location (like an alias)
	//
	// required: true
	ShortName *string `json:"shortName" db:"short_name"`

	//
	// The State for the physical location
	//
	// required: true
	State *string `json:"state" db:"state"`

	//
	// The Zipcode for the physical location
	//
	// required: true
	Zip *string `json:"zip" db:"zip"`
}

PhysLocationNullable contains the physical location of a cache group. It allows for all fields to be null.

type PhysLocationResponse

type PhysLocationResponse struct {
	Response PhysLocationNullable `json:"response"`
	Alerts
}

PhysLocationResponse is a single PhysLocationNullable as a response.

type PhysLocationTrimmed

type PhysLocationTrimmed struct {
	Name string `json:"name"`
}

PhysLocationTrimmed contains only the name of a physical location.

type PhysLocationsResponse

type PhysLocationsResponse struct {
	Response []PhysLocation `json:"response"`
	Alerts
}

PhysLocationsResponse is a list of PhysLocations as a response.

type Plugin

type Plugin struct {
	Name        *string `json:"name"`
	Version     *string `json:"version"`
	Description *string `json:"description"`
}

Plugin represents a TO enabled plugin used by Traffic Ops.

type PluginsResponse

type PluginsResponse struct {
	Response []Plugin `json:"response"`
}

PluginsResponse represents the response from Traffic Ops when getting enabled plugins.

type PostParamProfile

type PostParamProfile struct {
	ParamID    *int64   `json:"paramId"`
	ProfileIDs *[]int64 `json:"profileIds"`
	Replace    *bool    `json:"replace"`
}

func (*PostParamProfile) Sanitize

func (pp *PostParamProfile) Sanitize(tx *sql.Tx)

func (*PostParamProfile) Validate

func (pp *PostParamProfile) Validate(tx *sql.Tx) error

type PostProfileParam

type PostProfileParam struct {
	ProfileID *int64   `json:"profileId"`
	ParamIDs  *[]int64 `json:"paramIds"`
	Replace   *bool    `json:"replace"`
}

func (*PostProfileParam) Sanitize

func (pp *PostProfileParam) Sanitize(tx *sql.Tx)

func (*PostProfileParam) Validate

func (pp *PostProfileParam) Validate(tx *sql.Tx) error

type Profile

type Profile struct {
	ID              int                 `json:"id" db:"id"`
	LastUpdated     TimeNoMod           `json:"lastUpdated"`
	Name            string              `json:"name"`
	Parameter       string              `json:"param"`
	Description     string              `json:"description"`
	CDNName         string              `json:"cdnName"`
	CDNID           int                 `json:"cdn"`
	RoutingDisabled bool                `json:"routingDisabled"`
	Type            string              `json:"type"`
	Parameters      []ParameterNullable `json:"params,omitempty"`
}

Profile ...

type ProfileCopy

type ProfileCopy struct {
	ID           int    `json:"id"`
	Name         string `json:"name"`
	ExistingID   int    `json:"idCopyFrom"`
	ExistingName string `json:"profileCopyFrom"`
	Description  string `json:"description"`
}

ProfileCopy contains details about the profile created from an existing profile.

type ProfileCopyResponse

type ProfileCopyResponse struct {
	Response ProfileCopy `json:"response"`
	Alerts
}

ProfileCopyResponse represents the API response when a profile is copied

type ProfileExportImportNullable

type ProfileExportImportNullable struct {
	Name        *string `json:"name"`
	Description *string `json:"description"`
	CDNName     *string `json:"cdn"`
	Type        *string `json:"type"`
}

ProfileExportImportNullable is an object of the form used by Traffic Ops to represent exported and imported profiles.

type ProfileExportImportParameterNullable

type ProfileExportImportParameterNullable struct {
	ConfigFile *string `json:"config_file"`
	Name       *string `json:"name"`
	Value      *string `json:"value"`
}

ProfileExportImportParameterNullable is an object of the form used by Traffic Ops to represent parameters for exported and imported profiles.

type ProfileExportResponse

type ProfileExportResponse struct {
	// Parameters associated to the profile
	//
	Profile ProfileExportImportNullable `json:"profile"`

	// Parameters associated to the profile
	//
	Parameters []ProfileExportImportParameterNullable `json:"parameters"`
}

ProfileExportResponse is an object of the form used by Traffic Ops to represent exported profile response

type ProfileImportRequest

type ProfileImportRequest struct {
	// Parameters associated to the profile
	//
	Profile ProfileExportImportNullable `json:"profile"`

	// Parameters associated to the profile
	//
	Parameters []ProfileExportImportParameterNullable `json:"parameters"`
}

ProfileImportRequest is an object of the form used by Traffic Ops to represent a request to import a profile

func (*ProfileImportRequest) Validate

func (profileImport *ProfileImportRequest) Validate(tx *sql.Tx) error

Validate validates an profile import request

type ProfileImportResponse

type ProfileImportResponse struct {
	Response ProfileImportResponseObj `json:"response"`
	Alerts
}

ProfileImportResponse is an object of the form used by Traffic Ops to represent a response from importing a profile

type ProfileImportResponseObj

type ProfileImportResponseObj struct {
	ProfileExportImportNullable
	ID *int `json:"id"`
}

ProfileImportResponseObj contains data about the profile being imported

type ProfileNullable

type ProfileNullable struct {
	ID              *int                `json:"id" db:"id"`
	LastUpdated     *TimeNoMod          `json:"lastUpdated" db:"last_updated"`
	Name            *string             `json:"name" db:"name"`
	Description     *string             `json:"description" db:"description"`
	CDNName         *string             `json:"cdnName" db:"cdn_name"`
	CDNID           *int                `json:"cdn" db:"cdn"`
	RoutingDisabled *bool               `json:"routingDisabled" db:"routing_disabled"`
	Type            *string             `json:"type" db:"type"`
	Parameters      []ParameterNullable `json:"params,omitempty"`
}

ProfileNullable allows all fields to be 'null'

type ProfileParameter

type ProfileParameter struct {
	LastUpdated TimeNoMod `json:"lastUpdated"`
	Profile     string    `json:"profile"`
	ProfileID   int       `json:"profileId"`
	Parameter   string    `json:"parameter"`
	ParameterID int       `json:"parameterId"`
}

ProfileParameter ...

type ProfileParameterByName

type ProfileParameterByName 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"`
}

type ProfileParameterByNamePost

type ProfileParameterByNamePost struct {
	ConfigFile *string `json:"configFile"`
	Name       *string `json:"name"`
	Secure     *int    `json:"secure"`
	Value      *string `json:"value"`
}

func (*ProfileParameterByNamePost) Validate

func (p *ProfileParameterByNamePost) Validate(tx *sql.Tx) []error

type ProfileParameterNullable

type ProfileParameterNullable struct {
	LastUpdated *TimeNoMod `json:"lastUpdated" db:"last_updated"`
	Profile     *string    `json:"profile" db:"profile"`
	ProfileID   *int       `json:"profileId" db:"profile_id"`
	Parameter   *string    `json:"parameter" db:"parameter"`
	ParameterID *int       `json:"parameterId" db:"parameter_id"`
}

ProfileParameterNullable ...

type ProfileParameterPostResp

type ProfileParameterPostResp struct {
	Parameters  []ProfileParameterPostRespObj `json:"parameters"`
	ProfileID   int                           `json:"profileId"`
	ProfileName string                        `json:"profileName"`
}

type ProfileParameterPostRespObj

type ProfileParameterPostRespObj struct {
	ProfileParameterByNamePost
	ID int64 `json:"id"`
}

type ProfileParameterResponse

type ProfileParameterResponse struct {
	// in: body
	Response ProfileParameter `json:"response"`
	Alerts
}

ProfileParameterResponse is a single ProfileParameter response for Create to depict what changed. swagger:response ProfileParameterResponse in: body

type ProfileParametersByNamePost

type ProfileParametersByNamePost []ProfileParameterByNamePost

ProfileParametersByNamePost is the object posted to profile/name/parameter endpoints. This object may be posted as either a single JSON object, or an array of objects. Either will unmarshal into this object; a single object will unmarshal into an array of 1 element.

func (*ProfileParametersByNamePost) UnmarshalJSON

func (pp *ProfileParametersByNamePost) UnmarshalJSON(bts []byte) error

func (*ProfileParametersByNamePost) Validate

func (pp *ProfileParametersByNamePost) Validate(tx *sql.Tx) error

type ProfileParametersNullable

type ProfileParametersNullable struct {
	LastUpdated *TimeNoMod `json:"lastUpdated" db:"last_updated"`
	Profile     *string    `json:"profile" db:"profile"`
	Parameter   *int       `json:"parameter" db:"parameter_id"`
}

ProfileParametersNullable is an object of the form returned by the Traffic Ops /profileparameters endpoint.

type ProfileParametersNullableResponse

type ProfileParametersNullableResponse struct {
	Response []ProfileParametersNullable `json:"response"`
}

type ProfileParametersResponse

type ProfileParametersResponse struct {
	Response []ProfileParameter `json:"response"`
	Alerts
}

ProfileParametersResponse ...

type ProfileResponse

type ProfileResponse struct {
	// in: body
	Response Profile `json:"response"`
	Alerts
}

ProfileResponse is a single Profile Response for Update and Create to depict what changed swagger:response ProfileResponse in: body

type ProfileTrimmed

type ProfileTrimmed struct {
	Name string `json:"name"`
}

ProfileTrimmed ...

type ProfilesResponse

type ProfilesResponse struct {
	Response []Profile `json:"response"`
	Alerts
}

ProfilesResponse is a list of profiles returned by GET requests.

type Protocol

type Protocol string

Protocol represents an ATC-supported content delivery protocol.

func ProtocolFromString

func ProtocolFromString(s string) Protocol

ProtocolFromString parses a string and returns the corresponding Protocol.

func (Protocol) MarshalJSON

func (p Protocol) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface.

func (Protocol) String

func (p Protocol) String() string

String implements the "Stringer" interface.

func (*Protocol) UnmarshalJSON

func (p *Protocol) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface.

type QStringIgnore

type QStringIgnore int

QStringIgnore is an entry in the delivery_service table qstring_ignore column, and represents how to treat the URL query string for requests to that delivery service. This enum's String function returns the numeric representation, because it is a legacy database value, and the number should be kept for both database and API JSON uses. For the same reason, this enum has no FromString function.

const (
	QStringIgnoreUseInCacheKeyAndPassUp    QStringIgnore = 0
	QStringIgnoreIgnoreInCacheKeyAndPassUp QStringIgnore = 1
	QStringIgnoreDrop                      QStringIgnore = 2
)

func (QStringIgnore) String

func (e QStringIgnore) String() string

String returns the string number of the QStringIgnore value. Note this returns the number, not a human-readable value, because QStringIgnore is a legacy database sigil, and both database and API JSON uses should use the number. This also returns 'INVALID' for unknown values, to fail fast in the event of bad data.

type Region

type Region struct {
	DivisionName string    `json:"divisionName"`
	Division     int       `json:"division" db:"division"`
	ID           int       `json:"id" db:"id"`
	LastUpdated  TimeNoMod `json:"lastUpdated" db:"last_updated"`
	Name         string    `json:"name" db:"name"`
}

Region ...

type RegionName

type RegionName struct {
	ID       int                `json:"id"`
	Name     string             `json:"name"`
	Division RegionNameDivision `json:"division"`
}

RegionName is a response to a request to get a region by its name. It includes the division that the region is in.

type RegionNameDivision

type RegionNameDivision struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
}

RegionNameDivision is the division that contains the region that a request is trying to query by name.

type RegionNameResponse

type RegionNameResponse struct {
	Response []RegionName `json:"response"`
}

RegionNameResponse models the structure of a response to a request to get a region by its name.

type RegionsResponse

type RegionsResponse struct {
	Response []Region `json:"response"`
	Alerts
}

RegionsResponse ...

type RequestStatus

type RequestStatus string

RequestStatus captures where in the workflow this request is

func RequestStatusFromString

func RequestStatusFromString(rs string) (RequestStatus, error)

RequestStatusFromString gets the status enumeration from a string

func (RequestStatus) MarshalJSON

func (r RequestStatus) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaller

func (*RequestStatus) Scan

func (r *RequestStatus) Scan(src interface{}) error

Scan implements sql.Scanner

func (*RequestStatus) UnmarshalJSON

func (r *RequestStatus) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaller

func (RequestStatus) ValidTransition

func (r RequestStatus) ValidTransition(to RequestStatus) error

ValidTransition returns nil if the transition is allowed for the workflow, an error if not

func (*RequestStatus) Value

func (r *RequestStatus) Value() (driver.Value, error)

Value implements driver.Valuer

type ResolverMapping

type ResolverMapping struct {
	Resolve4 []string `json:"resolve4,omitempty"`
	Resolve6 []string `json:"resolve6,omitempty"`
}

func (*ResolverMapping) Validate

func (r *ResolverMapping) Validate(tx *sql.Tx) error

type ResultStatVal

type ResultStatVal struct {
	// Span is the number of polls this stat has been the same. For example,
	// if History is set to 100, and the last 50 polls had the same value for
	// this stat (but none of the previous 50 were the same), this stat's map
	// value slice will actually contain 51 entries, and the first entry will
	// have the value, the time of the last poll, and a Span of 50.
	// Assuming the poll time is every 8 seconds, users will then know, looking
	// at the Span, that the value was unchanged for the last 50*8=400 seconds.
	Span uint64 `json:"span"`
	// Time is the time this stat was returned.
	Time time.Time   `json:"time"`
	Val  interface{} `json:"value"`
}

ResultStatVal is the value of an individual stat returned from a poll. JSON values are all strings, for the TM1.0 /publish/CacheStats API.

func (*ResultStatVal) MarshalJSON

func (t *ResultStatVal) MarshalJSON() ([]byte, error)

func (*ResultStatVal) UnmarshalJSON

func (t *ResultStatVal) UnmarshalJSON(data []byte) error

type RiakPingResp

type RiakPingResp struct {
	Status string `json:"status"`
	Server string `json:"server"`
}

type Role

type Role struct {
	RoleV11

	// Capabilities associated with the Role
	//
	// required: true
	Capabilities *[]string `json:"capabilities" db:"-"`
}

Role ...

type RoleResponse

type RoleResponse struct {
	// in: body
	Response Role `json:"response"`
	Alerts
}

RoleResponse is a single Role response for Update and Create to depict what changed. swagger:response RoleResponse in: body

type RoleV11

type RoleV11 struct {
	// ID of the Role
	//
	// required: true
	ID *int `json:"id" db:"id"`

	// Name of the Role
	//
	// required: true
	Name *string `json:"name" db:"name"`

	// Description of the Role
	//
	// required: true
	Description *string `json:"description" db:"description"`

	// Priv Level of the Role
	//
	// required: true
	PrivLevel *int `json:"privLevel" db:"priv_level"`
}

RoleV11 ...

type RolesResponse

type RolesResponse struct {
	// in: body
	Response []Role `json:"response"`
	Alerts
}

RolesResponse is a list of Roles as a response. swagger:response RolesResponse in: body

type Routing

type Routing struct {
	StaticRoute       float64 `json:"staticRoute"`
	Geo               float64 `json:"geo"`
	Err               float64 `json:"err"`
	Fed               float64 `json:"fed"`
	CZ                float64 `json:"cz"`
	DeepCZ            float64 `json:"deepCz"`
	RegionalAlternate float64 `json:"regionalAlternate"`
	DSR               float64 `json:"dsr"`
	Miss              float64 `json:"miss"`
	RegionalDenied    float64 `json:"regionalDenied"`
}

Routing represents the aggregated routing percentages across CDNs or for a DS.

type SOA

type SOA struct {
	Admin              *string   `json:"admin,omitempty"`
	AdminTime          time.Time `json:"-"`
	ExpireSeconds      *string   `json:"expire,omitempty"`
	ExpireSecondsTime  time.Time `json:"-"`
	MinimumSeconds     *string   `json:"minimum,omitempty"`
	MinimumSecondsTime time.Time `json:"-"`
	RefreshSeconds     *string   `json:"refresh,omitempty"`
	RefreshSecondsTime time.Time `json:"-"`
	RetrySeconds       *string   `json:"retry,omitempty"`
	RetrySecondsTime   time.Time `json:"-"`
}

SOA (Start of Authority record) defines the SOA record for the CDN's top-level domain.

type SSLKeyRequestFields

type SSLKeyRequestFields struct {
	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"`
}

type Server

type Server 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"`
	InterfaceMtu     int                 `json:"interfaceMtu" db:"interface_mtu"`
	InterfaceName    string              `json:"interfaceName" db:"interface_name"`
	IP6Address       string              `json:"ip6Address" db:"ip6_address"`
	IP6IsService     bool                `json:"ip6IsService" db:"ip6_address_is_service"`
	IP6Gateway       string              `json:"ip6Gateway" db:"ip6_gateway"`
	IPAddress        string              `json:"ipAddress" db:"ip_address"`
	IPIsService      bool                `json:"ipIsService" db:"ip_address_is_service"`
	IPGateway        string              `json:"ipGateway" db:"ip_gateway"`
	IPNetmask        string              `json:"ipNetmask" db:"ip_netmask"`
	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"`
	RevalPending     bool                `json:"revalPending" db:"reval_pending"`
	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"`
	XMPPID           string              `json:"xmppId" db:"xmpp_id"`
	XMPPPasswd       string              `json:"xmppPasswd" db:"xmpp_passwd"`
}

Server is a non-"nullable" representation of a Server as it appeared in API version 2.0 Deprecated: Please use versioned and nullable structures from now on.

func (Server) ToNullable

func (s Server) ToNullable() ServerNullableV2

ToNullable converts the Server to an equivalent, "nullable" structure.

Note that "zero" values (e.g. the empty string "") are NOT coerced to actual null values. In particular, the only fields that will possibly be nil are FQDN - if the original server had a nil FQDN - and DeliveryServices - which will actually be a pointer to a nil map if the original server had a nil DeliveryServices map. Further note that this makes "shallow" copies of member properties; if reference types (map, slice, pointer etc.) are altered on the original after conversion, the changes WILL affect the nullable copy.

type ServerCapabilitiesResponse

type ServerCapabilitiesResponse struct {
	Response []ServerCapability `json:"response"`
	Alerts
}

ServerCapabilitiesResponse contains the result data from a GET /server_capabilities request.

type ServerCapability

type ServerCapability struct {
	Name        string     `json:"name" db:"name"`
	LastUpdated *TimeNoMod `json:"lastUpdated" db:"last_updated"`
}

ServerCapability contains information about a given ServerCapability in Traffic Ops.

type ServerCapabilityDetailResponse

type ServerCapabilityDetailResponse struct {
	Response ServerCapability `json:"response"`
	Alerts
}

ServerCapabilityDetailResponse contains the result data from a POST /server_capabilities request.

type ServerCheckColumns

type ServerCheckColumns struct {
	// ID uniquely identifies a servercheck columns row.
	ID int `db:"id"`

	// Server is the ID of the server which is associated with these checks.
	Server int `db:"server"`

	AA *int `db:"aa"`
	AB *int `db:"ab"`
	AC *int `db:"ac"`
	AD *int `db:"ad"`
	AE *int `db:"ae"`
	AF *int `db:"af"`
	AG *int `db:"ag"`
	AH *int `db:"ah"`
	AI *int `db:"ai"`
	AJ *int `db:"aj"`
	AK *int `db:"ak"`
	AL *int `db:"al"`
	AM *int `db:"am"`
	AN *int `db:"an"`
	AO *int `db:"ao"`
	AP *int `db:"ap"`
	AQ *int `db:"aq"`
	AR *int `db:"ar"`
	AT *int `db:"at"`
	AU *int `db:"au"`
	AV *int `db:"av"`
	AW *int `db:"aw"`
	AX *int `db:"ax"`
	AY *int `db:"ay"`
	AZ *int `db:"az"`
	BA *int `db:"ba"`
	BB *int `db:"bb"`
	BC *int `db:"bc"`
	BD *int `db:"bd"`
	BE *int `db:"be"`
	BF *int `db:"bf"`
}

ServerCheckColumns is a collection of columns associated with a particular server's "checks". The meaning of the column names is unknown.

type ServerCheckExtensionID

type ServerCheckExtensionID struct {
	ID int `json:"id"`
}

ServerCheckExtensionID ...

type ServerCheckExtensionNullable

type ServerCheckExtensionNullable struct {
	ID                    *int       `json:"id" db:"id"`
	Name                  *string    `json:"name" db:"name"`
	Version               *string    `json:"version" db:"version"`
	InfoURL               *string    `json:"info_url" db:"info_url"`
	ScriptFile            *string    `json:"script_file" db:"script_file"`
	IsActive              *int       `json:"isactive" db:"isactive"`
	AdditionConfigJSON    *string    `json:"additional_config_json" db:"additional_config_json"`
	Description           *string    `json:"description" db:"description"`
	ServercheckShortName  *string    `json:"servercheck_short_name" db:"servercheck_short_name"`
	ServercheckColumnName *string    `json:"-" db:"servercheck_column_name"`
	Type                  *string    `json:"type" db:"type_name"`
	TypeID                *int       `json:"-" db:"type"`
	LastUpdated           *TimeNoMod `json:"-" db:"last_updated"`
}

ServerCheckExtensionNullable represents a server check extension used by Traffic Ops.

func (*ServerCheckExtensionNullable) Validate

func (e *ServerCheckExtensionNullable) Validate(tx *sql.Tx) error

Validate ensures that the ServerCheckExtensionNullable request body is valid for creation.

type ServerCheckExtensionPostResponse

type ServerCheckExtensionPostResponse struct {
	Response ServerCheckExtensionID `json:"supplemental"`
	Alerts
}

ServerCheckExtensionPostResponse represents the response from Traffic Ops when creating ServerCheckExtension.

type ServerCheckExtensionResponse

type ServerCheckExtensionResponse struct {
	Response []ServerCheckExtensionNullable `json:"response"`
}

ServerCheckExtensionResponse represents the response from Traffic Ops when getting ServerCheckExtension.

type ServerDetail

type ServerDetail struct {
	CacheGroup         *string           `json:"cachegroup" db:"cachegroup"`
	CDNName            *string           `json:"cdnName" db:"cdn_name"`
	DeliveryServiceIDs []int64           `json:"deliveryservices,omitempty"`
	DomainName         *string           `json:"domainName" db:"domain_name"`
	GUID               *string           `json:"guid" db:"guid"`
	HardwareInfo       map[string]string `json:"hardwareInfo"`
	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"`
	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"`
	Profile            *string           `json:"profile" db:"profile"`
	ProfileDesc        *string           `json:"profileDesc" db:"profile_desc"`
	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"`
	TCPPort            *int              `json:"tcpPort" db:"tcp_port"`
	Type               string            `json:"type" db:"server_type"`
	XMPPID             *string           `json:"xmppId" db:"xmpp_id"`
	XMPPPasswd         *string           `json:"xmppPasswd" db:"xmpp_passwd"`
}

type ServerDetailV11

type ServerDetailV11 struct {
	ServerDetail
	LegacyInterfaceDetails
}

type ServerDetailV30

type ServerDetailV30 struct {
	ServerDetail
	ServerInterfaces *[]ServerInterfaceInfo `json:"interfaces"`
}

ServerDetailV30 is the details for a server for API v3

type ServerIPAddress

type ServerIPAddress struct {
	Address        string  `json:"address" db:"address"`
	Gateway        *string `json:"gateway" db:"gateway"`
	ServiceAddress bool    `json:"serviceAddress" db:"service_address"`
}

ServerIPAddress is the data associated with a server's interface's IP address.

type ServerInfo

type ServerInfo struct {
	Cachegroup   string
	CachegroupID int
	CDNID        int
	DomainName   string
	HostName     string
	ID           int
	Status       string
	Type         string
}

type ServerInterfaceInfo

type ServerInterfaceInfo struct {
	IPAddresses  []ServerIPAddress `json:"ipAddresses" db:"ip_addresses"`
	MaxBandwidth *uint64           `json:"maxBandwidth" db:"max_bandwidth"`
	Monitor      bool              `json:"monitor" db:"monitor"`
	MTU          *uint64           `json:"mtu" db:"mtu"`
	Name         string            `json:"name" db:"name"`
}

ServerInterfaceInfo is the data associated with a server's interface.

func GetVIPInterface

func GetVIPInterface(ts TrafficServer) ServerInterfaceInfo

GetVIPInterface returns the primary interface specified by the `Monitor` property of an Interface. First interface marked as `Monitor` is returned.

func (*ServerInterfaceInfo) GetDefaultAddress

func (i *ServerInterfaceInfo) GetDefaultAddress() (string, string)

GetDefaultAddress returns the IPv4 and IPv6 service addresses of the interface.

func (*ServerInterfaceInfo) Scan

func (sii *ServerInterfaceInfo) Scan(src interface{}) error

Scan implements the sql.Scanner interface expects json.RawMessage and unmarshals to a ServerInterfaceInfo struct

func (*ServerInterfaceInfo) Value

func (sii *ServerInterfaceInfo) Value() (driver.Value, error)

Value implements the driver.Valuer interface marshals struct to json to pass back as a json.RawMessage

type ServerNullable

type ServerNullable ServerV30

ServerNullable represents an ATC server, as returned by the TO API. Deprecated: please use versioned structures instead of this alias from now on.

func (*ServerNullable) ToServerV2

func (s *ServerNullable) ToServerV2() (ServerNullableV2, error)

ToServerV2 converts the server to an equivalent ServerNullableV2 structure, if possible. If the conversion could not be performed, an error is returned.

type ServerNullableV11

type ServerNullableV11 struct {
	LegacyInterfaceDetails
	CommonServerProperties
}

ServerNullableV11 is a server as it appeared in API version 1.1.

type ServerNullableV2

type ServerNullableV2 struct {
	ServerNullableV11
	IPIsService  *bool `json:"ipIsService" db:"ip_address_is_service"`
	IP6IsService *bool `json:"ip6IsService" db:"ip6_address_is_service"`
}

ServerNullableV2 is a server as it appeared in API v2.

func (ServerNullableV2) ToNonNullable

func (s ServerNullableV2) ToNonNullable() Server

ToNonNullable converts the ServerNullableV2 safely to a Server structure.

func (ServerNullableV2) Upgrade

func (s ServerNullableV2) Upgrade() (ServerV30, error)

Upgrade upgrades the ServerNullableV2 to the new ServerNullable structure.

Note that this makes "shallow" copies of all underlying data, so changes to the original will affect the upgraded copy.

type ServerPutStatus

type ServerPutStatus struct {
	Status        util.JSONNameOrIDStr `json:"status"`
	OfflineReason *string              `json:"offlineReason"`
}

type ServerQueueUpdate

type ServerQueueUpdate struct {
	ServerID util.JSONIntStr `json:"serverId"`
	Action   string          `json:"action"`
}

ServerQueueUpdate decodes the update data from the POST servers/{{ID}}/queue_update endpoint.

type ServerQueueUpdateRequest

type ServerQueueUpdateRequest struct {
	Action string `json:"action"`
}

ServerQueueUpdateRequest encodes the request data for the POST servers/{{ID}}/queue_update endpoint.

type ServerQueueUpdateResponse

type ServerQueueUpdateResponse struct {
	Response ServerQueueUpdate `json:"response"`
	Alerts
}

ServerQueueUpdateResponse decodes the full response with alerts from the POST servers/{{ID}}/queue_update endpoint.

type ServerServerCapability

type ServerServerCapability struct {
	LastUpdated      *TimeNoMod `json:"lastUpdated" db:"last_updated"`
	Server           *string    `json:"serverHostName,omitempty" db:"host_name"`
	ServerID         *int       `json:"serverId" db:"server"`
	ServerCapability *string    `json:"serverCapability" db:"server_capability"`
}

ServerServerCapability represents an association between a server capability and a server

type ServerStats

type ServerStats struct {
	// Interfaces contains statistics specific to each monitored interface
	// of the cache server.
	Interfaces map[string]map[string][]ResultStatVal `json:"interfaces"`
	// Stats contains statistics regarding the cache server in general.
	Stats map[string][]ResultStatVal `json:"stats"`
}

ServerStats is a representation of cache server statistics as present in the TM API.

type ServerUpdateStatus

type ServerUpdateStatus struct {
	HostName           string `json:"host_name"`
	UpdatePending      bool   `json:"upd_pending"`
	RevalPending       bool   `json:"reval_pending"`
	UseRevalPending    bool   `json:"use_reval_pending"`
	HostId             int    `json:"host_id"`
	Status             string `json:"status"`
	ParentPending      bool   `json:"parent_pending"`
	ParentRevalPending bool   `json:"parent_reval_pending"`
}

type ServerV1

type ServerV1 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"`
	InterfaceMtu     int                 `json:"interfaceMtu" db:"interface_mtu"`
	InterfaceName    string              `json:"interfaceName" db:"interface_name"`
	IP6Address       string              `json:"ip6Address" db:"ip6_address"`
	IP6Gateway       string              `json:"ip6Gateway" db:"ip6_gateway"`
	IPAddress        string              `json:"ipAddress" db:"ip_address"`
	IPGateway        string              `json:"ipGateway" db:"ip_gateway"`
	IPNetmask        string              `json:"ipNetmask" db:"ip_netmask"`
	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"`
	RevalPending     bool                `json:"revalPending" db:"reval_pending"`
	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"`
	XMPPID           string              `json:"xmppId" db:"xmpp_id"`
	XMPPPasswd       string              `json:"xmppPasswd" db:"xmpp_passwd"`
}

func (ServerV1) ToNullable

func (s ServerV1) ToNullable() ServerNullableV11

type ServerV30

type ServerV30 struct {
	CommonServerProperties
	Interfaces        []ServerInterfaceInfo `json:"interfaces" db:"interfaces"`
	StatusLastUpdated *time.Time            `json:"statusLastUpdated" db:"status_last_updated"`
}

ServerV30 is the representation of a Server in version 3 of the Traffic Ops API.

func (*ServerV30) ToServerV2

func (s *ServerV30) ToServerV2() (ServerNullableV2, error)

ToServerV2 converts the server to an equivalent ServerNullableV2 structure, if possible. If the conversion could not be performed, an error is returned.

type Servercheck

type Servercheck struct {
	CommonCheckFields

	// Various check types
	Checks struct {

		// IPv4 production interface (legacy name)
		Iface10G int `json:"10G"`

		// IPv6 production interface (legacy name)
		Iface10G6 int `json:"10G6"`

		// Cache Disk Usage
		CDU int `json:"CDU"`

		// Cache Hit Ratio
		CHR int `json:"CHR"`

		// DSCP check
		DSCP int `json:"DSCP"`

		// DNS check
		FQDN int `json:"FQDN"`

		// Out-of-band (BMC) interface check
		ILO int `json:"ILO"`

		// IPv4 production interface (new name)
		IPv4 int `json:"IPv4"`

		// IPv6 production interface (new name)
		IPv6 int `json:"IPv6"`

		// MTU check
		MTU int `json:"MTU"`

		// ORT check
		ORT int `json:"ORT"`

		// Traffic Router status for checked server
		RTR int `json:"RTR"`
	} `json:"checks"`
}

Servercheck is a single Servercheck struct for GET response. swagger:model Servercheck

type ServercheckPost

type ServercheckPost struct {

	// The Servercheck data to submit
	//
	// Name of the server check type
	//
	// required: true
	Name string `json:"servercheck_short_name"`

	// ID of the server
	//
	ID int `json:"id"`

	// Name of the server
	HostName string `json:"name" `

	// Value of the check result
	//
	// required: true
	Value int `json:"value"`
}

ServercheckPost is a single Servercheck struct for Update and Create to depict what changed.

type ServercheckPostResponse

type ServercheckPostResponse struct {
	Alerts []Alert `json:"alerts"`
}

ServercheckPostResponse is the response to a Servercheck POST request.

type ServercheckRequestNullable

type ServercheckRequestNullable struct {
	Name     *string `json:"servercheck_short_name"`
	ID       *int    `json:"id"`
	Value    *int    `json:"value"`
	HostName *string `json:"host_name"`
}

ServercheckRequestNullable is a single nullable Servercheck struct for Update and Create to depict what changed.

func (ServercheckRequestNullable) Validate

func (scp ServercheckRequestNullable) Validate(tx *sql.Tx) error

Validate ServercheckRequestNullable

type ServerchecksResponse

type ServerchecksResponse struct {
	// in: body
	Response []Servercheck `json:"response"`
	Alerts
}

ServerchecksResponse is a list of Serverchecks as a response. swagger:response ServerchecksResponse in: body

type ServersDetailResponse

type ServersDetailResponse struct {
	Response Server `json:"response"`
	Alerts
}

ServersDetailResponse is the JSON object returned for a single server.

type ServersResponse

type ServersResponse struct {
	Response []Server `json:"response"`
	Alerts
}

ServersResponse is a list of Servers as a response to an API v2 request. This can't change because it will break ORT. Unfortunately.

type ServersV1DetailResponse

type ServersV1DetailResponse struct {
	Response []ServerDetailV11 `json:"response"`
	Alerts
}

ServersV1DetailResponse is the JSON object returned for a single server for v1.

type ServersV1Response

type ServersV1Response struct {
	Response []ServerV1 `json:"response"`
	Alerts
}

ServersV1Response is a list of Servers for v1 as a response.

type ServersV3DetailResponse

type ServersV3DetailResponse struct {
	Response []ServerDetailV30 `json:"response"`
	Alerts
}

ServersV3DetailResponse is the JSON object returned for a single server for v3.

type ServersV3Response

type ServersV3Response struct {
	Response []ServerV30 `json:"response"`
	Summary  struct {
		Count uint64 `json:"count"`
	} `json:"summary"`
	Alerts
}

ServersV3Response is the format of a response to a GET request for /servers.

type ServiceCategoriesResponse

type ServiceCategoriesResponse struct {
	Response []ServiceCategory `json:"response"`
}

ServiceCategoriesResponse is a list of Service Categories as a response.

type ServiceCategory

type ServiceCategory struct {
	LastUpdated TimeNoMod `json:"lastUpdated" db:"last_updated"`
	Name        string    `json:"name" db:"name"`
}

ServiceCategory holds the name, id and associated tenant that comprise a service category.

type ServiceCategoryResponse

type ServiceCategoryResponse struct {
	Response ServiceCategory `json:"response"`
}

ServiceCategoryResponse is a single Service Category response for Update and Create to depict what changed.

type StaticDNS

type StaticDNS struct {
	Value string `json:"value"`
	TTL   int    `json:"ttl"`
	Name  string `json:"name"`
	Type  string `json:"type"`
}

StaticDNS ...

type StaticDNSEntriesResponse

type StaticDNSEntriesResponse struct {
	Response []StaticDNSEntry `json:"response"`
	Alerts
}

StaticDNSEntriesResponse is a list of StaticDNSEntry as a response.

type StaticDNSEntry

type StaticDNSEntry struct {

	// The static IP Address or fqdn of the static dns entry
	//
	// required: true
	Address string `json:"address" db:"address"`

	// The Cachegroup Name associated
	//
	CacheGroupName string `json:"cachegroup" db:"cachegroup"`

	// The Cachegroup ID associated
	//
	CacheGroupID int `json:"cachegroupId" db:"cachegroup_id"`

	// The DeliveryService associated
	//
	DeliveryService string `json:"deliveryservice" db:"dsname"`

	// The DeliveryService associated
	//
	// required: true
	DeliveryServiceID int `json:"deliveryserviceId" db:"deliveryservice_id"`

	// The host of the static dns entry
	//
	// required: true
	Host string `json:"host" db:"host"`

	// ID of the StaticDNSEntry
	//
	// required: true
	ID int `json:"id" db:"id"`

	// LastUpdated
	//
	LastUpdated TimeNoMod `json:"lastUpdated" db:"last_updated"`

	// The Time To Live for the static dns entry
	//
	// required: true
	TTL int64 `json:"ttl" db:"ttl"`

	// The type of the static DNS entry
	//
	// enum: ["A_RECORD", "AAAA_RECORD", "CNAME_RECORD"]
	Type string `json:"type"`

	// The type id of the static DNS entry
	//
	// required: true
	TypeID int `json:"typeId" db:"type_id"`
}

StaticDNSEntry holds information about a static DNS entry.

type StaticDNSEntryNullable

type StaticDNSEntryNullable struct {

	// The static IP Address or fqdn of the static dns entry
	//
	// required: true
	Address *string `json:"address" db:"address"`

	// The Cachegroup Name associated
	//
	CacheGroupName *string `json:"cachegroup" db:"cachegroup"`

	// The Cachegroup ID associated
	//
	CacheGroupID *int `json:"cachegroupId" db:"cachegroup_id"`

	// The DeliveryService Name associated
	//
	DeliveryService *string `json:"deliveryservice" db:"dsname"`

	// DeliveryService ID of the StaticDNSEntry
	//
	// required: true
	DeliveryServiceID *int `json:"deliveryserviceId" db:"deliveryservice_id"`

	// The host of the static dns entry
	//
	// required: true
	Host *string `json:"host" db:"host"`

	// ID of the StaticDNSEntry
	//
	// required: true
	ID *int `json:"id" db:"id"`

	// LastUpdated
	//
	LastUpdated *TimeNoMod `json:"lastUpdated" db:"last_updated"`

	// The Time To Live for the static dns entry
	//
	// required: true
	TTL *int64 `json:"ttl" db:"ttl"`

	// The type of the static DNS entry
	//
	// enum: ["A_RECORD", "AAAA_RECORD", "CNAME_RECORD"]
	Type *string `json:"type"`

	// The type id of the static DNS entry
	//
	// required: true
	TypeID int `json:"typeId" db:"type_id"`
}

StaticDNSEntryNullable holds information about a static DNS entry. Its fields are nullable.

type Stats

type Stats struct {
	CommonAPIData
	// Caches is a map of cache server hostnames to groupings of statistics
	// regarding each cache server and all of its separate network interfaces.
	Caches map[string]ServerStats `json:"caches"`
}

Stats is designed for returning via the API. It contains result history for each cache, as well as common API data.

func (*Stats) ToLegacy

func (s *Stats) ToLegacy(monitorConfig TrafficMonitorConfigMap) ([]string, LegacyStats)

type StatsSummary

type StatsSummary struct {
	CDNName         *string    `json:"cdnName"  db:"cdn_name"`
	DeliveryService *string    `json:"deliveryServiceName"  db:"deliveryservice_name"`
	StatName        *string    `json:"statName"  db:"stat_name"`
	StatValue       *float64   `json:"statValue"  db:"stat_value"`
	SummaryTime     time.Time  `json:"summaryTime"  db:"summary_time"`
	StatDate        *time.Time `json:"statDate"  db:"stat_date"`
}

StatsSummary ...

func (StatsSummary) MarshalJSON

func (ss StatsSummary) MarshalJSON() ([]byte, error)

MarshalJSON Customized Marshal to force date format on statDate

func (*StatsSummary) UnmarshalJSON

func (ss *StatsSummary) UnmarshalJSON(data []byte) error

UnmarshalJSON Customized Unmarshal to force date format on statDate

func (StatsSummary) Validate

func (ss StatsSummary) Validate(tx *sql.Tx) error

type StatsSummaryLastUpdated

type StatsSummaryLastUpdated struct {
	SummaryTime *time.Time `json:"summaryTime"  db:"summary_time"`
}

StatsSummaryLastUpdated ...

func (StatsSummaryLastUpdated) MarshalJSON

func (ss StatsSummaryLastUpdated) MarshalJSON() ([]byte, error)

MarshalJSON is a customized marshal to force date format on SummaryTime.

func (*StatsSummaryLastUpdated) UnmarshalJSON

func (ss *StatsSummaryLastUpdated) UnmarshalJSON(data []byte) error

UnmarshalJSON Customized Unmarshal to force timestamp format

type StatsSummaryLastUpdatedResponse

type StatsSummaryLastUpdatedResponse struct {
	Version  string                  `json:"version"`
	Response StatsSummaryLastUpdated `json:"response"`
}

type StatsSummaryResponse

type StatsSummaryResponse struct {
	Response []StatsSummary `json:"response"`
	Alerts
}

StatsSummaryResponse ...

type Status

type Status struct {

	// The Statuses to retrieve
	//
	// description of the status type
	//
	Description string `json:"description" db:"description"`

	// ID of the Status
	//
	// required: true
	ID int `json:"id" db:"id"`

	// The Time / Date this server entry was last updated
	//
	LastUpdated TimeNoMod `json:"lastUpdated" db:"last_updated"`

	// enum: ["OFFLINE", "ONLINE", "ADMIN_DOWN", "REPORTED", "CCR_IGNORE", "PRE_PROD"]
	Name string `json:"name" db:"name"`
}

Status is a single Status response for Update and Create to depict what changed. swagger:model Statuses

type StatusNullable

type StatusNullable struct {
	Description *string    `json:"description"`
	ID          *int       `json:"id" db:"id"`
	LastUpdated *TimeNoMod `json:"lastUpdated" db:"last_updated"`
	Name        *string    `json:"name" db:"name"`
}

StatusNullable is a nullable single Status response for Update and Create to depict what changed.

type StatusResponse

type StatusResponse struct {
	// in: body
	Response Status `json:"response"`
	Alerts
}

StatusResponse is a single Status response for Update and Create to depict what changed. swagger:response StatusResponse in: body

type StatusesResponse

type StatusesResponse struct {
	// in: body
	Response []Status `json:"response"`
	Alerts
}

StatusesResponse is a list of Statuses as a response that depicts the state of a server. swagger:response StatusesResponse

type Steering

type Steering struct {
	DeliveryService DeliveryServiceName      `json:"deliveryService"`
	ClientSteering  bool                     `json:"clientSteering"`
	Targets         []SteeringSteeringTarget `json:"targets"`
	Filters         []SteeringFilter         `json:"filters"`
}

Steering holds information about a steering delivery service.

type SteeringFilter

type SteeringFilter struct {
	DeliveryService DeliveryServiceName `json:"deliveryService"`
	Pattern         string              `json:"pattern"`
}

SteeringFilter is a filter for a target delivery service.

type SteeringSteeringTarget

type SteeringSteeringTarget struct {
	Order           int32               `json:"order"`
	Weight          int32               `json:"weight"`
	DeliveryService DeliveryServiceName `json:"deliveryService"`
	GeoOrder        *int                `json:"geoOrder,omitempty"`
	Longitude       *float64            `json:"longitude,omitempty"`
	Latitude        *float64            `json:"latitude,omitempty"`
}

SteeringSteeringTarget is a target delivery service of a steering delivery service.

type SteeringTarget

type SteeringTarget struct {
	DeliveryService   DeliveryServiceName `json:"deliveryService" db:"deliveryservice_name"`
	DeliveryServiceID int                 `json:"deliveryServiceId" db:"deliveryservice"`
	Target            DeliveryServiceName `json:"target" db:"target_name"`
	TargetID          int                 `json:"targetId" db:"target"`
	Type              string              `json:"type" db:"type"`      // TODO enum?
	TypeID            int                 `json:"typeId" db:"type_id"` // TODO enum?
	Value             util.JSONIntStr     `json:"value" db:"value"`
}

type SteeringTargetNullable

type SteeringTargetNullable struct {
	DeliveryService   *DeliveryServiceName `json:"deliveryService" db:"deliveryservice_name"`
	DeliveryServiceID *uint64              `json:"deliveryServiceId" db:"deliveryservice"`
	Target            *DeliveryServiceName `json:"target" db:"target_name"`
	TargetID          *uint64              `json:"targetId" db:"target"`
	Type              *string              `json:"type" db:"type_name"` // TODO enum?
	TypeID            *int                 `json:"typeId" db:"type_id"` // TODO enum?
	Value             *util.JSONIntStr     `json:"value" db:"value"`
}

func (SteeringTargetNullable) Validate

func (st SteeringTargetNullable) Validate(tx *sql.Tx) error

type SteeringType

type SteeringType string
const (
	SteeringTypeOrder     SteeringType = "STEERING_ORDER"
	SteeringTypeWeight    SteeringType = "STEERING_WEIGHT"
	SteeringTypeGeoOrder  SteeringType = "STEERING_GEO_ORDER"
	SteeringTypeGeoWeight SteeringType = "STEERING_GEO_WEIGHT"
	SteeringTypeInvalid   SteeringType = ""
)

func SteeringTypeFromString

func SteeringTypeFromString(s string) SteeringType

func (SteeringType) String

func (t SteeringType) String() string

String returns a string representation of this steering type.

type SystemInfo

type SystemInfo struct {
	ParametersNullable map[string]string `json:"parameters"`
}

SystemInfo can hold arbitrary system information (e.g., as a Traffic Ops API response).

type TMCacheGroup

type TMCacheGroup struct {
	Name        string                `json:"name"`
	Coordinates MonitoringCoordinates `json:"coordinates"`
}

TMCacheGroup contains all of the information about a Cache Group necessary for Traffic Monitor to do its job of monitoring health and statistics.

type TMConfigResponse

type TMConfigResponse struct {
	Response TrafficMonitorConfig `json:"response"`
}

TMConfigResponse is the response to requests made to the cdns/{{Name}}/configs/monitoring endpoint of the Traffic Ops API.

type TMDeliveryService

type TMDeliveryService struct {
	XMLID              string `json:"xmlId"`
	TotalTPSThreshold  int64  `json:"TotalTpsThreshold"`
	ServerStatus       string `json:"status"`
	TotalKbpsThreshold int64  `json:"TotalKbpsThreshold"`
}

TMDeliveryService is all of the information about a Delivery Service necessary for Traffic Monitor to do its job of monitoring health and statistics.

type TMParameters

type TMParameters struct {
	HealthConnectionTimeout int    `json:"health.connection.timeout"`
	HealthPollingURL        string `json:"health.polling.url"`
	HealthPollingFormat     string `json:"health.polling.format"`
	HealthPollingType       string `json:"health.polling.type"`
	HistoryCount            int    `json:"history.count"`
	MinFreeKbps             int64
	Thresholds              map[string]HealthThreshold `json:"health_threshold"`
}

TMParameters is a structure containing all of the Parameters with special meaning to Traffic Monitor. For specifics regarding each Parameter, refer to the official documentation. TODO change TO to return this struct, so a custom UnmarshalJSON isn't necessary.

func (*TMParameters) UnmarshalJSON

func (params *TMParameters) UnmarshalJSON(bytes []byte) (err error)

UnmarshalJSON implements the encoding/json.Unmarshaler interface.

Example
const data = `{
		"health.connection.timeout": 5,
		"health.polling.url": "https://example.com/",
		"health.polling.format": "stats_over_http",
		"history.count": 1,
		"health.threshold.bandwidth": ">50",
		"health.threshold.foo": "<=500"
	}`

var params TMParameters
if err := json.Unmarshal([]byte(data), &params); err != nil {
	fmt.Printf("Failed to unmarshal: %v\n", err)
	return
}
fmt.Printf("timeout: %d\n", params.HealthConnectionTimeout)
fmt.Printf("url: %s\n", params.HealthPollingURL)
fmt.Printf("format: %s\n", params.HealthPollingFormat)
fmt.Printf("history: %d\n", params.HistoryCount)
fmt.Printf("# of Thresholds: %d - foo: %s, bandwidth: %s\n", len(params.Thresholds), params.Thresholds["foo"], params.Thresholds["bandwidth"])
Output:

timeout: 5
url: https://example.com/
format: stats_over_http
history: 1
# of Thresholds: 2 - foo: <=500.000000, bandwidth: >50.000000

type TMProfile

type TMProfile struct {
	Parameters TMParameters `json:"parameters"`
	Name       string       `json:"name"`
	Type       string       `json:"type"`
}

TMProfile is primarily a collection of the Parameters with special meaning to Traffic Monitor for a Profile of one of the monitored cache servers and/or other Traffic Monitors, along with some identifying information for the Profile.

type TOExtensionID

type TOExtensionID struct {
	ID int `json:"id"`
}

TOExtensionID ...

type TOExtensionNullable

type TOExtensionNullable struct {
	ID                    *int       `json:"id" db:"id"`
	Name                  *string    `json:"name" db:"name"`
	Version               *string    `json:"version" db:"version"`
	InfoURL               *string    `json:"info_url" db:"info_url"`
	ScriptFile            *string    `json:"script_file" db:"script_file"`
	IsActive              *int       `json:"isactive" db:"isactive"`
	AdditionConfigJSON    *string    `json:"additional_config_json" db:"additional_config_json"`
	Description           *string    `json:"description" db:"description"`
	ServercheckShortName  *string    `json:"servercheck_short_name" db:"servercheck_short_name"`
	ServercheckColumnName *string    `json:"-" db:"servercheck_column_name"`
	Type                  *string    `json:"type" db:"type_name"`
	TypeID                *int       `json:"-" db:"type"`
	LastUpdated           *TimeNoMod `json:"-" db:"last_updated"`
}

TOExtensionNullable represents a TO extension used by Traffic Ops.

func (*TOExtensionNullable) Validate

func (e *TOExtensionNullable) Validate(tx *sql.Tx) error

Validate ensures that the TOExtensionNullable request body is valid for creation.

type TOExtensionPostResponse

type TOExtensionPostResponse struct {
	Response TOExtensionID `json:"supplemental"`
	Alerts
}

TOExtensionPostResponse represents the response from Traffic Ops when creating TOExtension.

type TOExtensionResponse

type TOExtensionResponse struct {
	Response []TOExtensionNullable `json:"response"`
	Alerts
}

TOExtensionResponse represents the response from Traffic Ops when getting TOExtension.

type TRDeliveryService

type TRDeliveryService struct {
	XMLID             string            `json:"xmlId"`
	Domains           []string          `json:"domains"`
	RoutingName       string            `json:"routingName"`
	MissLocation      MissLocation      `json:"missCoordinates"`
	CoverageZoneOnly  bool              `json:"coverageZoneOnly"`
	MatchSets         []MatchSet        `json:"matchSets"`
	TTL               int               `json:"ttl"`
	TTLs              TTLS              `json:"ttls"`
	BypassDestination BypassDestination `json:"bypassDestination"`
	StatcDNSEntries   []StaticDNS       `json:"statitDnsEntries"`
	Soa               SOA               `json:"soa"`
}

TRDeliveryService ... TODO JvD: move to deliveryservice.go ??

type TTLS

type TTLS struct {
	Arecord    int `json:"A"`
	SoaRecord  int `json:"SOA"`
	NsRecord   int `json:"NS"`
	AaaaRecord int `json:"AAAA"`
}

TTLS ...

type Tenant

type Tenant struct {
	Active      bool      `json:"active"`
	ID          int       `json:"id"`
	LastUpdated TimeNoMod `json:"lastUpdated" db:"last_updated"`
	Name        string    `json:"name"`
	ParentID    int       `json:"parentId"`
	ParentName  string    `json:"parentName,omitempty" db:"parent_name"`
}

Tenant ...

type TenantAlert

type TenantAlert struct {
	Level string `json:"level"`
	Text  string `json:"text"`
}

TenantAlert ...

type TenantNullable

type TenantNullable struct {
	ID          *int       `json:"id" db:"id"`
	Name        *string    `json:"name" db:"name"`
	Active      *bool      `json:"active" db:"active"`
	LastUpdated *TimeNoMod `json:"lastUpdated" db:"last_updated"`
	ParentID    *int       `json:"parentId" db:"parent_id"`
	ParentName  *string    `json:"parentName,omitempty" db:"parent_name"`
}

TenantNullable ...

type TenantResponse

type TenantResponse struct {
	Response Tenant        `json:"response"`
	Alerts   []TenantAlert `json:"alerts"`
}

TenantResponse is the response to a create/update

type Time

type Time struct {
	time.Time
	Valid bool
}

Time wraps standard time.Time to allow indication of invalid times

func (Time) MarshalJSON

func (t Time) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface.

Time structures marshal in the format defined by TimeLayout.

func (*Time) Scan

func (t *Time) Scan(value interface{}) error

Scan implements the database/sql Scanner interface.

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON implements the json.Unmarshaller interface

Time structures accept both RFC3339-compliant date/time strings as well as the format defined by TimeLayout and Unix(-ish) timestamps. Timestamps are expected to be integer numbers that represend milliseconds since Jan 1, 1970 00:00:00.000 UTC

func (Time) Value

func (t Time) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type TimeNoMod

type TimeNoMod Time

TimeNoMod supported JSON marshalling, but suppresses JSON unmarshalling

func NewTimeNoMod

func NewTimeNoMod() *TimeNoMod

NewTimeNoMod returns the address of a TimeNoMod.

func (TimeNoMod) MarshalJSON

func (t TimeNoMod) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaller interface

func (*TimeNoMod) Scan

func (t *TimeNoMod) Scan(value interface{}) error

Scan implements the database/sql Scanner interface.

func (*TimeNoMod) UnmarshalJSON

func (t *TimeNoMod) UnmarshalJSON([]byte) (err error)

UnmarshalJSON for TimeNoMod suppresses unmarshalling

func (TimeNoMod) Value

func (t TimeNoMod) Value() (driver.Value, error)

Value implements the database/sql/driver Valuer interface.

type TimeStamp

type TimeStamp time.Time

TimeStamp holds the current time with nanosecond precision. It is unused.

type TopologiesQueueUpdate

type TopologiesQueueUpdate struct {
	Action   string       `json:"action"`
	CDNID    int64        `json:"cdnId"`
	Topology TopologyName `json:"topology"`
}

TopologiesQueueUpdate decodes the update data from the POST topologies/{{name}}/queue_update endpoint.

type TopologiesQueueUpdateRequest

type TopologiesQueueUpdateRequest struct {
	Action string `json:"action"`
	CDNID  int64  `json:"cdnId"`
}

TopologiesQueueUpdateRequest encodes the request data for the POST topologies/{{name}}/queue_update endpoint.

type TopologiesQueueUpdateResponse

type TopologiesQueueUpdateResponse struct {
	TopologiesQueueUpdate `json:"response"`
	Alerts
}

TopologiesQueueUpdateResponse encodes the response data for the POST topologies/{{name}}/queue_update endpoint.

type TopologiesResponse

type TopologiesResponse struct {
	Response []Topology `json:"response"`
	Alerts
}

TopologiesResponse models the JSON object returned for a list of topologies in a response.

type Topology

type Topology struct {
	Description string         `json:"description" db:"description"`
	Name        string         `json:"name" db:"name"`
	Nodes       []TopologyNode `json:"nodes"`
	LastUpdated *TimeNoMod     `json:"lastUpdated" db:"last_updated"`
}

Topology holds the name and set of TopologyNodes that comprise a flexible topology.

type TopologyName

type TopologyName string

TopologyName is the name of a topology of cachegroups.

type TopologyNode

type TopologyNode struct {
	Id          int        `json:"-" db:"id"`
	Cachegroup  string     `json:"cachegroup" db:"cachegroup"`
	Parents     []int      `json:"parents"`
	LastUpdated *TimeNoMod `json:"-" db:"last_updated"`
}

TopologyNode holds a reference to a cachegroup and the indices of up to 2 parent nodes in the same topology's array of nodes.

type TopologyResponse

type TopologyResponse struct {
	Response Topology `json:"response"`
	Alerts
}

TopologiesResponse models the JSON object returned for a single topology in a response.

type TrafficCacheStatsConfig

type TrafficCacheStatsConfig struct {
	CDN string
	TrafficStatsConfig
}

TrafficCacheStatsConfig represents the configuration of a request made to Traffic Stats for caches

type TrafficDSStatsConfig

type TrafficDSStatsConfig struct {
	DeliveryService string
	TrafficStatsConfig
}

TrafficDSStatsConfig represents the configuration of a request made to Traffic Stats for delivery services

type TrafficDSStatsResponse

type TrafficDSStatsResponse struct {
	// Series holds the actual data - it is NOT in general the same as a github.com/influxdata/influxdb1-client/models.Row
	Series *TrafficStatsSeries `json:"series,omitempty"`
	// Summary contains summary statistics of the data in Series
	Summary *TrafficDSStatsSummary `json:"summary,omitempty"`
}

TrafficDSStatsResponse represents a response from the deliveryservice_stats` "Traffic Stats" endpoints.

type TrafficDSStatsResponseV1

type TrafficDSStatsResponseV1 struct {
	// Series holds the actual data - it is NOT in general the same as a github.com/influxdata/influxdb1-client/models.Row
	Series *TrafficStatsSeries `json:"series,omitempty"`
	// Summary contains summary statistics of the data in Series
	Summary *LegacyTrafficDSStatsSummary `json:"summary,omitempty"`
	// Source has an unknown purpose. I believe this is supposed to name the "plugin" that provided
	// the data - kept for compatibility with the Perl version(s) of the "Traffic Stats endpoints".
	Source string `json:"source"`
	// Version is supposed to represent the API version - but actually the API just reports a static
	// number (TRAFFIC_STATS_VERSION).
	Version string `json:"version"`
}

TrafficDSStatsResponseV1 represents a response from the deliveryservice_stats "Traffic Stats" endpoints. It contains the deprecated, legacy fields "Source" and "Version"

type TrafficDSStatsSummary

type TrafficDSStatsSummary struct {
	TrafficStatsSummary
	// TotalKiloBytes is the total number of kilobytes served when the "metric type" requested is "kbps"
	// (or actually just contains "kbps"). If this is not nil, TotalTransactions *should* always be
	// nil.
	TotalKiloBytes *float64 `json:"totalKiloBytes"`
	// Totaltransactions is the total number of transactions within the requested window. Whenever
	// the requested metric doesn't contain "kbps", it assumed to be some kind of transactions
	// measurement. In that case, this will not be nil - otherwise it will be nil. If this not nil,
	// TotalBytes *should* always be nil.
	TotalTransactions *float64 `json:"totalTransactions"`
}

TrafficDSStatsSummary contains summary statistics for a data series for deliveryservice stats.

type TrafficMonitor

type TrafficMonitor struct {
	// Port is the port on which the Traffic Monitor listens for HTTP requests.
	Port int `json:"port"`
	// IP6 is the Traffic Monitor's IPv6 address.
	IP6 string `json:"ip6"`
	// IP is the Traffic Monitor's IPv4 address.
	IP string `json:"ip"`
	// HostName is the Traffic Monitor's hostname.
	HostName string `json:"hostName"`
	// FQDN is the Fully Qualified Domain Name of the Traffic Monitor server.
	FQDN string `json:"fqdn"`
	// Profile is the Name of the Profile used by the Traffic Monitor.
	Profile string `json:"profile"`
	// Location is the Name of the Cache Group to which the Traffic Monitor
	// belongs - called "Location" for legacy reasons.
	Location string `json:"location"`
	// ServerStatus is the Name of the Status of the Traffic Monitor.
	ServerStatus string `json:"status"`
}

TrafficMonitor is a structure containing enough information about a Traffic Monitor instance for another Traffic Monitor to use it for quorums and peer polling.

type TrafficMonitorConfig

type TrafficMonitorConfig struct {
	// TrafficServers is the set of all Cache Servers which should be monitored
	// by the Traffic Monitor.
	TrafficServers []TrafficServer `json:"trafficServers,omitempty"`
	// CacheGroups is a collection of Cache Group Names associated with their
	// geographic coordinates, for use in determining Cache Group availability.
	CacheGroups []TMCacheGroup `json:"cacheGroups,omitempty"`
	// Config is a mapping of arbitrary configuration parameters to their
	// respective values. While there is no defined structure to this map,
	// certain configuration parameters have specifically defined semantics
	// which may be found in the Traffic Monitor documentation.
	Config map[string]interface{} `json:"config,omitempty"`
	// TrafficMonitors is the set of ALL Traffic Monitors (including whatever
	// Traffic Monitor requested the endpoint (if indeed one did)) which is
	// used to determine quorum and peer polling behavior.
	TrafficMonitors []TrafficMonitor `json:"trafficMonitors,omitempty"`
	// DeliveryServices is the set of all Delivery Services within the
	// monitored CDN, which are used to determine Delivery Service-level
	// statistics.
	DeliveryServices []TMDeliveryService `json:"deliveryServices,omitempty"`
	// Profiles is the set of Profiles in use by any and all monitored cache
	// servers (those given in TrafficServers), which are stored here to
	// avoid potentially lengthy reiteration.
	Profiles []TMProfile `json:"profiles,omitempty"`
}

TrafficMonitorConfig is the full set of information needed by Traffic Monitor to do its job of monitoring health and statistics of cache servers.

func (*TrafficMonitorConfig) ToLegacyConfig

func (tmc *TrafficMonitorConfig) ToLegacyConfig() LegacyTrafficMonitorConfig

ToLegacyConfig converts TrafficMonitorConfig to LegacyTrafficMonitorConfig.

type TrafficMonitorConfigMap

type TrafficMonitorConfigMap struct {
	// TrafficServer is a map of cache server hostnames to TrafficServer
	// objects.
	//
	// WARNING: Cache server hostnames are NOT guaranteed to be unique, so when
	// more than one cache server with the same hostname exists, the two CANNOT
	// coexist within this structure; only one will appear and, when
	// constructed using TrafficMonitorTransformToMap, which cache server does
	// exist in the generated map is undefined.
	TrafficServer map[string]TrafficServer
	// CacheGroup is a map of Cache Group Names to TMCacheGroup objects.
	CacheGroup map[string]TMCacheGroup
	// Config is a mapping of arbitrary configuration parameters to their
	// respective values. While there is no defined structure to this map,
	// certain configuration parameters have specifically defined semantics
	// which may be found in the Traffic Monitor documentation.
	Config map[string]interface{}
	// TrafficMonitor is a map of Traffic Monitor hostnames to TrafficMonitor
	// objects.
	//
	// WARNING: Traffic Monitor hostnames are NOT guaranteed to be unique, so
	// when more than one cache server with the same hostname exists, the two
	// CANNOT coexist within this structure; only one will appear and, when
	// constructed using TrafficMonitorTransformToMap, which Traffic Monitor
	// does exist in the generated map is undefined.
	TrafficMonitor map[string]TrafficMonitor
	// DeliveryService is a map of Delivery Service XMLIDs to TMDeliveryService
	// objects.
	DeliveryService map[string]TMDeliveryService
	// Profile is a map of Profile Names to TMProfile objects.
	Profile map[string]TMProfile
}

TrafficMonitorConfigMap is a representation of a TrafficMonitorConfig using unique values as map keys.

func TrafficMonitorTransformToMap

func TrafficMonitorTransformToMap(tmConfig *TrafficMonitorConfig) (*TrafficMonitorConfigMap, error)

func (*TrafficMonitorConfigMap) Valid

func (cfg *TrafficMonitorConfigMap) Valid() error

Valid returns a non-nil error if the configuration map is invalid.

A configuration map is considered invalid if: - It is nil - It has no CacheGroups - It has no Profiles - It has no Traffic Monitors - It has no Traffic Servers - The Config mapping has no 'peers.polling.interval' key - The Config mapping has no 'health.polling.interval' key

Example
mc := &TrafficMonitorConfigMap{
	CacheGroup: map[string]TMCacheGroup{"a": {}},
	Config: map[string]interface{}{
		"peers.polling.interval":  0.0,
		"health.polling.interval": 0.0,
	},
	DeliveryService: map[string]TMDeliveryService{"a": {}},
	Profile:         map[string]TMProfile{"a": {}},
	TrafficMonitor:  map[string]TrafficMonitor{"a": {}},
	TrafficServer:   map[string]TrafficServer{"a": {}},
}

fmt.Printf("Validity error: %v", mc.Valid())
Output:

Validity error: <nil>

type TrafficMonitorName

type TrafficMonitorName string

TrafficMonitorName is the hostname of a Traffic Monitor peer.

func (TrafficMonitorName) String

func (t TrafficMonitorName) String() string

type TrafficRouter

type TrafficRouter struct {
	Port         int    `json:"port"`
	IP6          string `json:"ip6"`
	IP           string `json:"ip"`
	FQDN         string `json:"fqdn"`
	Profile      string `json:"profile"`
	Location     string `json:"location"`
	ServerStatus string `json:"status"`
	APIPort      int    `json:"apiPort"`
}

TrafficRouter ...

type TrafficRouterConfig

type TrafficRouterConfig struct {
	TrafficServers   []TrafficServer        `json:"trafficServers,omitempty"`
	TrafficMonitors  []TrafficMonitor       `json:"trafficMonitors,omitempty"`
	TrafficRouters   []TrafficRouter        `json:"trafficRouters,omitempty"`
	CacheGroups      []TMCacheGroup         `json:"cacheGroups,omitempty"`
	DeliveryServices []TRDeliveryService    `json:"deliveryServices,omitempty"`
	Stats            map[string]interface{} `json:"stats,omitempty"`
	Config           map[string]interface{} `json:"config,omitempty"`
}

TrafficRouterConfig is the json unmarshalled without any changes note all structs are local to this file _except_ the TrafficRouterConfig struct.

type TrafficRouterConfigMap

type TrafficRouterConfigMap struct {
	TrafficServer   map[string]TrafficServer
	TrafficMonitor  map[string]TrafficMonitor
	TrafficRouter   map[string]TrafficRouter
	CacheGroup      map[string]TMCacheGroup
	DeliveryService map[string]TRDeliveryService
	Config          map[string]interface{}
	Stat            map[string]interface{}
}

TrafficRouterConfigMap ...

type TrafficServer

type TrafficServer struct {
	CacheGroup       string                `json:"cacheGroup"`
	DeliveryServices []tsdeliveryService   `json:"deliveryServices,omitempty"` // the deliveryServices key does not exist on mids
	FQDN             string                `json:"fqdn"`
	HashID           string                `json:"hashId"`
	HostName         string                `json:"hostName"`
	HTTPSPort        int                   `json:"httpsPort,omitempty"`
	Interfaces       []ServerInterfaceInfo `json:"interfaces"`
	Port             int                   `json:"port"`
	Profile          string                `json:"profile"`
	ServerStatus     string                `json:"status"`
	Type             string                `json:"type"`
}

TrafficServer represents a cache server for use by Traffic Monitor and Traffic Router instances.

func (*TrafficServer) IPv4

func (ts *TrafficServer) IPv4() string

IPv4 gets the server's IPv4 address if one exists, otherwise an empty string.

Note: This swallows errors from the legacy data conversion process.

Example
server := TrafficServer{
	Interfaces: []ServerInterfaceInfo{
		{
			IPAddresses: []ServerIPAddress{
				{
					Address:        "192.0.2.1",
					ServiceAddress: true,
				},
				{
					Address:        "192.0.2.2",
					ServiceAddress: false,
				},
			},
			Monitor: true,
		},
		{
			IPAddresses: []ServerIPAddress{
				{
					Address:        "192.0.2.3",
					ServiceAddress: false,
				},
			},
			Monitor: true,
		},
	},
}

fmt.Println(server.IPv4())
Output:

192.0.2.1

func (*TrafficServer) IPv6

func (ts *TrafficServer) IPv6() string

IPv6 gets the server's IPv6 address if one exists, otherwise an empty string.

Note: This swallows errors from the legacy data conversion process.

Example
server := TrafficServer{
	Interfaces: []ServerInterfaceInfo{
		{
			IPAddresses: []ServerIPAddress{
				{
					Address:        "2001:DB8::1",
					ServiceAddress: false,
				},
				{
					Address:        "2001:DB8::2",
					ServiceAddress: false,
				},
			},
			Monitor: true,
		},
		{
			IPAddresses: []ServerIPAddress{
				{
					Address:        "2001:DB8::3",
					ServiceAddress: true,
				},
			},
			Monitor: true,
		},
	},
}

fmt.Println(server.IPv6())
Output:

2001:DB8::3

func (*TrafficServer) ToLegacyServer

func (ts *TrafficServer) ToLegacyServer() LegacyTrafficServer

ToLegacyServer converts a TrafficServer to LegacyTrafficServer.

type TrafficStatsCDNStats

type TrafficStatsCDNStats struct {
	Bandwidth    *float64 `json:"bandwidth"`
	Capacity     *float64 `json:"capacity"`
	CDN          string   `json:"cdn"`
	Connnections *float64 `json:"connections"`
}

TrafficStatsCDNStats contains summary statistics for a given CDN

type TrafficStatsCDNStatsResponse

type TrafficStatsCDNStatsResponse struct {
	Response []TrafficStatsCDNsStats `json:"response"`
}

TrafficStatsCDNStatsResponse contains response for getting current stats

type TrafficStatsCDNsStats

type TrafficStatsCDNsStats struct {
	Stats []TrafficStatsCDNStats `json:"currentStats"`
}

TrafficStatsCDNsStats contains a list of CDN summary statistics

type TrafficStatsConfig

type TrafficStatsConfig struct {
	End            time.Time
	ExcludeSeries  bool
	ExcludeSummary bool
	Interval       string
	Limit          *uint64
	MetricType     string
	Offset         *uint64
	OrderBy        *TrafficStatsOrderable
	Start          time.Time
	Unix           bool
}

TrafficStatsConfig represents the configuration of a request made to Traffic Stats. This is typically constructed by parsing a request body submitted to Traffic Ops.

func (*TrafficStatsConfig) OffsetString

func (c *TrafficStatsConfig) OffsetString() string

OffsetString is a stupid, dirty hack to try to convince Influx to not giveback data that's outside of the range in a WHERE clause. It doesn't work, but it helps. (https://github.com/influxdata/influxdb/issues/8010)

type TrafficStatsExclude

type TrafficStatsExclude string

TrafficStatsExclude encodes what parts of a response to a request to a "Traffic Stats" endpoint of the TO API may be omitted.

const (
	// ExcludeSeries can be used to omit the data series from a response.
	ExcludeSeries TrafficStatsExclude = "series"

	// ExcludeSummary can be used to omit the summary series from a response.
	ExcludeSummary TrafficStatsExclude = "summary"

	// ExcludeInvalid can be used if the the key that you want to exclude fails
	// validation.
	ExcludeInvalid TrafficStatsExclude = "INVALID"
)

func ExcludeFromString

func ExcludeFromString(v string) TrafficStatsExclude

ExcludeFromString parses the passed string and returns the corresponding value as a TrafficStatsExclude.

type TrafficStatsOrderable

type TrafficStatsOrderable string

TrafficStatsOrderable encodes what columns by which the data returned from a Traffic Stats query may be ordered.

const (
	// TimeOrder indicates an ordering by time at which the measurement was taken
	TimeOrder TrafficStatsOrderable = "time"
)

func OrderableFromString

func OrderableFromString(v string) *TrafficStatsOrderable

OrderableFromString parses the passed string and returns the corresponding value as a pointer to a TrafficStatsOrderable - or nil if the value was invalid.

type TrafficStatsResponse

type TrafficStatsResponse struct {
	// Series holds the actual data - it is NOT in general the same as a github.com/influxdata/influxdb1-client/models.Row
	Series *TrafficStatsSeries `json:"series,omitempty"`
	// Summary contains summary statistics of the data in Series
	Summary *TrafficStatsSummary `json:"summary,omitempty"`
}

TrafficStatsResponse represents the generic response from one of the "Traffic Stats endpoints" of the Traffic Ops API, e.g. `/cache_stats`.

type TrafficStatsSeries

type TrafficStatsSeries struct {
	// Columns is a list of column names. Each "row" in Values is ordered to match up with these
	// column names.
	Columns []string `json:"columns"`
	// Count is the total number of returned data points. Should be the same as len(Values)
	Count uint `json:"count"`
	// Name is the name of the InfluxDB database from which the data was retrieved
	Name string `json:"name"`
	// Tags is a set of InfluxDB tags associated with the requested database.
	Tags map[string]string `json:"tags"`
	// Values is an array of rows of arbitrary data that can only really be interpreted by
	// inspecting Columns, in general. In practice, however, each element is nearly always a
	// slice where the first element is an RFC3339 timestamp (as a string) and the second/final
	// element is a floating point number (or nil) indicating the value at that time.
	Values [][]interface{} `json:"values"`
}

TrafficStatsSeries is the actual data returned by a request to a "Traffic Stats endpoint".

func (TrafficStatsSeries) FormatTimestamps

func (s TrafficStatsSeries) FormatTimestamps() error

FormatTimestamps formats the timestamps contained in the Values array as RFC3339 strings. This returns an error if the data is not in the expected format.

type TrafficStatsSummary

type TrafficStatsSummary struct {
	// Average is calculated as an arithmetic mean
	Average float64 `json:"average"`
	// Count is the total number of data points _except_ for any values that would appear as 'nil'
	// in the corresponding series
	Count                  uint    `json:"count"`
	FifthPercentile        float64 `json:"fifthPercentile"`
	Max                    float64 `json:"max"`
	Min                    float64 `json:"min"`
	NinetyEighthPercentile float64 `json:"ninetyEighthPercentile"`
	NinetyFifthPercentile  float64 `json:"ninetyFifthPercentile"`
}

TrafficStatsSummary contains summary statistics for a data series.

type TrafficStatsTotalStats

type TrafficStatsTotalStats struct {
	Bandwidth    *float64 `json:"bandwidth"`
	CDN          string   `json:"cdn"`
	Connnections *float64 `json:"connections"`
}

TrafficStatsTotalStats contains summary statistics across CDNs Different then TrafficStatsCDNStats as it omits Capacity

type Type

type Type struct {
	ID          int       `json:"id"`
	LastUpdated TimeNoMod `json:"lastUpdated"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
	UseInTable  string    `json:"useInTable"`
}

Type contains information about a given Type in Traffic Ops.

type TypeNullable

type TypeNullable struct {
	ID          *int       `json:"id" db:"id"`
	LastUpdated *TimeNoMod `json:"lastUpdated" db:"last_updated"`
	Name        *string    `json:"name" db:"name"`
	Description *string    `json:"description" db:"description"`
	UseInTable  *string    `json:"useInTable" db:"use_in_table"`
}

TypeNullable contains information about a given Type in Traffic Ops.

type TypesResponse

type TypesResponse struct {
	Response []Type `json:"response"`
	Alerts
}

TypesResponse ...

type URLSigKeys

type URLSigKeys map[string]string

type UpdateCDNFederationResponse

type UpdateCDNFederationResponse struct {
	Response CDNFederation `json:"response"`
	Alerts
}

UpdateCDNFederationResponse represents a Traffic Ops API response to a request to replace a Federation of a CDN with the one provided in the request body.

type UpdateDeliveryServiceNullableResponse

type UpdateDeliveryServiceNullableResponse struct {
	Response []DeliveryServiceNullable `json:"response"`
	Alerts
}

UpdateDeliveryServiceNullableResponse ... Deprecated: Please only use the versioned structures.

type UpdateDeliveryServiceResponse

type UpdateDeliveryServiceResponse struct {
	Response []DeliveryService `json:"response"`
	Alerts
}

UpdateDeliveryServiceResponse ... Deprecated: use UpdateDeliveryServiceNullableResponse instead

type UpdateUserResponse

type UpdateUserResponse struct {
	Response User `json:"response"`
	Alerts
}

UpdateUserResponse can hold a Traffic Ops API response to a PUT request to update a user.

type User

type User struct {
	Username             *string    `json:"username" db:"username"`
	RegistrationSent     *TimeNoMod `json:"registrationSent" db:"registration_sent"`
	LocalPassword        *string    `json:"localPasswd,omitempty" db:"local_passwd"`
	ConfirmLocalPassword *string    `json:"confirmLocalPasswd,omitempty" db:"confirm_local_passwd"`
	// NOTE: RoleName db:"-" tag is required due to clashing with the DB query here:
	// https://github.com/apache/trafficcontrol/blob/3b5dd406bf1a0bb456c062b0f6a465ec0617d8ef/traffic_ops/traffic_ops_golang/user/user.go#L197
	// It's done that way in order to maintain "rolename" vs "roleName" JSON field capitalization for the different users APIs.
	// TODO: make the breaking API change to make all user APIs use "roleName" consistently.
	RoleName *string `json:"roleName,omitempty" db:"-"`
	// contains filtered or unexported fields
}

User fields in v14 have been updated to be nullable

type UserAvailableDS

type UserAvailableDS struct {
	ID          *int    `json:"id" db:"id"`
	DisplayName *string `json:"displayName" db:"display_name"`
	XMLID       *string `json:"xmlId" db:"xml_id"`
	TenantID    *int    `json:"-"` // tenant is necessary to check authorization, but not serialized
}

type UserCredentials

type UserCredentials struct {
	Username string `json:"u"`
	Password string `json:"p"`
}

UserCredentials contains Traffic Ops login credentials

type UserCurrent

type UserCurrent struct {
	UserName  *string `json:"username"`
	LocalUser *bool   `json:"localUser"`
	RoleName  *string `json:"roleName"`
	// contains filtered or unexported fields
}

UserCurrent represents the profile for the authenticated user

type UserCurrentResponse

type UserCurrentResponse struct {
	Response UserCurrent `json:"response"`
	Alerts
}

UserCurrentResponse can hold a Traffic Ops API response to a request to get or update the current user.

type UserDeliveryServiceDeleteResponse

type UserDeliveryServiceDeleteResponse struct {
	Alerts
}

UserDeliveryServiceDeleteResponse can hold a Traffic Ops API response to a request to remove a delivery service from a user.

type UserDeliveryServicePostResponse

type UserDeliveryServicePostResponse struct {
	Alerts   []Alert                 `json:"alerts"`
	Response DeliveryServiceUserPost `json:"response"`
}

type UserDeliveryServicesNullableResponse

type UserDeliveryServicesNullableResponse struct {
	Response []DeliveryServiceNullable `json:"response"`
}

type UserInvalidationJob

type UserInvalidationJob struct {

	// Agent is unused, and developers should never count on it containing or meaning anything.
	Agent    *uint   `json:"agent"`
	AssetURL *string `json:"assetUrl"`

	// AssetType is unused, and developers should never count on it containing or meaning anything.
	AssetType       *string `json:"assetType"`
	DeliveryService *string `json:"deliveryService"`
	EnteredTime     *Time   `json:"enteredTime"`
	ID              *uint   `json:"id"`
	Keyword         *string `json:"keyword"`

	// ObjectName is unused, and developers should never count on it containing or meaning anything.
	ObjectName *string `json:"objectName"`

	// ObjectType is unused, and developers should never count on it containing or meaning anything.
	ObjectType *string `json:"objectType"`
	Parameters *string `json:"parameters"`
	Username   *string `json:"username"`
}

UserInvalidationJob is a full representation of content invalidation jobs as stored in the database, including several unused fields.

type UserInvalidationJobInput

type UserInvalidationJobInput struct {
	DSID  *uint   `json:"dsId"`
	Regex *string `json:"regex"`

	// StartTime is the time at which the job will come into effect. Must be in the future, but will
	// fail to Validate if it is further in the future than two days.
	StartTime *Time   `json:"startTime"`
	TTL       *uint64 `json:"ttl"`
	Urgent    *bool   `json:"urgent"`
}

UserInvalidationJobInput Represents legacy-style user input to the /user/current/jobs API endpoint. This is much less flexible than InvalidationJobInput, which should be used instead when possible.

func (*UserInvalidationJobInput) Validate

func (job *UserInvalidationJobInput) Validate(tx *sql.Tx) error

Validate validates that the user input is correct, given a transaction connected to the Traffic Ops database.

This requires a database transaction to check that the DSID is a valid identifier for an existing Delivery Service.

Returns an error describing any and all problematic fields encountered during validation.

type UserPasswordResetRequest

type UserPasswordResetRequest struct {
	Email rfc.EmailAddress `json:"email"`
}

UserPasswordResetRequest can hold Traffic Ops API request to reset a user's password.

type UserRegistrationRequest

type UserRegistrationRequest struct {
	Email rfc.EmailAddress `json:"email"`
	// Role - despite being named "Role" - is actually merely the *ID* of a Role to give the new user.
	Role     uint `json:"role"`
	TenantID uint `json:"tenantId"`
}

UserRegistrationRequest is the request submitted by operators when they want to register a new user.

func (*UserRegistrationRequest) Validate

func (urr *UserRegistrationRequest) Validate(tx *sql.Tx) error

Validate implements the github.com/apache/trafficcontrol/traffic_ops/traffic_ops_golang/api.ParseValidator interface.

type UserToken

type UserToken struct {
	Token string `json:"t"`
}

UserToken represents a request payload containing a UUID token for authentication

type UserV13

type UserV13 struct {
	Username         string    `json:"username"`
	PublicSSHKey     string    `json:"publicSshKey"`
	Role             int       `json:"role"`
	RoleName         string    `json:"rolename"`
	ID               int       `json:"id"`
	UID              int       `json:"uid"`
	GID              int       `json:"gid"`
	Company          string    `json:"company"`
	Email            string    `json:"email"`
	FullName         string    `json:"fullName"`
	NewUser          bool      `json:"newUser"`
	LastUpdated      string    `json:"lastUpdated"`
	AddressLine1     string    `json:"addressLine1"`
	AddressLine2     string    `json:"addressLine2"`
	City             string    `json:"city"`
	Country          string    `json:"country"`
	PhoneNumber      string    `json:"phoneNumber"`
	PostalCode       string    `json:"postalCode"`
	RegistrationSent TimeNoMod `json:"registrationSent"`
	StateOrProvince  string    `json:"stateOrProvince"`
	Tenant           string    `json:"tenant"`
	TenantID         int       `json:"tenantId"`
}

UserV13 contains non-nullable TO user information

type UsersResponse

type UsersResponse struct {
	Response []User `json:"response"`
	Alerts
}

UsersResponse can hold a Traffic Ops API response to a request to get a list of users.

type UsersResponseV13

type UsersResponseV13 struct {
	Response []UserV13 `json:"response"`
	Alerts
}

UsersResponseV13 is the Traffic Ops API version 1.3 variant of UserResponse. It is unused.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL