internal

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2022 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Short                = "short"
	Long                 = "long"
	Empty                = ""
	Global               = "global"
	Missing              = "missing"
	Exclusive            = "exclusive"
	Invalid              = "invalid"
	Redundant            = "redundant"
	RequestParsingError  = "requestParsingError"
	ResponseParsingError = "responseParsingError"
	SpinnerMessage       = "spinnerMessage"
	MissingArgs          = "missingArgs"
	FieldsNotRequired    = "fieldsNotRequired"
	DefaultPort          = 80
	IPV4                 = "IPV4"
	IPV6                 = "IPV6"
	TCP                  = "TCP"
	ICMP                 = "ICMP"
	FailedIps            = "failedIps"
)

constant message keys

View Source
const (
	Get  = "GET"
	Post = "POST"
)

HTTP request methods

View Source
const (
	CliErrExitCode     int = 1
	CmdErrExitCode     int = 2
	ParsingErrExitCode int = 3
)
View Source
const (
	ApplicationJson = "application/json"
)

HTTP header values

View Source
const (
	ContentType = "Content-Type"
)

HTTP headers

View Source
const HttpCodeExitCodeDiff = 300
View Source
const (
	Search = "search"
)

Edge Locations

View Source
const (
	TestTargetIp = "testTargetIp"
)

Gtm Hostnames

View Source
const (
	X_ED_CLIENT_TYPE = "X-ED-CLIENT-TYPE"
)

Variables

View Source
var CustomUsageTemplate = `` /* 1040-byte string literal not displayed */
View Source
var UsageFuncMap = template.FuncMap{
	"bold":        bold,
	"header":      header,
	"italic":      italic,
	"capsToTitle": CapsToTitle,
	"green":       success,
	"blue":        blue,
}

Functions

func Abort

func Abort(message string, errorCode int)

func AbortForCommand

func AbortForCommand(cmd *cobra.Command, cliError *CliError)

func AbortForCommandWithSubResource

func AbortForCommandWithSubResource(cmd *cobra.Command, cliError *CliError, subResource, operation string)

func AbortWithUsageAndMessage

func AbortWithUsageAndMessage(cmd *cobra.Command, message string, errorCode int)

func ByteArrayToStruct

func ByteArrayToStruct(byt []byte, objPtr interface{})

func CamelToTitle

func CamelToTitle(inp string) string

func CapsToTitle

func CapsToTitle(inp string) string

func ContainsIgnoreCase

func ContainsIgnoreCase(a string, b string) bool

Check contains and irrespective of case.

func ContainsInArray

func ContainsInArray(array []string, inputString string) bool

Check contains and irrespective of case.

func ConvertBooleanToYesOrNo

func ConvertBooleanToYesOrNo(input bool) string

func FormatTime

func FormatTime(inputTime string) string

func GetApiErrorMessagesForCommand

func GetApiErrorMessagesForCommand(cmd *cobra.Command, apiError ApiError, subResource, operation string) []string

func GetApiSubErrorMessagesForCommand

func GetApiSubErrorMessagesForCommand(cmd *cobra.Command, apiSubError []ApiSubError, parentErrorKey, subResource, operation string) []string

Get All the error messages for api sub errors

func GetErrorMessageForArg

func GetErrorMessageForArg(cmd *cobra.Command, errorType, argKeyInJson string) string

Get different type of message for positional args

func GetErrorMessageForFlag

func GetErrorMessageForFlag(cmd *cobra.Command, errorType, flagKeyInJson string) string

Get different type of message for flag

func GetGlobalErrorMessage

func GetGlobalErrorMessage(key string) string

Get global errors for given key

func GetGlobalFallBackMessage

func GetGlobalFallBackMessage() string

get fallback message

func GetMessageForKey

func GetMessageForKey(baseCmdPath *cobra.Command, key string) string

Return message for given key under command.

func GetPlaceHoldersInString

func GetPlaceHoldersInString(errorMessage, regex string) []string

Get all placeholders in string inside {{}}

func InitLoggingConfig

func InitLoggingConfig()

func PrintCurlResponse

func PrintCurlResponse(curlResponse CurlResponse)

func PrintDigResponse

func PrintDigResponse(digResponse DigResponse)

func PrintError

func PrintError(message string, args ...interface{})

Start Standard Print Functions

func PrintFailedIps

func PrintFailedIps(failedIps []string, failedIpsMessage string)

func PrintGtmHostnamesTable

func PrintGtmHostnamesTable(gtmPropertyContainer GtmPropertyContainer)

func PrintGtmTestTargetIpTable

func PrintGtmTestTargetIpTable(gtmPropertyIpsContainer GtmPropertyIpsContainer)

func PrintHeader

func PrintHeader(message string, args ...interface{})

func PrintIpaHostnamesTable

func PrintIpaHostnamesTable(ipaHostnamesResponse IpaHostnameResponse)

func PrintLocateIpResponse

func PrintLocateIpResponse(geoLocation GeoLocation, ip string)

func PrintLocateIpsResponse

func PrintLocateIpsResponse(verifyLocateIpsResponse VerifyLocateIpsResponse, failedIpsMessage string)

func PrintMtrResponse

func PrintMtrResponse(mtrRequest MtrRequest, mtrResponse MtrResponse)

func PrintSuccess

func PrintSuccess(message string, args ...interface{})

func PrintSuggestedActions

func PrintSuggestedActions(suggestedActions []string)

func PrintTranslateUrlResponse

func PrintTranslateUrlResponse(arlContainer ArlContainer)

func PrintUserDiagnosticsDataGroupDetails

func PrintUserDiagnosticsDataGroupDetails(userDiagnosticsDataGroupDetails UserDiagnosticsDataGroupDetails)

func PrintUserDiagnosticsDataGroupDetailsAfterCreate

func PrintUserDiagnosticsDataGroupDetailsAfterCreate(userDiagnosticsDataGroupDetails UserDiagnosticsDataGroupDetails)

func PrintUserDiagnosticsDataGroupDetailsTable

func PrintUserDiagnosticsDataGroupDetailsTable(groupsList []UserDiagnosticsDataGroupDetails)

func PrintVerifyIpResponse

func PrintVerifyIpResponse(verifyLocateIpResponse VerifyLocateIpResponse)

func PrintVerifyIpsResponse

func PrintVerifyIpsResponse(verifyLocateIpsResponse VerifyLocateIpsResponse, failedIpsMessage string)

func PrintWarning

func PrintWarning(message string, args ...interface{})

func ReadStdin

func ReadStdin() []byte

func ShowTable

func ShowTable(tableHeaders []string, tableContents [][]string)

ShowTable Standard function to show table in same format across Test Center CLI

func SplitCurlHeaderString

func SplitCurlHeaderString(responseHeaderString string) string

func StartSpinner

func StartSpinner(message string) *spinner.Spinner

func StopSpinner

func StopSpinner(s *spinner.Spinner, success bool)

Types

type ApiClient

type ApiClient struct {
	// contains filtered or unexported fields
}

func NewApiClient

func NewApiClient(client EdgeGridHttpClient) *ApiClient

func (ApiClient) ConnectivityProblemsGet

func (api ApiClient) ConnectivityProblemsGet(link string) (*[]byte, *CliError)

func (ApiClient) ConnectivityProblemsPost

func (api ApiClient) ConnectivityProblemsPost(connectivityProblemsRequest ConnectivityProblemsRequest) (*[]byte, *CliError)

func (ApiClient) ContentProblemsGet

func (api ApiClient) ContentProblemsGet(link string) (*[]byte, *CliError)

func (ApiClient) ContentProblemsPost

func (api ApiClient) ContentProblemsPost(contentProblemsRequest ContentProblemsRequest) (*[]byte, *CliError)

func (ApiClient) Curl

func (api ApiClient) Curl(curlRequest CurlRequest) (*[]byte, *CliError)

func (ApiClient) Dig

func (api ApiClient) Dig(digRequest DigRequest) (*[]byte, *CliError)

func (ApiClient) EdgeLocations

func (api ApiClient) EdgeLocations() (*[]byte, *CliError)

func (ApiClient) Estats

func (api ApiClient) Estats(estatsRequest EstatsRequest) (*[]byte, *CliError)

func (ApiClient) GrepGet

func (api ApiClient) GrepGet(link string) (*[]byte, *CliError)

func (ApiClient) GrepPost

func (api ApiClient) GrepPost(grepRequest GrepRequest) (*[]byte, *CliError)

func (ApiClient) GtmHostnames

func (api ApiClient) GtmHostnames() (*[]byte, *CliError)

func (ApiClient) GtmTestTargetIp

func (api ApiClient) GtmTestTargetIp(property string, domain string) (*[]byte, *CliError)

func (ApiClient) IpaHostnames

func (api ApiClient) IpaHostnames() (*[]byte, *CliError)

func (ApiClient) LocateIp

func (api ApiClient) LocateIp(locateIpsRequest VerifyLocateIpsRequest) (*[]byte, *CliError)

func (ApiClient) Mtr

func (api ApiClient) Mtr(mtrRequest MtrRequest) (*[]byte, *CliError)

func (ApiClient) TranslateErrorGet

func (api ApiClient) TranslateErrorGet(link string) (*[]byte, *CliError)

func (ApiClient) TranslateErrorPost

func (api ApiClient) TranslateErrorPost(errorTranslatorRequest ErrorTranslatorRequest) (*[]byte, *CliError)

func (ApiClient) TranslateUrl

func (api ApiClient) TranslateUrl(arlRequest ArlRequest) (*[]byte, *CliError)

func (ApiClient) UrlHealthCheckGet

func (api ApiClient) UrlHealthCheckGet(link string) (*[]byte, *CliError)

func (ApiClient) UrlHealthCheckPost

func (api ApiClient) UrlHealthCheckPost(urlHealthCheckRequest UrlHealthCheckRequest) (*[]byte, *CliError)

func (ApiClient) UserDiagnosticsCreate

func (api ApiClient) UserDiagnosticsCreate(userDiagnosticsDataRequest UserDiagnosticsDataRequest) (*[]byte, *CliError)

func (ApiClient) UserDiagnosticsGet

func (api ApiClient) UserDiagnosticsGet(linkId string, mtr, dig, curl bool) (*[]byte, *CliError)

func (ApiClient) UserDiagnosticsList

func (api ApiClient) UserDiagnosticsList(urlFilter, user string, active bool) (*[]byte, *CliError)

func (ApiClient) VerifyIp

func (api ApiClient) VerifyIp(verifyIpsRequest VerifyLocateIpsRequest) (*[]byte, *CliError)

func (ApiClient) VerifyLocateIp

func (api ApiClient) VerifyLocateIp(verifyLocateIpRequest VerifyLocateIpRequest) (*[]byte, *CliError)

type ApiError

type ApiError struct {
	Type     string        `json:"type"`
	Title    string        `json:"title"`
	Status   int           `json:"status"`
	Instance string        `json:"instance"`
	Detail   string        `json:"detail"`
	Errors   []ApiSubError `json:"errors"`
}

ApiError object for API error payloads

type ApiSubError

type ApiSubError struct {
	Type          string        `json:"type"`
	Title         string        `json:"title"`
	RequestField  string        `json:"requestField"`
	RequestValues []interface{} `json:"requestValues"`
	Detail        string        `json:"detail"`
}

ApiSubError object represents sub-errors of an error payload or error response in 207

type Arl added in v1.1.0

type Arl struct {
	Comparison string   `json:"comparison"`
	Value      []string `json:"value"`
}

type ArlContainer

type ArlContainer struct {
	Request       ArlRequest `json:"request"`
	TranslatedUrl ArlOutput  `json:"translatedUrl"`
}

type ArlOutput

type ArlOutput struct {
	TypeCode         string `json:"typeCode"`
	CacheKeyHostname string `json:"cacheKeyHostname"`
	CpCode           string `json:"cpCode"`
	SerialNumber     string `json:"serialNumber"`
	Ttl              string `json:"ttl"`
	Pragma           string `json:"pragma"`
	CacheControl     string `json:"cacheControl"`
}

type ArlRequest

type ArlRequest struct {
	Url string `json:"url"`
}

type CliError

type CliError struct {
	// contains filtered or unexported fields
}

CliError is used to transmit errors across the app

func CliErrorFromPulsarProblemObject

func CliErrorFromPulsarProblemObject(apiErrorByte []byte, responseCode int, fallbackMessage string) *CliError

func CliErrorWithMessage

func CliErrorWithMessage(message string) *CliError

type ConnectivityProblemsRequest

type ConnectivityProblemsRequest struct {
	Url               string   `json:"url"`
	EdgeLocationId    string   `json:"edgeLocationId,omitempty"`
	SpoofEdgeIp       string   `json:"spoofEdgeIp,omitempty"`
	ClientIp          string   `json:"clientIp,omitempty"`
	RequestHeaders    []string `json:"requestHeaders,omitempty"`
	IpVersion         string   `json:"ipVersion,omitempty"`
	PacketType        string   `json:"packetType,omitempty"`
	Port              int      `json:"port,omitempty"`
	RunFromSiteShield bool     `json:"runFromSiteShield,omitempty"`
}

type ConnectivityProblemsResponse

type ConnectivityProblemsResponse struct {
	ExecutionStatus string `json:"executionStatus"`
	RetryAfter      int    `json:"retryAfter"`
	Link            string `json:"link"`
}

type ContentProblemsRequest

type ContentProblemsRequest struct {
	Url               string   `json:"url"`
	EdgeLocationId    string   `json:"edgeLocationId,omitempty"`
	EdgeIp            string   `json:"spoofEdgeIp,omitempty"`
	RequestHeaders    []string `json:"requestHeaders,omitempty"`
	IpVersion         string   `json:"ipVersion,omitempty"`
	RunFromSiteShield bool     `json:"runFromSiteShield,omitempty"`
}

type ContentProblemsResponse

type ContentProblemsResponse struct {
	ExecutionStatus string `json:"executionStatus"`
	RetryAfter      int    `json:"retryAfter"`
	Link            string `json:"link"`
}

type CurlOutput

type CurlOutput struct {
	HttpStatusCode     int               `json:"httpStatusCode"`
	ResponseHeaders    map[string]string `json:"responseHeaders"`
	Timing             Timing            `json:"timing,omitempty"`
	ResponseBody       string            `json:"responseBody"`
	ResponseHeaderList []string          `json:"responseHeaderList"`
	HttpVersion        string            `json:"httpVersion"`
	ReasonPhrase       string            `json:"reasonPhrase"`
	PartialSuccess     bool              `json:"partialSuccess"`
}

type CurlRequest

type CurlRequest struct {
	Url               string   `json:"url"`
	EdgeIp            string   `json:"edgeIp,omitempty"`
	EdgeLocationId    string   `json:"edgeLocationId,omitempty"`
	IpVersion         string   `json:"ipVersion,omitempty"`
	RequestHeaders    []string `json:"requestHeaders,omitempty"`
	RunFromSiteShield bool     `json:"runFromSiteShield,omitempty"`
}

CurlRequest

type CurlResponse

type CurlResponse struct {
	Request              CurlRequest    `json:"request"`
	CreatedBy            string         `json:"createdBy"`
	CreatedTime          string         `json:"createdTime"`
	CompletedTime        string         `json:"completedTime"`
	ExecutionStatus      string         `json:"executionStatus"`
	InternalIp           string         `json:"internalIp"`
	EdgeIpLocation       EdgeIpLocation `json:"edgeIpLocation"`
	SiteShieldIp         string         `json:"siteShieldIp"`
	SiteShieldIpLocation EdgeIpLocation `json:"siteShieldIpLocation"`
	CurlOutput           CurlOutput     `json:"result"`
	SuggestedActions     []string       `json:"suggestedActions"`
	Warning              Warning        `json:"warning"`
}

type DigInfo

type DigInfo struct {
	Result string `json:"result"`
}

DigInfo

type DigRequest

type DigRequest struct {
	Hostname       string `json:"hostname"`
	QueryType      string `json:"queryType"`
	ClientLocation string `json:"edgeLocationId,omitempty"`
	EdgeServerIp   string `json:"edgeIp,omitempty"`
	IsGtmHostName  bool   `json:"isGtmHostname"`
}

DigRequest

type DigResponse

type DigResponse struct {
	Request          DigRequest     `json:"request"`
	CreatedTime      string         `json:"createdTime"`
	CreatedBy        string         `json:"createdBy"`
	CompletedTime    string         `json:"completedTime"`
	ExecutionStatus  string         `json:"executionStatus"`
	EdgeIpLocation   EdgeIpLocation `json:"edgeIpLocation"`
	InternalIp       string         `json:"internalIp"`
	Result           DigInfo        `json:"result"`
	SuggestedActions []string       `json:"suggestedActions"`
	Type             string         `json:"type"`
	Title            string         `json:"title"`
	Status           int            `json:"status"`
	Detail           string         `json:"detail"`
}

DigResponse

type DnsRecord

type DnsRecord struct {
	Domain          string `json:"domain"`
	Hostname        string `json:"hostName"`
	Ttl             string `json:"ttl"`
	RecordClass     string `json:"recordClass"`
	RecordType      string `json:"recordType"`
	PreferenceValue int    `json:"preferenceValue"`
	Value           string `json:"value"`
}

DnsRecord

type EdgeGridHttpClient

type EdgeGridHttpClient struct {
	// contains filtered or unexported fields
}

func NewEdgeGridHttpClient

func NewEdgeGridHttpClient(filepath, section, accountSwitchKey string) *EdgeGridHttpClient

type EdgeIpInfo

type EdgeIpInfo struct {
	ErrorId        string         `json:"errorId,omitempty"`
	LogLinesCount  int            `json:"logLinesCount"`
	EdgeIp         string         `json:"edgeIp"`
	EdgeIpLocation EdgeIpLocation `json:"edgeIpLocation"`
	HttpStatus     int            `json:"httpStatus"`
	Hits           int            `json:"hits"`
	ObjectStatus   []ObjectStatus `json:"objectStatus"`
	ErrorCode      string         `json:"errorCode"`
	EdgeLogsLink   string         `json:"edgeLogsLink"`
}

type EdgeIpLocation

type EdgeIpLocation struct {
	City        string   `json:"city"`
	RegionCode  string   `json:"regionCode,omitempty"`
	CountryCode string   `json:"countryCode"`
	AsNum       *int     `json:"asNumber,omitempty"`
	Latitude    *float32 `json:"latitude,omitempty"`
	Longitude   *float32 `json:"longitude,omitempty"`
}

type EdgeLocation

type EdgeLocation struct {
	Id    string `json:"id"`
	Value string `json:"value"`
}

type EdgeLocationContainer

type EdgeLocationContainer struct {
	EdgeLocations []EdgeLocation `json:"edgeLocations"`
}

type ErrorTranslatorRequest

type ErrorTranslatorRequest struct {
	ErrorCode        string `json:"errorCode"`
	TraceForwardLogs bool   `json:"traceForwardLogs,omitempty"`
}

ErrorTranslatorRequest

type ErrorTranslatorResponse

type ErrorTranslatorResponse struct {
	ExecutionStatus string `json:"executionStatus"`
	RetryAfter      int    `json:"retryAfter"`
	Link            string `json:"link"`
}

ErrorTranslatorResponse

type EstatsData

type EstatsData struct {
	EdgeErrors                      int                      `json:"edgeErrors"`
	EdgeHits                        int                      `json:"edgeHits"`
	EdgeFailurePercentage           float64                  `json:"edgeFailurePercentage"`
	OriginErrors                    int                      `json:"originErrors"`
	OriginHits                      int                      `json:"originHits"`
	OriginFailurePercentage         float64                  `json:"originFailurePercentage"`
	TopEdgeIpsWithError             []EdgeIpInfo             `json:"topEdgeIpsWithError"`
	TopEdgeIpsWithErrorFromOrigin   []EdgeIpInfo             `json:"topEdgeIpsWithErrorFromOrigin"`
	TopEdgeIpsWithSuccess           []EdgeIpInfo             `json:"topEdgeIpsWithSuccess"`
	TopEdgeIpsWithSuccessFromOrigin []EdgeIpInfo             `json:"topEdgeIpsWithSuccessFromOrigin"`
	EdgeStatusCodeDistribution      []StatusCodeDistribution `json:"edgeStatusCodeDistribution"`
	OriginStatusCodeDistribution    []StatusCodeDistribution `json:"originStatusCodeDistribution"`
}

type EstatsGrepResponse

type EstatsGrepResponse struct {
	LogLinesCount    int            `json:"logLinesCount"`
	ExecutionStatus  string         `json:"executionStatus"`
	CreatedTime      string         `json:"createdTime"`
	CompletedTime    string         `json:"completedTime"`
	CreatedBy        string         `json:"createdBy"`
	LogsContainer    LogsContainer  `json:"result"`
	SuggestedActions []string       `json:"suggestedActions"`
	EdgeIpLocation   EdgeIpLocation `json:"edgeIpLocation"`
	Warning          Warning        `json:"warning"`
}

type EstatsRequest

type EstatsRequest struct {
	Url       string `json:"url,omitempty"`
	CpCode    int    `json:"cpCode,omitempty"`
	Delivery  string `json:"delivery,omitempty"`
	ErrorType string `json:"errorType,omitempty"`
}

EstatsRequest

type EstatsResult

type EstatsResult struct {
	Request         EstatsRequest `json:"request"`
	RequestId       int           `json:"requestId"`
	CreatedBy       string        `json:"createdBy"`
	CreatedTime     string        `json:"createdTime"`
	CompletedTime   string        `json:"completedTime"`
	ExecutionStatus string        `json:"executionStatus"`
	Result          EstatsData    `json:"result"`
}

type EstatsResultWrapper

type EstatsResultWrapper struct {
	EstatsResult   EstatsResult         `json:"estatsResult"`
	EstatsLogLines []EstatsGrepResponse `json:"estatsLogLines,omitempty"`
}

EstatsWrapper

type GTMPropertyIps

type GTMPropertyIps struct {
	Property string   `json:"property"`
	Domain   string   `json:"domain"`
	TestIps  []string `json:"testIps"`
	Targets  []string `json:"targets"`
}

type GeoLocation

type GeoLocation struct {
	AreaCode    string   `json:"areaCode"`
	AsNum       *int     `json:"asNumber"`
	City        string   `json:"city"`
	ClientIP    string   `json:"clientIp"`
	Continent   string   `json:"continent"`
	CountryCode string   `json:"countryCode"`
	County      string   `json:"county"`
	DMA         *int     `json:"dma"`
	FIPS        string   `json:"fips"`
	Latitude    *float32 `json:"latitude"`
	Longitude   *float32 `json:"longitude"`
	MSA         *int     `json:"msa"`
	Network     string   `json:"network"`
	NetworkType string   `json:"networkType"`
	PMSA        *int     `json:"pmsa"`
	Proxy       string   `json:"proxy"`
	RegionCode  string   `json:"regionCode"`
	Throughput  string   `json:"throughput"`
	TimeZone    string   `json:"timeZone"`
	ZipCode     string   `json:"zipCode"`
}

Geolocation

type GrepRequest

type GrepRequest struct {
	CpCodes         []int           `json:"cpCodes,omitempty"`
	Hostnames       []string        `json:"hostnames,omitempty"`
	EdgeIp          string          `json:"edgeIp"`
	LogType         string          `json:"logType"`
	Start           string          `json:"start"`
	End             string          `json:"end"`
	UserAgents      []string        `json:"userAgent,omitempty"`
	HttpStatusCodes *HttpStatusCode `json:"httpStatusCodes,omitempty"`
	Arls            *Arl            `json:"arls,omitempty"`
	ClientIps       []string        `json:"clientIps,omitempty"`
}

type GrepResponse

type GrepResponse struct {
	ExecutionStatus string `json:"executionStatus"`
	RetryAfter      int    `json:"retryAfter"`
	Link            string `json:"link"`
}

type GtmProperty

type GtmProperty struct {
	Property string `json:"property"`
	Domain   string `json:"domain"`
	Hostname string `json:"hostname"`
	DomainId int    `json:"domainId"`
}

type GtmPropertyContainer

type GtmPropertyContainer struct {
	GtmProperties []GtmProperty `json:"gtmProperties"`
}

type GtmPropertyIpsContainer

type GtmPropertyIpsContainer struct {
	GTMPropertyIps GTMPropertyIps `json:"gtmPropertyIps"`
}

type HttpStatusCode

type HttpStatusCode struct {
	Comparison string   `json:"comparison"`
	Value      []string `json:"value"`
}

type IpaHostnameResponse

type IpaHostnameResponse struct {
	Hostnames []string `json:"hostnames"`
}

type Legend

type Legend struct {
	LogType       map[string]string `json:"logType"`
	ObjectStatus  map[string]string `json:"objectStatus"`
	ObjectStatus2 map[string]string `json:"objectStatus2"`
}

type ListResponse

type ListResponse struct {
	Groups []UserDiagnosticsDataGroupDetails `json:"groups,omitempty"`
}

add all list responses, use this as a container

type LogsContainer

type LogsContainer struct {
	Logs   []map[string]string `json:"logs"`
	Legend Legend              `json:"legend"`
}

type MtrHop

type MtrHop struct {
	Number            int            `json:"number"`
	IP                string         `json:"ip"`
	IPLocation        EdgeIpLocation `json:"ipLocation"`
	Host              string         `json:"host"`
	PacketLoss        float64        `json:"packetLoss"`
	SentPackets       int            `json:"sentPackets"`
	LastPacketLatency float64        `json:"lastPacketLatency"`
	AverageLatency    float64        `json:"averageLatency"`
	BestRtt           float64        `json:"bestRtt"`
	WorstRtt          float64        `json:"worstRtt"`
	StandardDeviation float64        `json:"standardDeviation"`
}

Mtr hop

type MtrRequest

type MtrRequest struct {
	Source             string `json:"source"`
	Destination        string `json:"destination"`
	PacketType         string `json:"packetType"`
	SourceType         string `json:"sourceType,omitempty"`
	DestinationType    string `json:"destinationType,omitempty"`
	IPVersion          string `json:"ipVersion,omitempty"`
	Port               int    `json:"port,omitempty"`
	GtmHostname        string `json:"gtmHostname,omitempty"`
	SiteShieldHostname string `json:"siteShieldHostname,omitempty"`
}

MtrRequest

type MtrResponse

type MtrResponse struct {
	SourceIPLocation      EdgeIpLocation `json:"sourceIpLocation"`
	DestinationIPLocation EdgeIpLocation `json:"destinationIpLocation"`
	SourceContext         string         `json:"sourceContext"`
	DestinationContext    string         `json:"destinationContext"`
	SourceInternalIP      string         `json:"sourceInternalIp"`
	DestinationInternalIP string         `json:"destinationInternalIp"`
	CreatedBy             string         `json:"createdBy"`
	CreatedTime           string         `json:"createdTime"`
	SiteShieldIp          string         `json:"siteShieldIp"`
	SiteShieldIpLocation  EdgeIpLocation `json:"siteShieldIpLocation"`
	Result                MtrResult      `json:"result"`
	SuggestedActions      []string       `json:"suggestedActions"`
}

MtrResponse

type MtrResult

type MtrResult struct {
	Host string   `json"host"`
	Hops []MtrHop `json:"hops"`
}

MtrResult

type ObjectStatus

type ObjectStatus struct {
	Code        string `json:"code"`
	Description string `json:"description"`
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(api ApiClient, cmd *cobra.Command, outputAsJson bool) *Service

func (Service) ConnectivityProblems

func (svc Service) ConnectivityProblems(connectivityProblemsRequest ConnectivityProblemsRequest)

func (Service) ContentProblems

func (svc Service) ContentProblems(contentProblemsRequest ContentProblemsRequest)

func (Service) Curl

func (svc Service) Curl(curlRequest CurlRequest)

func (Service) Dig

func (svc Service) Dig(digRequest DigRequest)

func (Service) EdgeLocations

func (svc Service) EdgeLocations(searchText string)

func (Service) Estats

func (svc Service) Estats(estatsRequest EstatsRequest, logsEstatsFlag bool)

func (Service) Grep

func (svc Service) Grep(grepRequest GrepRequest)

func (Service) GtmHostnames

func (svc Service) GtmHostnames()

func (Service) GtmTestTargetIp

func (svc Service) GtmTestTargetIp(hostname string)

func (Service) IpaHostnames

func (svc Service) IpaHostnames()

func (Service) LocateIp

func (svc Service) LocateIp(locateIpsRequest VerifyLocateIpsRequest)

func (Service) Mtr

func (svc Service) Mtr(mtrRequest MtrRequest)

func (Service) TranslateError

func (svc Service) TranslateError(errorTranslatorRequest ErrorTranslatorRequest)

func (Service) TranslateUrl

func (svc Service) TranslateUrl(arlRequest ArlRequest)

func (Service) UrlHealthCheck

func (svc Service) UrlHealthCheck(urlHealthCheckRequest UrlHealthCheckRequest)

func (Service) UserDiagnosticsCreate

func (svc Service) UserDiagnosticsCreate(userDiagnosticsDataRequest UserDiagnosticsDataRequest)

func (Service) UserDiagnosticsGet

func (svc Service) UserDiagnosticsGet(linkId string, mtr, dig, curl bool)

func (Service) UserDiagnosticsList

func (svc Service) UserDiagnosticsList(url, user string, active bool)

func (Service) VerifyIp

func (svc Service) VerifyIp(verifyIpsRequest VerifyLocateIpsRequest)

func (Service) VerifyLocateIp

func (svc Service) VerifyLocateIp(verifyLocateIpRequest VerifyLocateIpRequest)

type StatusCodeDistribution

type StatusCodeDistribution struct {
	HttpStatus int     `json:"httpStatus"`
	Hits       int     `json:"hits"`
	Percentage float64 `json:"percentage"`
}

type Timing

type Timing struct {
	DnsLookupTime     float64 `json:"dnsLookupTime,omitempty"`
	TcpConnectionTime float64 `json:"tcpConnectionTime,omitempty"`
	SslConnectionTime float64 `json:"sslConnectionTime,omitempty"`
	TimeToFirstByte   float64 `json:"timeToFirstByte,omitempty"`
	TotalTime         float64 `json:"totalTime,omitempty"`
}

type UrlHealthCheckRequest

type UrlHealthCheckRequest struct {
	Url               string   `json:"url"`
	EdgeLocationId    string   `json:"edgeLocationId,omitempty"`
	EdgeIp            string   `json:"spoofEdgeIp,omitempty"`
	Port              int      `json:"port,omitempty"`
	PacketType        string   `json:"packetType,omitempty"`
	IpVersion         string   `json:"ipVersion,omitempty"`
	RequestHeaders    []string `json:"requestHeaders,omitempty"`
	QueryType         string   `json:"queryType,omitempty"`
	ViewsAllowed      []string `json:"viewsAllowed,omitempty"`
	RunFromSiteShield bool     `json:"runFromSiteShield,omitempty"`
}

type UrlHealthCheckResponse

type UrlHealthCheckResponse struct {
	ExecutionStatus string `json:"executionStatus"`
	RetryAfter      int    `json:"retryAfter"`
	Link            string `json:"link"`
}

type UserDiagnosticsDataGroupDetails

type UserDiagnosticsDataGroupDetails struct {
	GroupID              string `json:"groupId"`
	Note                 string `json:"note"`
	URL                  string `json:"url"`
	IpaHostname          string `json:"ipaHostname"`
	CreatedTime          string `json:"createdTime"`
	DiagnosticLink       string `json:"diagnosticLink"`
	DiagnosticLinkStatus string `json:"diagnosticLinkStatus"`
	RecordCount          int    `json:"recordCount"`
	CreatedBy            string `json:"createdBy"`
}

UserDiagnosticsDataGroupDetails

type UserDiagnosticsDataRequest

type UserDiagnosticsDataRequest struct {
	Url         string `json:"url,omitempty"`
	Note        string `json:"note,omitempty"`
	IpaHostname string `json:"ipaHostname,omitempty"`
}

UserDiagnosticsDataRequest

type Validator

type Validator struct {
	// contains filtered or unexported fields
}

func NewValidator

func NewValidator(cmd *cobra.Command, jsonData []byte) *Validator

func (Validator) ValidateConnectivityProblemsFields

func (validator Validator) ValidateConnectivityProblemsFields(args []string, portStr string, connectivityProblemsRequest *ConnectivityProblemsRequest)

func (Validator) ValidateContentProblemsFields

func (validator Validator) ValidateContentProblemsFields(args []string, contentProblemsRequest *ContentProblemsRequest)

func (Validator) ValidateCurlFields

func (validator Validator) ValidateCurlFields(args []string, curlRequest *CurlRequest)

func (Validator) ValidateDigFields

func (validator Validator) ValidateDigFields(args []string, digRequest *DigRequest)

func (Validator) ValidateEstatsFields

func (validator Validator) ValidateEstatsFields(args []string, estatsRequest *EstatsRequest, logs, enhancedTls, standardTls, edgeErrors, originErrors bool)

func (Validator) ValidateGrepFields

func (validator Validator) ValidateGrepFields(args []string, grepRequest *GrepRequest, errorStatusCodeFlag, clientRequest, forwardRequest bool, httpStatusCodes []string, arls []string)

func (Validator) ValidateIpVersionFlag

func (validator Validator) ValidateIpVersionFlag(ipVersion *string, field string, required bool)

func (Validator) ValidateMtrFields

func (validator Validator) ValidateMtrFields(args []string, portStr string, mtrRequest *MtrRequest)

func (Validator) ValidatePacketTypeFlag

func (validator Validator) ValidatePacketTypeFlag(packetType *string, field string, required bool)

func (Validator) ValidatePortFlag

func (validator Validator) ValidatePortFlag(port string, portInt *int, field string, required bool)

func (Validator) ValidateTranslateErrorFields

func (validator Validator) ValidateTranslateErrorFields(args []string, errorTranslatorRequest *ErrorTranslatorRequest, traceForwardLogs bool)

func (Validator) ValidateTranslateUrlFields

func (validator Validator) ValidateTranslateUrlFields(args []string, translateUrlRequest *ArlRequest)

func (Validator) ValidateUrlHealthCheckFields

func (validator Validator) ValidateUrlHealthCheckFields(args []string, portStr string, urlHealthCheckRequest *UrlHealthCheckRequest, logs, networkConnectivity bool)

func (Validator) ValidateUserDiagnosticsCreateFields

func (validator Validator) ValidateUserDiagnosticsCreateFields(args []string, userDiagnosticsDataRequest *UserDiagnosticsDataRequest)

func (Validator) ValidateVerifyIpOrLocateIpFields

func (validator Validator) ValidateVerifyIpOrLocateIpFields(args []string, verifyLocateIpsRequest *VerifyLocateIpsRequest)

func (Validator) ValidateVerifyLocateIpFields

func (validator Validator) ValidateVerifyLocateIpFields(args []string, verifyLocateIpRequest *VerifyLocateIpRequest)

type VerifyLocateIpData

type VerifyLocateIpData struct {
	IsEdgeIp    bool        `json:"isEdgeIp"`
	GeoLocation GeoLocation `json:"geoLocation"`
}

VerifyLocateIp Result

type VerifyLocateIpRequest

type VerifyLocateIpRequest struct {
	IpAddress string `json:"ipAddress"`
}

VerifyLocateIpRequest

type VerifyLocateIpResponse

type VerifyLocateIpResponse struct {
	Request         VerifyLocateIpRequest `json:"request"`
	CreatedTime     string                `json:"createdTime"`
	CreatedBy       string                `json:"createdBy"`
	ExecutionStatus string                `json:"executionStatus"`
	Result          VerifyLocateIpData    `json:"result"`
}

VerifyLocateIpResponse

type VerifyLocateIpsData

type VerifyLocateIpsData struct {
	ExecutionStatus string      `json:"executionStatus"`
	IpAddress       string      `json:"ipAddress"`
	IsEdgeIp        bool        `json:"isEdgeIp"`
	GeoLocation     GeoLocation `json:"geoLocation"`
}

VerifyLocateIpsData

type VerifyLocateIpsRequest

type VerifyLocateIpsRequest struct {
	IpAddresses []string `json:"ipAddresses"`
}

VerifyLocateIpsRequest

type VerifyLocateIpsResponse

type VerifyLocateIpsResponse struct {
	Request         VerifyLocateIpsRequest `json:"request"`
	CreatedTime     string                 `json:"createdTime"`
	CreatedBy       string                 `json:"createdBy"`
	ExecutionStatus string                 `json:"executionStatus"`
	Result          []VerifyLocateIpsData  `json:"results"`
}

VerifyLocateIpsResponse

type Warning

type Warning struct {
	Key     string `json:"key"`
	Message string `json:"message"`
}

Jump to

Keyboard shortcuts

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