ddosx

package
v1.10.2 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type ACLGeoIPRule

type ACLGeoIPRule struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Code string `json:"code"`
}

ACLGeoIPRule represents a DDoSX ACL GeoIP rule

type ACLGeoIPRuleNotFoundError

type ACLGeoIPRuleNotFoundError struct {
	ID string
}

ACLGeoIPRuleNotFoundError indicates an ACL GeoIP rule was not found

func (*ACLGeoIPRuleNotFoundError) Error

func (e *ACLGeoIPRuleNotFoundError) Error() string

type ACLGeoIPRulesMode

type ACLGeoIPRulesMode string
const (
	ACLGeoIPRulesModeWhitelist ACLGeoIPRulesMode = "Whitelist"
	ACLGeoIPRulesModeBlacklist ACLGeoIPRulesMode = "Blacklist"
)

func ParseACLGeoIPRulesMode

func ParseACLGeoIPRulesMode(s string) (ACLGeoIPRulesMode, error)

ParseACLGeoIPRulesMode attempts to parse a ACLGeoIPRulesMode from string

func (ACLGeoIPRulesMode) String

func (s ACLGeoIPRulesMode) String() string

type ACLIPMode

type ACLIPMode string
const (
	ACLIPModeAllow ACLIPMode = "Allow"
	ACLIPModeDeny  ACLIPMode = "Deny"
)

func ParseACLIPMode

func ParseACLIPMode(s string) (ACLIPMode, error)

ParseACLIPMode attempts to parse a ACLIPMode from string

func (ACLIPMode) String

func (s ACLIPMode) String() string

type ACLIPRule

type ACLIPRule struct {
	ID   string               `json:"id"`
	IP   connection.IPAddress `json:"ip"`
	URI  string               `json:"uri"`
	Mode ACLIPMode            `json:"mode"`
}

ACLIPRule represents a DDoSX ACL IP rule

type ACLIPRuleNotFoundError

type ACLIPRuleNotFoundError struct {
	ID string
}

ACLIPRuleNotFoundError indicates an ACL IP rule was not found

func (*ACLIPRuleNotFoundError) Error

func (e *ACLIPRuleNotFoundError) Error() string

type CDNRule

type CDNRule struct {
	ID           string              `json:"id"`
	URI          string              `json:"uri"`
	CacheControl CDNRuleCacheControl `json:"cache_control"`
	// CacheControlDuration specifies the cache control duration. May be nil if duration not applicable
	CacheControlDuration CDNRuleCacheControlDuration `json:"cache_control_duration"`
	MimeTypes            []string                    `json:"mime_types"`
	Type                 CDNRuleType                 `json:"type"`
}

CDNRule represents a DDoSX CDN rule

type CDNRuleCacheControl

type CDNRuleCacheControl string
const (
	CDNRuleCacheControlCustom CDNRuleCacheControl = "Custom"
	CDNRuleCacheControlOrigin CDNRuleCacheControl = "Origin"
)

func ParseCDNRuleCacheControl

func ParseCDNRuleCacheControl(s string) (CDNRuleCacheControl, error)

ParseCDNRuleCacheControl attempts to parse a CDNRuleCacheControl from string

func (CDNRuleCacheControl) String

func (e CDNRuleCacheControl) String() string

type CDNRuleCacheControlDuration

type CDNRuleCacheControlDuration struct {
	Years   int `json:"years"`
	Months  int `json:"months"`
	Days    int `json:"days"`
	Hours   int `json:"hours"`
	Minutes int `json:"minutes"`
}

CDNRuleCacheControlDuration represents a DDoSX CDN rule duration

func ParseCDNRuleCacheControlDuration

func ParseCDNRuleCacheControlDuration(s string) (*CDNRuleCacheControlDuration, error)

ParseCDNRuleCacheControlDuration parses string s and returns a pointer to an initialised CDNRuleCacheControlDuration

func (*CDNRuleCacheControlDuration) Duration

Duration returns the cache control duration as time.Duration

func (*CDNRuleCacheControlDuration) String

func (d *CDNRuleCacheControlDuration) String() string

type CDNRuleNotFoundError

type CDNRuleNotFoundError struct {
	ID string
}

CDNRuleNotFoundError indicates a CDN rule was not found

func (*CDNRuleNotFoundError) Error

func (e *CDNRuleNotFoundError) Error() string

type CDNRuleType

type CDNRuleType string
const (
	CDNRuleTypeGlobal CDNRuleType = "global"
	CDNRuleTypePerURI CDNRuleType = "per-uri"
)

func ParseCDNRuleType

func ParseCDNRuleType(s string) (CDNRuleType, error)

ParseCDNRuleType attempts to parse a CDNRuleType from string

func (CDNRuleType) String

func (e CDNRuleType) String() string

type CreateACLGeoIPRuleRequest

type CreateACLGeoIPRuleRequest struct {
	connection.APIRequestBodyDefaultValidator

	Code string `json:"code" validate:"required"`
}

CreateACLGeoIPRuleRequest represents a DDoSX GeoIP ACL rule

func (*CreateACLGeoIPRuleRequest) Validate

Validate returns an error if struct properties are missing/invalid

type CreateACLIPRuleRequest

type CreateACLIPRuleRequest struct {
	connection.APIRequestBodyDefaultValidator

	IP   connection.IPAddress `json:"ip" validate:"required"`
	URI  string               `json:"uri"`
	Mode ACLIPMode            `json:"mode" validate:"required"`
}

CreateACLIPRuleRequest represents a DDoSX IP ACL rule

func (*CreateACLIPRuleRequest) Validate

Validate returns an error if struct properties are missing/invalid

type CreateCDNRuleRequest

type CreateCDNRuleRequest struct {
	connection.APIRequestBodyDefaultValidator

	URI                  string                       `json:"uri" validate:"required"`
	CacheControl         CDNRuleCacheControl          `json:"cache_control" validate:"required"`
	CacheControlDuration *CDNRuleCacheControlDuration `json:"cache_control_duration,omitempty"`
	MimeTypes            []string                     `json:"mime_types" validate:"required"`
	Type                 CDNRuleType                  `json:"type" validate:"required"`
}

CreateCDNRuleRequest represents a DDoSX CDN rule create request

func (*CreateCDNRuleRequest) Validate

Validate returns an error if struct properties are missing/invalid

type CreateDomainRequest

type CreateDomainRequest struct {
	connection.APIRequestBodyDefaultValidator

	Name string `json:"name" validate:"required"`
}

CreateDomainRequest represents a request to create a DDoSX domain

func (*CreateDomainRequest) Validate

Validate returns an error if struct properties are missing/invalid

type CreateHSTSRuleRequest

type CreateHSTSRuleRequest struct {
	connection.APIRequestBodyDefaultValidator

	MaxAge            int          `json:"max_age"`
	Preload           bool         `json:"preload"`
	IncludeSubdomains bool         `json:"include_subdomains"`
	Type              HSTSRuleType `json:"type" validate:"required"`
	RecordName        *string      `json:"record_name,omitempty"`
}

CreateHSTSRuleRequest represents a DDoSX HSTS rule create request

func (*CreateHSTSRuleRequest) Validate

Validate returns an error if struct properties are missing/invalid

type CreateRecordRequest

type CreateRecordRequest struct {
	connection.APIRequestBodyDefaultValidator

	Name            string     `json:"name" validate:"required"`
	SafeDNSRecordID int        `json:"safedns_record_id,omitempty"`
	SSLID           string     `json:"ssl_id,omitempty"`
	Type            RecordType `json:"type,omitempty"`
	Content         string     `json:"content,omitempty"`
}

CreateRecordRequest represents a request to create a DDoSX record

func (*CreateRecordRequest) Validate

Validate returns an error if struct properties are missing/invalid

type CreateSSLRequest

type CreateSSLRequest struct {
	connection.APIRequestBodyDefaultValidator

	FriendlyName string `json:"friendly_name" validate:"required"`
	UKFastSSLID  int    `json:"ukfast_ssl_id,omitempty"`
	Key          string `json:"key,omitempty"`
	Certificate  string `json:"certificate,omitempty"`
	CABundle     string `json:"ca_bundle,omitempty"`
}

CreateSSLRequest represents a DDoSX SSL create request

func (*CreateSSLRequest) Validate

Validate returns an error if struct properties are missing/invalid

type CreateWAFAdvancedRuleRequest

type CreateWAFAdvancedRuleRequest struct {
	connection.APIRequestBodyDefaultValidator

	Section  WAFAdvancedRuleSection  `json:"section" validate:"required"`
	Modifier WAFAdvancedRuleModifier `json:"modifier" validate:"required"`
	Phrase   string                  `json:"phrase" validate:"required"`
	IP       connection.IPAddress    `json:"ip" validate:"required"`
}

CreateWAFAdvancedRuleRequest represents a DDoSX WAF advanced rule create request

func (*CreateWAFAdvancedRuleRequest) Validate

Validate returns an error if struct properties are missing/invalid

type CreateWAFRequest

type CreateWAFRequest struct {
	connection.APIRequestBodyDefaultValidator

	Mode          WAFMode          `json:"mode" validate:"required"`
	ParanoiaLevel WAFParanoiaLevel `json:"paranoia_level" validate:"required"`
}

CreateWAFRequest represents a DDoSX WAF create request

func (*CreateWAFRequest) Validate

Validate returns an error if struct properties are missing/invalid

type CreateWAFRuleRequest

type CreateWAFRuleRequest struct {
	connection.APIRequestBodyDefaultValidator

	URI string               `json:"uri" validate:"required"`
	IP  connection.IPAddress `json:"ip" validate:"required"`
}

CreateWAFRuleRequest represents a DDoSX WAF rule create request

func (*CreateWAFRuleRequest) Validate

Validate returns an error if struct properties are missing/invalid

type DDoSXService

type DDoSXService interface {
	GetRecords(parameters connection.APIRequestParameters) ([]Record, error)
	GetRecordsPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[Record], error)

	GetDomains(parameters connection.APIRequestParameters) ([]Domain, error)
	GetDomainsPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[Domain], error)
	GetDomain(domainName string) (Domain, error)
	CreateDomain(req CreateDomainRequest) error
	DeleteDomain(domainName string, req DeleteDomainRequest) error
	DeployDomain(domainName string) error

	GetDomainRecords(domainName string, parameters connection.APIRequestParameters) ([]Record, error)
	GetDomainRecordsPaginated(domainName string, parameters connection.APIRequestParameters) (*connection.Paginated[Record], error)
	GetDomainRecord(domainName string, recordID string) (Record, error)
	CreateDomainRecord(domainName string, req CreateRecordRequest) (string, error)
	PatchDomainRecord(domainName string, recordID string, req PatchRecordRequest) error
	DeleteDomainRecord(domainName string, recordID string) error

	GetDomainProperties(domainName string, parameters connection.APIRequestParameters) ([]DomainProperty, error)
	GetDomainPropertiesPaginated(domainName string, parameters connection.APIRequestParameters) (*connection.Paginated[DomainProperty], error)
	GetDomainProperty(domainName string, propertyID string) (DomainProperty, error)
	PatchDomainProperty(domainName string, propertyID string, req PatchDomainPropertyRequest) error

	GetDomainWAF(domainName string) (WAF, error)
	CreateDomainWAF(domainName string, req CreateWAFRequest) error
	PatchDomainWAF(domainName string, req PatchWAFRequest) error
	DeleteDomainWAF(domainName string) error

	GetDomainWAFRuleSets(domainName string, parameters connection.APIRequestParameters) ([]WAFRuleSet, error)
	GetDomainWAFRuleSetsPaginated(domainName string, parameters connection.APIRequestParameters) (*connection.Paginated[WAFRuleSet], error)
	GetDomainWAFRuleSet(domainName string, ruleSetID string) (WAFRuleSet, error)
	PatchDomainWAFRuleSet(domainName string, ruleSetID string, req PatchWAFRuleSetRequest) error

	GetDomainWAFRules(domainName string, parameters connection.APIRequestParameters) ([]WAFRule, error)
	GetDomainWAFRulesPaginated(domainName string, parameters connection.APIRequestParameters) (*connection.Paginated[WAFRule], error)
	GetDomainWAFRule(domainName string, ruleID string) (WAFRule, error)
	CreateDomainWAFRule(domainName string, req CreateWAFRuleRequest) (string, error)
	PatchDomainWAFRule(domainName string, ruleSetID string, req PatchWAFRuleRequest) error
	DeleteDomainWAFRule(domainName string, ruleID string) error

	GetDomainWAFAdvancedRules(domainName string, parameters connection.APIRequestParameters) ([]WAFAdvancedRule, error)
	GetDomainWAFAdvancedRulesPaginated(domainName string, parameters connection.APIRequestParameters) (*connection.Paginated[WAFAdvancedRule], error)
	GetDomainWAFAdvancedRule(domainName string, ruleID string) (WAFAdvancedRule, error)
	CreateDomainWAFAdvancedRule(domainName string, req CreateWAFAdvancedRuleRequest) (string, error)
	PatchDomainWAFAdvancedRule(domainName string, ruleID string, req PatchWAFAdvancedRuleRequest) error
	DeleteDomainWAFAdvancedRule(domainName string, ruleID string) error

	GetSSLs(parameters connection.APIRequestParameters) ([]SSL, error)
	GetSSLsPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[SSL], error)
	GetSSL(sslID string) (SSL, error)
	CreateSSL(req CreateSSLRequest) (string, error)
	PatchSSL(sslID string, req PatchSSLRequest) (string, error)
	DeleteSSL(sslID string) error
	GetSSLContent(sslID string) (SSLContent, error)
	GetSSLPrivateKey(sslID string) (SSLPrivateKey, error)

	GetDomainACLGeoIPRules(domainName string, parameters connection.APIRequestParameters) ([]ACLGeoIPRule, error)
	GetDomainACLGeoIPRulesPaginated(domainName string, parameters connection.APIRequestParameters) (*connection.Paginated[ACLGeoIPRule], error)
	GetDomainACLGeoIPRule(domainName string, ruleID string) (ACLGeoIPRule, error)
	CreateDomainACLGeoIPRule(domainName string, req CreateACLGeoIPRuleRequest) (string, error)
	PatchDomainACLGeoIPRule(domainName string, ruleID string, req PatchACLGeoIPRuleRequest) error
	DeleteDomainACLGeoIPRule(domainName string, ruleID string) error
	GetDomainACLGeoIPRulesMode(domainName string) (ACLGeoIPRulesMode, error)
	PatchDomainACLGeoIPRulesMode(domainName string, req PatchACLGeoIPRulesModeRequest) error

	GetDomainACLIPRules(domainName string, parameters connection.APIRequestParameters) ([]ACLIPRule, error)
	GetDomainACLIPRulesPaginated(domainName string, parameters connection.APIRequestParameters) (*connection.Paginated[ACLIPRule], error)
	GetDomainACLIPRule(domainName string, ruleID string) (ACLIPRule, error)
	CreateDomainACLIPRule(domainName string, req CreateACLIPRuleRequest) (string, error)
	PatchDomainACLIPRule(domainName string, ruleID string, req PatchACLIPRuleRequest) error
	DeleteDomainACLIPRule(domainName string, ruleID string) error

	DownloadDomainVerificationFile(domainName string) (string, string, error)
	DownloadDomainVerificationFileStream(domainName string) (io.ReadCloser, string, error)
	VerifyDomainDNS(domainName string) error
	VerifyDomainFileUpload(domainName string) error

	AddDomainCDNConfiguration(domainName string) error
	DeleteDomainCDNConfiguration(domainName string) error
	CreateDomainCDNRule(domainName string, req CreateCDNRuleRequest) (string, error)
	GetDomainCDNRules(domainName string, parameters connection.APIRequestParameters) ([]CDNRule, error)
	GetDomainCDNRulesPaginated(domainName string, parameters connection.APIRequestParameters) (*connection.Paginated[CDNRule], error)
	GetDomainCDNRule(domainName string, ruleID string) (CDNRule, error)
	PatchDomainCDNRule(domainName string, ruleID string, req PatchCDNRuleRequest) error
	DeleteDomainCDNRule(domainName string, ruleID string) error
	PurgeDomainCDN(domainName string, req PurgeCDNRequest) error

	GetDomainHSTSConfiguration(domainName string) (HSTSConfiguration, error)
	AddDomainHSTSConfiguration(domainName string) error
	DeleteDomainHSTSConfiguration(domainName string) error
	CreateDomainHSTSRule(domainName string, req CreateHSTSRuleRequest) (string, error)
	GetDomainHSTSRules(domainName string, parameters connection.APIRequestParameters) ([]HSTSRule, error)
	GetDomainHSTSRulesPaginated(domainName string, parameters connection.APIRequestParameters) (*connection.Paginated[HSTSRule], error)
	GetDomainHSTSRule(domainName string, ruleID string) (HSTSRule, error)
	PatchDomainHSTSRule(domainName string, ruleID string, req PatchHSTSRuleRequest) error
	DeleteDomainHSTSRule(domainName string, ruleID string) error

	GetWAFLogs(parameters connection.APIRequestParameters) ([]WAFLog, error)
	GetWAFLogsPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[WAFLog], error)
	GetWAFLog(requestID string) (WAFLog, error)
	GetWAFLogMatches(parameters connection.APIRequestParameters) ([]WAFLogMatch, error)
	GetWAFLogMatchesPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[WAFLogMatch], error)
	GetWAFLogRequestMatches(requestID string, parameters connection.APIRequestParameters) ([]WAFLogMatch, error)
	GetWAFLogRequestMatchesPaginated(requestID string, parameters connection.APIRequestParameters) (*connection.Paginated[WAFLogMatch], error)
	GetWAFLogRequestMatch(requestID string, matchID string) (WAFLogMatch, error)

	ActivateDomainDNSRouting(domainName string) error
	DeactivateDomainDNSRouting(domainName string) error
}

DDoSXService is an interface for managing the DDoSX service

type DeleteDomainRequest

type DeleteDomainRequest struct {
	Summary     string `json:"summary"`
	Description string `json:"description"`
}

DeleteDomainRequest represents a DDoSX domain removal request

type Domain

type Domain struct {
	SafeDNSZoneID *int               `json:"safedns_zone_id"`
	Name          string             `json:"name"`
	Status        DomainStatus       `json:"status"`
	DNSActive     bool               `json:"dns_active"`
	CDNActive     bool               `json:"cdn_active"`
	WAFActive     bool               `json:"waf_active"`
	ExternalDNS   *DomainExternalDNS `json:"external_dns"`
}

Domain represents a DDoSX domain

type DomainAlreadyVerifiedError

type DomainAlreadyVerifiedError struct {
	Name string
}

DomainAlreadyVerifiedError indicates a domain is already verified

func (*DomainAlreadyVerifiedError) Error

type DomainCDNConfigurationNotFoundError

type DomainCDNConfigurationNotFoundError struct {
	DomainName string
}

DomainCDNConfigurationNotFoundError indicates CDN configuration was not found for domain

func (*DomainCDNConfigurationNotFoundError) Error

type DomainExternalDNS

type DomainExternalDNS struct {
	Verified           bool   `json:"verified"`
	VerificationString string `json:"verification_string"`
	Target             string `json:"target"`
}

DomainExternalDNS represents a DDoSX domain external DNS configuration

type DomainHSTSConfigurationNotFoundError

type DomainHSTSConfigurationNotFoundError struct {
	DomainName string
}

DomainHSTSConfigurationNotFoundError indicates HSTS configuration was not found for domain

func (*DomainHSTSConfigurationNotFoundError) Error

type DomainNotFoundError

type DomainNotFoundError struct {
	Name string
}

DomainNotFoundError indicates a domain was not found

func (*DomainNotFoundError) Error

func (e *DomainNotFoundError) Error() string

type DomainProperty

type DomainProperty struct {
	ID    string             `json:"id"`
	Name  DomainPropertyName `json:"name"`
	Value interface{}        `json:"value"`
}

DomainProperty represents a DDoSX domain property

type DomainPropertyName

type DomainPropertyName string
const (
	DomainPropertyNameClientMaxBodySize DomainPropertyName = "client_max_body_size"
	DomainPropertyNameProxyTimeout      DomainPropertyName = "proxy_timeout"
	DomainPropertyNameIPv6Enabled       DomainPropertyName = "ipv6_enabled"
	DomainPropertyNameSecureOrigin      DomainPropertyName = "secure_origin"
)

func ParseDomainPropertyName

func ParseDomainPropertyName(s string) (DomainPropertyName, error)

ParseDomainPropertyName attempts to parse a DomainPropertyName from string

func (DomainPropertyName) String

func (e DomainPropertyName) String() string

type DomainPropertyNotFoundError

type DomainPropertyNotFoundError struct {
	ID string
}

DomainPropertyNotFoundError indicates a domain property was not found

func (*DomainPropertyNotFoundError) Error

type DomainRecordNotFoundError

type DomainRecordNotFoundError struct {
	DomainName string
	ID         string
}

DomainRecordNotFoundError indicates a Domain Record was not found

func (*DomainRecordNotFoundError) Error

func (e *DomainRecordNotFoundError) Error() string

type DomainStatus

type DomainStatus string
const (
	DomainStatusConfigured    DomainStatus = "Configured"
	DomainStatusNotConfigured DomainStatus = "Not Configured"
	DomainStatusPending       DomainStatus = "Pending"
	DomainStatusFailed        DomainStatus = "Failed"
	DomainStatusCancelling    DomainStatus = "Cancelling"
	DomainStatusCancelled     DomainStatus = "Cancelled"
)

func (DomainStatus) String

func (s DomainStatus) String() string

type DomainWAFNotFoundError

type DomainWAFNotFoundError struct {
	DomainName string
}

DomainWAFNotFoundError indicates a WAF configuration was not found for domain

func (*DomainWAFNotFoundError) Error

func (e *DomainWAFNotFoundError) Error() string

type GetACLGeoIPRulesModeResponseBodyData

type GetACLGeoIPRulesModeResponseBodyData struct {
	Mode ACLGeoIPRulesMode `json:"mode"`
}

GetACLGeoIPRulesModeResponseBodyData represents an API response body data

type HSTSConfiguration

type HSTSConfiguration struct {
	Enabled bool `json:"enabled"`
}

HSTSConfiguration represents HSTS configuration for a DDoSX domain

type HSTSRule

type HSTSRule struct {
	ID                string       `json:"id"`
	MaxAge            int          `json:"max_age"`
	Preload           bool         `json:"preload"`
	IncludeSubdomains bool         `json:"include_subdomains"`
	Type              HSTSRuleType `json:"type"`
	RecordName        *string      `json:"record_name"`
}

HSTSRule represents HSTS rule for a DDoSX domain

type HSTSRuleNotFoundError

type HSTSRuleNotFoundError struct {
	ID string
}

HSTSRuleNotFoundError indicates a HSTS rule was not found

func (*HSTSRuleNotFoundError) Error

func (e *HSTSRuleNotFoundError) Error() string

type HSTSRuleType

type HSTSRuleType string
const (
	HSTSRuleTypeDomain HSTSRuleType = "domain"
	HSTSRuleTypeRecord HSTSRuleType = "record"
)

func ParseHSTSRuleType

func ParseHSTSRuleType(s string) (HSTSRuleType, error)

ParseHSTSRuleType attempts to parse a HSTSRuleType from string

func (HSTSRuleType) String

func (e HSTSRuleType) String() string

type PatchACLGeoIPRuleRequest

type PatchACLGeoIPRuleRequest struct {
	connection.APIRequestBodyDefaultValidator

	Code string `json:"code,omitempty"`
}

PatchACLGeoIPRuleRequest represents a DDoSX GeoIP ACL rule patch request

func (*PatchACLGeoIPRuleRequest) Validate

Validate returns an error if struct properties are missing/invalid

type PatchACLGeoIPRulesModeRequest

type PatchACLGeoIPRulesModeRequest struct {
	Mode ACLGeoIPRulesMode `json:"mode,omitempty"`
}

PatchACLGeoIPRulesModeRequest represents a DDoSX IP ACL rule mode patch request

func (*PatchACLGeoIPRulesModeRequest) Validate

Validate returns an error if struct properties are missing/invalid

type PatchACLIPRuleRequest

type PatchACLIPRuleRequest struct {
	IP   connection.IPAddress `json:"ip,omitempty"`
	URI  *string              `json:"uri,omitempty"`
	Mode ACLIPMode            `json:"mode,omitempty"`
}

PatchACLIPRuleRequest represents a DDoSX IP ACL rule patch request

func (*PatchACLIPRuleRequest) Validate

Validate returns an error if struct properties are missing/invalid

type PatchCDNRuleRequest

type PatchCDNRuleRequest struct {
	URI                  string                       `json:"uri,omitempty"`
	CacheControl         CDNRuleCacheControl          `json:"cache_control,omitempty"`
	CacheControlDuration *CDNRuleCacheControlDuration `json:"cache_control_duration,omitempty"`
	MimeTypes            []string                     `json:"mime_types,omitempty"`
	Type                 CDNRuleType                  `json:"type,omitempty"`
}

PatchCDNRuleRequest represents a DDoSX CDN rule patch request

func (*PatchCDNRuleRequest) Validate

Validate returns an error if struct properties are missing/invalid

type PatchDomainPropertyRequest

type PatchDomainPropertyRequest struct {
	Value interface{} `json:"value,omitempty"`
}

PatchDomainPropertyRequest represents a DDoSX Domain Property patch request

func (*PatchDomainPropertyRequest) Validate

Validate returns an error if struct properties are missing/invalid

type PatchHSTSRuleRequest

type PatchHSTSRuleRequest struct {
	MaxAge            *int  `json:"max_age,omitempty"`
	Preload           *bool `json:"preload,omitempty"`
	IncludeSubdomains *bool `json:"include_subdomains,omitempty"`
}

PatchHSTSRuleRequest represents a DDoSX HSTS rule patch request

func (*PatchHSTSRuleRequest) Validate

Validate returns an error if struct properties are missing/invalid

type PatchRecordRequest

type PatchRecordRequest struct {
	SafeDNSRecordID int        `json:"safedns_record_id,omitempty"`
	SSLID           string     `json:"ssl_id,omitempty"`
	Name            string     `json:"name,omitempty"`
	Type            RecordType `json:"type,omitempty"`
	Content         string     `json:"content,omitempty"`
}

PatchRecordRequest represents a DDoSX Record patch request

func (*PatchRecordRequest) Validate

Validate returns an error if struct properties are missing/invalid

type PatchSSLRequest

type PatchSSLRequest struct {
	FriendlyName string `json:"friendly_name,omitempty"`
	UKFastSSLID  int    `json:"ukfast_ssl_id,omitempty"`
	Key          string `json:"key,omitempty"`
	Certificate  string `json:"certificate,omitempty"`
	CABundle     string `json:"ca_bundle,omitempty"`
}

PatchSSLRequest represents a DDoSX SSL create request

func (*PatchSSLRequest) Validate

Validate returns an error if struct properties are missing/invalid

type PatchWAFAdvancedRuleRequest

type PatchWAFAdvancedRuleRequest struct {
	Section  WAFAdvancedRuleSection  `json:"section,omitempty"`
	Modifier WAFAdvancedRuleModifier `json:"modifier,omitempty"`
	Phrase   string                  `json:"phrase,omitempty"`
	IP       connection.IPAddress    `json:"ip,omitempty"`
}

PatchWAFAdvancedRuleRequest represents a DDoSX WAF advanced rule patch request

func (*PatchWAFAdvancedRuleRequest) Validate

Validate returns an error if struct properties are missing/invalid

type PatchWAFRequest

type PatchWAFRequest struct {
	Mode          WAFMode          `json:"mode,omitempty"`
	ParanoiaLevel WAFParanoiaLevel `json:"paranoia_level,omitempty"`
}

PatchWAFRequest represents a DDoSX WAF patch request

func (*PatchWAFRequest) Validate

Validate returns an error if struct properties are missing/invalid

type PatchWAFRuleRequest

type PatchWAFRuleRequest struct {
	URI string               `json:"uri,omitempty"`
	IP  connection.IPAddress `json:"ip,omitempty"`
}

PatchWAFRuleRequest represents a DDoSX WAF rule patch request

func (*PatchWAFRuleRequest) Validate

Validate returns an error if struct properties are missing/invalid

type PatchWAFRuleSetRequest

type PatchWAFRuleSetRequest struct {
	Active *bool `json:"active,omitempty"`
}

PatchWAFRuleSetRequest represents a DDoSX WAF rule set patch request

func (*PatchWAFRuleSetRequest) Validate

Validate returns an error if struct properties are missing/invalid

type PurgeCDNRequest

type PurgeCDNRequest struct {
	connection.APIRequestBodyDefaultValidator

	RecordName string `json:"record_name" validate:"required"`
	URI        string `json:"uri" validate:"required"`
}

PurgeCDNRequest represents a DDoSX CDN purge request

func (*PurgeCDNRequest) Validate

Validate returns an error if struct properties are missing/invalid

type Record

type Record struct {
	ID              string     `json:"id"`
	DomainName      string     `json:"domain_name"`
	SafeDNSRecordID *int       `json:"safedns_record_id"`
	SSLID           *string    `json:"ssl_id"`
	Name            string     `json:"name"`
	Type            RecordType `json:"type"`
	Content         string     `json:"content"`
}

Record represents a DDoSX record

type RecordNotFoundError

type RecordNotFoundError struct {
	ID string
}

RecordNotFoundError indicates a Record was not found

func (*RecordNotFoundError) Error

func (e *RecordNotFoundError) Error() string

type RecordType

type RecordType string
const (
	RecordTypeA    RecordType = "A"
	RecordTypeAAAA RecordType = "AAAA"
)

func (RecordType) String

func (s RecordType) String() string

type SSL

type SSL struct {
	ID           string   `json:"id"`
	UKFastSSLID  *int     `json:"ukfast_ssl_id"`
	Domains      []string `json:"domains"`
	FriendlyName string   `json:"friendly_name"`
}

SSL represents a DDoSX SSL

type SSLContent

type SSLContent struct {
	Certificate string `json:"certificate"`
	CABundle    string `json:"ca_bundle"`
}

SSLContent represents a DDoSX SSL content

type SSLNotFoundError

type SSLNotFoundError struct {
	ID string
}

SSLNotFoundError indicates an SSL was not found

func (*SSLNotFoundError) Error

func (e *SSLNotFoundError) Error() string

type SSLPrivateKey

type SSLPrivateKey struct {
	Key string `json:"key"`
}

SSLPrivateKey represents a DDoSX SSL private key

type Service

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

Service implements DDoSXService for managing DDoSX via the UKFast API

func NewService

func NewService(connection connection.Connection) *Service

NewService returns a new instance of Service

func (*Service) ActivateDomainDNSRouting

func (s *Service) ActivateDomainDNSRouting(domainName string) error

ActivateDomainDNSRouting activates DNS routing for a domain

func (*Service) AddDomainCDNConfiguration

func (s *Service) AddDomainCDNConfiguration(domainName string) error

AddDomainCDNConfiguration adds CDN configuration to a domain

func (*Service) AddDomainHSTSConfiguration

func (s *Service) AddDomainHSTSConfiguration(domainName string) error

AddDomainHSTSConfiguration adds HSTS headers to a domain

func (*Service) CreateDomain

func (s *Service) CreateDomain(req CreateDomainRequest) error

CreateDomain creates a new domain

func (*Service) CreateDomainACLGeoIPRule

func (s *Service) CreateDomainACLGeoIPRule(domainName string, req CreateACLGeoIPRuleRequest) (string, error)

CreateDomainACLGeoIPRule creates an ACL GeoIP rule

func (*Service) CreateDomainACLIPRule

func (s *Service) CreateDomainACLIPRule(domainName string, req CreateACLIPRuleRequest) (string, error)

CreateDomainACLIPRule creates an ACL IP rule

func (*Service) CreateDomainCDNRule

func (s *Service) CreateDomainCDNRule(domainName string, req CreateCDNRuleRequest) (string, error)

CreateDomainCDNRule creates a CDN rule

func (*Service) CreateDomainHSTSRule

func (s *Service) CreateDomainHSTSRule(domainName string, req CreateHSTSRuleRequest) (string, error)

CreateDomainHSTSRule creates a HSTS rule

func (*Service) CreateDomainRecord

func (s *Service) CreateDomainRecord(domainName string, req CreateRecordRequest) (string, error)

CreateDomainRecord creates a new record for a domain

func (*Service) CreateDomainWAF

func (s *Service) CreateDomainWAF(domainName string, req CreateWAFRequest) error

CreateDomainWAF creates the WAF configuration for a domain

func (*Service) CreateDomainWAFAdvancedRule

func (s *Service) CreateDomainWAFAdvancedRule(domainName string, req CreateWAFAdvancedRuleRequest) (string, error)

CreateDomainWAFAdvancedRule creates a WAF rule

func (*Service) CreateDomainWAFRule

func (s *Service) CreateDomainWAFRule(domainName string, req CreateWAFRuleRequest) (string, error)

CreateDomainWAFRule creates a WAF rule

func (*Service) CreateSSL

func (s *Service) CreateSSL(req CreateSSLRequest) (string, error)

CreateSSL retrieves creates an SSL

func (*Service) DeactivateDomainDNSRouting

func (s *Service) DeactivateDomainDNSRouting(domainName string) error

DeactivateDomainDNSRouting deactivates DNS routing for a domain

func (*Service) DeleteDomain

func (s *Service) DeleteDomain(domainName string, req DeleteDomainRequest) error

DeleteDomain removes a domain

func (*Service) DeleteDomainACLGeoIPRule

func (s *Service) DeleteDomainACLGeoIPRule(domainName string, ruleID string) error

DeleteDomainACLGeoIPRule deletes an ACL GeoIP rule

func (*Service) DeleteDomainACLIPRule

func (s *Service) DeleteDomainACLIPRule(domainName string, ruleID string) error

DeleteDomainACLIPRule deletes an ACL IP rule

func (*Service) DeleteDomainCDNConfiguration

func (s *Service) DeleteDomainCDNConfiguration(domainName string) error

DeleteDomainCDNConfiguration removes CDN configuration from a domain

func (*Service) DeleteDomainCDNRule

func (s *Service) DeleteDomainCDNRule(domainName string, ruleID string) error

DeleteDomainCDNRule removes a CDN rule

func (*Service) DeleteDomainHSTSConfiguration

func (s *Service) DeleteDomainHSTSConfiguration(domainName string) error

DeleteDomainHSTSConfiguration removes HSTS headers to a domain

func (*Service) DeleteDomainHSTSRule

func (s *Service) DeleteDomainHSTSRule(domainName string, ruleID string) error

DeleteDomainHSTSRule removes a HSTS rule

func (*Service) DeleteDomainRecord

func (s *Service) DeleteDomainRecord(domainName string, recordID string) error

DeleteDomainRecord deletes a single domain record by ID

func (*Service) DeleteDomainWAF

func (s *Service) DeleteDomainWAF(domainName string) error

DeleteDomainWAF deletes the WAF configuration for a domain

func (*Service) DeleteDomainWAFAdvancedRule

func (s *Service) DeleteDomainWAFAdvancedRule(domainName string, ruleID string) error

DeleteDomainWAFAdvancedRule deletees a waf advanced rule for a domain

func (*Service) DeleteDomainWAFRule

func (s *Service) DeleteDomainWAFRule(domainName string, ruleID string) error

DeleteDomainWAFRule deletes a waf rule for a domain

func (*Service) DeleteSSL

func (s *Service) DeleteSSL(sslID string) error

DeleteSSL deletes patches an SSL

func (*Service) DeployDomain

func (s *Service) DeployDomain(domainName string) error

DeployDomain deploys/commits changes to a domain

func (*Service) DownloadDomainVerificationFile

func (s *Service) DownloadDomainVerificationFile(domainName string) (content string, filename string, err error)

DownloadDomainVerificationFile downloads the verification file for a domain, returning the file contents, file name and an error

func (*Service) DownloadDomainVerificationFileStream

func (s *Service) DownloadDomainVerificationFileStream(domainName string) (contentStream io.ReadCloser, filename string, err error)

DownloadDomainVerificationFileStream downloads the verification file for a domain, returning a stream of the file contents, file name and an error

func (*Service) GetDomain

func (s *Service) GetDomain(domainName string) (Domain, error)

GetDomain retrieves a single domain by name

func (*Service) GetDomainACLGeoIPRule

func (s *Service) GetDomainACLGeoIPRule(domainName string, ruleID string) (ACLGeoIPRule, error)

GetDomainACLGeoIPRule retrieves a single ACL GeoIP rule for a domain

func (*Service) GetDomainACLGeoIPRules

func (s *Service) GetDomainACLGeoIPRules(domainName string, parameters connection.APIRequestParameters) ([]ACLGeoIPRule, error)

GetDomainACLGeoIPRules retrieves a list of rules

func (*Service) GetDomainACLGeoIPRulesMode

func (s *Service) GetDomainACLGeoIPRulesMode(domainName string) (ACLGeoIPRulesMode, error)

GetDomainACLGeoIPRulesMode retrieves the mode for ACL GeoIP rules

func (*Service) GetDomainACLGeoIPRulesPaginated

func (s *Service) GetDomainACLGeoIPRulesPaginated(domainName string, parameters connection.APIRequestParameters) (*connection.Paginated[ACLGeoIPRule], error)

GetDomainACLGeoIPRulesPaginated retrieves a paginated list of domains

func (*Service) GetDomainACLIPRule

func (s *Service) GetDomainACLIPRule(domainName string, ruleID string) (ACLIPRule, error)

GetDomainACLIPRule retrieves a single ACL IP rule for a domain

func (*Service) GetDomainACLIPRules

func (s *Service) GetDomainACLIPRules(domainName string, parameters connection.APIRequestParameters) ([]ACLIPRule, error)

GetDomainACLIPRules retrieves a list of rules

func (*Service) GetDomainACLIPRulesPaginated

func (s *Service) GetDomainACLIPRulesPaginated(domainName string, parameters connection.APIRequestParameters) (*connection.Paginated[ACLIPRule], error)

GetDomainACLIPRulesPaginated retrieves a paginated list of domains

func (*Service) GetDomainCDNRule

func (s *Service) GetDomainCDNRule(domainName string, ruleID string) (CDNRule, error)

GetDomainCDNRule retrieves a CDN rule

func (*Service) GetDomainCDNRules

func (s *Service) GetDomainCDNRules(domainName string, parameters connection.APIRequestParameters) ([]CDNRule, error)

GetDomainCDNRules retrieves a list of rules

func (*Service) GetDomainCDNRulesPaginated

func (s *Service) GetDomainCDNRulesPaginated(domainName string, parameters connection.APIRequestParameters) (*connection.Paginated[CDNRule], error)

GetDomainCDNRulesPaginated retrieves a paginated list of domains

func (*Service) GetDomainHSTSConfiguration

func (s *Service) GetDomainHSTSConfiguration(domainName string) (HSTSConfiguration, error)

GetDomainHSTSConfiguration retrieves the HSTS configuration for a domain

func (*Service) GetDomainHSTSRule

func (s *Service) GetDomainHSTSRule(domainName string, ruleID string) (HSTSRule, error)

GetDomainHSTSRule retrieves a HSTS rule

func (*Service) GetDomainHSTSRules

func (s *Service) GetDomainHSTSRules(domainName string, parameters connection.APIRequestParameters) ([]HSTSRule, error)

GetDomainHSTSRules retrieves a list of rules

func (*Service) GetDomainHSTSRulesPaginated

func (s *Service) GetDomainHSTSRulesPaginated(domainName string, parameters connection.APIRequestParameters) (*connection.Paginated[HSTSRule], error)

GetDomainHSTSRulesPaginated retrieves a paginated list of domains

func (*Service) GetDomainProperties

func (s *Service) GetDomainProperties(domainName string, parameters connection.APIRequestParameters) ([]DomainProperty, error)

GetDomainProperties retrieves a list of domain properties

func (*Service) GetDomainPropertiesPaginated

func (s *Service) GetDomainPropertiesPaginated(domainName string, parameters connection.APIRequestParameters) (*connection.Paginated[DomainProperty], error)

GetDomainPropertiesPaginated retrieves a paginated list of domain properties

func (*Service) GetDomainProperty

func (s *Service) GetDomainProperty(domainName string, propertyID string) (DomainProperty, error)

GetDomainProperty retrieves a single domain property by ID

func (*Service) GetDomainRecord

func (s *Service) GetDomainRecord(domainName string, recordID string) (Record, error)

GetDomainRecord retrieves a single domain record by ID

func (*Service) GetDomainRecords

func (s *Service) GetDomainRecords(domainName string, parameters connection.APIRequestParameters) ([]Record, error)

GetDomainRecords retrieves a list of records

func (*Service) GetDomainRecordsPaginated

func (s *Service) GetDomainRecordsPaginated(domainName string, parameters connection.APIRequestParameters) (*connection.Paginated[Record], error)

GetDomainRecordsPaginated retrieves a paginated list of domains

func (*Service) GetDomainWAF

func (s *Service) GetDomainWAF(domainName string) (WAF, error)

GetDomainWAF retrieves the WAF configuration for a domain

func (*Service) GetDomainWAFAdvancedRule

func (s *Service) GetDomainWAFAdvancedRule(domainName string, ruleID string) (WAFAdvancedRule, error)

GetDomainWAFAdvancedRule retrieves a waf rule for a domain

func (*Service) GetDomainWAFAdvancedRules

func (s *Service) GetDomainWAFAdvancedRules(domainName string, parameters connection.APIRequestParameters) ([]WAFAdvancedRule, error)

GetDomainWAFAdvancedRules retrieves a list of rules

func (*Service) GetDomainWAFAdvancedRulesPaginated

func (s *Service) GetDomainWAFAdvancedRulesPaginated(domainName string, parameters connection.APIRequestParameters) (*connection.Paginated[WAFAdvancedRule], error)

GetDomainWAFAdvancedRulesPaginated retrieves a paginated list of domains

func (*Service) GetDomainWAFRule

func (s *Service) GetDomainWAFRule(domainName string, ruleID string) (WAFRule, error)

GetDomainWAFRule retrieves a waf rule for a domain

func (*Service) GetDomainWAFRuleSet

func (s *Service) GetDomainWAFRuleSet(domainName string, ruleSetID string) (WAFRuleSet, error)

GetDomainWAFRuleSet retrieves a waf advanced rule set for a domain

func (*Service) GetDomainWAFRuleSets

func (s *Service) GetDomainWAFRuleSets(domainName string, parameters connection.APIRequestParameters) ([]WAFRuleSet, error)

GetDomainWAFRuleSets retrieves a list of rulesets

func (*Service) GetDomainWAFRuleSetsPaginated

func (s *Service) GetDomainWAFRuleSetsPaginated(domainName string, parameters connection.APIRequestParameters) (*connection.Paginated[WAFRuleSet], error)

GetDomainWAFRuleSetsPaginated retrieves a paginated list of domains

func (*Service) GetDomainWAFRules

func (s *Service) GetDomainWAFRules(domainName string, parameters connection.APIRequestParameters) ([]WAFRule, error)

GetDomainWAFRules retrieves a list of rules

func (*Service) GetDomainWAFRulesPaginated

func (s *Service) GetDomainWAFRulesPaginated(domainName string, parameters connection.APIRequestParameters) (*connection.Paginated[WAFRule], error)

GetDomainWAFRulesPaginated retrieves a paginated list of domains

func (*Service) GetDomains

func (s *Service) GetDomains(parameters connection.APIRequestParameters) ([]Domain, error)

GetDomains retrieves a list of domains

func (*Service) GetDomainsPaginated

func (s *Service) GetDomainsPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[Domain], error)

GetDomainsPaginated retrieves a paginated list of domains

func (*Service) GetRecords

func (s *Service) GetRecords(parameters connection.APIRequestParameters) ([]Record, error)

GetRecords retrieves a list of records

func (*Service) GetRecordsPaginated

func (s *Service) GetRecordsPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[Record], error)

GetRecordsPaginated retrieves a paginated list of domains

func (*Service) GetSSL

func (s *Service) GetSSL(sslID string) (SSL, error)

GetSSL retrieves a single ssl by id

func (*Service) GetSSLContent

func (s *Service) GetSSLContent(sslID string) (SSLContent, error)

GetSSLContent retrieves a single ssl by id

func (*Service) GetSSLPrivateKey

func (s *Service) GetSSLPrivateKey(sslID string) (SSLPrivateKey, error)

GetSSLPrivateKey retrieves a single ssl by id

func (*Service) GetSSLs

func (s *Service) GetSSLs(parameters connection.APIRequestParameters) ([]SSL, error)

GetSSLs retrieves a list of ssls

func (*Service) GetSSLsPaginated

func (s *Service) GetSSLsPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[SSL], error)

GetSSLsPaginated retrieves a paginated list of ssls

func (*Service) GetWAFLog

func (s *Service) GetWAFLog(requestID string) (WAFLog, error)

GetWAFLog retrieves a single log by id

func (*Service) GetWAFLogMatches

func (s *Service) GetWAFLogMatches(parameters connection.APIRequestParameters) ([]WAFLogMatch, error)

GetWAFLogMatches retrieves a list of log matches

func (*Service) GetWAFLogMatchesPaginated

func (s *Service) GetWAFLogMatchesPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[WAFLogMatch], error)

GetWAFLogMatchesPaginated retrieves a paginated list of log matches

func (*Service) GetWAFLogRequestMatch

func (s *Service) GetWAFLogRequestMatch(requestID string, matchID string) (WAFLogMatch, error)

GetWAFLogRequestMatch retrieves a single waf log request match

func (*Service) GetWAFLogRequestMatches

func (s *Service) GetWAFLogRequestMatches(requestID string, parameters connection.APIRequestParameters) ([]WAFLogMatch, error)

GetWAFLogRequestMatches retrieves a list of log matches for request

func (*Service) GetWAFLogRequestMatchesPaginated

func (s *Service) GetWAFLogRequestMatchesPaginated(requestID string, parameters connection.APIRequestParameters) (*connection.Paginated[WAFLogMatch], error)

GetWAFLogRequestMatchesPaginated retrieves a paginated list of matches for request

func (*Service) GetWAFLogs

func (s *Service) GetWAFLogs(parameters connection.APIRequestParameters) ([]WAFLog, error)

GetWAFLogs retrieves a list of logs

func (*Service) GetWAFLogsPaginated

func (s *Service) GetWAFLogsPaginated(parameters connection.APIRequestParameters) (*connection.Paginated[WAFLog], error)

GetWAFLogsPaginated retrieves a paginated list of logs

func (*Service) PatchDomainACLGeoIPRule

func (s *Service) PatchDomainACLGeoIPRule(domainName string, ruleID string, req PatchACLGeoIPRuleRequest) error

PatchDomainACLGeoIPRule patches an ACL GeoIP rule

func (*Service) PatchDomainACLGeoIPRulesMode

func (s *Service) PatchDomainACLGeoIPRulesMode(domainName string, req PatchACLGeoIPRulesModeRequest) error

PatchDomainACLGeoIPRulesMode patches the mode for ACL GeoIP rules

func (*Service) PatchDomainACLIPRule

func (s *Service) PatchDomainACLIPRule(domainName string, ruleID string, req PatchACLIPRuleRequest) error

PatchDomainACLIPRule patches an ACL IP rule

func (*Service) PatchDomainCDNRule

func (s *Service) PatchDomainCDNRule(domainName string, ruleID string, req PatchCDNRuleRequest) error

PatchDomainCDNRule patches a CDN rule

func (*Service) PatchDomainHSTSRule

func (s *Service) PatchDomainHSTSRule(domainName string, ruleID string, req PatchHSTSRuleRequest) error

PatchDomainHSTSRule patches a HSTS rule

func (*Service) PatchDomainProperty

func (s *Service) PatchDomainProperty(domainName string, propertyID string, req PatchDomainPropertyRequest) error

PatchDomainProperty patches a single domain property by ID

func (*Service) PatchDomainRecord

func (s *Service) PatchDomainRecord(domainName string, recordID string, req PatchRecordRequest) error

PatchDomainRecord patches a single domain record by ID

func (*Service) PatchDomainWAF

func (s *Service) PatchDomainWAF(domainName string, req PatchWAFRequest) error

PatchDomainWAF patches the WAF configuration for a domain

func (*Service) PatchDomainWAFAdvancedRule

func (s *Service) PatchDomainWAFAdvancedRule(domainName string, ruleID string, req PatchWAFAdvancedRuleRequest) error

PatchDomainWAFAdvancedRule patches a waf advanced rule for a domain

func (*Service) PatchDomainWAFRule

func (s *Service) PatchDomainWAFRule(domainName string, ruleID string, req PatchWAFRuleRequest) error

PatchDomainWAFRule patches a waf rule for a domain

func (*Service) PatchDomainWAFRuleSet

func (s *Service) PatchDomainWAFRuleSet(domainName string, ruleSetID string, req PatchWAFRuleSetRequest) error

PatchDomainWAFRuleSet patches a waf advanced rule set for a domain

func (*Service) PatchSSL

func (s *Service) PatchSSL(sslID string, req PatchSSLRequest) (string, error)

PatchSSL retrieves patches an SSL

func (*Service) PurgeDomainCDN

func (s *Service) PurgeDomainCDN(domainName string, req PurgeCDNRequest) error

PurgeDomainCDN purges cached content

func (*Service) VerifyDomainDNS

func (s *Service) VerifyDomainDNS(domainName string) error

VerifyDomainDNS verifies a domain via DNS method

func (*Service) VerifyDomainFileUpload

func (s *Service) VerifyDomainFileUpload(domainName string) error

VerifyDomainFileUpload verifies a domain via file-upload method

type WAF

type WAF struct {
	Mode          WAFMode          `json:"mode"`
	ParanoiaLevel WAFParanoiaLevel `json:"paranoia_level"`
}

WAF represents a DDoSX WAF configuration

type WAFAdvancedRule

type WAFAdvancedRule struct {
	ID       string                  `json:"id"`
	Section  WAFAdvancedRuleSection  `json:"section"`
	Modifier WAFAdvancedRuleModifier `json:"modifier"`
	Phrase   string                  `json:"phrase"`
	IP       connection.IPAddress    `json:"ip"`
}

WAFAdvancedRule represents a DDoSX WAF advanced rule

type WAFAdvancedRuleModifier

type WAFAdvancedRuleModifier string
const (
	WAFAdvancedRuleModifierBeginsWith   WAFAdvancedRuleModifier = "beginsWith"
	WAFAdvancedRuleModifierEndsWith     WAFAdvancedRuleModifier = "endsWith"
	WAFAdvancedRuleModifierContains     WAFAdvancedRuleModifier = "contains"
	WAFAdvancedRuleModifierContainsWord WAFAdvancedRuleModifier = "containsWord"
)

func ParseWAFAdvancedRuleModifier

func ParseWAFAdvancedRuleModifier(s string) (WAFAdvancedRuleModifier, error)

ParseWAFAdvancedRuleModifier attempts to parse a WAFAdvancedRuleModifier from string

func (WAFAdvancedRuleModifier) String

func (s WAFAdvancedRuleModifier) String() string

type WAFAdvancedRuleNotFoundError

type WAFAdvancedRuleNotFoundError struct {
	ID string
}

WAFAdvancedRuleNotFoundError indicates a WAF advanced rule was not found

func (*WAFAdvancedRuleNotFoundError) Error

type WAFAdvancedRuleSection

type WAFAdvancedRuleSection string
const (
	WAFAdvancedRuleSectionArgs           WAFAdvancedRuleSection = "ARGS"
	WAFAdvancedRuleSectionMatchedVars    WAFAdvancedRuleSection = "MATCHED_VARS"
	WAFAdvancedRuleSectionRemoteHost     WAFAdvancedRuleSection = "REMOTE_HOST"
	WAFAdvancedRuleSectionRequestBody    WAFAdvancedRuleSection = "REQUEST_BODY"
	WAFAdvancedRuleSectionRequestCookies WAFAdvancedRuleSection = "REQUEST_COOKIES"
	WAFAdvancedRuleSectionRequestHeaders WAFAdvancedRuleSection = "REQUEST_HEADERS"
	WAFAdvancedRuleSectionRequestURI     WAFAdvancedRuleSection = "REQUEST_URI"
)

func ParseWAFAdvancedRuleSection

func ParseWAFAdvancedRuleSection(s string) (WAFAdvancedRuleSection, error)

ParseWAFAdvancedRuleSection attempts to parse a WAFAdvancedRuleSection from string

func (WAFAdvancedRuleSection) String

func (s WAFAdvancedRuleSection) String() string

type WAFLog

type WAFLog struct {
	ID        string               `json:"id"`
	Host      string               `json:"host"`
	ClientIP  connection.IPAddress `json:"client_ip"`
	Request   string               `json:"request"`
	CreatedAt connection.DateTime  `json:"created_at"`
}

WAFLog represents a WAF log entry

type WAFLogMatch

type WAFLogMatch struct {
	ID          string               `json:"id"`
	LogID       string               `json:"log_id"`
	Host        string               `json:"host"`
	ClientIP    connection.IPAddress `json:"client_ip"`
	RequestURI  string               `json:"request_uri"`
	CreatedAt   connection.DateTime  `json:"created_at"`
	CountryCode string               `json:"country_code"`
	Method      string               `json:"method"`
	Content     string               `json:"content"`
	Message     string               `json:"message"`
	MatchData   string               `json:"match_data"`
	URIPart     string               `json:"uri_part"`
	Value       string               `json:"value"`
}

WAFLogMatch represents a WAF log match

type WAFLogMatchNotFoundError

type WAFLogMatchNotFoundError struct {
	ID string
}

WAFLogMatchNotFoundError indicates a WAF rule was not found

func (*WAFLogMatchNotFoundError) Error

func (e *WAFLogMatchNotFoundError) Error() string

type WAFLogNotFoundError

type WAFLogNotFoundError struct {
	ID string
}

WAFLogNotFoundError indicates a WAF rule was not found

func (*WAFLogNotFoundError) Error

func (e *WAFLogNotFoundError) Error() string

type WAFMode

type WAFMode string
const (
	WAFModeOn            WAFMode = "On"
	WAFModeOff           WAFMode = "Off"
	WAFModeDetectionOnly WAFMode = "DetectionOnly"
)

func ParseWAFMode

func ParseWAFMode(s string) (WAFMode, error)

ParseWAFMode attempts to parse a WAFMode from string

func (WAFMode) String

func (s WAFMode) String() string

type WAFParanoiaLevel

type WAFParanoiaLevel string
const (
	WAFParanoiaLevelLow     WAFParanoiaLevel = "Low"
	WAFParanoiaLevelMedium  WAFParanoiaLevel = "Medium"
	WAFParanoiaLevelHigh    WAFParanoiaLevel = "High"
	WAFParanoiaLevelHighest WAFParanoiaLevel = "Highest"
)

func ParseWAFParanoiaLevel

func ParseWAFParanoiaLevel(s string) (WAFParanoiaLevel, error)

ParseWAFParanoiaLevel attempts to parse a WAFParanoiaLevel from string

func (WAFParanoiaLevel) String

func (s WAFParanoiaLevel) String() string

type WAFRule

type WAFRule struct {
	ID  string               `json:"id"`
	URI string               `json:"uri"`
	IP  connection.IPAddress `json:"ip"`
}

WAFRule represents a DDoSX WAF rule

type WAFRuleNotFoundError

type WAFRuleNotFoundError struct {
	ID string
}

WAFRuleNotFoundError indicates a WAF rule was not found

func (*WAFRuleNotFoundError) Error

func (e *WAFRuleNotFoundError) Error() string

type WAFRuleSet

type WAFRuleSet struct {
	ID     string         `json:"id"`
	Name   WAFRuleSetName `json:"name"`
	Active bool           `json:"active"`
}

WAFRuleSet represents a DDoSX WAF rule set

type WAFRuleSetName

type WAFRuleSetName string
const (
	WAFRuleSetNameIPRepution                             WAFRuleSetName = "IP Reputation"
	WAFRuleSetNameMethodEnforcement                      WAFRuleSetName = "Method Enforcement"
	WAFRuleSetNameScannerDetection                       WAFRuleSetName = "Scanner Detection"
	WAFRuleSetNameProtocolEnforcement                    WAFRuleSetName = "Protocol Enforcement"
	WAFRuleSetNameProtocolAttack                         WAFRuleSetName = "Protocol Attack"
	WAFRuleSetNameApplicationAttackLocalFileInclusion    WAFRuleSetName = "Application Attack (Local File Inclusion)"
	WAFRuleSetNameApplicationAttackRemoteFileInclusion   WAFRuleSetName = "Application Attack (Remote File Inclusion)"
	WAFRuleSetNameApplicationAttackRemoteCodeExecution   WAFRuleSetName = "Application Attack (Remote Code Execution)"
	WAFRuleSetNameApplicationAttackPHP                   WAFRuleSetName = "Application Attack PHP"
	WAFRuleSetNameApplicationAttackXSSCrossSiteScripting WAFRuleSetName = "Application Attack XSS (Cross Site Scripting)"
	WAFRuleSetNameApplicationAttackSQLISQLInjection      WAFRuleSetName = "Application Attack SQLI (SQL Injection)"
	WAFRuleSetNameApplicationAttackSessionFixation       WAFRuleSetName = "Application Attack Session Fixation"
	WAFRuleSetNameDataDeakages                           WAFRuleSetName = "Data Leakages"
	WAFRuleSetNameDataLeakageSQL                         WAFRuleSetName = "Data Leakage SQL"
	WAFRuleSetNameDataLeakageJava                        WAFRuleSetName = "Data Leakage Java"
	WAFRuleSetNameDataLeakagePHP                         WAFRuleSetName = "Data Leakage PHP"
	WAFRuleSetNameDataLeakageIIS                         WAFRuleSetName = "Data Leakage IIS"
)

func (WAFRuleSetName) String

func (s WAFRuleSetName) String() string

type WAFRuleSetNotFoundError

type WAFRuleSetNotFoundError struct {
	ID string
}

WAFRuleSetNotFoundError indicates a WAF rule set was not found

func (*WAFRuleSetNotFoundError) Error

func (e *WAFRuleSetNotFoundError) Error() string

Jump to

Keyboard shortcuts

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