client

package
v6.0.2+incompatible Latest Latest
Warning

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

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

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

  1. Obtain the latest version of the library

go get github.com/apache/trafficcontrol/traffic_ops/v2-client

  1. 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)
	}
}

Documentation

Overview

Package client provides Go bindings to the Traffic Ops RPC API.

Index

Constants

View Source
const (
	// API_DELIVERY_SERVICES is the API path on which Traffic Ops serves Delivery Service
	// information. More specific information is typically found on sub-paths of this.
	// See Also: https://traffic-control-cdn.readthedocs.io/en/latest/api/v2/deliveryservices.html
	API_DELIVERY_SERVICES = apiBase + "/deliveryservices"

	// 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. It is
	// intended to be used with fmt.Sprintf to insert its required path parameter (namely the ID
	// of the Delivery Service of interest).
	// See Also: https://traffic-control-cdn.readthedocs.io/en/latest/api/v2/deliveryservices_id.html
	API_DELIVERY_SERVICE_ID = API_DELIVERY_SERVICES + "/%v"

	// 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. It is
	// intended to be used with fmt.Sprintf to insert its required path parameter (namely the ID
	// of the Delivery Service of interest).
	// See Also: https://traffic-control-cdn.readthedocs.io/en/latest/api/v2/deliveryservices_id_health.html
	API_DELIVERY_SERVICE_HEALTH = API_DELIVERY_SERVICE_ID + "/health"

	// 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. It is
	// intended to be used with fmt.Sprintf to insert its required path parameter (namely the ID
	// of the Delivery Service of interest).
	// See Also: https://traffic-control-cdn.readthedocs.io/en/latest/api/v2/deliveryservices_id_capacity.html
	API_DELIVERY_SERVICE_CAPACITY = API_DELIVERY_SERVICE_ID + "/capacity"

	// 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. It is intended to be used with fmt.Sprintf to insert its required path parameter
	// (namely the ID of the Delivery Service of interest).
	// See Also: https://traffic-control-cdn.readthedocs.io/en/latest/api/v2/deliveryservices_id_servers_eligible.html
	API_DELIVERY_SERVICE_ELIGIBLE_SERVERS = API_DELIVERY_SERVICE_ID + "/servers/eligible"

	// 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. It is intended to be used with fmt.Sprintf to insert its required path parameter
	// (namely the ID of the Delivery Service of interest).
	// See Also: https://traffic-control-cdn.readthedocs.io/en/latest/api/v2/deliveryservices_id_safe.html
	API_DELIVERY_SERVICES_SAFE_UPDATE = API_DELIVERY_SERVICE_ID + "/safe"

	// 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. It is
	// intended to be used with fmt.Sprintf to insert its required path parameter (namely the XMLID
	// of the Delivery Service of interest).
	// See Also: https://traffic-control-cdn.readthedocs.io/en/latest/api/v2/deliveryservices_xmlid_xmlid_sslkeys.html
	API_DELIVERY_SERVICE_XMLID_SSL_KEYS = API_DELIVERY_SERVICES + "/xmlid/%s/sslkeys"

	// 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. It is intended to be used with fmt.Sprintf to insert its required path parameter
	// (namely the XMLID of the Delivery Service of interest).
	// See Also: https://traffic-control-cdn.readthedocs.io/en/latest/api/v2/deliveryservices_xmlid_urisignkeys.html
	API_DELIVERY_SERVICES_URI_SIGNING_KEYS = API_DELIVERY_SERVICES + "/%s/urisignkeys"

	// 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. It is intended to be used with fmt.Sprintf to insert its required path parameter
	// (namely the XMLID of the Delivery Service of interest).
	// See Also: https://traffic-control-cdn.readthedocs.io/en/latest/api/v2/deliveryservices_xmlid_xmlid_urlkeys.html
	API_DELIVERY_SERVICES_URL_SIGNING_KEYS = API_DELIVERY_SERVICES + "/xmlId/%s/urlkeys"

	// API_DELIVERY_SERVICES_REGEXES is the API path on which Traffic Ops serves Delivery Service
	// 'regex' (Regular Expression) information.
	// See Also: https://traffic-control-cdn.readthedocs.io/en/latest/api/v2/deliveryservices_regexes.html
	API_DELIVERY_SERVICES_REGEXES = apiBase + "/deliveryservices_regexes"

	// 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. It is
	// intended to be used with fmt.Sprintf to insert its required path parameter (namely the ID
	// of the server of interest).
	// See Also: https://traffic-control-cdn.readthedocs.io/en/latest/api/v2/servers_id_deliveryservices.html
	API_SERVER_DELIVERY_SERVICES = apiBase + "/servers/%d/deliveryservices"

	// 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).
	// See Also: https://traffic-control-cdn.readthedocs.io/en/latest/api/v2/deliveryserviceserver.html
	API_DELIVERY_SERVICE_SERVER = apiBase + "/deliveryserviceserver"
)

These are the API endpoints used by the various Delivery Service-related client methods.

View Source
const (
	API_PROFILES                 = apiBase + "/profiles"
	API_PROFILES_NAME_PARAMETERS = API_PROFILES + "/name/%v/parameters"
)
View Source
const (
	API_PROFILE_PARAMETERS = apiBase + "/profileparameters"
	ProfileIdQueryParam    = "profileId"
	ParameterIdQueryParam  = "parameterId"
)
View Source
const (
	API_SERVERS                         = apiBase + "/servers"
	API_SERVERS_DETAILS                 = apiBase + "/servers/details"
	API_SERVER_ASSIGN_DELIVERY_SERVICES = API_SERVER_DELIVERY_SERVICES + "?replace=%t"
)
View Source
const (
	API_ABOUT = apiBase + "/about"
)
View Source
const (
	API_ASNS = apiBase + "/asns"
)
View Source
const (
	API_CACHEGROUPPARAMETERS = apiBase + "/cachegroupparameters"
)
View Source
const (
	API_CACHEGROUPS = apiBase + "/cachegroups"
)
View Source
const API_CAPABILITIES = apiBase + "/capabilities"
View Source
const (
	API_CDNS = apiBase + "/cdns"
)
View Source
const API_CDN_MONITORING_CONFIG = apiBase + "/cdns/%s/configs/monitoring"

API_CDN_MONITORING_CONFIG is the API path on which Traffic Ops serves the CDN monitoring configuration information. It is meant to be used with fmt.Sprintf to insert the necessary path parameters (namely the Name of the CDN of interest). See Also: https://traffic-control-cdn.readthedocs.io/en/latest/api/v2/cdns_name_configs_monitoring.html

View Source
const (
	API_COORDINATES = apiBase + "/coordinates"
)
View Source
const (
	API_DELIVERY_SERVICES_REQUIRED_CAPABILITIES = apiBase + "/deliveryservices_required_capabilities"
)
View Source
const (
	API_DELIVERY_SERVICE_REQUEST_COMMENTS = apiBase + "/deliveryservice_request_comments"
)
View Source
const (
	API_DIVISIONS = apiBase + "/divisions"
)
View Source
const (
	// See: https://traffic-control-cdn.readthedocs.io/en/latest/api/v2/deliveryservices_id_regexes.html
	API_DS_REGEXES = apiBase + "/deliveryservices/%v/regexes"
)
View Source
const (
	API_DS_REQUESTS = apiBase + "/deliveryservice_requests"
)
View Source
const (
	API_LOGS = apiBase + "/logs"
)
View Source
const (
	API_ORIGINS = apiBase + "/origins"
)
View Source
const (
	API_OSVERSIONS = apiBase + "/osversions"
)
View Source
const (
	API_PARAMETERS = apiBase + "/parameters"
)
View Source
const (
	API_PHYS_LOCATIONS = apiBase + "/phys_locations"
)
View Source
const (
	API_PING = apiBase + "/ping"
)
View Source
const (
	API_REGIONS = apiBase + "/regions"
)
View Source
const (
	API_ROLES = apiBase + "/roles"
)
View Source
const API_SERVERCHECK = apiBase + "/servercheck"
View Source
const (
	API_SERVER_CAPABILITIES = apiBase + "/server_capabilities"
)
View Source
const (
	API_SERVER_SERVER_CAPABILITIES = apiBase + "/server_server_capabilities"
)
View Source
const (
	API_SNAPSHOT = apiBase + "/snapshot"
)
View Source
const (
	API_STATIC_DNS_ENTRIES = apiBase + "/staticdnsentries"
)
View Source
const (
	API_STATS_SUMMARY = apiBase + "/stats_summary"
)
View Source
const (
	API_STATUSES = apiBase + "/statuses"
)
View Source
const API_TENANTS = apiBase + "/tenants"
View Source
const API_TENANT_ID = API_TENANTS + "/%v"
View Source
const API_TO_EXTENSION = apiBase + "/servercheck/extensions"
View Source
const (
	API_TYPES = apiBase + "/types"
)
View Source
const CacheHitStatusExpired = CacheHitStatus("expired")
View Source
const CacheHitStatusHit = CacheHitStatus("hit")
View Source
const CacheHitStatusInvalid = CacheHitStatus("")
View Source
const CacheHitStatusMiss = CacheHitStatus("miss")
View Source
const DefaultTimeout = time.Second * time.Duration(30)

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheEntry

type CacheEntry struct {
	Entered    int64
	Bytes      []byte
	RemoteAddr net.Addr
}

CacheEntry ...

type CacheHitStatus

type CacheHitStatus string

func StringToCacheHitStatus

func StringToCacheHitStatus(s string) CacheHitStatus

func (CacheHitStatus) String

func (s CacheHitStatus) String() string

type HTTPError

type HTTPError struct {
	HTTPStatusCode int
	HTTPStatus     string
	URL            string
	Body           string
}

HTTPError is returned on Update Session failure.

func (*HTTPError) Error

func (e *HTTPError) Error() string

Error implements the error interface for our customer error type.

type OuterResponse

type OuterResponse struct {
	Response json.RawMessage `json:"response"`
}

type ReqInf

type ReqInf struct {
	CacheHitStatus CacheHitStatus
	RemoteAddr     net.Addr
}

type Session

type Session struct {
	UserName string
	Password string
	URL      string
	Client   *http.Client

	UserAgentStr string
	// contains filtered or unexported fields
}

Session ...

func LoginWithAgent

func LoginWithAgent(toURL string, toUser string, toPasswd string, insecure bool, userAgent string, useCache bool, requestTimeout time.Duration) (*Session, net.Addr, error)

Login to traffic_ops, the response should set the cookie for this session automatically. Start with

to := traffic_ops.Login("user", "passwd", true)

subsequent calls like to.GetData("datadeliveryservice") will be authenticated. Returns the logged in client, the remote address of Traffic Ops which was translated and used to log in, and any error. If the error is not nil, the remote address may or may not be nil, depending whether the error occurred before the login request.

func LoginWithToken

func LoginWithToken(toURL string, token string, insecure bool, userAgent string, useCache bool, requestTimeout time.Duration) (*Session, net.Addr, error)

func LogoutWithAgent

func LogoutWithAgent(toURL string, toUser string, toPasswd string, insecure bool, userAgent string, useCache bool, requestTimeout time.Duration) (*Session, net.Addr, error)

Logout of traffic_ops

func NewNoAuthSession

func NewNoAuthSession(toURL string, insecure bool, userAgent string, useCache bool, requestTimeout time.Duration) *Session

NewNoAuthSession returns a new Session without logging in this can be used for querying unauthenticated endpoints without requiring a login

func NewSession

func NewSession(user, password, url, userAgent string, client *http.Client, useCache bool) *Session

func (*Session) AddFederationResolverMappingsForCurrentUser

func (to *Session) AddFederationResolverMappingsForCurrentUser(mappings tc.DeliveryServiceFederationResolverMappingRequest) (tc.Alerts, ReqInf, error)

AddFederationResolverMappingsForCurrentUser adds Federation Resolver mappings to one or more Delivery Services for the current user.

func (*Session) AllFederations

func (to *Session) AllFederations() ([]tc.AllDeliveryServiceFederationsMapping, ReqInf, error)

func (*Session) AllFederationsForCDN

func (to *Session) AllFederationsForCDN(cdnName string) ([]tc.AllDeliveryServiceFederationsMapping, ReqInf, error)

func (*Session) AssignDeliveryServiceIDsToServerID

func (to *Session) AssignDeliveryServiceIDsToServerID(server int, dsIDs []int, replace bool) (tc.Alerts, ReqInf, error)

AssignDeliveryServiceIDsToServerID assigns a set of Delivery Services to a single server, optionally replacing any and all existing assignments. 'server' should be the requested server's ID, 'dsIDs' should be a slice of the requested Delivery Services' IDs. If 'replace' is 'true', existing assignments to the server will be replaced.

func (*Session) AssignFederationFederationResolver

func (to *Session) AssignFederationFederationResolver(fedID int, resolverIDs []int, replace bool) (tc.AssignFederationFederationResolversResponse, ReqInf, error)

AssignFederationFederationResolver creates the Federation Resolver 'fr'.

func (*Session) CopyProfile

func (to *Session) CopyProfile(p tc.ProfileCopy) (tc.ProfileCopyResponse, ReqInf, error)

CopyProfile creates a new profile from an existing profile.

func (*Session) CreateASN

func (to *Session) CreateASN(entity tc.ASN) (tc.Alerts, ReqInf, error)

Create a ASN

func (*Session) CreateCDN

func (to *Session) CreateCDN(cdn tc.CDN) (tc.Alerts, ReqInf, error)

CreateCDN creates a CDN.

func (*Session) CreateCDNFederationByName

func (to *Session) CreateCDNFederationByName(f tc.CDNFederation, CDNName string) (*tc.CreateCDNFederationResponse, ReqInf, error)

func (*Session) CreateCacheGroupNullable

func (to *Session) CreateCacheGroupNullable(cachegroup tc.CacheGroupNullable) (*tc.CacheGroupDetailResponse, ReqInf, error)

Create a CacheGroup.

func (*Session) CreateCacheGroupParameter

func (to *Session) CreateCacheGroupParameter(cacheGroupID, parameterID int) (*tc.CacheGroupParametersPostResponse, ReqInf, error)

CreateCacheGroupParameter Associates a Parameter with a Cache Group

func (*Session) CreateCoordinate

func (to *Session) CreateCoordinate(coordinate tc.Coordinate) (tc.Alerts, ReqInf, error)

Create a Coordinate

func (*Session) CreateDeliveryServiceNullable

func (to *Session) CreateDeliveryServiceNullable(ds *tc.DeliveryServiceNullable) (*tc.CreateDeliveryServiceNullableResponse, error)

CreateDeliveryServiceNullable creates the DeliveryService it's passed.

func (*Session) CreateDeliveryServiceRequest

func (to *Session) CreateDeliveryServiceRequest(dsr tc.DeliveryServiceRequest) (tc.Alerts, ReqInf, error)

CreateDeliveryServiceRequest creates a Delivery Service Request.

func (*Session) CreateDeliveryServiceRequestComment

func (to *Session) CreateDeliveryServiceRequestComment(comment tc.DeliveryServiceRequestComment) (tc.Alerts, ReqInf, error)

Create a delivery service request comment

func (*Session) CreateDeliveryServiceServers

func (to *Session) CreateDeliveryServiceServers(dsID int, serverIDs []int, replace bool) (*tc.DSServerIDs, error)

CreateDeliveryServiceServers associates the given servers with the given delivery services. If replace is true, it deletes any existing associations for the given delivery service.

func (*Session) CreateDeliveryServicesRequiredCapability

func (to *Session) CreateDeliveryServicesRequiredCapability(capability tc.DeliveryServicesRequiredCapability) (tc.Alerts, ReqInf, error)

CreateDeliveryServicesRequiredCapability assigns a Required Capability to a Delivery Service

func (*Session) CreateDivision

func (to *Session) CreateDivision(division tc.Division) (tc.Alerts, ReqInf, error)

Create a Division

func (*Session) CreateFederationDeliveryServices

func (to *Session) CreateFederationDeliveryServices(federationID int, deliveryServiceIDs []int, replace bool) (ReqInf, error)

func (*Session) CreateFederationResolver

func (to *Session) CreateFederationResolver(fr tc.FederationResolver) (tc.Alerts, ReqInf, error)

CreateFederationResolver creates the Federation Resolver 'fr'.

func (*Session) CreateFederationUsers

func (to *Session) CreateFederationUsers(federationID int, userIDs []int, replace bool) (tc.Alerts, ReqInf, error)

GetFederationUsers Associates the given Users' IDs to a Federation

func (*Session) CreateInvalidationJob

func (to *Session) CreateInvalidationJob(job tc.InvalidationJobInput) (tc.Alerts, ReqInf, error)

Creates a new Content Invalidation Job

func (*Session) CreateMultipleParameters

func (to *Session) CreateMultipleParameters(pls []tc.Parameter) (tc.Alerts, ReqInf, error)

CreateMultipleParameters performs a POST to create multiple Parameters at once.

func (*Session) CreateMultipleProfileParameters

func (to *Session) CreateMultipleProfileParameters(pps []tc.ProfileParameter) (tc.Alerts, ReqInf, error)

CreateMultipleProfileParameters creates multiple ProfileParameters at once.

func (*Session) CreateOrigin

func (to *Session) CreateOrigin(origin tc.Origin) (*tc.OriginDetailResponse, ReqInf, error)

Create an Origin

func (*Session) CreateParameter

func (to *Session) CreateParameter(pl tc.Parameter) (tc.Alerts, ReqInf, error)

CreateParameter performs a POST to create a Parameter.

func (*Session) CreatePhysLocation

func (to *Session) CreatePhysLocation(pl tc.PhysLocation) (tc.Alerts, ReqInf, error)

CreatePhysLocation creates a PhysLocation.

func (*Session) CreateProfile

func (to *Session) CreateProfile(pl tc.Profile) (tc.Alerts, ReqInf, error)

CreateProfile creates a Profile.

func (*Session) CreateProfileParameter

func (to *Session) CreateProfileParameter(pp tc.ProfileParameter) (tc.Alerts, ReqInf, error)

Create a ProfileParameter

func (*Session) CreateRegion

func (to *Session) CreateRegion(region tc.Region) (tc.Alerts, ReqInf, error)

CreateRegion creates a Region.

func (*Session) CreateRole

func (to *Session) CreateRole(region tc.Role) (tc.Alerts, ReqInf, int, error)

CreateRole creates a Role.

func (*Session) CreateServer

func (to *Session) CreateServer(server tc.Server) (tc.Alerts, ReqInf, error)

CreateServer creates a Server.

func (*Session) CreateServerCapability

func (to *Session) CreateServerCapability(sc tc.ServerCapability) (*tc.ServerCapabilityDetailResponse, ReqInf, error)

CreateServerCapability creates a server capability and returns the response.

func (*Session) CreateServerCheckExtension

func (to *Session) CreateServerCheckExtension(ServerCheckExtension tc.ServerCheckExtensionNullable) (tc.Alerts, ReqInf, error)

CreateServerCheckExtension creates a servercheck extension.

func (*Session) CreateServerServerCapability

func (to *Session) CreateServerServerCapability(ssc tc.ServerServerCapability) (tc.Alerts, ReqInf, error)

CreateServerServerCapability assigns a Server Capability to a Server

func (*Session) CreateStaticDNSEntry

func (to *Session) CreateStaticDNSEntry(sdns tc.StaticDNSEntry) (tc.Alerts, ReqInf, error)

CreateStaticDNSEntry creates a Static DNS Entry.

func (*Session) CreateStatusNullable

func (to *Session) CreateStatusNullable(status tc.StatusNullable) (tc.Alerts, ReqInf, error)

CreateStatusNullable creates a new status, using the tc.StatusNullable structure.

func (*Session) CreateSteeringTarget

func (to *Session) CreateSteeringTarget(st tc.SteeringTargetNullable) (tc.Alerts, ReqInf, error)

func (*Session) CreateSummaryStats

func (to *Session) CreateSummaryStats(statsSummary tc.StatsSummary) (tc.Alerts, ReqInf, error)

CreateSummaryStats creates a stats summary

func (*Session) CreateTenant

func (to *Session) CreateTenant(t *tc.Tenant) (*tc.TenantResponse, error)

CreateTenant creates the Tenant it's passed.

func (*Session) CreateType

func (to *Session) CreateType(typ tc.Type) (tc.Alerts, ReqInf, error)

CreateType creates a Type. There should be a very good reason for doing this.

func (*Session) CreateUser

func (to *Session) CreateUser(user *tc.User) (*tc.CreateUserResponse, ReqInf, error)

CreateUser creates a user

func (*Session) DeleteASNByASN

func (to *Session) DeleteASNByASN(asn int) (tc.Alerts, ReqInf, error)

DELETE an ASN by asn number

func (*Session) DeleteCDNByID

func (to *Session) DeleteCDNByID(id int) (tc.Alerts, ReqInf, error)

DeleteCDNByID deletes a CDN by ID.

func (*Session) DeleteCDNFederationByID

func (to *Session) DeleteCDNFederationByID(CDNName string, ID int) (*tc.DeleteCDNFederationResponse, ReqInf, error)

func (*Session) DeleteCacheGroupByID

func (to *Session) DeleteCacheGroupByID(id int) (tc.Alerts, ReqInf, error)

DELETE a CacheGroup by ID.

func (*Session) DeleteCacheGroupParameter

func (to *Session) DeleteCacheGroupParameter(cacheGroupID, parameterID int) (tc.Alerts, ReqInf, error)

DeleteCacheGroupParameter Deassociates a Parameter with a Cache Group

func (*Session) DeleteCoordinateByID

func (to *Session) DeleteCoordinateByID(id int) (tc.Alerts, ReqInf, error)

DELETE a Coordinate by ID

func (*Session) DeleteDeliveryService

func (to *Session) DeleteDeliveryService(id string) (*tc.DeleteDeliveryServiceResponse, error)

DeleteDeliveryService deletes the DeliveryService matching the ID it's passed.

func (*Session) DeleteDeliveryServiceRequestByID

func (to *Session) DeleteDeliveryServiceRequestByID(id int) (tc.Alerts, ReqInf, error)

DELETE a DeliveryServiceRequest by DeliveryServiceRequest assignee

func (*Session) DeleteDeliveryServiceRequestCommentByID

func (to *Session) DeleteDeliveryServiceRequestCommentByID(id int) (tc.Alerts, ReqInf, error)

DELETE a delivery service request comment by ID

func (*Session) DeleteDeliveryServiceServer

func (to *Session) DeleteDeliveryServiceServer(dsID int, serverID int) (tc.Alerts, ReqInf, error)

func (*Session) DeleteDeliveryServiceUser deprecated

func (to *Session) DeleteDeliveryServiceUser(userID int, dsID int) (*tc.UserDeliveryServiceDeleteResponse, error)

DeleteDeliveryServiceUser deletes the association between the given Delivery Service and user

Deprecated: This method doesn't work, as Traffic Ops API version 2 and later do not actually provide this functionality.

func (*Session) DeleteDeliveryServicesRequiredCapability

func (to *Session) DeleteDeliveryServicesRequiredCapability(deliveryserviceID int, capability string) (tc.Alerts, ReqInf, error)

DeleteDeliveryServicesRequiredCapability unassigns a Required Capability from a Delivery Service

func (*Session) DeleteDivisionByID

func (to *Session) DeleteDivisionByID(id int) (tc.Alerts, ReqInf, error)

DELETE a Division by Division id

func (*Session) DeleteFederationDeliveryService

func (to *Session) DeleteFederationDeliveryService(federationID, deliveryServiceID int) (tc.Alerts, ReqInf, error)

DeleteFederationDeliveryService Deletes a given Delivery Service from a Federation

func (*Session) DeleteFederationResolver

func (to *Session) DeleteFederationResolver(id uint) (tc.Alerts, ReqInf, error)

DeleteFederationResolver deletes the Federation Resolver identified by 'id'.

func (*Session) DeleteFederationResolverMappingsForCurrentUser

func (to *Session) DeleteFederationResolverMappingsForCurrentUser() (tc.Alerts, ReqInf, error)

DeleteFederationResolverMappingsForCurrentUser removes ALL Federation Resolver mappings for ALL Federations assigned to the currently authenticated user, as well as deleting ALL of the Federation Resolvers themselves.

func (*Session) DeleteFederationUser

func (to *Session) DeleteFederationUser(federationID, userID int) (tc.Alerts, ReqInf, error)

DeleteFederationUser Deletes a given User from a Federation

func (*Session) DeleteOriginByID

func (to *Session) DeleteOriginByID(id int) (tc.Alerts, ReqInf, error)

DELETE an Origin by ID

func (*Session) DeleteParameterByID

func (to *Session) DeleteParameterByID(id int) (tc.Alerts, ReqInf, error)

DeleteParameterByID DELETEs a Parameter by ID.

func (*Session) DeleteParameterByProfileParameter

func (to *Session) DeleteParameterByProfileParameter(profile int, parameter int) (tc.Alerts, ReqInf, error)

DELETE a Parameter by Parameter

func (*Session) DeletePhysLocationByID

func (to *Session) DeletePhysLocationByID(id int) (tc.Alerts, ReqInf, error)

DELETE a PhysLocation by ID

func (*Session) DeleteProfileByID

func (to *Session) DeleteProfileByID(id int) (tc.Alerts, ReqInf, error)

DeleteProfileByID DELETEs a Profile by ID.

func (*Session) DeleteRegion

func (to *Session) DeleteRegion(id *int, name *string) (tc.Alerts, ReqInf, error)

DeleteRegion lets you DELETE a Region. Only 1 parameter is required, not both.

func (*Session) DeleteRegionByID

func (to *Session) DeleteRegionByID(id int) (tc.Alerts, ReqInf, error)

DeleteRegionByID DELETEs a Region by ID.

func (*Session) DeleteRoleByID

func (to *Session) DeleteRoleByID(id int) (tc.Alerts, ReqInf, int, error)

DeleteRoleByID DELETEs a Role by ID.

func (*Session) DeleteServerByID

func (to *Session) DeleteServerByID(id int) (tc.Alerts, ReqInf, error)

DeleteServerByID DELETEs a Server by ID.

func (*Session) DeleteServerCapability

func (to *Session) DeleteServerCapability(name string) (tc.Alerts, ReqInf, error)

DeleteServerCapability deletes the given server capability by name.

func (*Session) DeleteServerCheckExtension

func (to *Session) DeleteServerCheckExtension(id int) (tc.Alerts, ReqInf, error)

DeleteServerCheckExtension deletes a servercheck extension.

func (*Session) DeleteServerServerCapability

func (to *Session) DeleteServerServerCapability(serverID int, serverCapability string) (tc.Alerts, ReqInf, error)

DeleteServerServerCapability unassigns a Server Capability from a Server

func (*Session) DeleteStaticDNSEntryByID

func (to *Session) DeleteStaticDNSEntryByID(id int) (tc.Alerts, ReqInf, error)

DeleteStaticDNSEntryByID DELETEs a Static DNS Entry by ID.

func (*Session) DeleteStatusByID

func (to *Session) DeleteStatusByID(id int) (tc.Alerts, ReqInf, error)

DeleteStatusByID DELETEs a Status by ID.

func (*Session) DeleteSteeringTarget

func (to *Session) DeleteSteeringTarget(dsID int, targetID int) (tc.Alerts, ReqInf, error)

func (*Session) DeleteTenant

func (to *Session) DeleteTenant(id string) (*tc.DeleteTenantResponse, error)

DeleteTenant deletes the Tenant matching the ID it's passed.

func (*Session) DeleteTypeByID

func (to *Session) DeleteTypeByID(id int) (tc.Alerts, ReqInf, error)

DeleteTypeByID DELETEs a Type by ID.

func (*Session) DeleteUserByID

func (to *Session) DeleteUserByID(id int) (tc.Alerts, ReqInf, error)

DeleteUserByID updates user with the given id

func (*Session) ErrUnlessOK

func (to *Session) ErrUnlessOK(resp *http.Response, remoteAddr net.Addr, err error, path string) (*http.Response, net.Addr, error)

ErrUnlessOk returns nil and an error if the given Response's status code is anything but 200 OK. This includes reading the Response.Body and Closing it. Otherwise, the given response and error are returned unchanged.

func (*Session) ExportProfile

func (to *Session) ExportProfile(id int) (*tc.ProfileExportResponse, ReqInf, error)

ExportProfile Returns an exported Profile.

func (*Session) Federations

func (to *Session) Federations() ([]tc.AllDeliveryServiceFederationsMapping, ReqInf, error)

func (*Session) GetAPICapabilities

func (to *Session) GetAPICapabilities(capability string, order string) (tc.APICapabilityResponse, ReqInf, error)

GetAPICapabilities will retrieve API Capabilities. In the event that no capability parameter is supplied, it will return all existing. If a capability is supplied, it will return only those with an exact match. Order may be specified to change the default sort order.

func (*Session) GetASNByASN

func (to *Session) GetASNByASN(asn int) ([]tc.ASN, ReqInf, error)

GET an ASN by the asn number

func (*Session) GetASNByID

func (to *Session) GetASNByID(id int) ([]tc.ASN, ReqInf, error)

GET a ASN by the id

func (*Session) GetASNs

func (to *Session) GetASNs() ([]tc.ASN, ReqInf, error)

Returns a list of ASNs

func (*Session) GetAbout

func (to *Session) GetAbout() (map[string]string, ReqInf, error)

GetAbout gets data about the TO instance.

func (*Session) GetAccessibleDeliveryServicesByTenant

func (to *Session) GetAccessibleDeliveryServicesByTenant(tenantId int) ([]tc.DeliveryServiceNullable, ReqInf, error)

GetAccessibleDeliveryServicesByTenant gets all delivery services associated with the given tenant, and all of it's children.

func (*Session) GetAllCacheGroupParameters

func (to *Session) GetAllCacheGroupParameters() ([]tc.CacheGroupParametersResponseNullable, ReqInf, error)

GetAllCacheGroupParameters Gets all Cachegroup Parameter associations

func (*Session) GetCDNByID

func (to *Session) GetCDNByID(id int) ([]tc.CDN, ReqInf, error)

GetCDNByID a CDN by the CDN ID.

func (*Session) GetCDNByName

func (to *Session) GetCDNByName(name string) ([]tc.CDN, ReqInf, error)

GetCDNByName gets a CDN by the CDN name.

func (*Session) GetCDNFederationsByID

func (to *Session) GetCDNFederationsByID(CDNName string, ID int) (*tc.CDNFederationResponse, ReqInf, error)

func (*Session) GetCDNFederationsByName

func (to *Session) GetCDNFederationsByName(CDNName string) (*tc.CDNFederationResponse, ReqInf, error)

func (*Session) GetCDNSSLKeys

func (to *Session) GetCDNSSLKeys(name string) ([]tc.CDNSSLKeys, ReqInf, error)

func (*Session) GetCDNs

func (to *Session) GetCDNs() ([]tc.CDN, ReqInf, error)

GetCDNs eturns a list of CDNs.

func (*Session) GetCRConfig

func (to *Session) GetCRConfig(cdn string) ([]byte, ReqInf, error)

GetCRConfig returns the raw JSON bytes of the CRConfig from Traffic Ops, and whether the bytes were from the client's internal cache.

func (*Session) GetCRConfigNew

func (to *Session) GetCRConfigNew(cdn string) ([]byte, ReqInf, error)

GetCRConfigNew returns the raw JSON bytes of the latest CRConfig from Traffic Ops, and whether the bytes were from the client's internal cache.

func (*Session) GetCacheGroupNullableByID

func (to *Session) GetCacheGroupNullableByID(id int) ([]tc.CacheGroupNullable, ReqInf, error)

GET a CacheGroup by the CacheGroup ID.

func (*Session) GetCacheGroupNullableByName

func (to *Session) GetCacheGroupNullableByName(name string) ([]tc.CacheGroupNullable, ReqInf, error)

GET a CacheGroup by the CacheGroup name.

func (*Session) GetCacheGroupNullableByShortName

func (to *Session) GetCacheGroupNullableByShortName(shortName string) ([]tc.CacheGroupNullable, ReqInf, error)

GET a CacheGroup by the CacheGroup name.

func (*Session) GetCacheGroupParameters

func (to *Session) GetCacheGroupParameters(cacheGroupID int) ([]tc.CacheGroupParameter, ReqInf, error)

GetCacheGroupParameters Gets a Cache Group's Parameters

func (*Session) GetCacheGroupParametersByQueryParams

func (to *Session) GetCacheGroupParametersByQueryParams(cacheGroupID int, queryParams string) ([]tc.CacheGroupParameter, ReqInf, error)

GetCacheGroupParametersByQueryParams Gets a Cache Group's Parameters with query parameters

func (*Session) GetCacheGroupsNullable

func (to *Session) GetCacheGroupsNullable() ([]tc.CacheGroupNullable, ReqInf, error)

Returns a list of CacheGroups.

func (*Session) GetCapabilities

func (to *Session) GetCapabilities() ([]tc.Capability, ReqInf, error)

GetCapabilities retrieves all capabilities.

func (*Session) GetCapability

func (to *Session) GetCapability(c string) (tc.Capability, ReqInf, error)

GetCapability retrieves only the capability named 'c'.

func (*Session) GetCoordinateByID

func (to *Session) GetCoordinateByID(id int) ([]tc.Coordinate, ReqInf, error)

GET a Coordinate by the Coordinate id

func (*Session) GetCoordinateByName

func (to *Session) GetCoordinateByName(name string) ([]tc.Coordinate, ReqInf, error)

GET a Coordinate by the Coordinate name

func (*Session) GetCoordinates

func (to *Session) GetCoordinates() ([]tc.Coordinate, ReqInf, error)

Returns a list of Coordinates

func (*Session) GetCurrentStats

func (to *Session) GetCurrentStats() (tc.TrafficStatsCDNStatsResponse, ReqInf, error)

GetCurrentStats gets current stats for each CDNs and a total across them

func (*Session) GetDeliveryServiceByXMLIDNullable

func (to *Session) GetDeliveryServiceByXMLIDNullable(XMLID string) ([]tc.DeliveryServiceNullable, ReqInf, error)

GetDeliveryServiceByXMLIDNullable returns the Delivery Service identified by the passed XMLID. The length of the returned slice should always be 1 when the request is succesful - if it isn't something very wicked has happened to Traffic Ops.

func (*Session) GetDeliveryServiceCapacity

func (to *Session) GetDeliveryServiceCapacity(id string) (*tc.DeliveryServiceCapacity, ReqInf, error)

GetDeliveryServiceCapacity gets the 'capacity' of the Delivery Service identified by the integral, unique identifier 'id' (which must be passed as a string).

func (*Session) GetDeliveryServiceHealth

func (to *Session) GetDeliveryServiceHealth(id string) (*tc.DeliveryServiceHealth, ReqInf, error)

GetDeliveryServiceHealth gets the 'health' of the Delivery Service identified by the integral, unique identifier 'id' (which must be passed as a string).

func (*Session) GetDeliveryServiceNullable

func (to *Session) GetDeliveryServiceNullable(id string) (*tc.DeliveryServiceNullable, ReqInf, error)

GetDeliveryServiceNullable returns the Delivery Service identified by the integral, unique identifier 'id' (which must be passed as a string).

func (*Session) GetDeliveryServiceRegexes

func (to *Session) GetDeliveryServiceRegexes() ([]tc.DeliveryServiceRegexes, ReqInf, error)

GetDeliveryServiceRegexes returns the "Regexes" (Regular Expressions) used by all (tenant-visible) Delivery Services.

func (*Session) GetDeliveryServiceRegexesByDSID

func (to *Session) GetDeliveryServiceRegexesByDSID(dsID int, params map[string]string) ([]tc.DeliveryServiceIDRegex, ReqInf, error)

GetDeliveryServiceRegexesByDSID gets DeliveryServiceRegexes by a DS id also accepts an optional map of query parameters

func (*Session) GetDeliveryServiceRequestByID

func (to *Session) GetDeliveryServiceRequestByID(id int) ([]tc.DeliveryServiceRequest, ReqInf, error)

GET a DeliveryServiceRequest by the DeliveryServiceRequest id

func (*Session) GetDeliveryServiceRequestByXMLID

func (to *Session) GetDeliveryServiceRequestByXMLID(XMLID string) ([]tc.DeliveryServiceRequest, ReqInf, error)

GET a DeliveryServiceRequest by the DeliveryServiceRequest XMLID

func (*Session) GetDeliveryServiceRequestCommentByID

func (to *Session) GetDeliveryServiceRequestCommentByID(id int) ([]tc.DeliveryServiceRequestComment, ReqInf, error)

GET a delivery service request comment by ID

func (*Session) GetDeliveryServiceRequestComments

func (to *Session) GetDeliveryServiceRequestComments() ([]tc.DeliveryServiceRequestComment, ReqInf, error)

Returns a list of delivery service request comments

func (*Session) GetDeliveryServiceRequests

func (to *Session) GetDeliveryServiceRequests() ([]tc.DeliveryServiceRequest, ReqInf, error)

GetDeliveryServiceRequests retrieves all deliveryservices available to session user.

func (*Session) GetDeliveryServiceSSLKeysByID

func (to *Session) GetDeliveryServiceSSLKeysByID(XMLID string) (*tc.DeliveryServiceSSLKeys, ReqInf, error)

GetDeliveryServiceSSLKeysByID returns information about the SSL Keys used by the Delivery Service identified by the passed XMLID.

func (*Session) GetDeliveryServiceServer

func (to *Session) GetDeliveryServiceServer(page, limit string) ([]tc.DeliveryServiceServer, ReqInf, error)

GetDeliveryServiceServer returns associations between Delivery Services and servers using the provided pagination controls.

func (*Session) GetDeliveryServiceServers

func (to *Session) GetDeliveryServiceServers() (tc.DeliveryServiceServerResponse, ReqInf, error)

GetDeliveryServiceServers gets all delivery service servers, with the default API limit.

func (*Session) GetDeliveryServiceServersN

func (to *Session) GetDeliveryServiceServersN(n int) (tc.DeliveryServiceServerResponse, ReqInf, error)

GetDeliveryServiceServersN gets all delivery service servers, with a limit of n.

func (*Session) GetDeliveryServiceServersWithLimits

func (to *Session) GetDeliveryServiceServersWithLimits(limit int, deliveryServiceIDs []int, serverIDs []int) (tc.DeliveryServiceServerResponse, ReqInf, error)

GetDeliveryServiceServersWithLimits gets all delivery service servers, allowing specifying the limit of mappings to return, the delivery services to return, and the servers to return. The limit may be 0, in which case the default limit will be applied. The deliveryServiceIDs and serverIDs may be nil or empty, in which case all delivery services and/or servers will be returned.

func (*Session) GetDeliveryServiceURISigningKeys

func (to *Session) GetDeliveryServiceURISigningKeys(dsName string) ([]byte, ReqInf, error)

GetDeliveryServiceURISigningKeys returns the URI-signing keys used by the Delivery Service identified by the XMLID 'dsName'. The result is not parsed.

func (*Session) GetDeliveryServiceURLSigKeys

func (to *Session) GetDeliveryServiceURLSigKeys(dsName string) (tc.URLSigKeys, ReqInf, error)

GetDeliveryServiceURLSigKeys returns the URL-signing keys used by the Delivery Service identified by the XMLID 'dsName'.

func (*Session) GetDeliveryServicesByCDNID

func (to *Session) GetDeliveryServicesByCDNID(cdnID int) ([]tc.DeliveryServiceNullable, ReqInf, error)

GetDeliveryServicesByCDNID returns the (tenant-visible) Delivery Services within the CDN identified by the integral, unique identifier 'cdnID'.

func (*Session) GetDeliveryServicesByServer

func (to *Session) GetDeliveryServicesByServer(id int) ([]tc.DeliveryServiceNullable, ReqInf, error)

GetDeliveryServicesByServer returns all of the (tenant-visible) Delivery Services assigned to the server identified by the integral, unique identifier 'id'.

func (*Session) GetDeliveryServicesEligible

func (to *Session) GetDeliveryServicesEligible(dsID int) ([]tc.DSServerV11, ReqInf, error)

GetDeliveryServicesEligible returns the servers eligible for assignment to the Delivery Service identified by the integral, unique identifier 'dsID'.

func (*Session) GetDeliveryServicesNullable

func (to *Session) GetDeliveryServicesNullable() ([]tc.DeliveryServiceNullable, ReqInf, error)

GetDeliveryServicesNullable returns a slice of Delivery Services.

func (*Session) GetDeliveryServicesRequiredCapabilities

func (to *Session) GetDeliveryServicesRequiredCapabilities(deliveryServiceID *int, xmlID, capability *string) ([]tc.DeliveryServicesRequiredCapability, ReqInf, error)

GetDeliveryServicesRequiredCapabilities retrieves a list of Required Capabilities that are assigned to a Delivery Service Callers can filter the results by delivery service id, xml id and/or required capability via the optional parameters

func (*Session) GetDivisionByID

func (to *Session) GetDivisionByID(id int) ([]tc.Division, ReqInf, error)

GET a Division by the Division id

func (*Session) GetDivisionByName

func (to *Session) GetDivisionByName(name string) ([]tc.Division, ReqInf, error)

GET a Division by the Division name

func (*Session) GetDivisions

func (to *Session) GetDivisions() ([]tc.Division, ReqInf, error)

Returns a list of Divisions

func (*Session) GetDomains

func (to *Session) GetDomains() ([]tc.Domain, ReqInf, error)

func (*Session) GetFederationDeliveryServices

func (to *Session) GetFederationDeliveryServices(federationID int) ([]tc.FederationDeliveryServiceNullable, ReqInf, error)

GetFederationDeliveryServices Returns a given Federation's Delivery Services

func (*Session) GetFederationFederationResolversByID

func (to *Session) GetFederationFederationResolversByID(id int) (tc.FederationFederationResolversResponse, ReqInf, error)

GetFederationFederationResolversByID retrieves all Federation Resolvers belonging to Federation of ID.

func (*Session) GetFederationResolverByID

func (to *Session) GetFederationResolverByID(ID uint) (tc.FederationResolver, ReqInf, error)

GetFederationResolverByID retrieves a single Federation Resolver identified by ID.

func (*Session) GetFederationResolverByIPAddress

func (to *Session) GetFederationResolverByIPAddress(ip string) (tc.FederationResolver, ReqInf, error)

GetFederationResolverByIPAddress retrieves the Federation Resolver that uses the IP address or CIDR-notation subnet 'ip'.

func (*Session) GetFederationResolvers

func (to *Session) GetFederationResolvers() ([]tc.FederationResolver, ReqInf, error)

GetFederationResolvers retrieves all Federation Resolvers from Traffic Ops

func (*Session) GetFederationResolversByType

func (to *Session) GetFederationResolversByType(t string) ([]tc.FederationResolver, ReqInf, error)

GetFederationResolversByType gets all Federation Resolvers that are of the Type named 't'.

func (*Session) GetFederationUsers

func (to *Session) GetFederationUsers(federationID int) ([]tc.FederationUser, ReqInf, error)

GetFederationUsers Returns a given Federation's Users

func (*Session) GetInvalidationJobs

func (to *Session) GetInvalidationJobs(ds *interface{}, user *interface{}) ([]tc.InvalidationJob, ReqInf, error)

Returns a list of Content Invalidation Jobs visible to your Tenant, filtered according to ds and user

Either or both of ds and user may be nil, but when they are not they cause filtering of the returned jobs by Delivery Service and Traffic Ops user, respectively.

ds may be a uint, int, or float64 indicating the integral, unique identifier of the desired Delivery Service (in the case of a float64 the fractional part is dropped, e.g. 3.45 -> 3), or it may be a string, in which case it should be the xml_id of the desired Delivery Service, or it may be an actual tc.DeliveryService or tc.DeliveryServiceNullable structure.

Likewise, user may be a uint, int or float64 indicating the integral, unique identifier of the desired user (in the case of a float64 the fractional part is dropped, e.g. 3.45 -> 3), or it may be a string, in which case it should be the username of the desired user, or it may be an actual tc.User or tc.UserCurrent structure.

func (*Session) GetJobs

func (to *Session) GetJobs(deliveryServiceID *int, userID *int) ([]tc.Job, ReqInf, error)

GetJobs returns a list of Jobs. If deliveryServiceID or userID are not nil, only jobs for that delivery service or belonging to that user are returned. Both deliveryServiceID and userID may be nil.

Deprecated, use GetInvalidationJobs instead

func (*Session) GetLogs

func (to *Session) GetLogs() ([]tc.Log, ReqInf, error)

GetLogs gets a list of logs.

func (*Session) GetLogsByDays

func (to *Session) GetLogsByDays(days int) ([]tc.Log, ReqInf, error)

GetLogsByDays gets a list of logs limited to a certain number of days.

func (*Session) GetLogsByLimit

func (to *Session) GetLogsByLimit(limit int) ([]tc.Log, ReqInf, error)

GetLogsByLimit gets a list of logs limited to a certain number of logs.

func (*Session) GetLogsByQueryParams

func (to *Session) GetLogsByQueryParams(queryParams string) ([]tc.Log, ReqInf, error)

GetLogsByQueryParams gets a list of logs filtered by query params.

func (*Session) GetOSVersions

func (to *Session) GetOSVersions() (map[string]string, ReqInf, error)

GetOSVersions GETs all available Operating System (OS) versions for ISO generation, as well as the name of the directory where the "kickstarter" files are found. Structure of returned map:

key:   Name of OS
value: Directory where the ISO source can be found

func (*Session) GetOriginByID

func (to *Session) GetOriginByID(id int) ([]tc.Origin, ReqInf, error)

GET an Origin by the Origin ID

func (*Session) GetOriginByName

func (to *Session) GetOriginByName(name string) ([]tc.Origin, ReqInf, error)

GET an Origin by the Origin name

func (*Session) GetOrigins

func (to *Session) GetOrigins() ([]tc.Origin, ReqInf, error)

Returns a list of Origins

func (*Session) GetOriginsByDeliveryServiceID

func (to *Session) GetOriginsByDeliveryServiceID(id int) ([]tc.Origin, ReqInf, error)

GET a list of Origins by Delivery Service ID

func (*Session) GetOriginsByQueryParams

func (to *Session) GetOriginsByQueryParams(queryParams string) ([]tc.Origin, ReqInf, error)

GET a list of Origins by a query parameter string

func (*Session) GetParameterByConfigFile

func (to *Session) GetParameterByConfigFile(configFile string) ([]tc.Parameter, ReqInf, error)

GetParameterByConfigFile GETs a Parameter by the Parameter ConfigFile.

func (*Session) GetParameterByID

func (to *Session) GetParameterByID(id int) ([]tc.Parameter, ReqInf, error)

GetParameterByID GETs a Parameter by the Parameter ID.

func (*Session) GetParameterByName

func (to *Session) GetParameterByName(name string) ([]tc.Parameter, ReqInf, error)

GetParameterByName GETs a Parameter by the Parameter name.

func (*Session) GetParameterByNameAndConfigFile

func (to *Session) GetParameterByNameAndConfigFile(name string, configFile string) ([]tc.Parameter, ReqInf, error)

GetParameterByNameAndConfigFile GETs a Parameter by the Parameter Name and ConfigFile.

func (*Session) GetParameterByNameAndConfigFileAndValue

func (to *Session) GetParameterByNameAndConfigFileAndValue(name, configFile, value string) ([]tc.Parameter, ReqInf, error)

GetParameterByNameAndConfigFileAndValue GETs a Parameter by the Parameter Name and ConfigFile and Value. TODO: API should support all 3, but does not support filter by value currently. Until then, loop through hits until you find one with that value.

func (*Session) GetParameters

func (to *Session) GetParameters() ([]tc.Parameter, ReqInf, error)

GetParameters returns a list of Parameters.

func (*Session) GetParametersByProfileName

func (to *Session) GetParametersByProfileName(profileName string) ([]tc.Parameter, ReqInf, error)

GetParametersByProfileName gets all of the Parameters assigned to the Profile named 'profileName'.

func (*Session) GetPhysLocationByID

func (to *Session) GetPhysLocationByID(id int) ([]tc.PhysLocation, ReqInf, error)

GET a PhysLocation by the PhysLocation ID

func (*Session) GetPhysLocationByName

func (to *Session) GetPhysLocationByName(name string) ([]tc.PhysLocation, ReqInf, error)

GET a PhysLocation by the PhysLocation name

func (*Session) GetPhysLocations

func (to *Session) GetPhysLocations(params map[string]string) ([]tc.PhysLocation, ReqInf, error)

Returns a list of PhysLocations with optional query parameters applied

func (*Session) GetProfileByCDNID

func (to *Session) GetProfileByCDNID(cdnID int) ([]tc.Profile, ReqInf, error)

GetProfileByCDNID GETs a Profile by the Profile CDN ID.

func (*Session) GetProfileByID

func (to *Session) GetProfileByID(id int) ([]tc.Profile, ReqInf, error)

GetProfileByID GETs a Profile by the Profile ID.

func (*Session) GetProfileByName

func (to *Session) GetProfileByName(name string) ([]tc.Profile, ReqInf, error)

GetProfileByName GETs a Profile by the Profile name.

func (*Session) GetProfileByParameter

func (to *Session) GetProfileByParameter(param string) ([]tc.Profile, ReqInf, error)

GetProfileByParameter GETs a Profile by the Profile "param".

func (*Session) GetProfileParameterByQueryParams

func (to *Session) GetProfileParameterByQueryParams(queryParams string) ([]tc.ProfileParameter, ReqInf, error)

GET a Profile Parameter by the Parameter

func (*Session) GetProfileParameters

func (to *Session) GetProfileParameters() ([]tc.ProfileParameter, ReqInf, error)

Returns a list of Profile Parameters

func (*Session) GetProfiles

func (to *Session) GetProfiles() ([]tc.Profile, ReqInf, error)

GetProfiles returns a list of Profiles.

func (*Session) GetRegionByID

func (to *Session) GetRegionByID(id int) ([]tc.Region, ReqInf, error)

GetRegionByID GETs a Region by the Region ID.

func (*Session) GetRegionByName

func (to *Session) GetRegionByName(name string) ([]tc.Region, ReqInf, error)

GetRegionByName GETs a Region by the Region name.

func (*Session) GetRegions

func (to *Session) GetRegions() ([]tc.Region, ReqInf, error)

GetRegions returns a list of regions.

func (*Session) GetRoleByID

func (to *Session) GetRoleByID(id int) ([]tc.Role, ReqInf, int, error)

GetRoleByID GETs a Role by the Role ID.

func (*Session) GetRoleByName

func (to *Session) GetRoleByName(name string) ([]tc.Role, ReqInf, int, error)

GetRoleByName GETs a Role by the Role name.

func (*Session) GetRoleByQueryParams

func (to *Session) GetRoleByQueryParams(queryParams map[string]string) ([]tc.Role, ReqInf, int, error)

GetRoleByQueryParams gets a Role by the Role query parameters.

func (*Session) GetRoles

func (to *Session) GetRoles() ([]tc.Role, ReqInf, int, error)

GetRoles returns a list of roles.

func (*Session) GetServerByHostName

func (to *Session) GetServerByHostName(hostName string) ([]tc.Server, ReqInf, error)

GetServerByHostName GETs Servers by the Server hostname.

func (*Session) GetServerByID

func (to *Session) GetServerByID(id int) ([]tc.Server, ReqInf, error)

GetServerByID GETs a Server by the Server ID.

func (*Session) GetServerCapabilities

func (to *Session) GetServerCapabilities() ([]tc.ServerCapability, ReqInf, error)

GetServerCapabilities returns all the server capabilities.

func (*Session) GetServerCapability

func (to *Session) GetServerCapability(name string) (*tc.ServerCapability, ReqInf, error)

GetServerCapability returns the given server capability by name.

func (*Session) GetServerCheckExtensions

func (to *Session) GetServerCheckExtensions() (tc.ServerCheckExtensionResponse, ReqInf, error)

GetServerCheckExtensions gets all servercheck extensions.

func (*Session) GetServerDetailsByHostName

func (to *Session) GetServerDetailsByHostName(hostName string) ([]tc.ServerDetailV11, ReqInf, error)

GetServerDetailsByHostName GETs Servers by the Server hostname.

func (*Session) GetServerFQDN

func (to *Session) GetServerFQDN(n string) (string, ReqInf, error)

GetServerFQDN returns the Fully Qualified Domain Name (FQDN) of the first server found to have the Host Name 'n'.

func (*Session) GetServerIDDeliveryServices

func (to *Session) GetServerIDDeliveryServices(server int) ([]tc.DeliveryServiceNullable, ReqInf, error)

GetServerIDDeliveryServices returns all of the Delivery Services assigned to the server identified by the integral, unique identifier 'server'.

func (*Session) GetServerServerCapabilities

func (to *Session) GetServerServerCapabilities(serverID *int, serverHostName, serverCapability *string) ([]tc.ServerServerCapability, ReqInf, error)

GetServerServerCapabilities retrieves a list of Server Capabilities that are assigned to a Server Callers can filter the results by server id, server host name and/or server capability via the optional parameters

func (*Session) GetServerUpdateStatus

func (to *Session) GetServerUpdateStatus(hostName string) (tc.ServerUpdateStatus, ReqInf, error)

GetServerUpdateStatus GETs the Server Update Status by the Server hostname.

func (*Session) GetServers

func (to *Session) GetServers() ([]tc.Server, ReqInf, error)

GetServers returns a list of Servers.

func (*Session) GetServersByType

func (to *Session) GetServersByType(qparams url.Values) ([]tc.Server, ReqInf, error)

GetServersByType returns all servers that match the given query parameter filters, NOT - as the name might imply - all servers of a specific type (though type can be specified in the query parameters).

func (*Session) GetServersChecks

func (to *Session) GetServersChecks() ([]tc.GenericServerCheck, tc.Alerts, ReqInf, error)

GetServersChecks fetches check and meta information about servers from /servercheck.

func (*Session) GetServersShortNameSearch

func (to *Session) GetServersShortNameSearch(shortname string) ([]string, ReqInf, error)

GetServersShortNameSearch returns all of the Host Names of servers that contain 'shortname'.

func (*Session) GetStaticDNSEntries

func (to *Session) GetStaticDNSEntries() ([]tc.StaticDNSEntry, ReqInf, error)

GetStaticDNSEntries returns a list of Static DNS Entrys.

func (*Session) GetStaticDNSEntriesByHost

func (to *Session) GetStaticDNSEntriesByHost(host string) ([]tc.StaticDNSEntry, ReqInf, error)

GetStaticDNSEntriesByHost GETs a Static DNS Entry by the Static DNS Entry's host.

func (*Session) GetStaticDNSEntryByID

func (to *Session) GetStaticDNSEntryByID(id int) ([]tc.StaticDNSEntry, ReqInf, error)

GetStaticDNSEntryByID GETs a Static DNS Entry by the Static DNS Entry's ID.

func (*Session) GetStatusByID

func (to *Session) GetStatusByID(id int) ([]tc.Status, ReqInf, error)

GetStatusByID GETs a Status by the Status ID.

func (*Session) GetStatusByName

func (to *Session) GetStatusByName(name string) ([]tc.Status, ReqInf, error)

GetStatusByName GETs a Status by the Status name.

func (*Session) GetStatuses

func (to *Session) GetStatuses() ([]tc.Status, ReqInf, error)

GetStatuses returns a list of Statuses.

func (*Session) GetSteeringTargets

func (to *Session) GetSteeringTargets(dsID int) ([]tc.SteeringTargetNullable, ReqInf, error)

func (*Session) GetSummaryStats

func (to *Session) GetSummaryStats(cdn, deliveryService, statName *string) (tc.StatsSummaryResponse, ReqInf, error)

GetSummaryStats gets a list of summary stats with the ability to filter on cdn,deliveryService and/or stat

func (*Session) GetSummaryStatsLastUpdated

func (to *Session) GetSummaryStatsLastUpdated(statName *string) (tc.StatsSummaryLastUpdatedResponse, ReqInf, error)

GetSummaryStatsLastUpdated time of the last summary for a given stat

func (*Session) GetTrafficMonitorConfig

func (to *Session) GetTrafficMonitorConfig(cdn string) (*tc.LegacyTrafficMonitorConfig, ReqInf, error)

GetTrafficMonitorConfig returns the monitoring configuration for the CDN named by 'cdn'.

func (*Session) GetTrafficMonitorConfigMap

func (to *Session) GetTrafficMonitorConfigMap(cdn string) (*tc.LegacyTrafficMonitorConfigMap, ReqInf, error)

GetTrafficMonitorConfigMap is functionally identical to GetTrafficMonitorConfig, except that it coerces the value returned by the API to the tc.LegacyTrafficMonitorConfigMap structure.

func (*Session) GetTypeByID

func (to *Session) GetTypeByID(id int) ([]tc.Type, ReqInf, error)

GetTypeByID GETs a Type by the Type ID.

func (*Session) GetTypeByName

func (to *Session) GetTypeByName(name string) ([]tc.Type, ReqInf, error)

GetTypeByName GET a Type by the Type name.

func (*Session) GetTypes

func (to *Session) GetTypes(useInTable ...string) ([]tc.Type, ReqInf, error)

GetTypes returns a list of Types. If a 'useInTable' parameter is passed, the returned Types are restricted to those with that exact 'useInTable' property. Only exactly 1 or exactly 0 'useInTable' parameters may be passed; passing more will result in an error being returned.

func (*Session) GetUserByID

func (to *Session) GetUserByID(id int) ([]tc.User, ReqInf, error)

func (*Session) GetUserByUsername

func (to *Session) GetUserByUsername(username string) ([]tc.User, ReqInf, error)

func (*Session) GetUserCurrent

func (to *Session) GetUserCurrent() (*tc.UserCurrent, ReqInf, error)

GetUserCurrent gets information about the current user

func (*Session) GetUsers

func (to *Session) GetUsers() ([]tc.User, ReqInf, error)

GetUsers returns all users accessible from current user

func (*Session) GetUsersByRole

func (to *Session) GetUsersByRole(roleName string) ([]tc.User, ReqInf, error)

GetUsersByRole returns all users accessible from current user for a given role

func (*Session) ImportProfile

func (to *Session) ImportProfile(importRequest *tc.ProfileImportRequest) (*tc.ProfileImportResponse, ReqInf, error)

ImportProfile imports an exported Profile.

func (*Session) InsertServerCheckStatus

func (to *Session) InsertServerCheckStatus(status tc.ServercheckRequestNullable) (*tc.ServercheckPostResponse, ReqInf, error)

InsertServerCheckStatus Will insert/update the servercheck value based on if it already exists or not.

func (*Session) Ping

func (to *Session) Ping() (map[string]string, ReqInf, error)

Ping returns a static json object to show that traffic_ops is responsive

func (*Session) PostDeliveryServiceRegexesByDSID

func (to *Session) PostDeliveryServiceRegexesByDSID(dsID int, regex tc.DeliveryServiceRegexPost) (tc.Alerts, ReqInf, error)

func (*Session) RawRequest

func (to *Session) RawRequest(method, path string, body []byte) (*http.Response, net.Addr, error)

RawRequest performs the actual HTTP request to Traffic Ops, simply, without trying to refresh the cookie if an Unauthorized code is returned. Returns the response, the remote address of the Traffic Ops instance used, and any error. The returned net.Addr is guaranteed to be either nil or valid, even if the returned error is not nil. Callers are encouraged to check and use the net.Addr if an error is returned, and use the remote address in their own error messages. This violates the Go idiom that a non-nil error implies all other values are undefined, but it's more straightforward than alternatives like typecasting.

func (*Session) RegisterNewUser

func (to *Session) RegisterNewUser(tenantID uint, roleID uint, email rfc.EmailAddress) (tc.Alerts, ReqInf, error)

RegisterNewUser requests the registration of a new user with the given tenant ID and role ID, through their email.

func (*Session) ReplaceFederationResolverMappingsForCurrentUser

func (to *Session) ReplaceFederationResolverMappingsForCurrentUser(mappings tc.DeliveryServiceFederationResolverMappingRequest) (tc.Alerts, ReqInf, error)

ReplaceFederationResolverMappingsForCurrentUser replaces any and all Federation Resolver mappings on all Federations assigned to the currently authenticated user. This will first remove ALL Federation Resolver mappings for ALL Federations assigned to the currently authenticated user, as well as deleting ALL of the Federation Resolvers themselves. In other words, calling this is equivalent to a call to DeleteFederationResolverMappingsForCurrentUser followed by a call to AddFederationResolverMappingsForCurrentUser .

func (*Session) SetCachegroupDeliveryServices

func (to *Session) SetCachegroupDeliveryServices(cgID int, dsIDs []int) (tc.CacheGroupPostDSRespResponse, ReqInf, error)

func (*Session) SetDeliveryServiceUser deprecated

func (to *Session) SetDeliveryServiceUser(userID int, dses []int, replace bool) (*tc.UserDeliveryServicePostResponse, error)

SetUserDeliveryService associates the given Delivery Services with the given user.

Deprecated: This method doesn't work, as Traffic Ops API version 2 and later do not actually provide this functionality.

func (*Session) SetServerQueueUpdate

func (to *Session) SetServerQueueUpdate(serverID int, queueUpdate bool) (tc.ServerQueueUpdateResponse, ReqInf, error)

SetServerQueueUpdate updates a server's status and returns the response.

func (*Session) SetUpdateServerStatuses

func (to *Session) SetUpdateServerStatuses(serverName string, updateStatus *bool, revalStatus *bool) (ReqInf, error)

UpdateServerStatus updates a server's queue status and/or reval status. Either updateStatus or revalStatus may be nil, in which case that status isn't updated (but not both, because that wouldn't do anything).

func (*Session) SnapshotCRConfig

func (to *Session) SnapshotCRConfig(cdn string) (ReqInf, error)

SnapshotCRConfig snapshots a CDN by name.

func (*Session) SnapshotCRConfigByID

func (to *Session) SnapshotCRConfigByID(id int) (tc.Alerts, ReqInf, error)

SnapshotCDNByID snapshots a CDN by ID.

func (*Session) Steering

func (to *Session) Steering() ([]tc.Steering, ReqInf, error)

func (*Session) Tenant

func (to *Session) Tenant(id string) (*tc.Tenant, ReqInf, error)

Tenant gets the Tenant identified by the passed integral, unique identifer - which must be passed as a string.

func (*Session) TenantByName

func (to *Session) TenantByName(name string) (*tc.Tenant, ReqInf, error)

TenantByName gets the Tenant with the name it's passed.

func (*Session) Tenants

func (to *Session) Tenants() ([]tc.Tenant, ReqInf, error)

Tenants gets an array of Tenants.

func (*Session) UpdateASNByID

func (to *Session) UpdateASNByID(id int, entity tc.ASN) (tc.Alerts, ReqInf, error)

Update a ASN by ID

func (*Session) UpdateCDNByID

func (to *Session) UpdateCDNByID(id int, cdn tc.CDN) (tc.Alerts, ReqInf, error)

UpdateCDNByID updates a CDN by ID.

func (*Session) UpdateCDNFederationsByID

func (to *Session) UpdateCDNFederationsByID(f tc.CDNFederation, CDNName string, ID int) (*tc.UpdateCDNFederationResponse, ReqInf, error)

func (*Session) UpdateCacheGroupNullableByID

func (to *Session) UpdateCacheGroupNullableByID(id int, cachegroup tc.CacheGroupNullable) (*tc.CacheGroupDetailResponse, ReqInf, error)

Update a CacheGroup by ID.

func (*Session) UpdateCoordinateByID

func (to *Session) UpdateCoordinateByID(id int, coordinate tc.Coordinate) (tc.Alerts, ReqInf, error)

Update a Coordinate by ID

func (*Session) UpdateCurrentUser

func (to *Session) UpdateCurrentUser(u tc.User) (*tc.UpdateUserResponse, ReqInf, error)

UpdateCurrentUser replaces the current user data with the provided tc.User structure.

func (*Session) UpdateDeliveryServiceNullable

func (to *Session) UpdateDeliveryServiceNullable(id string, ds *tc.DeliveryServiceNullable) (*tc.UpdateDeliveryServiceNullableResponse, error)

UpdateDeliveryServiceNullable updates the DeliveryService matching the ID it's passed with the DeliveryService it is passed.

func (*Session) UpdateDeliveryServiceRequestByID

func (to *Session) UpdateDeliveryServiceRequestByID(id int, dsr tc.DeliveryServiceRequest) (tc.Alerts, ReqInf, error)

Update a DeliveryServiceRequest by ID

func (*Session) UpdateDeliveryServiceRequestCommentByID

func (to *Session) UpdateDeliveryServiceRequestCommentByID(id int, comment tc.DeliveryServiceRequestComment) (tc.Alerts, ReqInf, error)

Update a delivery service request by ID

func (*Session) UpdateDeliveryServiceSafe

func (to *Session) UpdateDeliveryServiceSafe(id int, ds tc.DeliveryServiceSafeUpdateRequest) ([]tc.DeliveryServiceNullable, ReqInf, error)

UpdateDeliveryServiceSafe updates the given Delivery Service identified by 'id' with the given "safe" fields.

func (*Session) UpdateDivisionByID

func (to *Session) UpdateDivisionByID(id int, division tc.Division) (tc.Alerts, ReqInf, error)

Update a Division by ID

func (*Session) UpdateOriginByID

func (to *Session) UpdateOriginByID(id int, origin tc.Origin) (*tc.OriginDetailResponse, ReqInf, error)

Update an Origin by ID

func (*Session) UpdateParameterByID

func (to *Session) UpdateParameterByID(id int, pl tc.Parameter) (tc.Alerts, ReqInf, error)

UpdateParameterByID performs a PUT to update a Parameter by ID.

func (*Session) UpdatePhysLocationByID

func (to *Session) UpdatePhysLocationByID(id int, pl tc.PhysLocation) (tc.Alerts, ReqInf, error)

Update a PhysLocation by ID

func (*Session) UpdateProfileByID

func (to *Session) UpdateProfileByID(id int, pl tc.Profile) (tc.Alerts, ReqInf, error)

UpdateProfileByID updates a Profile by ID.

func (*Session) UpdateRegionByID

func (to *Session) UpdateRegionByID(id int, region tc.Region) (tc.Alerts, ReqInf, error)

UpdateRegionByID updates a Region by ID.

func (*Session) UpdateRoleByID

func (to *Session) UpdateRoleByID(id int, region tc.Role) (tc.Alerts, ReqInf, int, error)

UpdateRoleByID updates a Role by ID.

func (*Session) UpdateServerByID

func (to *Session) UpdateServerByID(id int, server tc.Server) (tc.Alerts, ReqInf, error)

UpdateServerByID updates a Server by ID.

func (*Session) UpdateServerStatus

func (to *Session) UpdateServerStatus(serverID int, req tc.ServerPutStatus) (*tc.Alerts, ReqInf, error)

UpdateServerStatus updates a server's status and returns the response.

func (*Session) UpdateStaticDNSEntryByID

func (to *Session) UpdateStaticDNSEntryByID(id int, sdns tc.StaticDNSEntry) (tc.Alerts, ReqInf, int, error)

UpdateStaticDNSEntryByID updates a Static DNS Entry by ID.

func (*Session) UpdateStatusByID

func (to *Session) UpdateStatusByID(id int, status tc.Status) (tc.Alerts, ReqInf, error)

UpdateStatusByID updates a Status by ID.

func (*Session) UpdateSteeringTarget

func (to *Session) UpdateSteeringTarget(st tc.SteeringTargetNullable) (tc.Alerts, ReqInf, error)

func (*Session) UpdateTenant

func (to *Session) UpdateTenant(id string, t *tc.Tenant) (*tc.TenantResponse, error)

UpdateTenant updates the Tenant matching the ID it's passed with the Tenant it is passed.

func (*Session) UpdateTypeByID

func (to *Session) UpdateTypeByID(id int, typ tc.Type) (tc.Alerts, ReqInf, error)

UpdateTypeByID updates a Type by ID.

func (*Session) UpdateUserByID

func (to *Session) UpdateUserByID(id int, u *tc.User) (*tc.UpdateUserResponse, ReqInf, error)

UpdateUserByID updates user with the given id

Jump to

Keyboard shortcuts

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