Documentation ¶
Overview ¶
toreqnew implements a Traffic Ops client vendored one version back.
This should be used for all requests, unless they require an endpoint or field added in the latest version.
If a feature in the latest Traffic Ops is required, toreqnew should be used with a fallback to this client if the Traffic Ops is not the latest (which can be determined by the bool returned by all toreqnew.TOClient funcs).
Index ¶
- Constants
- func GetTOToolNameAndURL(globalParams []tc.Parameter) (string, string)
- func MaybeIPStr(addr net.Addr) string
- type TOClient
- func (cl *TOClient) Cookies(url *url.URL) string
- func (cl *TOClient) GetCDN(cdnName tc.CDNName) (tc.CDN, net.Addr, error)
- func (cl *TOClient) GetCDNDeliveryServices(cdnID int) ([]atscfg.DeliveryService, net.Addr, error)
- func (cl *TOClient) GetCDNSSLKeys(cdnName tc.CDNName) ([]tc.CDNSSLKeys, net.Addr, error)
- func (cl *TOClient) GetCacheGroups() ([]tc.CacheGroupNullable, net.Addr, error)
- func (cl *TOClient) GetConfigFileParameters(configFile string) ([]tc.Parameter, net.Addr, error)
- func (cl *TOClient) GetDeliveryServiceRegexes() ([]tc.DeliveryServiceRegexes, net.Addr, error)
- func (cl *TOClient) GetDeliveryServiceRequiredCapabilitiesByID(dsIDs []int) (map[int]map[atscfg.ServerCapability]struct{}, net.Addr, error)
- func (cl *TOClient) GetDeliveryServiceServers(dsIDs []int, serverIDs []int) ([]tc.DeliveryServiceServer, net.Addr, error)
- func (cl *TOClient) GetGlobalParameters() ([]tc.Parameter, net.Addr, error)
- func (cl *TOClient) GetJobs() ([]tc.Job, net.Addr, error)
- func (cl *TOClient) GetParametersByName(paramName string) ([]tc.Parameter, net.Addr, error)
- func (cl *TOClient) GetProfileByName(profileName string) (tc.Profile, net.Addr, error)
- func (cl *TOClient) GetServerByHostName(serverHostName string) (*atscfg.Server, net.Addr, error)
- func (cl *TOClient) GetServerCapabilitiesByID(serverIDs []int) (map[int]map[atscfg.ServerCapability]struct{}, net.Addr, error)
- func (cl *TOClient) GetServerProfileParameters(profileName string) ([]tc.Parameter, net.Addr, error)
- func (cl *TOClient) GetServerUpdateStatus(cacheHostName tc.CacheName) (tc.ServerUpdateStatus, net.Addr, error)
- func (cl *TOClient) GetServers() ([]atscfg.Server, net.Addr, error)
- func (cl *TOClient) GetStatuses() ([]tc.Status, net.Addr, error)
- func (cl *TOClient) GetURISigningKeys(dsName string) ([]byte, net.Addr, error)
- func (cl *TOClient) GetURLSigKeys(dsName string) (tc.URLSigKeys, net.Addr, error)
Constants ¶
const DeliveryServiceServersAlwaysGetAll = true
DeliveryServiceServersAlwaysGetAll indicates whether to always get all delivery service servers from Traffic Ops, and cache all in a file (but still return to the caller only the objects they requested). This exists and is currently true, because with an ORT run, it's typically more efficient to get them all in a single request, and re-use that cache; than for every config file to get and cache its own unique set. If your use case is more efficient to only get the needed objects, for example if you're frequently requesting one file, set this false to get and cache the specific needed delivery services and servers.
Variables ¶
This section is empty.
Functions ¶
func GetTOToolNameAndURL ¶
func MaybeIPStr ¶
MaybeIPStr returns the addr string if it isn't nil, or the empty string if it is. This is intended for logging, to allow logging with one line, whether addr is nil or not.
Types ¶
type TOClient ¶
func New ¶
func New(url *url.URL, user string, pass string, insecure bool, timeout time.Duration, userAgent string) (*TOClient, error)
New logs into Traffic Ops, returning the TOClient which contains the logged-in client.
func (*TOClient) Cookies ¶
Cookies returns the HTTP session cookies from the client. It does not do any kind of validation, but assumes the HTTP cookies exist from a prior login and are valid for a Traffic Ops session. The url is the Traffic Ops URL, and should match this client's Traffic Ops URL, and the URL of the new client this session cookie is presumably being fetched for.