waap

package
v0.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DomainListParams

type DomainListParams struct {
	// Number of items to return
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Filter domains based on the domain name. Supports '\*' as a wildcard character
	Name param.Opt[string] `query:"name,omitzero" json:"-"`
	// Number of items to skip
	Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
	// Filter domains based on their IDs
	IDs []int64 `query:"ids,omitzero" json:"-"`
	// Sort the response by given field.
	//
	// Any of "id", "name", "status", "created_at", "-id", "-name", "-status",
	// "-created_at".
	Ordering DomainListParamsOrdering `query:"ordering,omitzero" json:"-"`
	// The different statuses a domain can have
	//
	// Any of "active", "bypass", "monitor", "locked".
	Status WaapDomainStatus `query:"status,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (DomainListParams) URLQuery

func (r DomainListParams) URLQuery() (v url.Values, err error)

URLQuery serializes DomainListParams's query parameters as `url.Values`.

type DomainListParamsOrdering

type DomainListParamsOrdering string

Sort the response by given field.

const (
	DomainListParamsOrderingID             DomainListParamsOrdering = "id"
	DomainListParamsOrderingName           DomainListParamsOrdering = "name"
	DomainListParamsOrderingStatus         DomainListParamsOrdering = "status"
	DomainListParamsOrderingCreatedAt      DomainListParamsOrdering = "created_at"
	DomainListParamsOrderingMinusID        DomainListParamsOrdering = "-id"
	DomainListParamsOrderingMinusName      DomainListParamsOrdering = "-name"
	DomainListParamsOrderingMinusStatus    DomainListParamsOrdering = "-status"
	DomainListParamsOrderingMinusCreatedAt DomainListParamsOrdering = "-created_at"
)

type DomainService

type DomainService struct {
	Options  []option.RequestOption
	Settings DomainSettingService
}

DomainService contains methods and other services that help with interacting with the gcore API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewDomainService method instead.

func NewDomainService

func NewDomainService(opts ...option.RequestOption) (r DomainService)

NewDomainService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*DomainService) Delete

func (r *DomainService) Delete(ctx context.Context, domainID int64, opts ...option.RequestOption) (err error)

Delete an inactive domain by ID. Only domains with status 'bypass' can be deleted.

func (*DomainService) Get

func (r *DomainService) Get(ctx context.Context, domainID int64, opts ...option.RequestOption) (res *WaapDetailedDomain, err error)

Retrieve detailed information about a specific domain

func (*DomainService) List

Retrieve a list of domains associated with the client

func (*DomainService) ListAutoPaging

Retrieve a list of domains associated with the client

func (*DomainService) Update

func (r *DomainService) Update(ctx context.Context, domainID int64, body DomainUpdateParams, opts ...option.RequestOption) (err error)

Update Domain

type DomainSettingService

type DomainSettingService struct {
	Options []option.RequestOption
}

DomainSettingService contains methods and other services that help with interacting with the gcore API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewDomainSettingService method instead.

func NewDomainSettingService

func NewDomainSettingService(opts ...option.RequestOption) (r DomainSettingService)

NewDomainSettingService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*DomainSettingService) Get

func (r *DomainSettingService) Get(ctx context.Context, domainID int64, opts ...option.RequestOption) (res *WaapDomainSettings, err error)

Retrieve settings for a specific domain

func (*DomainSettingService) Update

func (r *DomainSettingService) Update(ctx context.Context, domainID int64, body DomainSettingUpdateParams, opts ...option.RequestOption) (err error)

Update settings for a specific domain

type DomainSettingUpdateParams

type DomainSettingUpdateParams struct {
	// Editable API settings of a domain
	API DomainSettingUpdateParamsAPI `json:"api,omitzero"`
	// Editable DDoS settings for a domain.
	DDOS DomainSettingUpdateParamsDDOS `json:"ddos,omitzero"`
	// contains filtered or unexported fields
}

func (DomainSettingUpdateParams) MarshalJSON

func (r DomainSettingUpdateParams) MarshalJSON() (data []byte, err error)

func (*DomainSettingUpdateParams) UnmarshalJSON

func (r *DomainSettingUpdateParams) UnmarshalJSON(data []byte) error

type DomainSettingUpdateParamsAPI

type DomainSettingUpdateParamsAPI struct {
	// The API URLs for a domain. If your domain has a common base URL for all API
	// paths, it can be set here
	APIURLs []string `json:"api_urls,omitzero"`
	// contains filtered or unexported fields
}

Editable API settings of a domain

func (DomainSettingUpdateParamsAPI) MarshalJSON

func (r DomainSettingUpdateParamsAPI) MarshalJSON() (data []byte, err error)

func (*DomainSettingUpdateParamsAPI) UnmarshalJSON

func (r *DomainSettingUpdateParamsAPI) UnmarshalJSON(data []byte) error

type DomainSettingUpdateParamsDDOS

type DomainSettingUpdateParamsDDOS struct {
	// The burst threshold detects sudden rises in traffic. If it is met and the number
	// of requests is at least five times the last 2-second interval, DDoS protection
	// will activate. Default is 1000.
	BurstThreshold param.Opt[int64] `json:"burst_threshold,omitzero"`
	// The global threshold is responsible for identifying DDoS attacks with a slow
	// rise in traffic. If the threshold is met and the current number of requests is
	// at least double that of the previous 10-second window, DDoS protection will
	// activate. Default is 5000.
	GlobalThreshold param.Opt[int64] `json:"global_threshold,omitzero"`
	// contains filtered or unexported fields
}

Editable DDoS settings for a domain.

func (DomainSettingUpdateParamsDDOS) MarshalJSON

func (r DomainSettingUpdateParamsDDOS) MarshalJSON() (data []byte, err error)

func (*DomainSettingUpdateParamsDDOS) UnmarshalJSON

func (r *DomainSettingUpdateParamsDDOS) UnmarshalJSON(data []byte) error

type DomainUpdateParams

type DomainUpdateParams struct {
	// Domain statuses that can be used when updating a domain
	//
	// Any of "active", "monitor".
	Status DomainUpdateParamsStatus `json:"status,omitzero"`
	// contains filtered or unexported fields
}

func (DomainUpdateParams) MarshalJSON

func (r DomainUpdateParams) MarshalJSON() (data []byte, err error)

func (*DomainUpdateParams) UnmarshalJSON

func (r *DomainUpdateParams) UnmarshalJSON(data []byte) error

type DomainUpdateParamsStatus

type DomainUpdateParamsStatus string

Domain statuses that can be used when updating a domain

const (
	DomainUpdateParamsStatusActive  DomainUpdateParamsStatus = "active"
	DomainUpdateParamsStatusMonitor DomainUpdateParamsStatus = "monitor"
)

type Error

type Error = apierror.Error

type WaapAPIURLs

type WaapAPIURLs struct {
	// The API URLs for a domain. If your domain has a common base URL for all API
	// paths, it can be set here
	APIURLs []string `json:"api_urls"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		APIURLs     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

API settings of a domain

func (WaapAPIURLs) RawJSON

func (r WaapAPIURLs) RawJSON() string

Returns the unmodified JSON received from the API

func (*WaapAPIURLs) UnmarshalJSON

func (r *WaapAPIURLs) UnmarshalJSON(data []byte) error

type WaapDetailedDomain

type WaapDetailedDomain struct {
	// The domain ID
	ID int64 `json:"id,required"`
	// The date and time the domain was created in ISO 8601 format
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// The ID of the custom page set
	CustomPageSet int64 `json:"custom_page_set,required"`
	// The domain name
	Name string `json:"name,required"`
	// The different statuses a domain can have
	//
	// Any of "active", "bypass", "monitor", "locked".
	Status WaapDomainStatus `json:"status,required"`
	// Domain level quotas
	Quotas map[string]WaapDetailedDomainQuota `json:"quotas,nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		CreatedAt     respjson.Field
		CustomPageSet respjson.Field
		Name          respjson.Field
		Status        respjson.Field
		Quotas        respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Represents a WAAP domain, serving as a singular unit within the WAAP service.

Each domain functions autonomously, possessing its own set of rules and configurations to manage web application firewall settings and behaviors.

func (WaapDetailedDomain) RawJSON

func (r WaapDetailedDomain) RawJSON() string

Returns the unmodified JSON received from the API

func (*WaapDetailedDomain) UnmarshalJSON

func (r *WaapDetailedDomain) UnmarshalJSON(data []byte) error

type WaapDetailedDomainQuota

type WaapDetailedDomainQuota struct {
	// The maximum allowed number of this resource
	Allowed int64 `json:"allowed,required"`
	// The current number of this resource
	Current int64 `json:"current,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Allowed     respjson.Field
		Current     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (WaapDetailedDomainQuota) RawJSON

func (r WaapDetailedDomainQuota) RawJSON() string

Returns the unmodified JSON received from the API

func (*WaapDetailedDomainQuota) UnmarshalJSON

func (r *WaapDetailedDomainQuota) UnmarshalJSON(data []byte) error

type WaapDomainDDOSSettings

type WaapDomainDDOSSettings struct {
	// The burst threshold detects sudden rises in traffic. If it is met and the number
	// of requests is at least five times the last 2-second interval, DDoS protection
	// will activate. Default is 1000.
	BurstThreshold int64 `json:"burst_threshold"`
	// The global threshold is responsible for identifying DDoS attacks with a slow
	// rise in traffic. If the threshold is met and the current number of requests is
	// at least double that of the previous 10-second window, DDoS protection will
	// activate. Default is 5000.
	GlobalThreshold int64 `json:"global_threshold"`
	// The sub-second threshold protects WAAP servers against attacks from traffic
	// bursts. When this threshold is reached, the DDoS mode will activate on the
	// affected WAAP server, not the whole WAAP cluster. Default is 50.
	SubSecondThreshold int64 `json:"sub_second_threshold"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		BurstThreshold     respjson.Field
		GlobalThreshold    respjson.Field
		SubSecondThreshold respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

DDoS settings for a domain.

func (WaapDomainDDOSSettings) RawJSON

func (r WaapDomainDDOSSettings) RawJSON() string

Returns the unmodified JSON received from the API

func (*WaapDomainDDOSSettings) UnmarshalJSON

func (r *WaapDomainDDOSSettings) UnmarshalJSON(data []byte) error

type WaapDomainSettings

type WaapDomainSettings struct {
	// API settings of a domain
	API WaapAPIURLs `json:"api,required"`
	// DDoS settings for a domain.
	DDOS WaapDomainDDOSSettings `json:"ddos,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		API         respjson.Field
		DDOS        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Settings for a domain.

func (WaapDomainSettings) RawJSON

func (r WaapDomainSettings) RawJSON() string

Returns the unmodified JSON received from the API

func (*WaapDomainSettings) UnmarshalJSON

func (r *WaapDomainSettings) UnmarshalJSON(data []byte) error

type WaapDomainStatus

type WaapDomainStatus string

The different statuses a domain can have

const (
	WaapDomainStatusActive  WaapDomainStatus = "active"
	WaapDomainStatusBypass  WaapDomainStatus = "bypass"
	WaapDomainStatusMonitor WaapDomainStatus = "monitor"
	WaapDomainStatusLocked  WaapDomainStatus = "locked"
)

type WaapService

type WaapService struct {
	Options []option.RequestOption
	Domains DomainService
}

WaapService contains methods and other services that help with interacting with the gcore API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewWaapService method instead.

func NewWaapService

func NewWaapService(opts ...option.RequestOption) (r WaapService)

NewWaapService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

type WaapSummaryDomain

type WaapSummaryDomain struct {
	// The domain ID
	ID int64 `json:"id,required"`
	// The date and time the domain was created in ISO 8601 format
	CreatedAt time.Time `json:"created_at,required" format:"date-time"`
	// The ID of the custom page set
	CustomPageSet int64 `json:"custom_page_set,required"`
	// The domain name
	Name string `json:"name,required"`
	// The different statuses a domain can have
	//
	// Any of "active", "bypass", "monitor", "locked".
	Status WaapDomainStatus `json:"status,required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		CreatedAt     respjson.Field
		CustomPageSet respjson.Field
		Name          respjson.Field
		Status        respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Represents a WAAP domain when getting a list of domains.

func (WaapSummaryDomain) RawJSON

func (r WaapSummaryDomain) RawJSON() string

Returns the unmodified JSON received from the API

func (*WaapSummaryDomain) UnmarshalJSON

func (r *WaapSummaryDomain) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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