toreqnew

package
v5.1.4+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2021 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 13 Imported by: 0

Documentation

Overview

toreqnew implements a Traffic Ops client for features in the latest version.

This should only be used if an endpoint or field needed for config gen is in the latest.

Users should always check the returned bool, and if it's false, call the vendored toreq client and set the proper defaults for the new feature(s).

All TOClient functions should check for 404 or 503 and return a bool false if so.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsUnsupportedErr

func IsUnsupportedErr(err error) bool

Types

type TOClient

type TOClient struct {
	C          *toclient.Session
	NumRetries int
}

func New

func New(cookies string, url *url.URL, user string, pass string, insecure bool, timeout time.Duration, userAgent string) (*TOClient, error)

New returns a TOClient with the given credentials. Note it does not actually log in or try to make a request. Rather, it assumes the cookies are valid for a session. No external communication is made.

func (*TOClient) GetCDNDeliveryServices

func (cl *TOClient) GetCDNDeliveryServices(cdnID int) ([]atscfg.DeliveryService, net.Addr, bool, error)

GetCDNDeliveryServices returns the deliveryservices, whether this client's version is unsupported by the server, and any error. Note if the server returns a 404 or 503, this returns false and a nil error. Users should check the "not supported" bool, and use the vendored TOClient if it's set, and set proper defaults for the new feature(s).

func (*TOClient) GetServerUpdateStatus

func (cl *TOClient) GetServerUpdateStatus(cacheHostName tc.CacheName) (tc.ServerUpdateStatus, net.Addr, bool, error)

func (*TOClient) GetServers

func (cl *TOClient) GetServers() ([]atscfg.Server, net.Addr, bool, error)

func (*TOClient) GetTopologies

func (cl *TOClient) GetTopologies() ([]tc.Topology, net.Addr, bool, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL