myrasec

package module
v2.51.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: MIT Imports: 18 Imported by: 4

README

myrasec-go

Go Report Card Go Reference tests

A Go library for interacting with Myra Security API.

Example usage

package main

import (
	"log"
	"os"

	myrasec "github.com/Myra-Security-GmbH/myrasec-go/v2"
)

func main() {
	api, err := myrasec.New(os.Getenv("MYRA_API_KEY"), os.Getenv("MYRA_API_SECRET"))
	// Alternatively you can use the API token for authentication, too
	// api, err := myrasec.NewWithToken(os.Getenv("MYRA_API_TOKEN"))
	if err != nil {
		log.Fatal(err)
	}

	domains, err := api.ListDomains(map[string]string{"pageSize": "100"})
	if err != nil {
		log.Fatal(err)
	}

	for _, d := range domains {
		log.Println(d.Name)
	}
}

Documentation

Documentation

Index

Constants

View Source
const (
	RecordTypeA     = "A"
	RecordTypeAAAA  = "AAAA"
	RecordTypeCNAME = "CNAME"
)
View Source
const (
	ParamPage     = "page"
	ParamPageSize = "pageSize"
	ParamSearch   = "search"
)
View Source
const (
	// APIBaseURL ...
	APIBaseURL = "https://apiv2.myracloud.com/%s"
	// DefaultAPILanguage ...
	DefaultAPILanguage = "en"
	// DefaultAPIUserAgent ...
	DefaultAPIUserAgent = "myrasec-go"
	// DefaultCachingTTL ...
	DefaultCachingTTL = 10
	// DefaultRetryCount ...
	DefaultRetryCount = 1
	// DefaultRetrySleep ...
	DefaultRetrySleep = 0
	// ErrorMsgRateLimitReached ...
	ErrorMsgRateLimitReached = "rate limit reached - too many requests"
)

Variables

View Source
var APILanguages = map[string]bool{
	"en": true,
	"de": true,
}

APILanguages ...

Functions

func BuildCacheKey added in v2.16.0

func BuildCacheKey(req *http.Request) string

BuildCacheKey

func BuildSHA256 added in v2.14.0

func BuildSHA256(str string) string

BuildSHA256 builds the SHA256 for the passed string

func EnsureTrailingDot added in v2.26.0

func EnsureTrailingDot(subdomain string) string

EnsureTrailingDot ensures and returns the passed subdomain with a trailing dot

func ExtractDomainIdFromGeneralDomainName added in v2.35.0

func ExtractDomainIdFromGeneralDomainName(generalDomainName string) (int, error)

ExtractDomainIdFromGeneralDomainName extracts the domainID from the general domain name annotation (ALL-1234.)

func IsGeneralDomainName added in v2.26.0

func IsGeneralDomainName(name string) bool

IsGeneralDomainName checks if the passed name starts with ALL- or ALL:

func RemoveTrailingDot added in v2.26.0

func RemoveTrailingDot(subdomain string) string

RemoveTrailingDot removes and returns the trailing dot from the passed subdomain name

Types

type API

type API struct {
	BaseURL   string
	Language  string
	UserAgent string
	// contains filtered or unexported fields
}

API holds the configuration for the current API client.

func New

func New(key, secret string) (*API, error)

New returns a new MYRA API Client

func NewWithToken added in v2.50.0

func NewWithToken(token string) (*API, error)

func (*API) ClearCache added in v2.18.0

func (api *API) ClearCache(cacheClear *CacheClear, domainId int) (*[]CacheClear, error)

ClearCache ...

func (*API) CloneTag added in v2.47.0

func (api *API) CloneTag(tag *Tag) (*Tag, error)

CloneTag clones the passed tag using the MYRA API

func (*API) CreateApiKey added in v2.43.0

func (api *API) CreateApiKey(apikey *APIKey) (*APIKey, error)

CreateApiKey creates a new API key using the MYRA API

func (*API) CreateCacheSetting

func (api *API) CreateCacheSetting(setting *CacheSetting, domainId int, subDomainName string) (*CacheSetting, error)

CreateCacheSetting creates a new cache setting for the passed subdomain (name) using the MYRA API

func (*API) CreateDNSRecord

func (api *API) CreateDNSRecord(record *DNSRecord, domainId int) (*DNSRecord, error)

CreateDNSRecord creates a new DNS record using the MYRA API

func (*API) CreateDomain

func (api *API) CreateDomain(domain *Domain) (*Domain, error)

CreateDomain creates a new domain using the MYRA API

func (*API) CreateErrorPage added in v2.8.0

func (api *API) CreateErrorPage(errorPage *ErrorPage, domainId int) (*ErrorPage, error)

CreateErrorPage creates a new error page using the MYRA API

func (*API) CreateIPFilter

func (api *API) CreateIPFilter(filter *IPFilter, domainId int, subDomainName string) (*IPFilter, error)

CreateIPFilter creates a new ip filter for the passed subdomain (name) using the MYRA API

func (*API) CreateMaintenance added in v2.12.0

func (api *API) CreateMaintenance(maintenance *Maintenance, domainId int, subDomainName string) (*Maintenance, error)

CreateMaintenance creates a new maintenance page for the passed subdomain (name) using the MYRA API

func (*API) CreateMaintenanceTemplate added in v2.19.0

func (api *API) CreateMaintenanceTemplate(template *MaintenanceTemplate, domainId int) (*MaintenanceTemplate, error)

CreateMaintenanceTemplate creates a new maintenance template for the passed domain (id) using the MYRA API

func (*API) CreateRedirect

func (api *API) CreateRedirect(redirect *Redirect, domainId int, subDomainName string) (*Redirect, error)

CreateRedirect creates a new redirect for the passed subdomain (name) using the MYRA API

func (*API) CreateSSLCertificate

func (api *API) CreateSSLCertificate(cert *SSLCertificate, domainId int) (*SSLCertificate, error)

CreateSSLCertificate creates a new SSL certificates on the passed domain (ID) using the MYRA API

func (*API) CreateTag added in v2.20.0

func (api *API) CreateTag(tag *Tag) (*Tag, error)

CreateTag creates a new tag using the MYRA API

func (*API) CreateTagCacheSetting added in v2.20.0

func (api *API) CreateTagCacheSetting(setting *CacheSetting, tagId int) (*CacheSetting, error)

CreateTagCacheSetting creates a new cache setting for the passed subdomain (name) using the MYRA API

func (*API) CreateTagInformation added in v2.37.0

func (api *API) CreateTagInformation(information *TagInformation, tagId int) (*TagInformation, error)

CreateTagInformation creates a new tag information for the passed tag (ID) using the MYRA API

func (*API) CreateTagWAFRule added in v2.20.0

func (api *API) CreateTagWAFRule(rule *TagWAFRule, tagId int) (*TagWAFRule, error)

CreateTagWAFRule creates a new tag using the MYRA API

func (*API) CreateWAFRule

func (api *API) CreateWAFRule(rule *WAFRule, domainId int, subDomainName string) (*WAFRule, error)

CreateWAFRule creates a new WAF rule

func (*API) CreateWaitingRoom added in v2.36.0

func (api *API) CreateWaitingRoom(waitingroom *WaitingRoom) (*WaitingRoom, error)

CreateWaitingRoom creates a new waiting room

func (*API) DeleteApiKey added in v2.43.0

func (api *API) DeleteApiKey(apikey *APIKey) (*APIKey, error)

DeleteApiKey deletes the passed API key using the MYRA API

func (*API) DeleteCacheSetting

func (api *API) DeleteCacheSetting(setting *CacheSetting, domainId int, subDomainName string) (*CacheSetting, error)

DeleteCacheSetting deletes the passed cache setting using the MYRA API

func (*API) DeleteDNSRecord

func (api *API) DeleteDNSRecord(record *DNSRecord, domainId int) (*DNSRecord, error)

DeleteDNSRecord deletes the passed DNS record using the MYRA API

func (*API) DeleteDomain

func (api *API) DeleteDomain(domain *Domain) (*Domain, error)

DeleteDomain deletes the passed domain using the MYRA API

func (*API) DeleteErrorPage added in v2.8.0

func (api *API) DeleteErrorPage(errorPage *ErrorPage, domainId int) (*ErrorPage, error)

DeleteErrorPage deletes the passed error page using the MYRA API

func (*API) DeleteIPFilter

func (api *API) DeleteIPFilter(filter *IPFilter, domainId int, subDomainName string) (*IPFilter, error)

DeleteIPFilter deletes the passed ip filter using the MYRA API

func (*API) DeleteMaintenance added in v2.12.0

func (api *API) DeleteMaintenance(maintenance *Maintenance, domainId int, subDomainName string) (*Maintenance, error)

DeleteMaintenance deletes the passed maintenance page using the MYRA API

func (*API) DeleteMaintenanceTemplate added in v2.19.0

func (api *API) DeleteMaintenanceTemplate(template *MaintenanceTemplate, domainId int) (*MaintenanceTemplate, error)

DeleteMaintenanceTemplate deletes the passed maintenance template using the MYRA API

func (*API) DeleteRedirect

func (api *API) DeleteRedirect(redirect *Redirect, domainId int, subDomainName string) (*Redirect, error)

DeleteRedirect deletes the passed redirect using the MYRA API

func (*API) DeleteSSLCertificate

func (api *API) DeleteSSLCertificate(cert *SSLCertificate, domainId int) (*SSLCertificate, error)

DeleteSSLCertificate "deletes" the passed SSL certificate by removing the assigned subdomains from the certificate using the MYRA API

func (*API) DeleteTag added in v2.20.0

func (api *API) DeleteTag(tag *Tag) (*Tag, error)

DeleteTag deletes the passed tag using the MYRA API

func (*API) DeleteTagCacheSetting added in v2.20.0

func (api *API) DeleteTagCacheSetting(setting *CacheSetting, tagId int) (*CacheSetting, error)

DeleteTagCacheSetting deletes the passed cache setting using the MYRA API

func (*API) DeleteTagInformation added in v2.37.0

func (api *API) DeleteTagInformation(information *TagInformation, tagId int) (*TagInformation, error)

DeleteTagInformation deletes the passed tag information using the MYRA API

func (*API) DeleteTagWAFRule added in v2.20.0

func (api *API) DeleteTagWAFRule(rule *TagWAFRule) (*TagWAFRule, error)

DeleteTagWAFRule deletes the passed tag using the MYRA API

func (*API) DeleteWAFRule

func (api *API) DeleteWAFRule(rule *WAFRule) (*WAFRule, error)

DeleteWAFRule deletes the passed WAF rule

func (*API) DeleteWaitingRoom added in v2.36.0

func (api *API) DeleteWaitingRoom(waitingroom *WaitingRoom) (*WaitingRoom, error)

DeleteWaitingRoom updates the waiting room

func (*API) DisableCaching added in v2.14.0

func (api *API) DisableCaching()

DisableCaching disables the caching of the response NOTE: The caching feature is still in development and may not work as expected.

func (*API) EnableCaching added in v2.14.0

func (api *API) EnableCaching()

EnableCaching enables the caching of the response. Note: Only GET requests are cached. NOTE: The caching feature is still in development and may not work as expected.

func (*API) FetchDomain added in v2.26.0

func (api *API) FetchDomain(domain string) (*Domain, error)

FetchDomain returns the Domain for the passed domain (name)

func (*API) FetchDomainForSubdomainName added in v2.26.0

func (api *API) FetchDomainForSubdomainName(subdomain string) (*Domain, error)

FetchDomainForSubdomainName returns the Domain for the passed subdomain (name)

func (*API) FetchWAFRule

func (api *API) FetchWAFRule(id int, params map[string]string) (*WAFRule, error)

FetchWAFRule returns a single WAF rule for the given ID

func (*API) GetDNSRecord added in v2.6.0

func (api *API) GetDNSRecord(domainId int, id int) (*DNSRecord, error)

GetDNSRecord returns a single DNS record with/for the given identifier

func (*API) GetDomain added in v2.6.0

func (api *API) GetDomain(id int) (*Domain, error)

GetDomain returns a single domain with/for the given identifier

func (*API) GetErrorPage added in v2.8.0

func (api *API) GetErrorPage(domainId int, pageId int) (*ErrorPage, error)

GetErrorPage returns a single error page with/for the given identifier

func (*API) GetIPFilter added in v2.6.0

func (api *API) GetIPFilter(domainId int, subDomainName string, id int) (*IPFilter, error)

GetIPFilter returns a single ip filter with/for the given identifier

func (*API) GetRedirect added in v2.6.0

func (api *API) GetRedirect(domainId int, subDomainName string, id int) (*Redirect, error)

GetRedirect returns a single redirect with/for the given identifier

func (*API) GetSSLCertificate added in v2.6.0

func (api *API) GetSSLCertificate(domainId int, id int) (*SSLCertificate, error)

GetSSLCertificate returns a single SSL certificate with/for the given identifier

func (*API) GetTag added in v2.20.0

func (api *API) GetTag(id int) (*Tag, error)

GetTag returns a single tag for the given identifier

func (*API) GetTagWAFRule added in v2.20.0

func (api *API) GetTagWAFRule(tagId int, ruleId int) (*TagWAFRule, error)

GetTagWAFRule returns a single tag for the given identifier

func (*API) GetWaitingRoom added in v2.36.0

func (api *API) GetWaitingRoom(id int) (*WaitingRoom, error)

GetWaitingRoom returns the waiting room

func (*API) GetZoneConfigJson added in v2.37.0

func (api *API) GetZoneConfigJson(domainId int, params map[string]string) (*string, error)

func (*API) GetZoneConfigRaw added in v2.37.0

func (api *API) GetZoneConfigRaw(domainId int, params map[string]string) (*string, error)

func (*API) ListAllSubdomains added in v2.5.0

func (api *API) ListAllSubdomains(params map[string]string) ([]VHost, error)

ListAllSubdomains ...

func (*API) ListAllSubdomainsForDomain added in v2.5.0

func (api *API) ListAllSubdomainsForDomain(domainId int, params map[string]string) ([]VHost, error)

ListAllSubdomainsForDomain ...

func (*API) ListApiKeys added in v2.43.0

func (api *API) ListApiKeys(params map[string]string) ([]APIKey, error)

ListApiKeys returns a slice containing all available API keys

func (*API) ListCacheSettings

func (api *API) ListCacheSettings(domainId int, subDomainName string, params map[string]string) ([]CacheSetting, error)

ListCacheSettings returns a slice containing all visible cache settings for a subdomain

func (*API) ListDNSRecords

func (api *API) ListDNSRecords(domainId int, params map[string]string) ([]DNSRecord, error)

ListDNSRecords returns a slice containing all visible DNS records for a domain

func (*API) ListDomains

func (api *API) ListDomains(params map[string]string) ([]Domain, error)

ListDomains returns a slice containing all visible domains

func (*API) ListErrorPages added in v2.8.0

func (api *API) ListErrorPages(domainId int, params map[string]string) ([]ErrorPage, error)

ListErrorPages returns a slice containing all error pages

func (*API) ListIPFilters

func (api *API) ListIPFilters(domainId int, subDomainName string, params map[string]string) ([]IPFilter, error)

ListIPFilters returns a slice containing all visible ip filters for a subdomain

func (*API) ListIPRanges

func (api *API) ListIPRanges(params map[string]string) ([]IPRange, error)

ListIPRanges returns a slice containing all ip ranges

func (*API) ListMaintenanceTemplates added in v2.19.0

func (api *API) ListMaintenanceTemplates(domainId int, params map[string]string) ([]MaintenanceTemplate, error)

ListMaintenanceTemplates returns a slice containing all maintenance templates for a domain

func (*API) ListMaintenances added in v2.12.0

func (api *API) ListMaintenances(domainId int, subDomainName string, params map[string]string) ([]Maintenance, error)

ListMaintenances returns a slice containing all maintenance pages for a subdomain

func (*API) ListRedirects

func (api *API) ListRedirects(domainId int, subDomainName string, params map[string]string) ([]Redirect, error)

ListRedirects returns a slice containing all visible redirects for a subdomain

func (*API) ListSSLCertificates

func (api *API) ListSSLCertificates(domainId int, params map[string]string) ([]SSLCertificate, error)

ListSSLCertificates returns a slice containing all visible SSL certificates for a domain

func (*API) ListSettings

func (api *API) ListSettings(domainId int, subDomainName string, params map[string]string) (*Settings, error)

ListSettings returns a Setting struct containing the settings for the passed subdomain

func (*API) ListSettingsFull added in v2.30.0

func (api *API) ListSettingsFull(domainId int, subDomainName string, params map[string]string) (any, error)

ListSettingsFull returns a Setting struct containing the full hierarchie of the settings

func (*API) ListSslConfigurations added in v2.33.0

func (api *API) ListSslConfigurations() ([]SslConfiguration, error)

func (*API) ListTagCacheSettings added in v2.20.0

func (api *API) ListTagCacheSettings(tagId int, params map[string]string) ([]CacheSetting, error)

ListTagCacheSettings returns a slice containing all visible cache settings for a subdomain

func (*API) ListTagInformation added in v2.37.0

func (api *API) ListTagInformation(tagId int, params map[string]string) ([]TagInformation, error)

ListTagInformation returns a slice containing all tag information for the passed tag (ID)

func (*API) ListTagInformationBySubDomainName added in v2.37.0

func (api *API) ListTagInformationBySubDomainName(subDomainName string, params map[string]string) ([]TagInformation, error)

ListTagInformationBySubDomainName returns a slice containing all tag information for the passed subDomainName

func (*API) ListTagSettings added in v2.20.0

func (api *API) ListTagSettings(tagId int) (*Settings, error)

ListTagSettings returns a Setting struct containing the settings for the passed tag

func (*API) ListTagSettingsMap added in v2.30.2

func (api *API) ListTagSettingsMap(tagId int) (any, error)

func (*API) ListTagWAFRules added in v2.20.0

func (api *API) ListTagWAFRules(tagId int, params map[string]string) ([]TagWAFRule, error)

ListTagWAFRules returns a slice containing all visible tags

func (*API) ListTags added in v2.20.0

func (api *API) ListTags(params map[string]string) ([]Tag, error)

ListTags returns a slice containing all visible tags

func (*API) ListWAFActions

func (api *API) ListWAFActions() ([]WAFAction, error)

ListWAFActions returns a list of available WAF actions

func (*API) ListWAFConditions

func (api *API) ListWAFConditions() ([]WAFCondition, error)

ListWAFConditions returns a list of available WAF conditions

func (*API) ListWAFRules

func (api *API) ListWAFRules(domainId int, params map[string]string) ([]WAFRule, error)

ListWAFRules returns a list of WAF rules.

func (*API) ListWaitingRoomsForDomain added in v2.36.0

func (api *API) ListWaitingRoomsForDomain(domainId int, params map[string]string) ([]WaitingRoom, error)

ListWaitingRoomsForDomain returns a slice containing all visible waiting rooms for domain

func (*API) ListWaitingRoomsForSubDomain added in v2.36.0

func (api *API) ListWaitingRoomsForSubDomain(subDomainName string, params map[string]string) ([]WaitingRoom, error)

ListWaitingRoomsForSubDomain returns a slice containing all visible waiting rooms for subdomain

func (*API) Me added in v2.43.0

func (api *API) Me() (*User, error)

Me returns the active user information

func (*API) PruneCache added in v2.16.0

func (api *API) PruneCache()

PruneCache

func (*API) QueryStatistics added in v2.23.0

func (api *API) QueryStatistics(query *StatisticQuery) (*Statistics, error)

QueryStatistics function is used to fetch statistical data

func (*API) RemoveFromCache added in v2.16.0

func (api *API) RemoveFromCache(s string)

RemoveFromCache removes a single element from the cache

func (*API) SetCachingTTL added in v2.14.0

func (api *API) SetCachingTTL(ttl int)

SetCachingTTL sets a ttl value for the caching. You have to first call the EnableCaching function to enable the caching. NOTE: The caching feature is still in development and may not work as expected.

func (*API) SetLanguage

func (api *API) SetLanguage(language string) error

SetLanguage changes the API language.

func (*API) SetMaxRetries added in v2.17.0

func (api *API) SetMaxRetries(n int)

SetMaxRetries sets the maxRetries value in the API struct. In case of a non-successfull request, it will try (in total) n times.

func (*API) SetProxy added in v2.25.0

func (api *API) SetProxy(proxyURL string) error

SetProxy allows to set a custom proxyURL for the api client.

func (*API) SetRetrySleep added in v2.17.0

func (api *API) SetRetrySleep(n int)

SetRetrySleep sets a sleep value. It will wait for n-seconds to do the request again in case of retry operation.

func (*API) SetUserAgent

func (api *API) SetUserAgent(userAgent string)

SetUserAgent sets the User-Agent for the API.

func (*API) UpdateCacheSetting

func (api *API) UpdateCacheSetting(setting *CacheSetting, domainId int, subDomainName string) (*CacheSetting, error)

UpdateCacheSetting updates the passed cache setting using the MYRA API

func (*API) UpdateDNSRecord

func (api *API) UpdateDNSRecord(record *DNSRecord, domainId int) (*DNSRecord, error)

UpdateDNSRecord updates the passed DNS record using the MYRA API

func (*API) UpdateDomain

func (api *API) UpdateDomain(domain *Domain) (*Domain, error)

UpdateDomain updates the passed domain using the MYRA API

func (*API) UpdateErrorPage added in v2.8.0

func (api *API) UpdateErrorPage(errorPage *ErrorPage, domainId int) (*ErrorPage, error)

UpdateErrorPage updates the passed error page using the MYRA API

func (*API) UpdateIPFilter

func (api *API) UpdateIPFilter(filter *IPFilter, domainId int, subDomainName string) (*IPFilter, error)

UpdateIPFilter updates the passed ip filter using the MYRA API

func (*API) UpdateMaintenance added in v2.12.0

func (api *API) UpdateMaintenance(maintenance *Maintenance, domainId int, subDomainName string) (*Maintenance, error)

UpdateMaintenance updates the passed maintenance page using the MYRA API

func (*API) UpdateMaintenanceTemplate added in v2.19.0

func (api *API) UpdateMaintenanceTemplate(template *MaintenanceTemplate, domainId int) (*MaintenanceTemplate, error)

UpdateMaintenanceTemplate updates the passed maintenance template using the MYRA API

func (*API) UpdateRedirect

func (api *API) UpdateRedirect(redirect *Redirect, domainId int, subDomainName string) (*Redirect, error)

UpdateRedirect updates the passed redirect using the MYRA API

func (*API) UpdateSSLCertificate

func (api *API) UpdateSSLCertificate(cert *SSLCertificate, domainId int) (*SSLCertificate, error)

UpdateSSLCertificate updates the passed SSL certificate using the MYRA API

func (*API) UpdateSettings

func (api *API) UpdateSettings(settings *Settings, domainId int, subDomainName string) (*Settings, error)

UpdateSettings updates the passed settings using the MYRA API Deprecated: this method uses myra-api settings in a wrong way, please use UpdateSettingsPartial instead

func (*API) UpdateSettingsPartial added in v2.29.0

func (api *API) UpdateSettingsPartial(settings map[string]any, domainId int, subDomainName string) (any, error)

UpdateSettingsPartial updates the passed settings using the MYRA API

func (*API) UpdateTag added in v2.20.0

func (api *API) UpdateTag(tag *Tag) (*Tag, error)

UpdateTag updates the passed tag using the MYRA API

func (*API) UpdateTagCacheSetting added in v2.20.0

func (api *API) UpdateTagCacheSetting(setting *CacheSetting, tagId int) (*CacheSetting, error)

UpdateTagCacheSetting updates the passed cache setting using the MYRA API

func (*API) UpdateTagInformation added in v2.37.0

func (api *API) UpdateTagInformation(information *TagInformation, tagId int) (*TagInformation, error)

UpdateTagInformation updates the passed tag information using the MYRA API

func (*API) UpdateTagSettings added in v2.20.0

func (api *API) UpdateTagSettings(settings *Settings, tagId int) (*Settings, error)

UpdateTagSettings updates the passed settings using the MYRA API

func (*API) UpdateTagSettingsPartial added in v2.29.0

func (api *API) UpdateTagSettingsPartial(settings map[string]any, tagId int) (any, error)

UpdateTagSettings updates the passed settings using the MYRA API

func (*API) UpdateTagWAFRule added in v2.20.0

func (api *API) UpdateTagWAFRule(rule *TagWAFRule) (*TagWAFRule, error)

UpdateTagWAFRule updates the passed tag using the MYRA API

func (*API) UpdateWAFRule

func (api *API) UpdateWAFRule(rule *WAFRule, domainId int, subDomainName string) (*WAFRule, error)

UpdateWAFRule updates the passed WAF rule

func (*API) UpdateWaitingRoom added in v2.36.0

func (api *API) UpdateWaitingRoom(waitingroom *WaitingRoom) (*WaitingRoom, error)

UpdateWaitingRoom updates the waiting room

type APIKey added in v2.43.0

type APIKey struct {
	// ID is the unique identifier for the API key.
	// This value is server-generated and cannot be set during creation.
	ID int `` /* 137-byte string literal not displayed */

	// Created indicates the timestamp when the API key was generated.
	// This is a server-managed, read-only value in ISO 8601 format.
	Created *types.DateTime `` /* 155-byte string literal not displayed */

	// Modified serves as a version identifier for optimistic locking.
	// It records the last update time in ISO 8601 format. This field is required
	// for update and delete operations to ensure data consistency.
	Modified *types.DateTime `` /* 191-byte string literal not displayed */

	// Name is an arbitrary, user-defined label for the API key.
	Name string `json:"name,omitempty" jsonschema:"An arbitrary, user-defined label for the API key."`

	// Key is the public token part of the credential.
	Key string `json:"key,omitempty" jsonschema:"The public token string of the API key."`

	// Secret is the private portion of the credential.
	// Note: This value is returned only once upon creation and cannot be retrieved later.
	Secret string `` /* 134-byte string literal not displayed */
}

APIKey represents an authentication credential used to access the API. It encapsulates the public identifier, the private secret, and metadata regarding the lifecycle of the key.

type APIMethod

type APIMethod struct {
	BaseURL            string
	Name               string
	Action             string
	Method             string
	Result             any
	AdditionalHeaders  map[string]string
	ResponseDecodeFunc func(resp *http.Response, definition APIMethod) (any, error)
}

APIMethod represents API call definitions used in the methods map

type CacheClear added in v2.18.0

type CacheClear struct {
	// FQDN specifies the Fully Qualified Domain Name (e.g., "www.example.com").
	// If left empty, the purge operation applies to the entire domain scope.
	FQDN string `` /* 141-byte string literal not displayed */

	// Resource indicates the relative path to invalidate.
	// It supports wildcard characters (e.g., "*") for pattern matching.
	Resource string `` /* 160-byte string literal not displayed */

	// Recursive determines whether the purge applies to sub-directories.
	// If true, the operation extends to all resources nested under the target path.
	Recursive bool `` /* 136-byte string literal not displayed */
}

CacheClear defines the parameters for invalidating cached content. It allows targeting specific resources or performing bulk purges based on domain and path patterns.

type CacheSetting

type CacheSetting struct {
	// ID is the unique identifier for the cache setting.
	// This value is server-generated and required for update and delete operations.
	ID int `` /* 158-byte string literal not displayed */

	// Created indicates when the setting was established.
	// This is a server-managed, read-only value in ISO 8601 format.
	Created *types.DateTime `json:"created,omitempty" jsonschema:"The timestamp of creation (ISO 8601 format). This is a server-managed, read-only value."`

	// Modified serves as a version identifier for optimistic locking.
	// It records the last update time in ISO 8601 format. This field is required
	// for update and delete operations to ensure data consistency.
	Modified *types.DateTime `` /* 165-byte string literal not displayed */

	// Type defines the matching strategy for the path.
	// Valid options are "prefix", "suffix", and "exact".
	Type string `json:"type" jsonschema:"The strategy used to match the request path. Allowed values: 'prefix', 'suffix', 'exact'."`

	// Path is the pattern used to identify requests for this rule.
	// It supports regular expressions but must not contain start ('^') or end ('$') anchors,
	// as these are implied by the chosen Type.
	Path string `` /* 179-byte string literal not displayed */

	// TTL (Time To Live) defines the cache duration in seconds.
	TTL int `json:"ttl" jsonschema:"The Time To Live (TTL) in seconds. Defines the lifespan of the cached response."`

	// NotFoundTTL defines the cache duration for 404 responses.
	NotFoundTTL int `json:"notFoundTtl" jsonschema:"The duration in seconds to cache 404 (Not Found) responses."`

	// Sort controls the priority of the rule execution.
	// Lower numbers typically indicate higher priority when sorting is active.
	Sort int `json:"sort,omitempty" jsonschema:"The execution priority order of the cache rule."`

	// Enabled determines if the rule is currently active.
	Enabled bool `json:"enabled,omitempty" jsonschema:"Determines whether this cache setting is active."`

	// Enforce overrides the Origin's Cache-Control headers.
	// If true, the backend uses the defined TTL regardless of the Origin's instructions.
	Enforce bool `` /* 131-byte string literal not displayed */

	// Comment is an optional text to describe the purpose of this rule.
	Comment string `json:"comment,omitempty" jsonschema:"An optional comment or description for this cache setting."`
}

CacheSetting represents a single rule definition for caching behavior. It determines how requests are matched (via path patterns) and how long responses are retained (TTL).

type Certificate

type Certificate struct {
	// ID is the unique identifier for the certificate.
	// This value is server-generated and required for update and delete operations.
	ID int `` /* 156-byte string literal not displayed */

	// Created indicates when the certificate object was added to the system.
	// This is a server-managed, read-only value in ISO 8601 format.
	Created *types.DateTime `json:"created,omitempty" jsonschema:"The timestamp of creation (ISO 8601 format). Server-managed, read-only."`

	// Modified serves as a version identifier for optimistic locking.
	// It records the last update time in ISO 8601 format. This field is required
	// for update and delete operations to ensure data consistency.
	Modified *types.DateTime `` /* 165-byte string literal not displayed */

	// Subject is the Common Name (CN) or subject extracted from the certificate.
	// Read-only; automatically parsed from the uploaded PEM data.
	Subject string `` /* 130-byte string literal not displayed */

	// Algorithm specifies the signature algorithm used (e.g., SHA256withRSA).
	// Read-only; automatically parsed from the uploaded PEM data.
	Algorithm string `` /* 128-byte string literal not displayed */

	// ValidFrom indicates the start date of the certificate's validity period.
	// Read-only; automatically parsed from the uploaded PEM data.
	ValidFrom *types.DateTime `` /* 140-byte string literal not displayed */

	// ValidTo indicates the expiration date of the certificate.
	// Read-only; automatically parsed from the uploaded PEM data.
	ValidTo *types.DateTime `` /* 132-byte string literal not displayed */

	// Fingerprint is the unique hash (SHA1/SHA256) of the certificate.
	// Read-only; automatically parsed from the uploaded PEM data.
	Fingerprint string `` /* 129-byte string literal not displayed */

	// SerialNumber is the serial number assigned by the CA.
	// Read-only; automatically parsed from the uploaded PEM data.
	SerialNumber string `` /* 139-byte string literal not displayed */

	// Cert contains the raw public certificate data in PEM format.
	// This is the primary input field for uploading a certificate.
	Cert string `` /* 154-byte string literal not displayed */
}

Certificate serves as the base structure for SSL certificate data. It contains the raw PEM data and extracted metadata like validity dates and fingerprints.

type DNSRecord

type DNSRecord struct {
	// ID is the unique identifier for the DNS record.
	// This value is server-generated and required for update and delete operations.
	ID int `` /* 155-byte string literal not displayed */

	// Created indicates when the record was added.
	// This is a server-managed, read-only value in ISO 8601 format.
	Created *types.DateTime `json:"created,omitempty" jsonschema:"The timestamp of creation (ISO 8601 format). This is a server-managed, read-only value."`

	// Modified serves as a version identifier for optimistic locking.
	// It records the last update time in ISO 8601 format. This field is required
	// for update and delete operations to ensure data consistency.
	Modified *types.DateTime `` /* 165-byte string literal not displayed */

	// Name is the subdomain or host name (e.g., "www" or "@" for the root domain).
	Name string `json:"name" jsonschema:"The subdomain name (e.g., 'www', 'mail') or '@' for the root domain."`

	// Value is the target data for the record.
	// Depending on RecordType, this can be an IP address, domain name, or text.
	Value string `json:"value" jsonschema:"The record content, such as an IP address, domain name, or text value."`

	// RecordType specifies the DNS resource record type.
	// Valid values include A, AAAA, MX, CNAME, TXT, NS, SRV, PTR, and DS.
	RecordType string `` /* 171-byte string literal not displayed */

	// AlternativeCNAME indicates an alias pointing to this record.
	// This is a read-only attribute generated by the API.
	AlternativeCNAME string `` /* 137-byte string literal not displayed */

	// Comment is an optional text to describe the purpose of this record.
	Comment string `json:"comment,omitempty" jsonschema:"An optional comment or description for this DNS record."`

	// CAATag specifies the property tag for CAA records.
	// Example values: "issue", "issuewild", "iodef".
	CAATag string `` /* 174-byte string literal not displayed */

	// Active indicates if the record is proxied/protected by the Myra WAF.
	Active bool `json:"active" jsonschema:"If true, the record is proxied and protected by the Myra WAF/CDN. If false, it is DNS-only."`

	// Enabled determines if the DNS record is active in the zone.
	Enabled bool `json:"enabled" jsonschema:"Determines whether this DNS record is enabled (published) or disabled."`

	// TTL (Time To Live) defines the cache duration in seconds for DNS resolvers.
	TTL int `json:"ttl" jsonschema:"The Time To Live (TTL) in seconds. Controls how long DNS resolvers cache this record."`

	// Priority specifies the priority for MX and SRV records.
	// Lower values typically indicate higher priority.
	Priority int `json:"priority,omitempty" jsonschema:"Priority value. Required for MX and SRV records."`

	// Port defines the service port for SRV records.
	Port int `json:"port,omitempty" jsonschema:"Service port. Required for SRV records."`

	// Weight defines the relative weight for SRV records with the same priority.
	Weight int `json:"weight,omitempty" jsonschema:"Weight value. Required for SRV records."`

	// CAAFlags represents the flag byte for CAA records (usually 0 or 128).
	CAAFlags int `json:"caaFlags,omitempty" jsonschema:"Flags for CAA records (e.g., 0 for non-critical, 128 for critical)."`

	// Encryption specifies the algorithm ID for DS records.
	// Common values: 8 (RSA/SHA-256), 13 (ECDSA-P256/SHA256).
	Encryption int `` /* 178-byte string literal not displayed */

	// HashType specifies the digest type ID for DS records.
	// Values: 1 (SHA-1), 2 (SHA-256), 3 (GOST), 4 (SHA-384).
	HashType int `` /* 132-byte string literal not displayed */

	// IdentificationNumber is the Key Tag for DS records.
	IdentificationNumber int `json:"identificationNumber,omitempty" jsonschema:"The Key Tag (ID) for DS records."`

	// UpstreamOptions configures load balancing behavior for the origin.
	UpstreamOptions *UpstreamOptions `` /* 135-byte string literal not displayed */
}

DNSRecord represents a single DNS entry within a domain zone. It supports various record types including standard records (A, CNAME) and specialized security records (CAA, DS).

func (DNSRecord) CanBeProtected added in v2.27.0

func (rec DNSRecord) CanBeProtected() bool

type Domain

type Domain struct {
	// ID is the unique identifier for the domain.
	// This value is server-generated and required for update and delete operations.
	ID int `` /* 151-byte string literal not displayed */

	// Created indicates when the domain was added to the system.
	// This is a server-managed, read-only value in ISO 8601 format.
	Created *types.DateTime `json:"created,omitempty" jsonschema:"The timestamp of creation (ISO 8601 format). Server-managed, read-only."`

	// Modified serves as a version identifier for optimistic locking.
	// It records the last update time in ISO 8601 format. This field is required
	// for update and delete operations to ensure data consistency.
	Modified *types.DateTime `` /* 165-byte string literal not displayed */

	// Name is the Fully Qualified Domain Name (FQDN).
	// This value is immutable once created.
	Name string `` /* 173-byte string literal not displayed */

	// AutoUpdate controls the immediate deployment of configuration changes.
	// If false, changes are saved to the database but not propagated to the edge/WAF
	// until re-enabled. Useful for performing atomic batch updates.
	AutoUpdate bool `` /* 208-byte string literal not displayed */

	// AutoDNS triggers an automatic DNS record import during creation.
	// Note: This relies on external DNS queries and may result in an incomplete list.
	AutoDNS bool `` /* 176-byte string literal not displayed */

	// Paused indicates if the WAF/Protection is currently suspended for this domain.
	Paused bool `json:"paused" jsonschema:"Indicates if the Myra protection/WAF is currently suspended (paused) for this domain."`

	// PausedUntil specifies the scheduled date for automatic reactivation of protection.
	PausedUntil *types.DateTime `` /* 152-byte string literal not displayed */

	// Reversed indicates if the domain is reversed.
	Reversed bool `json:"reversed" jsonschema:"Indicates whether the domain is reversed (boolean flag)."`
}

Domain represents a website or zone managed by the Myra platform. It acts as the root object for all configuration settings, DNS records, and cache rules associated with a specific FQDN.

type ErrorPage added in v2.8.0

type ErrorPage struct {
	// ID is the internal system identifier for the object.
	// This value is read-only and ignored for update and delete operations.
	ID int `` /* 194-byte string literal not displayed */

	// Created indicates when the error page was created.
	// This is a server-managed, read-only value in ISO 8601 format.
	Created *types.DateTime `` /* 129-byte string literal not displayed */

	// Modified serves as a version identifier for optimistic locking.
	// It records the last update time in ISO 8601 format. This field is required
	// for update and delete operations to ensure data consistency.
	Modified *types.DateTime `` /* 165-byte string literal not displayed */

	// ErrorCode represents the HTTP Status Code (e.g., 404, 500).
	// This value is part of the composite unique key and is immutable once created.
	ErrorCode int `` /* 140-byte string literal not displayed */

	// Content contains the raw HTML code to be rendered.
	Content string `json:"content,omitempty" jsonschema:"The raw HTML content to be displayed for this error page."`

	// SubDomainName is the FQDN for which this error page is configured.
	// This value is part of the composite unique key and is immutable once created.
	SubDomainName string `` /* 157-byte string literal not displayed */
}

ErrorPage represents a custom HTML error page configuration (e.g., 404, 500). Unlike other objects, it is uniquely identified by the combination of SubDomainName and ErrorCode, rather than the numeric ID.

type IPFilter

type IPFilter struct {
	// ID is the unique identifier for the IP filter.
	// This value is server-generated and required for update and delete operations.
	ID int `` /* 154-byte string literal not displayed */

	// Created indicates when the filter was added.
	// This is a server-managed, read-only value in ISO 8601 format.
	Created *types.DateTime `json:"created,omitempty" jsonschema:"The timestamp of creation (ISO 8601 format). Server-managed, read-only."`

	// Modified serves as a version identifier for optimistic locking.
	// It records the last update time in ISO 8601 format. This field is required
	// for update and delete operations to ensure data consistency.
	Modified *types.DateTime `` /* 165-byte string literal not displayed */

	// ExpireDate schedules the automatic deactivation of the filter.
	// If nil, the filter remains active until manually disabled or deleted.
	ExpireDate *types.DateTime `` /* 165-byte string literal not displayed */

	// Value is the IP address or CIDR range to match.
	// Supports IPv4 and IPv6. Note: IPv6 ranges are restricted to /128.
	Value string `` /* 156-byte string literal not displayed */

	// Type defines the action to take when the filter matches.
	// Valid values are BLACKLIST, WHITELIST, or WHITELIST_REQUEST_LIMITER.
	Type string `json:"type" jsonschema:"The action type for the filter. Valid values: 'BLACKLIST', 'WHITELIST', 'WHITELIST_REQUEST_LIMITER'."`

	// Comment provides a descriptive note for the filter rule.
	Comment string `json:"comment,omitempty" jsonschema:"A descriptive comment or note for this IP filter."`

	// Enabled controls whether the filter is currently active.
	Enabled bool `json:"enabled" jsonschema:"Indicates if the IP filter rule is currently active (enabled) or inactive."`

	// SubDomainName is the FQDN of the subdomain this filter applies to.
	// This value is typically set via the URL context and is immutable on the object itself.
	SubDomainName string `` /* 163-byte string literal not displayed */
}

IPFilter represents an access control rule for a specific subdomain. It allows blocking or whitelisting of traffic based on IP addresses or CIDR ranges.

type IPRange

type IPRange struct {
	// ID is the unique identifier for the IP range.
	// This value is server-generated and required for update and delete operations.
	ID int `` /* 153-byte string literal not displayed */

	// Created indicates when the IP range was added.
	// This is a server-managed, read-only value in ISO 8601 format.
	Created *types.DateTime `json:"created,omitempty" jsonschema:"The timestamp of creation (ISO 8601 format). Server-managed, read-only."`

	// Modified serves as a version identifier for optimistic locking.
	// It records the last update time in ISO 8601 format. This field is required
	// for update and delete operations to ensure data consistency.
	Modified *types.DateTime `` /* 165-byte string literal not displayed */

	// Network defines the IP address range in CIDR notation.
	Network string `json:"network" jsonschema:"The network address in CIDR notation (e.g., '192.168.0.0/24' or '2001:db8::/32')."`

	// ValidFrom specifies the start date for the range's validity.
	// If nil, the range is considered valid immediately upon creation.
	ValidFrom *types.DateTime `` /* 129-byte string literal not displayed */

	// ValidTo specifies the expiration date for the range.
	// If nil, the range remains valid indefinitely.
	ValidTo *types.DateTime `` /* 127-byte string literal not displayed */

	// Enabled controls whether the IP range is currently active.
	Enabled bool `json:"enabled" jsonschema:"Indicates if this IP range is currently active (enabled) or ignored."`

	// Comment provides a descriptive note for the IP range.
	Comment string `json:"comment,omitempty" jsonschema:"A descriptive comment or note for this IP range."`
}

IPRange represents a specific network block defined by a CIDR notation. It is used to define validity periods and access status for specific network ranges.

type Maintenance added in v2.12.0

type Maintenance struct {
	// ID is the unique identifier for the maintenance entry.
	// This value is server-generated and required for update and delete operations.
	ID int `` /* 162-byte string literal not displayed */

	// Created indicates when the maintenance entry was created.
	// This is a server-managed, read-only value in ISO 8601 format.
	Created *types.DateTime `json:"created,omitempty" jsonschema:"The timestamp of creation (ISO 8601 format). Server-managed, read-only."`

	// Modified serves as a version identifier for optimistic locking.
	// It records the last update time in ISO 8601 format. This field is required
	// for update and delete operations to ensure data consistency.
	Modified *types.DateTime `` /* 165-byte string literal not displayed */

	// Start specifies when the maintenance window begins.
	// If nil, the maintenance starts immediately.
	Start *types.DateTime `` /* 136-byte string literal not displayed */

	// End specifies when the maintenance window finishes.
	// Must be later than Start.
	End *types.DateTime `json:"end,omitempty" jsonschema:"The end timestamp (ISO 8601). Must be later than 'Start'."`

	// Active indicates if the maintenance mode is currently live.
	// This is a computed read-only value based on Start and End.
	Active bool `` /* 169-byte string literal not displayed */

	// Content contains the HTML code for the maintenance page.
	// Note: Avoid linking to resources on the maintenance domain itself.
	Content string `` /* 206-byte string literal not displayed */

	// ContentFrom allows copying content from another existing maintenance page.
	// If specified, the system copies the HTML from the referenced FQDN.
	ContentFrom string `` /* 184-byte string literal not displayed */

	// FQDN is the fully qualified domain name this maintenance applies to.
	FQDN string `json:"fqdn" jsonschema:"The Fully Qualified Domain Name (FQDN) to apply maintenance mode to (e.g., 'www.example.com')."`
}

Maintenance represents a scheduled maintenance window for a specific domain (FQDN). It controls when the maintenance page is displayed to visitors.

type MaintenanceTemplate added in v2.19.0

type MaintenanceTemplate struct {
	// ID is the unique identifier for the maintenance template.
	// This value is server-generated and required for update and delete operations.
	ID int `` /* 153-byte string literal not displayed */

	// Created indicates when the template was created.
	// This is a server-managed, read-only value in ISO 8601 format.
	Created *types.DateTime `json:"created,omitempty" jsonschema:"The timestamp of creation (ISO 8601 format). Server-managed, read-only."`

	// Modified serves as a version identifier for optimistic locking.
	// It records the last update time in ISO 8601 format. This field is required
	// for update and delete operations to ensure data consistency.
	Modified *types.DateTime `` /* 165-byte string literal not displayed */

	// Name is a descriptive label for the template.
	Name string `json:"name" jsonschema:"A descriptive name to identify this maintenance template."`

	// Content contains the HTML code for the maintenance page.
	// Note: Avoid linking to resources on the maintenance domain itself.
	Content string `` /* 206-byte string literal not displayed */
}

MaintenanceTemplate represents a reusable HTML layout for maintenance pages. It defines the visual content displayed to users when a domain is switched to maintenance mode.

type Redirect

type Redirect struct {
	// ID is the unique identifier for the redirect rule.
	// This value is server-generated and required for update and delete operations.
	ID int `` /* 153-byte string literal not displayed */

	// Created indicates when the redirect was added.
	// This is a server-managed, read-only value in ISO 8601 format.
	Created *types.DateTime `json:"created,omitempty" jsonschema:"The timestamp of creation (ISO 8601 format). Server-managed, read-only."`

	// Modified serves as a version identifier for optimistic locking.
	// It records the last update time in ISO 8601 format. This field is required
	// for update and delete operations to ensure data consistency.
	Modified *types.DateTime `` /* 165-byte string literal not displayed */

	// Type determines the HTTP status code used for the redirection.
	// Valid values are 'permanent' (HTTP 301) and 'redirect' (HTTP 302).
	Type string `` /* 135-byte string literal not displayed */

	// SubDomainName is the FQDN of the subdomain this redirect applies to.
	// This value is typically set via the URL context and is immutable on the object itself.
	SubDomainName string `` /* 165-byte string literal not displayed */

	// Source is the incoming path or pattern to match against.
	// Depending on MatchingType, this can be an exact path, prefix, or suffix.
	Source string `json:"source" jsonschema:"The source path or pattern to match against the incoming request URI."`

	// Destination is the target URL where the user will be sent.
	// Can be an absolute URL (https://...) or a relative path (/page).
	Destination string `` /* 139-byte string literal not displayed */

	// MatchingType defines how the Source field is interpreted.
	// Valid values are 'prefix', 'suffix', and 'exact'.
	MatchingType string `` /* 148-byte string literal not displayed */

	// Comment provides a descriptive note for the redirect rule.
	Comment string `json:"comment,omitempty" jsonschema:"A descriptive comment or note for this redirect rule."`

	// Sort defines the execution order of redirect rules.
	// Lower numbers are processed first (ascending order).
	Sort int `json:"sort,omitempty" jsonschema:"The priority/sort order (ascending). Lower numbers are processed first."`

	// Enabled controls whether the redirect rule is currently active.
	Enabled bool `json:"enabled" jsonschema:"Indicates if the redirect rule is currently active (enabled) or ignored."`

	// ExpertMode disables safety checks like loop detection.
	// Use with caution to prevent infinite redirect loops.
	ExpertMode bool `json:"expertMode,omitempty" jsonschema:"If true, disables automatic redirect loop detection. Use with caution."`
}

Redirect represents an HTTP redirection rule (Forwarding). It maps incoming requests from a source path to a destination URL based on specific matching criteria.

type Response

type Response struct {
	Error         bool         `json:"error,omitempty"`
	ViolationList []*Violation `json:"violationList,omitempty"`
	ErrorMessage  string       `json:"errorMessage,omitempty"`
	WarningList   []*Warning   `json:"warningList,omitempty"`
	TargetObject  []any        `json:"targetObject,omitempty"`
	Data          []any        `json:"data,omitempty"`
	List          []any        `json:"list,omitempty"`
	Result        []any        `json:"result,omitempty"`
	Page          int          `json:"page,omitempty"`
	Count         int          `json:"count,omitempty"`
	PageSize      int          `json:"pageSize,omitempty"`
	Domain        []any        `json:"domain,omitempty"`
}

Response defines a response, returned by the MYRA API

type SSLCertificate

type SSLCertificate struct {
	*Certificate

	// SubjectAlternatives lists all SANs (Subject Alternative Names) covered by this certificate.
	// Read-only; automatically parsed from the uploaded PEM data.
	SubjectAlternatives []string `` /* 170-byte string literal not displayed */

	// Intermediates contains the chain of intermediate certificates.
	// The system automatically sorts and filters these based on the uploaded certificate.
	Intermediates []SSLIntermediate `` /* 179-byte string literal not displayed */

	// Wildcard indicates if the certificate is a wildcard certificate (*.domain.tld).
	// Read-only; automatically determined from the subject.
	Wildcard bool `json:"wildcard" jsonschema:"True if the certificate is a wildcard certificate (Subject starts with '*'). Read-only."`

	// ExtendedValidation indicates if the certificate has EV status (green bar).
	// Read-only; determined via OID matching (e.g., Google Chrome™ standards).
	ExtendedValidation bool `json:"extendedValidation" jsonschema:"True if the certificate is detected as Extended Validation (EV). Read-only."`

	// Subdomains is a list of FQDNs in the Myra system assigned to this certificate.
	Subdomains []string `json:"subdomains,omitempty" jsonschema:"List of subdomains (FQDNs) explicitly assigned to use this certificate."`

	// Key is the private key associated with the certificate in PEM format.
	// Required for new uploads. Write-only (usually not returned in GET requests for security).
	Key string `` /* 153-byte string literal not displayed */

	// CertRefreshForced allows overwriting an existing certificate even if the new one matches differently.
	// Use with caution to prevent accidental interruptions.
	CertRefreshForced bool `` /* 180-byte string literal not displayed */

	// CertToRefresh is the ID of an existing certificate to replace/rotate.
	// Used to update a certificate without changing assigned IP addresses.
	CertToRefresh int `` /* 161-byte string literal not displayed */

	// SslConfigurationName specifies the TLS protocol and cipher suite profile.
	// Valid values: 'Myra-Global-TLS-Default', '2023-mozilla-intermediate', '2023-mozilla-modern'.
	SslConfigurationName string `` /* 174-byte string literal not displayed */

	// Managed indicates if the certificate is automatically managed/renewed by the Myra platform (e.g., Let's Encrypt).
	// Read-only.
	Managed bool `` /* 127-byte string literal not displayed */
}

SSLCertificate represents a full SSL configuration object, including the private key and assignments to specific subdomains. It embeds the base Certificate metadata.

type SSLIntermediate

type SSLIntermediate struct {
	*Certificate

	// Issuer is the name of the entity that signed this intermediate certificate.
	Issuer string `json:"issuer" jsonschema:"The name of the Issuer (CA) that signed this certificate. Read-only."`
}

SSLIntermediate represents an intermediate CA certificate in the chain.

type Settings

type Settings struct {
	// AccessLog controls the generation of separate access logs.
	// If enabled, logs from each edge node are aggregated and available via SFTP.
	AccessLog bool `` /* 154-byte string literal not displayed */

	// AntibotPostFlood enables the detection of POST flood attacks.
	// Uses a JavaScript-based puzzle to verify the client.
	AntibotPostFlood bool `json:"antibot_post_flood,omitempty" jsonschema:"Enables detection of POST floods using a JavaScript Proof-of-Work puzzle."`

	// AntibotPostFloodThreshold sets the trigger frequency for the POST flood puzzle.
	// Higher values mean the puzzle is presented less frequently.
	AntibotPostFloodThreshold int `` /* 164-byte string literal not displayed */

	// AntibotProofOfWork enables general bot detection via JS puzzles.
	AntibotProofOfWork bool `` /* 133-byte string literal not displayed */

	// AntibotProofOfWorkThreshold sets the trigger frequency for the general PoW puzzle.
	AntibotProofOfWorkThreshold int `` /* 186-byte string literal not displayed */

	// BalancingMethod defines the strategy for distributing requests to upstream servers.
	// Valid values: 'round-robin', 'ip_hash', 'least_conn'.
	BalancingMethod string `` /* 179-byte string literal not displayed */

	// BlockNotWhitelisted blocks all IPs not explicitly whitelisted in IP filters.
	BlockNotWhitelisted bool `` /* 155-byte string literal not displayed */

	// BlockTorNetwork blocks traffic originating from known Tor exit nodes.
	BlockTorNetwork bool `` /* 136-byte string literal not displayed */

	// CacheEnabled toggles the caching engine.
	// Requires defined Cache Settings objects to function effectively.
	CacheEnabled bool `` /* 153-byte string literal not displayed */

	// CacheRevalidate forces revalidation of expired cache items.
	// Uses 'If-Modified-Since' and 'If-None-Match' headers.
	CacheRevalidate bool `` /* 173-byte string literal not displayed */

	// CDN is a deprecated setting.
	// It has no effect and should not be used.
	CDN bool `json:"cdn,omitempty" jsonschema:"Deprecated setting. Has no effect."`

	// ClientMaxBodySize sets the maximum allowed size of the request body.
	// Matches the 'Content-Length' header.
	ClientMaxBodySize int `` /* 154-byte string literal not displayed */

	// CookieName is the name of the cookie used for stickiness.
	// Only used when BalancingMethod is set to 'cookie_based' (custom).
	CookieName string `` /* 157-byte string literal not displayed */

	// DiffieHellmanExchange defines the bit size of DH parameters.
	// Note: Java 6/7 clients do not support >1024 bits.
	DiffieHellmanExchange int `` /* 172-byte string literal not displayed */

	// DisableForwardFor disables the automatic injection/replacement of the Forwarded-For header.
	DisableForwardFor bool `` /* 138-byte string literal not displayed */

	// EnableOriginSNI allows SNI (Server Name Indication) when connecting to the origin.
	EnableOriginSNI bool `` /* 176-byte string literal not displayed */

	// EnforceCacheTTL overrides origin cache headers with Myra settings.
	EnforceCacheTTL bool `` /* 149-byte string literal not displayed */

	// ForwardedForReplacement allows setting a custom name for the client IP header.
	ForwardedForReplacement string `` /* 166-byte string literal not displayed */

	// HSTS enables Strict-Transport-Security.
	// Forces browsers to interact with the domain only via HTTPS.
	HSTS bool `json:"hsts,omitempty" jsonschema:"Enables HTTP Strict Transport Security (HSTS). Forces browsers to use HTTPS only."`

	// HSTSIncludeSubdomains extends HSTS protection to all subdomains.
	HSTSIncludeSubdomains bool `json:"hsts_include_subdomains,omitempty" jsonschema:"If true, the HSTS policy applies to all subdomains as well."`

	// HSTSMaxAge defines the duration (in seconds) the HSTS header is valid.
	HSTSMaxAge int `json:"hsts_max_age,omitempty" jsonschema:"The duration (in seconds) for which the browser should remember to force HTTPS."`

	// HSTSPreload allows the domain to be submitted to the global HSTS preload list.
	HSTSPreload bool `` /* 157-byte string literal not displayed */

	// HTTPOriginPort sets the port for plain HTTP upstream connections.
	HTTPOriginPort int `json:"http_origin_port,omitempty" jsonschema:"The TCP port used to connect to the origin server via plain HTTP (usually 80)."`

	// IgnoreNoCache forces caching even if the origin sends 'no-cache' headers.
	IgnoreNoCache bool `` /* 166-byte string literal not displayed */

	// ImageOptimization enables lossless compression for JPEG and PNGs.
	ImageOptimization bool `json:"image_optimization,omitempty" jsonschema:"Enables automatic lossless compression/optimization of JPEG and PNG images."`

	// IPLock prevents accidental IP address changes via the API/GUI.
	// Only available at the general domain level.
	IPLock bool `` /* 146-byte string literal not displayed */

	// IPv6Active enables IPv6 connectivity for the domain.
	IPv6Active bool `` /* 137-byte string literal not displayed */

	// LimitAllowedHTTPMethod restricts the HTTP methods accepted by the edge.
	// E.g., ["GET", "POST"].
	LimitAllowedHTTPMethod []string `` /* 169-byte string literal not displayed */

	// LimitTLSVersion restricts the allowed TLS protocol versions.
	// E.g., ["TLSv1.2", "TLSv1.3"].
	LimitTLSVersion []string `` /* 141-byte string literal not displayed */

	// LogFormat specifies a custom log line format.
	LogFormat string `json:"log_format,omitempty" jsonschema:"Defines a custom structure for log entries."`

	// MonitoringAlertThreshold sets the error rate (errors/minute) that triggers an alert.
	MonitoringAlertThreshold int `` /* 138-byte string literal not displayed */

	// MonitoringContactEMail is a space-separated list of alert recipients.
	MonitoringContactEMail string `json:"monitoring_contact_email,omitempty" jsonschema:"Space-separated list of email addresses to receive monitoring alerts."`

	// MonitoringSendAlert enables upstream error reporting.
	MonitoringSendAlert bool `` /* 134-byte string literal not displayed */

	// MyraSSLHeader injects 'X-Myra-SSL' to indicate a secure connection to the origin.
	MyraSSLHeader bool `` /* 154-byte string literal not displayed */

	// MyraSSLCertificate lists certificates to use for upstream authentication.
	MyraSSLCertificate []string `` /* 145-byte string literal not displayed */

	// MyraSSLCertificateKey lists private keys for the upstream certificates.
	MyraSSLCertificateKey []string `json:"myra_ssl_certificate_key,omitempty" jsonschema:"List of private keys corresponding to the MyraSSLCertificate."`

	// NextUpstream defines conditions to try the next server in the pool.
	// Values: error, timeout, invalid_header, http_500, http_502, etc. 'off' disables it.
	NextUpstream []string `` /* 182-byte string literal not displayed */

	// OnlyHTTPS forces all traffic to the origin to use HTTPS.
	OnlyHTTPS bool `` /* 135-byte string literal not displayed */

	// OriginConnectionHeader defines the 'Connection' header sent to the upstream.
	OriginConnectionHeader string `` /* 148-byte string literal not displayed */

	// ProxyCacheBypass defines a cookie name that forces a cache miss.
	ProxyCacheBypass string `` /* 134-byte string literal not displayed */

	// ProxyCacheStale defines when to serve stale content on upstream errors.
	// Values: error, timeout, updating, http_500, etc.
	ProxyCacheStale []string `` /* 176-byte string literal not displayed */

	// ProxyConnectTimeout is the timeout (seconds) for connecting to the upstream.
	// Max: 60s.
	ProxyConnectTimeout int `` /* 140-byte string literal not displayed */

	// ProxyHostHeader sets a custom 'Host' header for upstream requests.
	// Default: current subdomain.
	ProxyHostHeader *string `` /* 141-byte string literal not displayed */

	// ProxyReadTimeout is the timeout (seconds) for reading the upstream response.
	// Applies between two successive read operations.
	ProxyReadTimeout int `` /* 150-byte string literal not displayed */

	// RequestLimitBlock enables CAPTCHA challenges for rate-limited IPs.
	RequestLimitBlock string `` /* 146-byte string literal not displayed */

	// RequestLimitLevel sets the max requests per minute per IP.
	RequestLimitLevel int `` /* 145-byte string literal not displayed */

	// RequestLimitReport enables email reporting for rate limits.
	RequestLimitReport bool `` /* 127-byte string literal not displayed */

	// RequestLimitReportEMail is a space-separated list of rate-limit report recipients.
	RequestLimitReportEMail string `` /* 130-byte string literal not displayed */

	// Rewrite enables automated JavaScript optimization (bundling/deferring).
	Rewrite bool `` /* 141-byte string literal not displayed */

	// SourceProtocol defines the protocol scheme for upstream connections.
	// Values: 'same' (match client), 'http', 'https'.
	SourceProtocol string `` /* 174-byte string literal not displayed */

	// Spdy enables HTTP/2.
	// Note: Requires HTTPS to be active.
	Spdy bool `json:"spdy,omitempty" jsonschema:"Enables the HTTP/2 protocol (formerly SPDY). Note: Requires active HTTPS."`

	// SSLClientVerify enables mTLS client certificate verification.
	SSLClientVerify string `` /* 140-byte string literal not displayed */

	// SSLClientCertificate is a list of trusted CA certificates (PEM) for mTLS.
	SSLClientCertificate []string `` /* 140-byte string literal not displayed */

	// SSLClientHeaderVerification is the header name containing the verification result.
	SSLClientHeaderVerification string `` /* 171-byte string literal not displayed */

	// SSLClientHeaderFingerprint is the header name containing the client cert fingerprint.
	SSLClientHeaderFingerprint string `` /* 136-byte string literal not displayed */

	// SSLOriginPort sets the port for SSL upstream connections.
	SSLOriginPort int `json:"ssl_origin_port,omitempty" jsonschema:"The TCP port used to connect to the origin server via HTTPS (usually 443)."`

	// WAFEnable toggles the Web Application Firewall.
	WAFEnable bool `` /* 127-byte string literal not displayed */

	// WAFLevelsEnable selects the WAF rule sets to apply.
	// E.g., ["wafrules_sql", "wafrules_xss"].
	WAFLevelsEnable []string `json:"waf_levels_enable,omitempty" jsonschema:"List of active WAF rule sets (e.g., ['wafrules_sql', 'wafrules_xss'])."`

	// WAFPolicy defines the default action if a rule matches.
	// Values: 'block', 'allow', 'log'.
	WAFPolicy string `json:"waf_policy,omitempty" jsonschema:"Default action when a WAF rule is triggered. Valid values: 'block', 'allow', 'log'."`
}

Settings represents the comprehensive configuration for a domain or subdomain. It controls caching, WAF, security features, and upstream balancing behavior.

type SslConfiguration added in v2.33.0

type SslConfiguration struct {
	// ID is the unique identifier for the SSL configuration.
	// This value is server-generated and read-only.
	ID int `` /* 133-byte string literal not displayed */

	// Name is a unique label for this configuration profile.
	Name string `json:"name" jsonschema:"A unique name or label to identify this SSL configuration (e.g., 'Myra-Global-TLS-Default')."`

	// Ciphers defines the list of allowed cipher suites.
	// Expects an OpenSSL cipher string format.
	Ciphers string `` /* 165-byte string literal not displayed */

	// Protocols defines the list of allowed TLS protocols.
	// Typically a space-separated string (e.g., "TLSv1.2 TLSv1.3").
	Protocols string `json:"protocols" jsonschema:"Space-separated list of enabled TLS protocols (e.g., 'TLSv1.2 TLSv1.3')."`
}

SslConfiguration represents a custom TLS/SSL profile. It defines the specific cipher suites and protocols allowed for secure connections.

type StatisticQuery added in v2.23.0

type StatisticQuery struct {
	// AggregationInterval defines the time granularity for histogram data.
	// Only relevant if the data source type is 'histogram'.
	AggregationInterval string `` /* 186-byte string literal not displayed */

	// DataSources configures which metrics to fetch and how to format them.
	// Map Key: The metric source name (e.g., 'stats', 'waf', 'dns', 'cache').
	// Map Value: Configuration options (e.g., {'type': 'histogram'} or {'type': 'top', 'limit': '10'}).
	DataSources map[string]map[string]string `` /* 170-byte string literal not displayed */

	// StartDate is the beginning of the reporting window (ISO 8601).
	StartDate *types.DateTime `json:"startDate" jsonschema:"The start timestamp (ISO 8601) for the data aggregation interval."`

	// EndDate is the end of the reporting window (ISO 8601).
	EndDate *types.DateTime `json:"endDate" jsonschema:"The end timestamp (ISO 8601) for the data aggregation interval."`

	// FQDN is a list of specific Fully Qualified Domain Names to include.
	// Only used if Type is set to 'fqdn'.
	FQDN []string `` /* 139-byte string literal not displayed */

	// Type defines the scope of the query.
	// Common values are 'fqdn' (specific domains).
	Type string `json:"type" jsonschema:"The scope selection mode. Valid values: 'fqdn' (use the provided FQDN list)."`
}

StatisticQuery defines the criteria for fetching statistical data. It specifies the time range, target domains, and specific metrics (data sources) to retrieve.

type Statistics added in v2.23.0

type Statistics struct {
	// Query echoes the parameters used to generate this statistical report.
	Query *StatisticQuery `json:"query" jsonschema:"The query configuration used to generate the results."`

	// Result contains the raw statistical data.
	// The structure of this map depends dynamically on the requested 'dataSources'.
	Result map[string]any `` /* 186-byte string literal not displayed */
}

Statistics acts as a container for the requested statistical report. It includes both the original query parameters and the resulting data set.

type Tag added in v2.20.0

type Tag struct {
	// ID is the unique identifier for the tag.
	// This value is server-generated and required for update and delete operations.
	ID int `` /* 148-byte string literal not displayed */

	// Created indicates when the tag was created.
	// This is a server-managed, read-only value in ISO 8601 format.
	Created *types.DateTime `json:"created,omitempty" jsonschema:"The timestamp of creation (ISO 8601 format). Server-managed, read-only."`

	// Modified serves as a version identifier for optimistic locking.
	// It records the last update time in ISO 8601 format. This field is required
	// for update and delete operations to ensure data consistency.
	Modified *types.DateTime `` /* 165-byte string literal not displayed */

	// Name is the display label for the tag.
	Name string `json:"name" jsonschema:"The unique name of the tag used for identification."`

	// Type defines the functional category of the tag.
	// Valid values are: CONFIG, WAF, CACHE, RATE_LIMIT, INFORMATION.
	Type string `json:"type" jsonschema:"The category/type of the tag. Valid values: 'CONFIG', 'WAF', 'CACHE', 'RATE_LIMIT', 'INFORMATION'."`

	// Assignments lists the domains or subdomains linked to this tag.
	Assignments []TagAssignment `json:"assignments" jsonschema:"List of resources (domains/subdomains) assigned to this tag."`

	// Sort defines the processing order priority.
	// Specifically relevant for WAF tags to determine rule execution order.
	Sort int `json:"sort,omitempty" jsonschema:"Priority/Sorting order. Crucial for 'WAF' tags to determine the execution order of rules."`

	// Global indicates if the tag is a system-wide predefined tag.
	// Global tags cannot be renamed or modified; only assignments can be changed.
	Global bool `` /* 182-byte string literal not displayed */
}

Tag represents a logical grouping container for configuration settings. Tags can be applied to domains or subdomains to enforce shared rules (e.g., WAF, Cache).

type TagAssignment added in v2.20.0

type TagAssignment struct {
	// ID is the unique identifier for the assignment.
	// This value is server-generated and required for update and delete operations.
	ID int `` /* 155-byte string literal not displayed */

	// Created indicates when the assignment was created.
	// This is a server-managed, read-only value in ISO 8601 format.
	Created *types.DateTime `json:"created,omitempty" jsonschema:"The timestamp of creation (ISO 8601 format). Server-managed, read-only."`

	// Modified serves as a version identifier for optimistic locking.
	// It records the last update time in ISO 8601 format. This field is required
	// for update and delete operations to ensure data consistency.
	Modified *types.DateTime `` /* 165-byte string literal not displayed */

	// Type defines the scope of the assignment.
	// Valid values are: DOMAIN, SUBDOMAIN.
	Type string `json:"type" jsonschema:"The scope of the assignment. Valid values: 'DOMAIN', 'SUBDOMAIN'."`

	// Title is the identifier of the assigned resource (usually the domain name).
	Title string `json:"title" jsonschema:"The identifier of the assigned resource (e.g., the Domain Name)."`

	// SubDomainName specifies the target subdomain.
	// Only required if Type is set to SUBDOMAIN.
	SubDomainName string `json:"subDomainName" jsonschema:"The specific subdomain FQDN. Required if 'type' is set to 'SUBDOMAIN'."`
}

TagAssignment represents the link between a Tag and a specific resource (Domain or Subdomain).

type TagInformation added in v2.37.0

type TagInformation struct {
	// ID is the unique identifier for the tag assignment.
	// This value is server-generated and required for update and delete operations.
	ID int `` /* 148-byte string literal not displayed */

	// Created indicates when the tag was added.
	// This is a server-managed, read-only value in ISO 8601 format.
	Created *types.DateTime `json:"created,omitempty" jsonschema:"The timestamp of creation (ISO 8601 format). Server-managed, read-only."`

	// Modified serves as a version identifier for optimistic locking.
	// It records the last update time in ISO 8601 format. This field is required
	// for update and delete operations to ensure data consistency.
	Modified *types.DateTime `` /* 165-byte string literal not displayed */

	// Key is the identifier or category name for the tag.
	// Example: "Environment" or "Project".
	Key string `json:"key" jsonschema:"The key portion of the tag pair (e.g., 'Environment')."`

	// Value is the specific content associated with the tag key.
	// Example: "Production" or "Marketing-Campaign".
	Value string `json:"value" jsonschema:"The value portion of the tag pair (e.g., 'Production')."`

	// Comment provides a descriptive note for this tag information key-value pair.
	Comment string `json:"comment,omitempty" jsonschema:"A descriptive comment or note regarding this specific tag information key-value pair."`
}

TagInformation represents a key-value label attached to a resource.

type TagWAFRule added in v2.20.0

type TagWAFRule struct {
	// ID is the unique identifier for the WAF rule.
	// This value is server-generated and required for update and delete operations.
	ID int `` /* 149-byte string literal not displayed */

	// Created indicates when the rule was added.
	// This is a server-managed, read-only value in ISO 8601 format.
	Created *types.DateTime `json:"created,omitempty" jsonschema:"The timestamp of creation (ISO 8601 format). Server-managed, read-only."`

	// Modified serves as a version identifier for optimistic locking.
	// It records the last update time in ISO 8601 format. This field is required
	// for update and delete operations to ensure data consistency.
	Modified *types.DateTime `` /* 165-byte string literal not displayed */

	// ExpireDate defines when this rule automatically becomes invalid.
	// If nil, the rule never expires.
	ExpireDate *types.DateTime `` /* 135-byte string literal not displayed */

	// Name is a unique label for the rule.
	Name string `json:"name" jsonschema:"A descriptive name to identify the WAF rule."`

	// Description provides further details about the rule's purpose.
	Description string `json:"description" jsonschema:"A detailed description explaining the purpose of this WAF rule."`

	// Direction specifies whether the rule applies to incoming requests or outgoing responses.
	// Valid values: 'in', 'out'.
	Direction string `` /* 131-byte string literal not displayed */

	// LogIdentifier is a custom tag string used to find matches in the access logs.
	LogIdentifier string `json:"logIdentifier" jsonschema:"A custom string identifier used to tag and find rule matches in the access logs."`

	// UUID is a system-assigned unique identifier string.
	// Read-only.
	Uuid string `json:"uuid,omitempty" jsonschema:"System-assigned unique string identifier (UUID). Read-only."`

	// Sort defines the execution order of rules.
	// Lower numbers are processed first.
	Sort int `json:"sort" jsonschema:"The execution order/priority. Lower numbers are processed first."`

	// Sync indicates if the rule is synchronized to the edge nodes.
	Sync bool `json:"sync" jsonschema:"Indicates synchronization status with edge nodes."`

	// ProcessNext controls the rule chain execution flow.
	// If true, subsequent rules are evaluated even if this rule matches.
	ProcessNext bool `` /* 161-byte string literal not displayed */

	// Enabled controls whether the rule is currently active.
	Enabled bool `json:"enabled" jsonschema:"Indicates if the WAF rule is currently active (enabled) or ignored."`

	// Actions defines what happens when the conditions are met.
	Actions []*WAFAction `json:"actions" jsonschema:"List of actions to execute when the rule conditions are met (e.g., Block, Log, Allow)."`

	// Conditions defines the logical checks (e.g., IP match, Header match) required to trigger the rule.
	Conditions []*WAFCondition `json:"conditions" jsonschema:"List of logical conditions that must be satisfied for the rule to trigger."`

	// TagId is the ID of the Tag this rule belongs to.
	TagId int `json:"tagId" jsonschema:"The ID of the parent Tag to which this WAF rule is attached."`
}

TagWAFRule represents a Web Application Firewall rule linked to a specific Tag. It allows applying WAF logic (conditions and actions) to all domains associated with that tag.

type UpstreamOptions

type UpstreamOptions struct {
	// ID is the unique identifier for the upstream option.
	ID int `` /* 127-byte string literal not displayed */

	// Created indicates when the configuration was added.
	// This is a server-managed, read-only value.
	Created *types.DateTime `json:"created,omitempty" jsonschema:"The timestamp of creation (ISO 8601 format). Server-managed, read-only."`

	// Modified serves as a version identifier.
	// Required for update and delete operations.
	Modified *types.DateTime `` /* 144-byte string literal not displayed */

	// Backup marks the server as a failover standby.
	// It only receives traffic if primary servers are unavailable.
	Backup bool `` /* 136-byte string literal not displayed */

	// Down marks the server as administratively unavailable.
	Down bool `json:"down" jsonschema:"If true, marks the origin server as permanently unavailable (maintenance mode)."`

	// FailTimeout defines the time window for counting failure attempts
	// and the duration the server is considered unavailable.
	// Example format: "10s", "1m".
	FailTimeout string `` /* 178-byte string literal not displayed */

	// MaxFails is the threshold of unsuccessful attempts within FailTimeout
	// before the server is considered unavailable.
	MaxFails int `` /* 139-byte string literal not displayed */

	// Weight assigns a relative priority to the origin server.
	// Higher values indicate a higher proportion of traffic.
	Weight int `json:"weight" jsonschema:"The load balancing weight. Higher numbers receive a larger proportion of traffic."`
}

UpstreamOptions controls the load balancing and failover behavior for origin servers associated with a DNS record.

type User added in v2.43.0

type User struct {
	// ID is the unique identifier for the user.
	// This value is server-generated and read-only.
	ID int `json:"id,omitempty" jsonschema:"The unique identifier for the user. Server-generated and read-only. Ignored during creation."`

	// Created indicates when the user was created.
	// This is a server-managed, read-only value in ISO 8601 format.
	Created *types.DateTime `json:"created,omitempty" jsonschema:"The timestamp of creation (ISO 8601 format). Server-managed, read-only."`

	// Modified serves as a version identifier for optimistic locking.
	// It records the last update time in ISO 8601 format. This field is required
	// for update and delete operations to ensure data consistency.
	Modified *types.DateTime `` /* 165-byte string literal not displayed */

	// Login is the unique username for the account.
	// This must be a valid email address.
	Login string `json:"login,omitempty" jsonschema:"The user's login name. Must be a valid email address (format: user@example.com)."`
}

User represents a registered account holder in the system. It contains the authentication identity (Login) and metadata.

type VHost added in v2.5.0

type VHost struct {
	// ID is the unique identifier for the VHost.
	// Server-generated.
	ID int `` /* 157-byte string literal not displayed */

	// Label is a descriptive name for the VHost.
	// Used for easier identification in the UI.
	Label string `` /* 141-byte string literal not displayed */

	// Value specifies the actual hostname.
	// This is the FQDN handled by this VHost.
	Value string `json:"value,omitempty" jsonschema:"The specific hostname or FQDN associated with this VHost (e.g., 'shop.example.com.')."`

	// DomainName is the parent domain of the VHost.
	DomainName string `json:"domainName,omitempty" jsonschema:"The Fully Qualified Domain Name (FQDN) of the parent domain."`

	// Access indicates if the VHost is generally accessible.
	Access bool `json:"access" jsonschema:"Indicates if the VHost is configured to be accessible (active)."`

	// Paused indicates if the VHost is temporarily suspended.
	// If true, traffic might be blocked or not processed.
	Paused bool `json:"paused" jsonschema:"Indicates if the VHost is currently paused. If true, traffic processing is suspended."`
}

VHost represents a Virtual Host configuration within a domain. It maps specific hostnames (subdomains) to specific settings or backends.

type Violation

type Violation struct {
	Path    string `json:"propertypath,omitempty"`
	Message string `json:"message,omitempty"`
}

Violation defines a violation VO, returned by the MYRA API

type WAFAction

type WAFAction struct {
	// ID is the unique identifier for the action.
	ID int `` /* 143-byte string literal not displayed */

	// Created indicates when the action was added.
	Created *types.DateTime `json:"created,omitempty" jsonschema:"The timestamp of creation (ISO 8601). Server-managed, read-only."`

	// Modified serves as a version identifier for optimistic locking.
	Modified *types.DateTime `json:"modified,omitempty" jsonschema:"The last update timestamp (ISO 8601). Required for updates and deletes."`

	// Type defines the specific action to perform (e.g., 'block', 'allow', 'log').
	Type string `json:"type" jsonschema:"The type of action to execute (e.g., 'block', 'log', 'allow')."`

	// Name is the display name of the action type.
	// Read-only; derived from Type.
	Name string `json:"name" jsonschema:"The display name of the action. Read-only."`

	// CustomKey is an optional configuration key for the action.
	// Usage depends on ForceCustomValues.
	CustomKey string `json:"customKey" jsonschema:"Optional configuration key. Usage depends on the specific action type."`

	// Value is the configuration value for the action.
	// Usage depends on ForceCustomValues.
	Value string `json:"value" jsonschema:"The configuration value for the action. Required for certain action types."`

	// ForceCustomValues indicates input requirements for this action type.
	// 0=none, 1=value, 2=key+value. Read-only metadata.
	ForceCustomValues bool `` /* 144-byte string literal not displayed */

	// AvailablePhases indicates in which request phases this action is valid.
	// 1=request, 2=response, 3=both. Read-only metadata.
	AvailablePhases int `` /* 137-byte string literal not displayed */
}

WAFAction represents an operation executed when a WAF rule triggers.

type WAFCondition

type WAFCondition struct {
	// ID is the unique identifier for the condition.
	ID int `` /* 146-byte string literal not displayed */

	// Created indicates when the condition was added.
	Created *types.DateTime `json:"created,omitempty" jsonschema:"The timestamp of creation (ISO 8601). Server-managed, read-only."`

	// Modified serves as a version identifier for optimistic locking.
	Modified *types.DateTime `json:"modified,omitempty" jsonschema:"The last update timestamp (ISO 8601). Required for updates and deletes."`

	// Name identifies the type of check (e.g., 'url', 'ip', 'header').
	Name string `json:"name" jsonschema:"The type of the condition (e.g., 'url', 'ip', 'user_agent')."`

	// MatchingType defines the comparison operator.
	// Valid values: EXACT, IREGEX, REGEX, PREFIX, SUFFIX, and their NOT variants.
	MatchingType string `` /* 212-byte string literal not displayed */

	// Key specifies the target of the check (e.g., the specific header name).
	// Usage depends on the condition Name.
	Key string `` /* 127-byte string literal not displayed */

	// Value specifies the pattern or content to match against.
	Value string `json:"value" jsonschema:"The value or pattern to match against."`

	// Alias is a human-readable label for the condition type.
	// Read-only; derived from Name.
	Alias string `json:"alias" jsonschema:"The display label for the condition type. Read-only."`

	// Category groups conditions types.
	// Read-only.
	Category string `json:"category" jsonschema:"The category of the condition. Read-only."`

	// ForceCustomValues indicates input requirements for this condition type.
	// 0=none, 1=value, 2=key+value. Read-only metadata.
	ForceCustomValues bool `json:"forceCustomValues" jsonschema:"Metadata indicating input requirements: 0=none, 1=value, 2=key+value. Read-only."`

	// AvailablePhases indicates in which request phases this condition is valid.
	// 1=request, 2=response, 3=both. Read-only metadata.
	AvailablePhases int `json:"availablePhases" jsonschema:"Metadata indicating valid phases: 1=request, 2=response, 3=both. Read-only."`
}

WAFCondition represents a logical check within a WAF rule.

type WAFRule

type WAFRule struct {
	// ID is the unique identifier for the WAF rule.
	// This value is server-generated and required for update and delete operations.
	ID int `` /* 149-byte string literal not displayed */

	// Created indicates when the rule was added.
	// This is a server-managed, read-only value in ISO 8601 format.
	Created *types.DateTime `json:"created,omitempty" jsonschema:"The timestamp of creation (ISO 8601 format). Server-managed, read-only."`

	// Modified serves as a version identifier for optimistic locking.
	// It records the last update time in ISO 8601 format. This field is required
	// for update and delete operations to ensure data consistency.
	Modified *types.DateTime `` /* 165-byte string literal not displayed */

	// ExpireDate defines when this rule automatically becomes invalid.
	// If nil, the rule never expires.
	ExpireDate *types.DateTime `` /* 135-byte string literal not displayed */

	// Name is a unique label for the rule.
	Name string `json:"name" jsonschema:"A descriptive name to identify the WAF rule."`

	// Description provides further details about the rule's purpose.
	Description string `json:"description" jsonschema:"A detailed description explaining the purpose of this WAF rule."`

	// Direction specifies whether the rule applies to incoming requests or outgoing responses.
	// Valid values: 'in', 'out'.
	Direction string `` /* 131-byte string literal not displayed */

	// LogIdentifier is a custom tag string used to find matches in the access logs.
	LogIdentifier string `json:"logIdentifier" jsonschema:"A custom string identifier used to tag and find rule matches in the access logs."`

	// UUID is a system-assigned unique identifier string.
	// Read-only.
	Uuid string `json:"uuid,omitempty" jsonschema:"System-assigned unique string identifier (UUID). Read-only."`

	// RuleType identifies the category or logic type of the rule.
	// Typically 'custom_rule' for user-defined rules.
	RuleType string `json:"ruleType" jsonschema:"The type classification of the rule (e.g., 'custom_rule')."`

	// SubDomainName is the FQDN this rule belongs to.
	// Usually set via URL context.
	SubDomainName string `` /* 133-byte string literal not displayed */

	// Sort defines the execution order of rules.
	// Lower numbers are processed first.
	Sort int `json:"sort" jsonschema:"The execution order/priority. Lower numbers are processed first."`

	// Sync indicates if the rule is synchronized to the edge nodes.
	Sync bool `json:"sync" jsonschema:"Indicates synchronization status with edge nodes."`

	// Template indicates if this rule serves as a template for others.
	Template bool `json:"template" jsonschema:"If true, this rule is a template and not directly applied to traffic."`

	// ProcessNext controls the rule chain execution flow.
	// If true, subsequent rules are evaluated even if this rule matches.
	ProcessNext bool `` /* 161-byte string literal not displayed */

	// Enabled controls whether the rule is currently active.
	Enabled bool `json:"enabled" jsonschema:"Indicates if the WAF rule is currently active (enabled) or ignored."`

	// Actions defines what happens when the conditions are met.
	Actions []*WAFAction `json:"actions" jsonschema:"List of actions to execute when the rule conditions are met (e.g., Block, Log)."`

	// Conditions defines the logical checks required to trigger the rule.
	Conditions []*WAFCondition `json:"conditions" jsonschema:"List of logical conditions that must be satisfied for the rule to trigger."`
}

WAFRule represents a single Web Application Firewall rule for a specific subdomain. It defines a set of conditions and the actions to take when those conditions are met.

type WaitingRoom added in v2.36.0

type WaitingRoom struct {
	// ID is the unique identifier for the waiting room configuration.
	// This value is server-generated and required for update and delete operations.
	ID int `` /* 157-byte string literal not displayed */

	// Created indicates when the waiting room was configured.
	// This is a server-managed, read-only value in ISO 8601 format.
	Created *types.DateTime `json:"created,omitempty" jsonschema:"The timestamp of creation (ISO 8601 format). Server-managed, read-only."`

	// Modified serves as a version identifier for optimistic locking.
	// It records the last update time in ISO 8601 format. This field is required
	// for update and delete operations to ensure data consistency.
	Modified *types.DateTime `` /* 165-byte string literal not displayed */

	// Name is a descriptive label for the waiting room.
	Name string `json:"name" jsonschema:"A descriptive name for this waiting room configuration."`

	// VhostId is the identifier of the Virtual Host this waiting room protects.
	VhostId int `json:"vhostId" jsonschema:"The unique identifier of the target VHost (Virtual Host)."`

	// SubDomainName is the FQDN associated with the VHost.
	// Optional: If omitted, it is determined automatically from the VhostId.
	SubDomainName string `` /* 163-byte string literal not displayed */

	// MaxConcurrent sets the limit of simultaneous users allowed on the origin.
	// Exceeding this limit triggers the waiting room for new visitors.
	MaxConcurrent int `` /* 166-byte string literal not displayed */

	// SessionTimeout defines the idle timeout for active users.
	// If a user is inactive for this period, they lose their spot.
	SessionTimeout int `` /* 144-byte string literal not displayed */

	// WaitRefresh defines the auto-reload interval for the waiting page.
	// Logic: If the session is not accessed after the 3rd reload, it is removed from the queue.
	WaitRefresh int `` /* 188-byte string literal not displayed */

	// Paths defines the URL patterns covered by this waiting room.
	// Expects Regex. Default is "." (match all).
	// Warning: "." overrides specific path settings on the same domain.
	Paths []string `` /* 207-byte string literal not displayed */

	// Content contains the HTML code displayed to users in the queue.
	Content string `json:"content" jsonschema:"The raw HTML content displayed to visitors while they are in the waiting queue."`
}

WaitingRoom represents a virtual queue system for high-traffic scenarios. It limits the number of concurrent users allowed on the origin server to prevent overloads.

type Warning

type Warning struct {
	Path    string `json:"path,omitempty"`
	Message string `json:"message,omitempty"`
}

Warning defines a warning VO, returned by the MYRA API

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

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