package
6.1.0+incompatible
Repository: https://github.com/apache/trafficcontrol.git
Documentation: pkg.go.dev
# README
Traffic Ops Go Client
Deprecated
The version of the Traffic Ops API supported by this client is deprecated.
Please switch to the github.com/apache/trafficcontrol/traffic_ops/v3-client
package.
Getting Started
- Obtain the latest version of the library
go get github.com/apache/trafficcontrol/traffic_ops/v2-client
- Get a basic TO session started and fetch a list of CDNs
package main
import (
"fmt"
"os"
"time"
"github.com/apache/trafficcontrol/lib/go-tc"
toclient "github.com/apache/trafficcontrol/traffic_ops/v2-client"
)
const TOURL = "http://localhost"
const TOUser = "user"
const TOPassword = "password"
const AllowInsecureConnections = true
const UserAgent = "MySampleApp"
const UseClientCache = false
const TrafficOpsRequestTimeout = time.Second * time.Duration(10)
func main() {
session, remoteaddr, err := toclient.LoginWithAgent(
TOURL,
TOUser,
TOPassword,
AllowInsecureConnections,
UserAgent,
UseClientCache,
TrafficOpsRequestTimeout)
if err != nil {
fmt.Printf("An error occurred while logging in:\n\t%v\n", err)
os.Exit(1)
}
fmt.Println("Connected to: " + remoteaddr.String())
var cdns []v13.CDN
cdns, _, err = session.GetCDNs()
if err != nil {
fmt.Printf("An error occurred while getting cdns:\n\t%v\n", err)
os.Exit(1)
}
for _, cdn := range cdns {
fmt.Println(cdn.Name)
}
}
# Functions
Login to traffic_ops, the response should set the cookie for this session automatically.
No description provided by the author
Logout of traffic_ops.
NewNoAuthSession returns a new Session without logging in this can be used for querying unauthenticated endpoints without requiring a login.
No description provided by the author
No description provided by the author
# Constants
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
API_CDN_MONITORING_CONFIG is the API path on which Traffic Ops serves the CDN monitoring configuration information.
No description provided by the author
No description provided by the author
API_DELIVERY_SERVICE_CAPACITY is the API path on which Traffic Ops serves information about the 'capacity' of a specific Delivery Service identified by an integral, unique identifier.
API_DELIVERY_SERVICE_ELIGIBLE_SERVERS is the API path on which Traffic Ops serves information about the servers which are eligible to be assigned to a specific Delivery Service identified by an integral, unique identifier.
API_DELIVERY_SERVICE_HEALTH is the API path on which Traffic Ops serves information about the 'health' of a specific Delivery Service identified by an integral, unique identifier.
API_DELIVERY_SERVICE_ID is the API path on which Traffic Ops serves information about a specific Delivery Service identified by an integral, unique identifier.
No description provided by the author
API_DELIVERY_SERVICE_SERVER is the API path on which Traffic Ops serves functionality related to the associations between Delivery Services and their assigned Server(s).
API_DELIVERY_SERVICE_XMLID_SSL_KEYS is the API path on which Traffic Ops serves information about and functionality relating to the SSL keys used by a Delivery Service identified by its XMLID.
API_DELIVERY_SERVICES is the API path on which Traffic Ops serves Delivery Service information.
API_DELIVERY_SERVICES_REGEXES is the API path on which Traffic Ops serves Delivery Service 'regex' (Regular Expression) information.
No description provided by the author
API_DELIVERY_SERVICES_SAFE_UPDATE is the API path on which Traffic Ops provides the functionality to update the "safe" subset of properties of a Delivery Service identified by an integral, unique identifer.
API_DELIVERY_SERVICE_URI_SIGNING_KEYS is the API path on which Traffic Ops serves information about and functionality relating to the URI-signing keys used by a Delivery Service identified by its XMLID.
API_DELIVERY_SERVICES_URL_SIGNING_KEYS is the API path on which Traffic Ops serves information about and functionality relating to the URL-signing keys used by a Delivery Service identified by its XMLID.
No description provided by the author
See: https://traffic-control-cdn.readthedocs.io/en/latest/api/v2/deliveryservices_id_regexes.html.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
API_SERVER_DELIVERY_SERVICES is the API path on which Traffic Ops serves functionality related to the associations a specific server and its assigned Delivery Services.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
CacheEntry ...
HTTPError is returned on Update Session failure.
No description provided by the author
No description provided by the author
Session ...
# Type aliases
No description provided by the author