ddosx

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

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 added in v1.0.6

func ParseACLGeoIPRulesMode(s string) (ACLGeoIPRulesMode, error)

ParseACLGeoIPRulesMode attempts to parse a ACLGeoIPRulesMode from string

func (ACLGeoIPRulesMode) String added in v1.0.6

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 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 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 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" validate:"required"`
	Content         string     `json:"content" validate:"required"`
}

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 {
	GetDomains(parameters connection.APIRequestParameters) ([]Domain, error)
	GetDomainsPaginated(parameters connection.APIRequestParameters) ([]Domain, error)
	GetDomain(domainName string) (Domain, error)
	CreateDomain(req CreateDomainRequest) error
	DeployDomain(domainName string) error
	GetDomainRecords(domainName string, parameters connection.APIRequestParameters) ([]Record, error)
	GetDomainRecordsPaginated(domainName string, parameters connection.APIRequestParameters) ([]Record, error)
	GetRecords(parameters connection.APIRequestParameters) ([]Record, error)
	GetRecordsPaginated(parameters connection.APIRequestParameters) ([]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) ([]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) ([]WAFRuleSet, error)
	GetDomainWAFRuleSet(domainName string, ruleSetID string, parameters connection.APIRequestParameters) (WAFRuleSet, error)
	PatchDomainWAFRuleSet(domainName string, ruleSetID string, req PatchWAFRuleSetRequest) error
	GetDomainWAFRules(domainName string, parameters connection.APIRequestParameters) ([]WAFRule, error)
	GetDomainWAFRulesPaginated(domainName string, parameters connection.APIRequestParameters) ([]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) ([]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) ([]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) ([]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) ([]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)
}

DDoSXService is an interface for managing the DDoSX service

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 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 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  string      `json:"name"`
	Value interface{} `json:"value"`
}

DomainProperty represents a DDoSX domain property

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 GetACLGeoIPRuleResponseBody

type GetACLGeoIPRuleResponseBody struct {
	connection.APIResponseBody

	Data ACLGeoIPRule `json:"data"`
}

GetACLGeoIPRuleResponseBody represents an API response body containing ACLGeoIPRule data

type GetACLGeoIPRulesModeResponseBody

type GetACLGeoIPRulesModeResponseBody struct {
	connection.APIResponseBody

	Data struct {
		Mode ACLGeoIPRulesMode `json:"mode"`
	} `json:"data"`
}

GetACLGeoIPRulesModeResponseBody represents an API response body containing ACLGeoIPRulesMode data

type GetACLGeoIPRulesResponseBody

type GetACLGeoIPRulesResponseBody struct {
	connection.APIResponseBody

	Data []ACLGeoIPRule `json:"data"`
}

GetACLGeoIPRulesResponseBody represents an API response body containing []ACLGeoIPRule data

type GetACLIPRuleResponseBody

type GetACLIPRuleResponseBody struct {
	connection.APIResponseBody

	Data ACLIPRule `json:"data"`
}

GetACLIPRuleResponseBody represents an API response body containing ACLIPRule data

type GetACLIPRulesResponseBody

type GetACLIPRulesResponseBody struct {
	connection.APIResponseBody

	Data []ACLIPRule `json:"data"`
}

GetACLIPRulesResponseBody represents an API response body containing []ACLIPRule data

type GetDomainPropertiesResponseBody

type GetDomainPropertiesResponseBody struct {
	connection.APIResponseBody

	Data []DomainProperty `json:"data"`
}

GetDomainPropertiesResponseBody represents an API response body containing []DomainProperty data

type GetDomainPropertyResponseBody

type GetDomainPropertyResponseBody struct {
	connection.APIResponseBody

	Data DomainProperty `json:"data"`
}

GetDomainPropertyResponseBody represents an API response body containing DomainProperty data

type GetDomainResponseBody

type GetDomainResponseBody struct {
	connection.APIResponseBody

	Data Domain `json:"data"`
}

GetDomainResponseBody represents an API response body containing Domain data

type GetDomainsResponseBody

type GetDomainsResponseBody struct {
	connection.APIResponseBody

	Data []Domain `json:"data"`
}

GetDomainsResponseBody represents an API response body containing []Domain data

type GetRecordResponseBody

type GetRecordResponseBody struct {
	connection.APIResponseBody

	Data Record `json:"data"`
}

GetRecordResponseBody represents an API response body containing Record data

type GetRecordsResponseBody

type GetRecordsResponseBody struct {
	connection.APIResponseBody

	Data []Record `json:"data"`
}

GetRecordsResponseBody represents an API response body containing []Record data

type GetSSLContentResponseBody

type GetSSLContentResponseBody struct {
	connection.APIResponseBody

	Data SSLContent `json:"data"`
}

GetSSLContentResponseBody represents an API response body containing SSLContent data

type GetSSLPrivateKeyResponseBody

type GetSSLPrivateKeyResponseBody struct {
	connection.APIResponseBody

	Data SSLPrivateKey `json:"data"`
}

GetSSLPrivateKeyResponseBody represents an API response body containing SSLPrivateKey data

type GetSSLResponseBody

type GetSSLResponseBody struct {
	connection.APIResponseBody

	Data SSL `json:"data"`
}

GetSSLResponseBody represents an API response body containing SSL data

type GetSSLsResponseBody

type GetSSLsResponseBody struct {
	connection.APIResponseBody

	Data []SSL `json:"data"`
}

GetSSLsResponseBody represents an API response body containing []SSL data

type GetWAFAdvancedRuleResponseBody

type GetWAFAdvancedRuleResponseBody struct {
	connection.APIResponseBody

	Data WAFAdvancedRule `json:"data"`
}

GetWAFAdvancedRuleResponseBody represents an API response body containing WAFAdvancedRule

type GetWAFAdvancedRulesResponseBody

type GetWAFAdvancedRulesResponseBody struct {
	connection.APIResponseBody

	Data []WAFAdvancedRule `json:"data"`
}

GetWAFAdvancedRulesResponseBody represents an API response body containing []WAFAdvancedRule

type GetWAFResponseBody

type GetWAFResponseBody struct {
	connection.APIResponseBody

	Data WAF `json:"data"`
}

GetWAFResponseBody represents an API response body containing WAF data

type GetWAFRuleResponseBody

type GetWAFRuleResponseBody struct {
	connection.APIResponseBody

	Data WAFRule `json:"data"`
}

GetWAFRuleResponseBody represents an API response body containing WAFRule

type GetWAFRuleSetResponseBody

type GetWAFRuleSetResponseBody struct {
	connection.APIResponseBody

	Data WAFRuleSet `json:"data"`
}

GetWAFRuleSetResponseBody represents an API response body containing WAFRuleSet data

type GetWAFRuleSetsResponseBody

type GetWAFRuleSetsResponseBody struct {
	connection.APIResponseBody

	Data []WAFRuleSet `json:"data"`
}

GetWAFRuleSetsResponseBody represents an API response body containing []WAFRuleSet data

type GetWAFRulesResponseBody

type GetWAFRulesResponseBody struct {
	connection.APIResponseBody

	Data []WAFRule `json:"data"`
}

GetWAFRulesResponseBody represents an API response body containing []WAFRule

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 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 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 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) 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) 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) 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) 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) GetDomainACLGeoIPRules

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

GetDomainACLGeoIPRules retrieves a list of GeoIP ACLs for a domain

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) ([]ACLGeoIPRule, error)

GetDomainACLGeoIPRulesPaginated retrieves paginated list of waf advanced rules for a domain

func (*Service) GetDomainACLIPRules

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

GetDomainACLIPRules retrieves a list of IP ACLs for a domain

func (*Service) GetDomainACLIPRulesPaginated

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

GetDomainACLIPRulesPaginated retrieves paginated list of waf advanced rules for a domain

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) ([]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) GetDomainRecords

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

GetDomainRecords retrieves a list of domain records

func (*Service) GetDomainRecordsPaginated

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

GetDomainRecordsPaginated retrieves a paginated list of records

func (*Service) GetDomainWAF

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

GetDomainWAF retrieves the WAF configuration for a domain

func (*Service) GetDomainWAFAdvancedRules

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

GetDomainWAFAdvancedRules retrieves a list of waf advanced rules for a domain

func (*Service) GetDomainWAFAdvancedRulesPaginated

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

GetDomainWAFAdvancedRulesPaginated retrieves paginated list of waf advanced rules for a domain

func (*Service) GetDomainWAFRuleSet

func (s *Service) GetDomainWAFRuleSet(domainName string, ruleSetID string, parameters connection.APIRequestParameters) (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 paginated list of waf advanced rule sets for a domain

func (*Service) GetDomainWAFRuleSetsPaginated

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

GetDomainWAFRuleSetsPaginated retrieves paginated list of waf advanced rule sets for a domain

func (*Service) GetDomainWAFRules

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

GetDomainWAFRules retrieves a list of waf rules for a domain

func (*Service) GetDomainWAFRulesPaginated

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

GetDomainWAFRulesPaginated retrieves paginated list of waf rules for a domain

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) ([]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) ([]Record, error)

GetRecordsPaginated retrieves a paginated list of records

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) ([]SSL, error)

GetSSLsPaginated retrieves a paginated list of ssls

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) 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

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 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 WAFMode 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