package
7.0.1+incompatible
Repository: https://github.com/apache/trafficcontrol.git
Documentation: pkg.go.dev
# README
Traffic Ops Go Client
Getting Started
- Obtain the latest version of the library
go get github.com/apache/trafficcontrol/traffic_ops/v3-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/v3-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 []tc.CDN
cdns, _, err = session.GetCDNsWithHdr(nil)
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
ErrIsNotImplemented checks if err ultimately arose at least in part because the Traffic Ops server did not support the requested API version.
Login authenticates with Traffic Ops and returns the client object.
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 The useCache argument is ignored.
No description provided by the author
# Constants
API_ABOUT is Deprecated: will be removed in the next major version.
API_ASNS is Deprecated: will be removed in the next major version.
API_CACHEGROUPPARAMETERS is Deprecated: will be removed in the next major version.
DEPRECATED: will be removed in the next major version.
API_CAPABILITIES is Deprecated: will be removed in the next major version.
API_CDN_MONITORING_CONFIG is the API path on which Traffic Ops serves the CDN monitoring configuration information.
API_CDNS is Deprecated: will be removed in the next major version.
API_COORDINATES is Deprecated: will be removed in the next major version.
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_GENERATE_SSL_KEYS is the API path on which Traffic Ops will generate new SSL keys See Also: https://traffic-control-cdn.readthedocs.io/en/latest/api/v3/deliveryservices_sslkeys_generate.html
Deprecated: will be removed in the next major version.
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.
API_DELIVERY_SERVICE_REQUEST_COMMENTS is Deprecated: will be removed in the next major version.
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.
API_DELIVERY_SERVICES_REQUIRED_CAPABILITIES is Deprecated: will be removed in the next major version.
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_SERVICES_SERVERS is the API path on which Traffic Ops serves functionality related to the associations between a Delivery Service and its assigned Server(s).
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.
API_DIVISIONS is Deprecated: will be removed in the next major version.
API_DS_REGEXES is Deprecated: will be removed in the next major version.
API_DS_REQUESTS is Deprecated: will be removed in the next major version.
DEPRECATED: will be removed in the next major version.
API_ORIGINS is Deprecated: will be removed in the next major version.
API_OSVERSIONS is Deprecated: will be removed in the next major version.
API_PARAMETERS is Deprecated: will be removed in the next major version.
API_PHYS_LOCATIONS is Deprecated: will be removed in the next major version.
API_PING is Deprecated: will be removed in the next major version.
DEPRECATED: will be removed in the next major version.
API_PROFILES is Deprecated: will be removed in the next major version.
API_PROFILES_NAME_PARAMETERS is Deprecated: will be removed in the next major version.
API_REGIONS is Deprecated: will be removed in the next major version.
API_ROLES is Deprecated: will be removed in the next major version.
API_SERVER_ASSIGN_DELIVERY_SERVICES is Deprecated: will be removed in the next major version.
API_SERVER_CAPABILITIES is Deprecated: will be removed in the next major version.
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.
API_SERVER_SERVER_CAPABILITIES is Deprecated: will be removed in the next major version.
API_SERVERCHECK is Deprecated: will be removed in the next major version.
API_SERVERS is Deprecated: will be removed in the next major version.
API_SERVERS_DETAILS is Deprecated: will be removed in the next major version.
API_SERVICE_CATEGORIES is Deprecated: will be removed in the next major version.
API_SNAPSHOT is Deprecated: will be removed in the next major version.
API_STATIC_DNS_ENTRIES is Deprecated: will be removed in the next major version.
API_STATS_SUMMARY is Deprecated: will be removed in the next major version.
API_STATUSES is Deprecated: will be removed in the next major version.
API_TENANT_ID is Deprecated: will be removed in the next major version.
API_TENANTS is Deprecated: will be removed in the next major version.
API_TO_EXTENSION is Deprecated: will be removed in the next major version.
DEPRECATED: will be removed in the next major version.
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
These are the API endpoints used by the various Delivery Service-related client methods.
These are the API endpoints used by the various Delivery Service-related client methods.
These are the API endpoints used by the various Delivery Service-related client methods.
These are the API endpoints used by the various Delivery Service-related client methods.
These are the API endpoints used by the various Delivery Service-related client methods.
No description provided by the author
These are the API endpoints used by the various Delivery Service-related client methods.
These are the API endpoints used by the various Delivery Service-related client methods.
These are the API endpoints used by the various Delivery Service-related client methods.
No description provided by the author
These are the API endpoints used by the various Delivery Service-related client methods.
These are the API endpoints used by the various Delivery Service-related client methods.
These are the API endpoints used by the various Delivery Service-related client methods.
These are the API endpoints used by the various Delivery Service-related client methods.
These are the API endpoints used by the various Delivery Service-related client methods.
No description provided by the author
No description provided by the author
No description provided by the author
APIFederations is Deprecated: will be removed in the next major version.
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
These are the API endpoints used by the various Delivery Service-related client methods.
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
ApiTopologies is Deprecated: will be removed in the next major version.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Variables
ErrNotImplemented is returned when Traffic Ops returns a 501 Not Implemented Users should check ErrIsNotImplemented rather than comparing directly, in case context was added.
# Structs
No description provided by the author
No description provided by the author
Session is a Traffic Ops client.