v1.1.3 Latest Latest

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

Go to latest
Published: Jun 30, 2015 License: Apache-2.0 Imports: 13 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type Alert

type Alert struct {
	Level string `json:"level"`
	Text  string `json:"text"`

type CacheGroup

type CacheGroup struct {
	Name        string  `json:"name"`
	ShortName   string  `json:"shortName"`
	Latitude    float64 `json:"latitude,string"`
	Longitude   float64 `json:"longitude,string"`
	ParentName  string  `json:"parentCachegroupName,omitempty"`
	Type        string  `json:"typeName,omitempty"`
	LastUpdated string  `json:"lastUpdated,omitempty"`

type CacheGroupResponse

type CacheGroupResponse struct {
	Version  string       `json:"version"`
	Response []CacheGroup `json:"response"`

type Credentials

type Credentials struct {
	Username string `json:"u"`
	Password string `json:"p"`

type ParamResponse

type ParamResponse struct {
	Version  string      `json:"version"`
	Response []Parameter `json:"response"`

type Parameter

type Parameter struct {
	Name        string `json:"name"`
	ConfigFile  string `json:"configFile"`
	Value       string `json:"Value"`
	LastUpdated string `json:"lastUpdated"`

type Profile

type Profile struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	LastUpdated string `json:"lastUpdated"`

type ProfileResponse

type ProfileResponse struct {
	Version  string    `json:"version"`
	Response []Profile `json:"response"`

type Result

type Result struct {
	Alerts  []Alert
	Version string `json:"version"`

{"alerts":[{"level":"success","text":"Successfully logged in."}],"version":"1.1"}

type Server

type Server struct {
	DomainName     string `json:"domainName"`
	HostName       string `json:"hostName"`
	Id             string `json:"id"`
	IloIpAddress   string `json:"iloIpAddress"`
	IloIpGateway   string `json:"iloIpGateway"`
	IloIpNetmask   string `json:"iloIpNetmask"`
	IloPassword    string `json:"iloPassword"`
	IloUsername    string `json:"iloUsername"`
	InterfaceMtu   string `json:"interfaceMtu"`
	InterfaceName  string `json:"interfaceName"`
	Ip6Address     string `json:"ip6Address"`
	Ip6Gateway     string `json:"ip6Gateway"`
	IpAddress      string `json:"ipAddress"`
	IpGateway      string `json:"ipGateway"`
	IpNetoask      string `json:"ipNetoask"`
	LastUpdated    string `json:"lastUpdated"`
	Location       string `json:"cachegroup"`
	MgmtIpAddress  string `json:"mgmtIpAddress"`
	MgmtIpGateway  string `json:"mgmtIpGateway"`
	MgmtIpNetoask  string `json:"mgmtIpNetmask"`
	PhysLocation   string `json:"physLocation"`
	Profile        string `json:"profile"`
	Rack           string `json:"rack"`
	RouterHostName string `json:"routerHostName"`
	RouterPortName string `json:"routerPortName"`
	Status         string `json:"status"`
	TcpPort        string `json:"tcpPort"`
	Type           string `json:"type"`
	XmppId         string `json:"xmppId"`
	XmppPasswd     string `json:"xmppPasswd"`

type ServerResponse

type ServerResponse struct {
	Version  string   `json:"version"`
	Response []Server `json:"response"`

type Session

type Session struct {
	UserName  string
	Password  string
	Url       string
	UserAgent *http.Client
	Cache     map[string]cacheentry

func Login

func Login(toUrl string, toUser string, toPasswd string, insecure bool) (*Session, 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.

func (*Session) CRConfigRaw

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

func (*Session) CacheGroups

func (to *Session) CacheGroups() ([]CacheGroup, error)

CacheGroups Get the CacheGroups in an array of CacheGroup structs (note CacheGroup used to be called location)

func (*Session) Parameters

func (to *Session) Parameters(profileName string) ([]Parameter, error)

Parameters Get an array of parameter structs for the profile given

func (*Session) Profiles

func (to *Session) Profiles() ([]Profile, error)

Profiles Get an array of Profiles

func (*Session) Servers

func (to *Session) Servers() ([]Server, error)

Servers Get an array of servers

func (*Session) ServersFqdn

func (to *Session) ServersFqdn(n string) (string, error)

ServersFqdn Returns a the full domain name for the server short name passed in.

func (*Session) ServersShortNameSearch

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

ShortNameSearch Returns a slice of short server names that match a greedy match.

func (*Session) TrafficMonitorConfig

func (to *Session) TrafficMonitorConfig(cdn string) (TrafficMonitorConfig, error)

func (*Session) TrafficMonitorConfigMap

func (to *Session) TrafficMonitorConfigMap(cdn string) (TrafficMonitorConfigMap, error)

func (*Session) TrafficRouterConfig

func (to *Session) TrafficRouterConfig(cdn string) (TrafficRouterConfig, error)

get the json arrays

func (*Session) TrafficRouterConfigMap

func (to *Session) TrafficRouterConfigMap(cdn string) (TrafficRouterConfigMap, error)

get a bunch of maps

func (*Session) TrafficRouterConfigRaw

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

type TrafficMonitorConfig

type TrafficMonitorConfig struct {
	TrafficServers   []trafficServer                 `json:"trafficServers"`
	CacheGroups      []cacheGroup                    `json:"cacheGroups"`
	Config           map[string]interface{}          `json:"config"`
	TrafficMonitors  []trafficMonitor                `json:"trafficMonitors"`
	DeliveryServices []trafficMonitorDeliveryService `json:"deliveryServices"`
	Profiles         []profile                       `json:"profiles"`

type TrafficMonitorConfigMap

type TrafficMonitorConfigMap struct {
	TrafficServer   map[string]trafficServer
	CacheGroup      map[string]cacheGroup
	Config          map[string]interface{}
	TrafficMonitor  map[string]trafficMonitor
	DeliveryService map[string]trafficMonitorDeliveryService
	Profile         map[string]profile

type TrafficRouterConfig

type TrafficRouterConfig struct {
	TrafficServers   []trafficServer        `json:"trafficServers"`
	TrafficMonitors  []trafficMonitor       `json:"trafficMonitors"`
	TrafficRouters   []trafficRouter        `json:"trafficRouters"`
	CacheGroups      []cacheGroup           `json:"cacheGroups"`
	DeliveryServices []deliveryService      `json:"deliveryServices"`
	Stats            map[string]interface{} `json:"stats"`
	Config           map[string]interface{} `json:"config"`

TrafficRouterConfig is the json unmarshalled without any changes note all structs are local to this file _except_ the TrafficRouterConfig struct.

type TrafficRouterConfigMap

type TrafficRouterConfigMap struct {
	TrafficServer   map[string]trafficServer
	TrafficMonitor  map[string]trafficMonitor
	TrafficRouter   map[string]trafficRouter
	CacheGroup      map[string]cacheGroup
	DeliveryService map[string]deliveryService
	Config          map[string]interface{}
	Stat            map[string]interface{}

Jump to

Keyboard shortcuts

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