Documentation
¶
Index ¶
- type AlibabaRegion
- type AlibabaRegions
- type AuditLogListParams
- type AuditLogService
- func (r *AuditLogService) Get(ctx context.Context, logID int64, opts ...option.RequestOption) (res *CdnAuditLogEntry, err error)
- func (r *AuditLogService) List(ctx context.Context, query AuditLogListParams, opts ...option.RequestOption) (res *pagination.OffsetPage[CdnAuditLogEntry], err error)
- func (r *AuditLogService) ListAutoPaging(ctx context.Context, query AuditLogListParams, opts ...option.RequestOption) *pagination.OffsetPageAutoPager[CdnAuditLogEntry]
- type AwsRegion
- type AwsRegions
- type CaCertificate
- type CaCertificateList
- type CdnAccount
- type CdnAccountLimits
- type CdnAccountService
- type CdnAuditLogEntry
- type CdnAuditLogEntryAction
- type CdnAvailableFeatures
- type CdnAvailableFeaturesFreeFeature
- type CdnAvailableFeaturesPaidFeature
- type CdnListPurgeStatusesParams
- type CdnLogEntry
- type CdnLogEntryData
- type CdnLogEntryMeta
- type CdnMetrics
- type CdnMetricsDataUnion
- type CdnMetricsGroups
- type CdnMetricsValue
- type CdnMetricsValues
- type CdnResource
- type CdnResourceList
- type CdnResourceOptions
- type CdnResourceOptionsAllowedHTTPMethods
- type CdnResourceOptionsBotProtection
- type CdnResourceOptionsBotProtectionBotChallenge
- type CdnResourceOptionsBrotliCompression
- type CdnResourceOptionsBrowserCacheSettings
- type CdnResourceOptionsCacheHTTPHeadersdeprecated
- type CdnResourceOptionsCors
- type CdnResourceOptionsCountryACL
- type CdnResourceOptionsDisableCachedeprecated
- type CdnResourceOptionsDisableProxyForceRanges
- type CdnResourceOptionsEdgeCacheSettings
- type CdnResourceOptionsFastedge
- type CdnResourceOptionsFastedgeOnRequestBody
- type CdnResourceOptionsFastedgeOnRequestHeaders
- type CdnResourceOptionsFastedgeOnResponseBody
- type CdnResourceOptionsFastedgeOnResponseHeaders
- type CdnResourceOptionsFetchCompressed
- type CdnResourceOptionsFollowOriginRedirect
- type CdnResourceOptionsForceReturn
- type CdnResourceOptionsForceReturnTimeInterval
- type CdnResourceOptionsForwardHostHeader
- type CdnResourceOptionsGzipOn
- type CdnResourceOptionsHostHeader
- type CdnResourceOptionsHttp3Enabled
- type CdnResourceOptionsIPAddressACL
- type CdnResourceOptionsIgnoreCookie
- type CdnResourceOptionsIgnoreQueryString
- type CdnResourceOptionsImageStack
- type CdnResourceOptionsLimitBandwidth
- type CdnResourceOptionsProxyCacheKey
- type CdnResourceOptionsProxyCacheMethodsSet
- type CdnResourceOptionsProxyConnectTimeout
- type CdnResourceOptionsProxyReadTimeout
- type CdnResourceOptionsQueryParamsBlacklist
- type CdnResourceOptionsQueryParamsWhitelist
- type CdnResourceOptionsQueryStringForwarding
- type CdnResourceOptionsRedirectHTTPSToHTTP
- type CdnResourceOptionsRedirectHTTPToHTTPS
- type CdnResourceOptionsReferrerACL
- type CdnResourceOptionsRequestLimiter
- type CdnResourceOptionsResponseHeadersHidingPolicy
- type CdnResourceOptionsRewrite
- type CdnResourceOptionsSecureKey
- type CdnResourceOptionsSlice
- type CdnResourceOptionsSni
- type CdnResourceOptionsStale
- type CdnResourceOptionsStaticHeadersdeprecated
- type CdnResourceOptionsStaticRequestHeaders
- type CdnResourceOptionsStaticResponseHeaders
- type CdnResourceOptionsStaticResponseHeadersValue
- type CdnResourceOptionsTlsVersions
- type CdnResourceOptionsUseDefaultLeChain
- type CdnResourceOptionsUseDns01LeChallenge
- type CdnResourceOptionsUseRsaLeCert
- type CdnResourceOptionsUserAgentACL
- type CdnResourceOptionsWaap
- type CdnResourceOptionsWebsockets
- type CdnResourceOriginProtocol
- type CdnResourceRule
- type CdnResourceRuleOptions
- type CdnResourceRuleOptionsAllowedHTTPMethods
- type CdnResourceRuleOptionsBotProtection
- type CdnResourceRuleOptionsBotProtectionBotChallenge
- type CdnResourceRuleOptionsBrotliCompression
- type CdnResourceRuleOptionsBrowserCacheSettings
- type CdnResourceRuleOptionsCacheHTTPHeadersdeprecated
- type CdnResourceRuleOptionsCors
- type CdnResourceRuleOptionsCountryACL
- type CdnResourceRuleOptionsDisableCachedeprecated
- type CdnResourceRuleOptionsDisableProxyForceRanges
- type CdnResourceRuleOptionsEdgeCacheSettings
- type CdnResourceRuleOptionsFastedge
- type CdnResourceRuleOptionsFastedgeOnRequestBody
- type CdnResourceRuleOptionsFastedgeOnRequestHeaders
- type CdnResourceRuleOptionsFastedgeOnResponseBody
- type CdnResourceRuleOptionsFastedgeOnResponseHeaders
- type CdnResourceRuleOptionsFetchCompressed
- type CdnResourceRuleOptionsFollowOriginRedirect
- type CdnResourceRuleOptionsForceReturn
- type CdnResourceRuleOptionsForceReturnTimeInterval
- type CdnResourceRuleOptionsForwardHostHeader
- type CdnResourceRuleOptionsGzipOn
- type CdnResourceRuleOptionsHostHeader
- type CdnResourceRuleOptionsIPAddressACL
- type CdnResourceRuleOptionsIgnoreCookie
- type CdnResourceRuleOptionsIgnoreQueryString
- type CdnResourceRuleOptionsImageStack
- type CdnResourceRuleOptionsLimitBandwidth
- type CdnResourceRuleOptionsProxyCacheKey
- type CdnResourceRuleOptionsProxyCacheMethodsSet
- type CdnResourceRuleOptionsProxyConnectTimeout
- type CdnResourceRuleOptionsProxyReadTimeout
- type CdnResourceRuleOptionsQueryParamsBlacklist
- type CdnResourceRuleOptionsQueryParamsWhitelist
- type CdnResourceRuleOptionsQueryStringForwarding
- type CdnResourceRuleOptionsRedirectHTTPSToHTTP
- type CdnResourceRuleOptionsRedirectHTTPToHTTPS
- type CdnResourceRuleOptionsReferrerACL
- type CdnResourceRuleOptionsRequestLimiter
- type CdnResourceRuleOptionsResponseHeadersHidingPolicy
- type CdnResourceRuleOptionsRewrite
- type CdnResourceRuleOptionsSecureKey
- type CdnResourceRuleOptionsSlice
- type CdnResourceRuleOptionsSni
- type CdnResourceRuleOptionsStale
- type CdnResourceRuleOptionsStaticHeadersdeprecated
- type CdnResourceRuleOptionsStaticRequestHeaders
- type CdnResourceRuleOptionsStaticResponseHeaders
- type CdnResourceRuleOptionsStaticResponseHeadersValue
- type CdnResourceRuleOptionsUserAgentACL
- type CdnResourceRuleOptionsWaap
- type CdnResourceRuleOptionsWebsockets
- type CdnResourceRuleOriginProtocol
- type CdnResourceRuleOverrideOriginProtocol
- type CdnResourceStatus
- type CdnService
- func (r *CdnService) GetAccountLimits(ctx context.Context, opts ...option.RequestOption) (res *CdnAccountLimits, err error)
- func (r *CdnService) GetAccountOverview(ctx context.Context, opts ...option.RequestOption) (res *CdnAccount, err error)
- func (r *CdnService) GetAvailableFeatures(ctx context.Context, opts ...option.RequestOption) (res *CdnAvailableFeatures, err error)
- func (r *CdnService) ListAlibabaRegions(ctx context.Context, opts ...option.RequestOption) (res *AlibabaRegions, err error)
- func (r *CdnService) ListAwsRegions(ctx context.Context, opts ...option.RequestOption) (res *AwsRegions, err error)
- func (r *CdnService) ListPurgeStatuses(ctx context.Context, query CdnListPurgeStatusesParams, ...) (res *[]PurgeStatus, err error)
- func (r *CdnService) UpdateAccount(ctx context.Context, body CdnUpdateAccountParams, opts ...option.RequestOption) (res *CdnAccount, err error)
- type CdnUpdateAccountParams
- type CertificateGetStatusParams
- type CertificateListParams
- type CertificateNewParams
- type CertificateNewParamsBodyLetSEncryptCertificate
- type CertificateNewParamsBodyOwnCertificate
- type CertificateReplaceParams
- type CertificateService
- func (r *CertificateService) Delete(ctx context.Context, sslID int64, opts ...option.RequestOption) (err error)
- func (r *CertificateService) ForceRetry(ctx context.Context, certID int64, opts ...option.RequestOption) (err error)
- func (r *CertificateService) Get(ctx context.Context, sslID int64, opts ...option.RequestOption) (res *SslDetail, err error)
- func (r *CertificateService) GetStatus(ctx context.Context, certID int64, query CertificateGetStatusParams, ...) (res *SslRequestStatus, err error)
- func (r *CertificateService) List(ctx context.Context, query CertificateListParams, opts ...option.RequestOption) (res *SslDetailList, err error)
- func (r *CertificateService) New(ctx context.Context, body CertificateNewParams, opts ...option.RequestOption) (err error)
- func (r *CertificateService) Renew(ctx context.Context, certID int64, opts ...option.RequestOption) (err error)
- func (r *CertificateService) Replace(ctx context.Context, sslID int64, body CertificateReplaceParams, ...) (res *SslDetail, err error)
- type Error
- type IPRangeListIPsParams
- type IPRangeListIPsParamsAccept
- type IPRangeListIPsParamsFormat
- type IPRangeListParams
- type IPRangeListParamsAccept
- type IPRangeListParamsFormat
- type IPRangeService
- type LogDownloadParams
- type LogListParams
- type LogService
- func (r *LogService) Download(ctx context.Context, query LogDownloadParams, opts ...option.RequestOption) (res *http.Response, err error)
- func (r *LogService) List(ctx context.Context, query LogListParams, opts ...option.RequestOption) (res *pagination.OffsetPageCdnLogs[CdnLogEntryData], err error)
- func (r *LogService) ListAutoPaging(ctx context.Context, query LogListParams, opts ...option.RequestOption) *pagination.OffsetPageCdnLogsAutoPager[CdnLogEntryData]
- type LogsAggregatedStats
- type LogsUploaderConfig
- type LogsUploaderConfigList
- type LogsUploaderConfigListParams
- type LogsUploaderConfigNewParams
- type LogsUploaderConfigReplaceParams
- type LogsUploaderConfigService
- func (r *LogsUploaderConfigService) Delete(ctx context.Context, id int64, opts ...option.RequestOption) (err error)
- func (r *LogsUploaderConfigService) Get(ctx context.Context, id int64, opts ...option.RequestOption) (res *LogsUploaderConfig, err error)
- func (r *LogsUploaderConfigService) List(ctx context.Context, query LogsUploaderConfigListParams, ...) (res *LogsUploaderConfigList, err error)
- func (r *LogsUploaderConfigService) New(ctx context.Context, body LogsUploaderConfigNewParams, ...) (res *LogsUploaderConfig, err error)
- func (r *LogsUploaderConfigService) Replace(ctx context.Context, id int64, body LogsUploaderConfigReplaceParams, ...) (res *LogsUploaderConfig, err error)
- func (r *LogsUploaderConfigService) Update(ctx context.Context, id int64, body LogsUploaderConfigUpdateParams, ...) (res *LogsUploaderConfig, err error)
- func (r *LogsUploaderConfigService) Validate(ctx context.Context, id int64, opts ...option.RequestOption) (res *LogsUploaderValidation, err error)
- type LogsUploaderConfigStatus
- type LogsUploaderConfigUpdateParams
- type LogsUploaderPolicy
- type LogsUploaderPolicyFormatType
- type LogsUploaderPolicyList
- type LogsUploaderPolicyListParams
- type LogsUploaderPolicyNewParams
- type LogsUploaderPolicyNewParamsFormatType
- type LogsUploaderPolicyReplaceParams
- type LogsUploaderPolicyReplaceParamsFormatType
- type LogsUploaderPolicyService
- func (r *LogsUploaderPolicyService) Delete(ctx context.Context, id int64, opts ...option.RequestOption) (err error)
- func (r *LogsUploaderPolicyService) Get(ctx context.Context, id int64, opts ...option.RequestOption) (res *LogsUploaderPolicy, err error)
- func (r *LogsUploaderPolicyService) List(ctx context.Context, query LogsUploaderPolicyListParams, ...) (res *LogsUploaderPolicyList, err error)
- func (r *LogsUploaderPolicyService) ListFields(ctx context.Context, opts ...option.RequestOption) (res *[]string, err error)
- func (r *LogsUploaderPolicyService) New(ctx context.Context, body LogsUploaderPolicyNewParams, ...) (res *LogsUploaderPolicy, err error)
- func (r *LogsUploaderPolicyService) Replace(ctx context.Context, id int64, body LogsUploaderPolicyReplaceParams, ...) (res *LogsUploaderPolicy, err error)
- func (r *LogsUploaderPolicyService) Update(ctx context.Context, id int64, body LogsUploaderPolicyUpdateParams, ...) (res *LogsUploaderPolicy, err error)
- type LogsUploaderPolicyUpdateParams
- type LogsUploaderPolicyUpdateParamsFormatType
- type LogsUploaderService
- type LogsUploaderTarget
- type LogsUploaderTargetConfigFtpConfig
- type LogsUploaderTargetConfigHTTPConfig
- type LogsUploaderTargetConfigHTTPConfigAppend
- type LogsUploaderTargetConfigHTTPConfigAppendResponseAction
- type LogsUploaderTargetConfigHTTPConfigAuth
- type LogsUploaderTargetConfigHTTPConfigAuthConfig
- type LogsUploaderTargetConfigHTTPConfigRetry
- type LogsUploaderTargetConfigHTTPConfigRetryResponseAction
- type LogsUploaderTargetConfigHTTPConfigUpload
- type LogsUploaderTargetConfigHTTPConfigUploadResponseAction
- type LogsUploaderTargetConfigObject
- type LogsUploaderTargetConfigS3AmazonConfig
- type LogsUploaderTargetConfigS3GcoreConfig
- type LogsUploaderTargetConfigSftpConfig
- type LogsUploaderTargetConfigUnion
- func (u LogsUploaderTargetConfigUnion) AsFtpConfig() (v LogsUploaderTargetConfigFtpConfig)
- func (u LogsUploaderTargetConfigUnion) AsHTTPConfig() (v LogsUploaderTargetConfigHTTPConfig)
- func (u LogsUploaderTargetConfigUnion) AsLogsUploaderTargetConfigObject() (v LogsUploaderTargetConfigObject)
- func (u LogsUploaderTargetConfigUnion) AsLogsUploaderTargetConfigS3GcoreConfig() (v LogsUploaderTargetConfigS3GcoreConfig)
- func (u LogsUploaderTargetConfigUnion) AsS3AmazonConfig() (v LogsUploaderTargetConfigS3AmazonConfig)
- func (u LogsUploaderTargetConfigUnion) AsS3GcoreConfig() (v LogsUploaderTargetConfigS3GcoreConfig)
- func (u LogsUploaderTargetConfigUnion) AsSftpConfig() (v LogsUploaderTargetConfigSftpConfig)
- func (u LogsUploaderTargetConfigUnion) AsVariant2() (v LogsUploaderTargetConfigS3GcoreConfig)
- func (u LogsUploaderTargetConfigUnion) RawJSON() string
- func (r *LogsUploaderTargetConfigUnion) UnmarshalJSON(data []byte) error
- type LogsUploaderTargetList
- type LogsUploaderTargetListParams
- type LogsUploaderTargetNewParams
- type LogsUploaderTargetNewParamsConfigFtpConfig
- type LogsUploaderTargetNewParamsConfigHTTPConfig
- type LogsUploaderTargetNewParamsConfigHTTPConfigAppend
- type LogsUploaderTargetNewParamsConfigHTTPConfigAppendResponseAction
- type LogsUploaderTargetNewParamsConfigHTTPConfigAuth
- type LogsUploaderTargetNewParamsConfigHTTPConfigAuthConfig
- type LogsUploaderTargetNewParamsConfigHTTPConfigRetry
- type LogsUploaderTargetNewParamsConfigHTTPConfigRetryResponseAction
- type LogsUploaderTargetNewParamsConfigHTTPConfigUpload
- type LogsUploaderTargetNewParamsConfigHTTPConfigUploadResponseAction
- type LogsUploaderTargetNewParamsConfigS3AmazonConfig
- type LogsUploaderTargetNewParamsConfigS3GcoreConfig
- type LogsUploaderTargetNewParamsConfigS3OssConfig
- type LogsUploaderTargetNewParamsConfigS3OtherConfig
- type LogsUploaderTargetNewParamsConfigS3V1Config
- type LogsUploaderTargetNewParamsConfigSftpConfig
- type LogsUploaderTargetNewParamsConfigUnion
- func (u LogsUploaderTargetNewParamsConfigUnion) GetAccessKeyID() *string
- func (u LogsUploaderTargetNewParamsConfigUnion) GetAppend() *LogsUploaderTargetNewParamsConfigHTTPConfigAppend
- func (u LogsUploaderTargetNewParamsConfigUnion) GetAuth() *LogsUploaderTargetNewParamsConfigHTTPConfigAuth
- func (u LogsUploaderTargetNewParamsConfigUnion) GetBucketName() *string
- func (u LogsUploaderTargetNewParamsConfigUnion) GetContentType() *string
- func (u LogsUploaderTargetNewParamsConfigUnion) GetDirectory() *string
- func (u LogsUploaderTargetNewParamsConfigUnion) GetEndpoint() *string
- func (u LogsUploaderTargetNewParamsConfigUnion) GetHostname() *string
- func (u LogsUploaderTargetNewParamsConfigUnion) GetKeyPassphrase() *string
- func (u LogsUploaderTargetNewParamsConfigUnion) GetPassword() *string
- func (u LogsUploaderTargetNewParamsConfigUnion) GetPrivateKey() *string
- func (u LogsUploaderTargetNewParamsConfigUnion) GetRegion() *string
- func (u LogsUploaderTargetNewParamsConfigUnion) GetRetry() *LogsUploaderTargetNewParamsConfigHTTPConfigRetry
- func (u LogsUploaderTargetNewParamsConfigUnion) GetSecretAccessKey() *string
- func (u LogsUploaderTargetNewParamsConfigUnion) GetTimeoutSeconds() *int64
- func (u LogsUploaderTargetNewParamsConfigUnion) GetUpload() *LogsUploaderTargetNewParamsConfigHTTPConfigUpload
- func (u LogsUploaderTargetNewParamsConfigUnion) GetUsePathStyle() *bool
- func (u LogsUploaderTargetNewParamsConfigUnion) GetUser() *string
- func (u LogsUploaderTargetNewParamsConfigUnion) MarshalJSON() ([]byte, error)
- func (u *LogsUploaderTargetNewParamsConfigUnion) UnmarshalJSON(data []byte) error
- type LogsUploaderTargetNewParamsStorageType
- type LogsUploaderTargetReplaceParams
- type LogsUploaderTargetReplaceParamsConfigFtpConfig
- type LogsUploaderTargetReplaceParamsConfigHTTPConfig
- type LogsUploaderTargetReplaceParamsConfigHTTPConfigAppend
- type LogsUploaderTargetReplaceParamsConfigHTTPConfigAppendResponseAction
- type LogsUploaderTargetReplaceParamsConfigHTTPConfigAuth
- type LogsUploaderTargetReplaceParamsConfigHTTPConfigAuthConfig
- type LogsUploaderTargetReplaceParamsConfigHTTPConfigRetry
- type LogsUploaderTargetReplaceParamsConfigHTTPConfigRetryResponseAction
- type LogsUploaderTargetReplaceParamsConfigHTTPConfigUpload
- type LogsUploaderTargetReplaceParamsConfigHTTPConfigUploadResponseAction
- type LogsUploaderTargetReplaceParamsConfigS3AmazonConfig
- type LogsUploaderTargetReplaceParamsConfigS3GcoreConfig
- type LogsUploaderTargetReplaceParamsConfigS3OssConfig
- type LogsUploaderTargetReplaceParamsConfigS3OtherConfig
- type LogsUploaderTargetReplaceParamsConfigS3V1Config
- type LogsUploaderTargetReplaceParamsConfigSftpConfig
- type LogsUploaderTargetReplaceParamsConfigUnion
- func (u LogsUploaderTargetReplaceParamsConfigUnion) GetAccessKeyID() *string
- func (u LogsUploaderTargetReplaceParamsConfigUnion) GetAppend() *LogsUploaderTargetReplaceParamsConfigHTTPConfigAppend
- func (u LogsUploaderTargetReplaceParamsConfigUnion) GetAuth() *LogsUploaderTargetReplaceParamsConfigHTTPConfigAuth
- func (u LogsUploaderTargetReplaceParamsConfigUnion) GetBucketName() *string
- func (u LogsUploaderTargetReplaceParamsConfigUnion) GetContentType() *string
- func (u LogsUploaderTargetReplaceParamsConfigUnion) GetDirectory() *string
- func (u LogsUploaderTargetReplaceParamsConfigUnion) GetEndpoint() *string
- func (u LogsUploaderTargetReplaceParamsConfigUnion) GetHostname() *string
- func (u LogsUploaderTargetReplaceParamsConfigUnion) GetKeyPassphrase() *string
- func (u LogsUploaderTargetReplaceParamsConfigUnion) GetPassword() *string
- func (u LogsUploaderTargetReplaceParamsConfigUnion) GetPrivateKey() *string
- func (u LogsUploaderTargetReplaceParamsConfigUnion) GetRegion() *string
- func (u LogsUploaderTargetReplaceParamsConfigUnion) GetRetry() *LogsUploaderTargetReplaceParamsConfigHTTPConfigRetry
- func (u LogsUploaderTargetReplaceParamsConfigUnion) GetSecretAccessKey() *string
- func (u LogsUploaderTargetReplaceParamsConfigUnion) GetTimeoutSeconds() *int64
- func (u LogsUploaderTargetReplaceParamsConfigUnion) GetUpload() *LogsUploaderTargetReplaceParamsConfigHTTPConfigUpload
- func (u LogsUploaderTargetReplaceParamsConfigUnion) GetUsePathStyle() *bool
- func (u LogsUploaderTargetReplaceParamsConfigUnion) GetUser() *string
- func (u LogsUploaderTargetReplaceParamsConfigUnion) MarshalJSON() ([]byte, error)
- func (u *LogsUploaderTargetReplaceParamsConfigUnion) UnmarshalJSON(data []byte) error
- type LogsUploaderTargetReplaceParamsStorageType
- type LogsUploaderTargetService
- func (r *LogsUploaderTargetService) Delete(ctx context.Context, id int64, opts ...option.RequestOption) (err error)
- func (r *LogsUploaderTargetService) Get(ctx context.Context, id int64, opts ...option.RequestOption) (res *LogsUploaderTarget, err error)
- func (r *LogsUploaderTargetService) List(ctx context.Context, query LogsUploaderTargetListParams, ...) (res *LogsUploaderTargetList, err error)
- func (r *LogsUploaderTargetService) New(ctx context.Context, body LogsUploaderTargetNewParams, ...) (res *LogsUploaderTarget, err error)
- func (r *LogsUploaderTargetService) Replace(ctx context.Context, id int64, body LogsUploaderTargetReplaceParams, ...) (res *LogsUploaderTarget, err error)
- func (r *LogsUploaderTargetService) Update(ctx context.Context, id int64, body LogsUploaderTargetUpdateParams, ...) (res *LogsUploaderTarget, err error)
- func (r *LogsUploaderTargetService) Validate(ctx context.Context, id int64, opts ...option.RequestOption) (res *LogsUploaderValidation, err error)
- type LogsUploaderTargetStatus
- type LogsUploaderTargetStorageType
- type LogsUploaderTargetUpdateParams
- type LogsUploaderTargetUpdateParamsConfigFtpConfig
- type LogsUploaderTargetUpdateParamsConfigHTTPConfig
- type LogsUploaderTargetUpdateParamsConfigHTTPConfigAppend
- type LogsUploaderTargetUpdateParamsConfigHTTPConfigAppendResponseAction
- type LogsUploaderTargetUpdateParamsConfigHTTPConfigAuth
- type LogsUploaderTargetUpdateParamsConfigHTTPConfigAuthConfig
- type LogsUploaderTargetUpdateParamsConfigHTTPConfigRetry
- type LogsUploaderTargetUpdateParamsConfigHTTPConfigRetryResponseAction
- type LogsUploaderTargetUpdateParamsConfigHTTPConfigUpload
- type LogsUploaderTargetUpdateParamsConfigHTTPConfigUploadResponseAction
- type LogsUploaderTargetUpdateParamsConfigS3AmazonConfig
- type LogsUploaderTargetUpdateParamsConfigS3GcoreConfig
- type LogsUploaderTargetUpdateParamsConfigS3OssConfig
- type LogsUploaderTargetUpdateParamsConfigS3OtherConfig
- type LogsUploaderTargetUpdateParamsConfigS3V1Config
- type LogsUploaderTargetUpdateParamsConfigSftpConfig
- type LogsUploaderTargetUpdateParamsConfigUnion
- func (u LogsUploaderTargetUpdateParamsConfigUnion) GetAccessKeyID() *string
- func (u LogsUploaderTargetUpdateParamsConfigUnion) GetAppend() *LogsUploaderTargetUpdateParamsConfigHTTPConfigAppend
- func (u LogsUploaderTargetUpdateParamsConfigUnion) GetAuth() *LogsUploaderTargetUpdateParamsConfigHTTPConfigAuth
- func (u LogsUploaderTargetUpdateParamsConfigUnion) GetBucketName() *string
- func (u LogsUploaderTargetUpdateParamsConfigUnion) GetContentType() *string
- func (u LogsUploaderTargetUpdateParamsConfigUnion) GetDirectory() *string
- func (u LogsUploaderTargetUpdateParamsConfigUnion) GetEndpoint() *string
- func (u LogsUploaderTargetUpdateParamsConfigUnion) GetHostname() *string
- func (u LogsUploaderTargetUpdateParamsConfigUnion) GetKeyPassphrase() *string
- func (u LogsUploaderTargetUpdateParamsConfigUnion) GetPassword() *string
- func (u LogsUploaderTargetUpdateParamsConfigUnion) GetPrivateKey() *string
- func (u LogsUploaderTargetUpdateParamsConfigUnion) GetRegion() *string
- func (u LogsUploaderTargetUpdateParamsConfigUnion) GetRetry() *LogsUploaderTargetUpdateParamsConfigHTTPConfigRetry
- func (u LogsUploaderTargetUpdateParamsConfigUnion) GetSecretAccessKey() *string
- func (u LogsUploaderTargetUpdateParamsConfigUnion) GetTimeoutSeconds() *int64
- func (u LogsUploaderTargetUpdateParamsConfigUnion) GetUpload() *LogsUploaderTargetUpdateParamsConfigHTTPConfigUpload
- func (u LogsUploaderTargetUpdateParamsConfigUnion) GetUsePathStyle() *bool
- func (u LogsUploaderTargetUpdateParamsConfigUnion) GetUser() *string
- func (u LogsUploaderTargetUpdateParamsConfigUnion) MarshalJSON() ([]byte, error)
- func (u *LogsUploaderTargetUpdateParamsConfigUnion) UnmarshalJSON(data []byte) error
- type LogsUploaderTargetUpdateParamsStorageType
- type LogsUploaderValidation
- type LogsUploaderValidationStatus
- type MetricListParams
- type MetricListParamsFilterBy
- type MetricListParamsFilterByValueUnion
- type MetricService
- type NetworkCapacity
- type NetworkCapacityItem
- type NetworkCapacityService
- type OriginGroupListParams
- type OriginGroupNewParams
- type OriginGroupNewParamsBodyAwsSignatureV4
- type OriginGroupNewParamsBodyAwsSignatureV4Auth
- type OriginGroupNewParamsBodyNoneAuth
- type OriginGroupNewParamsBodyNoneAuthSource
- type OriginGroupReplaceParams
- type OriginGroupReplaceParamsBodyAwsSignatureV4
- type OriginGroupReplaceParamsBodyAwsSignatureV4Auth
- type OriginGroupReplaceParamsBodyNoneAuth
- type OriginGroupReplaceParamsBodyNoneAuthSource
- type OriginGroupService
- func (r *OriginGroupService) Delete(ctx context.Context, originGroupID int64, opts ...option.RequestOption) (err error)
- func (r *OriginGroupService) Get(ctx context.Context, originGroupID int64, opts ...option.RequestOption) (res *OriginGroupsUnion, err error)
- func (r *OriginGroupService) List(ctx context.Context, query OriginGroupListParams, opts ...option.RequestOption) (res *OriginGroupsList, err error)
- func (r *OriginGroupService) New(ctx context.Context, body OriginGroupNewParams, opts ...option.RequestOption) (res *OriginGroupsUnion, err error)
- func (r *OriginGroupService) Replace(ctx context.Context, originGroupID int64, body OriginGroupReplaceParams, ...) (res *OriginGroupsUnion, err error)
- func (r *OriginGroupService) Update(ctx context.Context, originGroupID int64, body OriginGroupUpdateParams, ...) (res *OriginGroupsUnion, err error)
- type OriginGroupUpdateParams
- type OriginGroupUpdateParamsBodyAwsSignatureV4
- type OriginGroupUpdateParamsBodyAwsSignatureV4Auth
- type OriginGroupUpdateParamsBodyNoneAuth
- type OriginGroupUpdateParamsBodyNoneAuthSource
- type OriginGroupsAwsSignatureV4
- type OriginGroupsAwsSignatureV4Auth
- type OriginGroupsList
- type OriginGroupsNoneAuth
- type OriginGroupsNoneAuthSource
- type OriginGroupsUnion
- type OriginShielding
- type OriginShieldingParam
- type OriginShieldingReplaced
- type PublicIPList
- type PublicNetworkList
- type PurgeStatus
- type PurgeStatusResource
- type PurgeStatusStatus
- type ResourceAggregatedStats
- type ResourceListParams
- type ResourceListParamsStatus
- type ResourceNewParams
- type ResourceNewParamsOptions
- type ResourceNewParamsOptionsAllowedHTTPMethods
- type ResourceNewParamsOptionsBotProtection
- type ResourceNewParamsOptionsBotProtectionBotChallenge
- type ResourceNewParamsOptionsBrotliCompression
- type ResourceNewParamsOptionsBrowserCacheSettings
- type ResourceNewParamsOptionsCacheHTTPHeadersdeprecated
- type ResourceNewParamsOptionsCors
- type ResourceNewParamsOptionsCountryACL
- type ResourceNewParamsOptionsDisableCachedeprecated
- type ResourceNewParamsOptionsDisableProxyForceRanges
- type ResourceNewParamsOptionsEdgeCacheSettings
- type ResourceNewParamsOptionsFastedge
- type ResourceNewParamsOptionsFastedgeOnRequestBody
- type ResourceNewParamsOptionsFastedgeOnRequestHeaders
- type ResourceNewParamsOptionsFastedgeOnResponseBody
- type ResourceNewParamsOptionsFastedgeOnResponseHeaders
- type ResourceNewParamsOptionsFetchCompressed
- type ResourceNewParamsOptionsFollowOriginRedirect
- type ResourceNewParamsOptionsForceReturn
- type ResourceNewParamsOptionsForceReturnTimeInterval
- type ResourceNewParamsOptionsForwardHostHeader
- type ResourceNewParamsOptionsGzipOn
- type ResourceNewParamsOptionsHostHeader
- type ResourceNewParamsOptionsHttp3Enabled
- type ResourceNewParamsOptionsIPAddressACL
- type ResourceNewParamsOptionsIgnoreCookie
- type ResourceNewParamsOptionsIgnoreQueryString
- type ResourceNewParamsOptionsImageStack
- type ResourceNewParamsOptionsLimitBandwidth
- type ResourceNewParamsOptionsProxyCacheKey
- type ResourceNewParamsOptionsProxyCacheMethodsSet
- type ResourceNewParamsOptionsProxyConnectTimeout
- type ResourceNewParamsOptionsProxyReadTimeout
- type ResourceNewParamsOptionsQueryParamsBlacklist
- type ResourceNewParamsOptionsQueryParamsWhitelist
- type ResourceNewParamsOptionsQueryStringForwarding
- type ResourceNewParamsOptionsRedirectHTTPSToHTTP
- type ResourceNewParamsOptionsRedirectHTTPToHTTPS
- type ResourceNewParamsOptionsReferrerACL
- type ResourceNewParamsOptionsRequestLimiter
- type ResourceNewParamsOptionsResponseHeadersHidingPolicy
- type ResourceNewParamsOptionsRewrite
- type ResourceNewParamsOptionsSecureKey
- type ResourceNewParamsOptionsSlice
- type ResourceNewParamsOptionsSni
- type ResourceNewParamsOptionsStale
- type ResourceNewParamsOptionsStaticHeadersdeprecated
- type ResourceNewParamsOptionsStaticRequestHeaders
- type ResourceNewParamsOptionsStaticResponseHeaders
- type ResourceNewParamsOptionsStaticResponseHeadersValue
- type ResourceNewParamsOptionsTlsVersions
- type ResourceNewParamsOptionsUseDefaultLeChain
- type ResourceNewParamsOptionsUseDns01LeChallenge
- type ResourceNewParamsOptionsUseRsaLeCert
- type ResourceNewParamsOptionsUserAgentACL
- type ResourceNewParamsOptionsWaap
- type ResourceNewParamsOptionsWebsockets
- type ResourceNewParamsOriginProtocol
- type ResourcePrefetchParams
- type ResourcePurgeParams
- type ResourcePurgeParamsBodyPurgeAllCache
- type ResourcePurgeParamsBodyPurgeByPattern
- type ResourcePurgeParamsBodyPurgeByURL
- type ResourceReplaceParams
- type ResourceReplaceParamsOptions
- type ResourceReplaceParamsOptionsAllowedHTTPMethods
- type ResourceReplaceParamsOptionsBotProtection
- type ResourceReplaceParamsOptionsBotProtectionBotChallenge
- type ResourceReplaceParamsOptionsBrotliCompression
- type ResourceReplaceParamsOptionsBrowserCacheSettings
- type ResourceReplaceParamsOptionsCacheHTTPHeadersdeprecated
- type ResourceReplaceParamsOptionsCors
- type ResourceReplaceParamsOptionsCountryACL
- type ResourceReplaceParamsOptionsDisableCachedeprecated
- type ResourceReplaceParamsOptionsDisableProxyForceRanges
- type ResourceReplaceParamsOptionsEdgeCacheSettings
- type ResourceReplaceParamsOptionsFastedge
- type ResourceReplaceParamsOptionsFastedgeOnRequestBody
- type ResourceReplaceParamsOptionsFastedgeOnRequestHeaders
- type ResourceReplaceParamsOptionsFastedgeOnResponseBody
- type ResourceReplaceParamsOptionsFastedgeOnResponseHeaders
- type ResourceReplaceParamsOptionsFetchCompressed
- type ResourceReplaceParamsOptionsFollowOriginRedirect
- type ResourceReplaceParamsOptionsForceReturn
- type ResourceReplaceParamsOptionsForceReturnTimeInterval
- type ResourceReplaceParamsOptionsForwardHostHeader
- type ResourceReplaceParamsOptionsGzipOn
- type ResourceReplaceParamsOptionsHostHeader
- type ResourceReplaceParamsOptionsHttp3Enabled
- type ResourceReplaceParamsOptionsIPAddressACL
- type ResourceReplaceParamsOptionsIgnoreCookie
- type ResourceReplaceParamsOptionsIgnoreQueryString
- type ResourceReplaceParamsOptionsImageStack
- type ResourceReplaceParamsOptionsLimitBandwidth
- type ResourceReplaceParamsOptionsProxyCacheKey
- type ResourceReplaceParamsOptionsProxyCacheMethodsSet
- type ResourceReplaceParamsOptionsProxyConnectTimeout
- type ResourceReplaceParamsOptionsProxyReadTimeout
- type ResourceReplaceParamsOptionsQueryParamsBlacklist
- type ResourceReplaceParamsOptionsQueryParamsWhitelist
- type ResourceReplaceParamsOptionsQueryStringForwarding
- type ResourceReplaceParamsOptionsRedirectHTTPSToHTTP
- type ResourceReplaceParamsOptionsRedirectHTTPToHTTPS
- type ResourceReplaceParamsOptionsReferrerACL
- type ResourceReplaceParamsOptionsRequestLimiter
- type ResourceReplaceParamsOptionsResponseHeadersHidingPolicy
- type ResourceReplaceParamsOptionsRewrite
- type ResourceReplaceParamsOptionsSecureKey
- type ResourceReplaceParamsOptionsSlice
- type ResourceReplaceParamsOptionsSni
- type ResourceReplaceParamsOptionsStale
- type ResourceReplaceParamsOptionsStaticHeadersdeprecated
- type ResourceReplaceParamsOptionsStaticRequestHeaders
- type ResourceReplaceParamsOptionsStaticResponseHeaders
- type ResourceReplaceParamsOptionsStaticResponseHeadersValue
- type ResourceReplaceParamsOptionsTlsVersions
- type ResourceReplaceParamsOptionsUseDefaultLeChain
- type ResourceReplaceParamsOptionsUseDns01LeChallenge
- type ResourceReplaceParamsOptionsUseRsaLeCert
- type ResourceReplaceParamsOptionsUserAgentACL
- type ResourceReplaceParamsOptionsWaap
- type ResourceReplaceParamsOptionsWebsockets
- type ResourceReplaceParamsOriginProtocol
- type ResourceRuleDeleteParams
- type ResourceRuleGetParams
- type ResourceRuleNewParams
- type ResourceRuleNewParamsOptions
- type ResourceRuleNewParamsOptionsAllowedHTTPMethods
- type ResourceRuleNewParamsOptionsBotProtection
- type ResourceRuleNewParamsOptionsBotProtectionBotChallenge
- type ResourceRuleNewParamsOptionsBrotliCompression
- type ResourceRuleNewParamsOptionsBrowserCacheSettings
- type ResourceRuleNewParamsOptionsCacheHTTPHeadersdeprecated
- type ResourceRuleNewParamsOptionsCors
- type ResourceRuleNewParamsOptionsCountryACL
- type ResourceRuleNewParamsOptionsDisableCachedeprecated
- type ResourceRuleNewParamsOptionsDisableProxyForceRanges
- type ResourceRuleNewParamsOptionsEdgeCacheSettings
- type ResourceRuleNewParamsOptionsFastedge
- type ResourceRuleNewParamsOptionsFastedgeOnRequestBody
- type ResourceRuleNewParamsOptionsFastedgeOnRequestHeaders
- type ResourceRuleNewParamsOptionsFastedgeOnResponseBody
- type ResourceRuleNewParamsOptionsFastedgeOnResponseHeaders
- type ResourceRuleNewParamsOptionsFetchCompressed
- type ResourceRuleNewParamsOptionsFollowOriginRedirect
- type ResourceRuleNewParamsOptionsForceReturn
- type ResourceRuleNewParamsOptionsForceReturnTimeInterval
- type ResourceRuleNewParamsOptionsForwardHostHeader
- type ResourceRuleNewParamsOptionsGzipOn
- type ResourceRuleNewParamsOptionsHostHeader
- type ResourceRuleNewParamsOptionsIPAddressACL
- type ResourceRuleNewParamsOptionsIgnoreCookie
- type ResourceRuleNewParamsOptionsIgnoreQueryString
- type ResourceRuleNewParamsOptionsImageStack
- type ResourceRuleNewParamsOptionsLimitBandwidth
- type ResourceRuleNewParamsOptionsProxyCacheKey
- type ResourceRuleNewParamsOptionsProxyCacheMethodsSet
- type ResourceRuleNewParamsOptionsProxyConnectTimeout
- type ResourceRuleNewParamsOptionsProxyReadTimeout
- type ResourceRuleNewParamsOptionsQueryParamsBlacklist
- type ResourceRuleNewParamsOptionsQueryParamsWhitelist
- type ResourceRuleNewParamsOptionsQueryStringForwarding
- type ResourceRuleNewParamsOptionsRedirectHTTPSToHTTP
- type ResourceRuleNewParamsOptionsRedirectHTTPToHTTPS
- type ResourceRuleNewParamsOptionsReferrerACL
- type ResourceRuleNewParamsOptionsRequestLimiter
- type ResourceRuleNewParamsOptionsResponseHeadersHidingPolicy
- type ResourceRuleNewParamsOptionsRewrite
- type ResourceRuleNewParamsOptionsSecureKey
- type ResourceRuleNewParamsOptionsSlice
- type ResourceRuleNewParamsOptionsSni
- type ResourceRuleNewParamsOptionsStale
- type ResourceRuleNewParamsOptionsStaticHeadersdeprecated
- type ResourceRuleNewParamsOptionsStaticRequestHeaders
- type ResourceRuleNewParamsOptionsStaticResponseHeaders
- type ResourceRuleNewParamsOptionsStaticResponseHeadersValue
- type ResourceRuleNewParamsOptionsUserAgentACL
- type ResourceRuleNewParamsOptionsWaap
- type ResourceRuleNewParamsOptionsWebsockets
- type ResourceRuleNewParamsOverrideOriginProtocol
- type ResourceRuleReplaceParams
- type ResourceRuleReplaceParamsOptions
- type ResourceRuleReplaceParamsOptionsAllowedHTTPMethods
- type ResourceRuleReplaceParamsOptionsBotProtection
- type ResourceRuleReplaceParamsOptionsBotProtectionBotChallenge
- type ResourceRuleReplaceParamsOptionsBrotliCompression
- type ResourceRuleReplaceParamsOptionsBrowserCacheSettings
- type ResourceRuleReplaceParamsOptionsCacheHTTPHeadersdeprecated
- type ResourceRuleReplaceParamsOptionsCors
- type ResourceRuleReplaceParamsOptionsCountryACL
- type ResourceRuleReplaceParamsOptionsDisableCachedeprecated
- type ResourceRuleReplaceParamsOptionsDisableProxyForceRanges
- type ResourceRuleReplaceParamsOptionsEdgeCacheSettings
- type ResourceRuleReplaceParamsOptionsFastedge
- type ResourceRuleReplaceParamsOptionsFastedgeOnRequestBody
- type ResourceRuleReplaceParamsOptionsFastedgeOnRequestHeaders
- type ResourceRuleReplaceParamsOptionsFastedgeOnResponseBody
- type ResourceRuleReplaceParamsOptionsFastedgeOnResponseHeaders
- type ResourceRuleReplaceParamsOptionsFetchCompressed
- type ResourceRuleReplaceParamsOptionsFollowOriginRedirect
- type ResourceRuleReplaceParamsOptionsForceReturn
- type ResourceRuleReplaceParamsOptionsForceReturnTimeInterval
- type ResourceRuleReplaceParamsOptionsForwardHostHeader
- type ResourceRuleReplaceParamsOptionsGzipOn
- type ResourceRuleReplaceParamsOptionsHostHeader
- type ResourceRuleReplaceParamsOptionsIPAddressACL
- type ResourceRuleReplaceParamsOptionsIgnoreCookie
- type ResourceRuleReplaceParamsOptionsIgnoreQueryString
- type ResourceRuleReplaceParamsOptionsImageStack
- type ResourceRuleReplaceParamsOptionsLimitBandwidth
- type ResourceRuleReplaceParamsOptionsProxyCacheKey
- type ResourceRuleReplaceParamsOptionsProxyCacheMethodsSet
- type ResourceRuleReplaceParamsOptionsProxyConnectTimeout
- type ResourceRuleReplaceParamsOptionsProxyReadTimeout
- type ResourceRuleReplaceParamsOptionsQueryParamsBlacklist
- type ResourceRuleReplaceParamsOptionsQueryParamsWhitelist
- type ResourceRuleReplaceParamsOptionsQueryStringForwarding
- type ResourceRuleReplaceParamsOptionsRedirectHTTPSToHTTP
- type ResourceRuleReplaceParamsOptionsRedirectHTTPToHTTPS
- type ResourceRuleReplaceParamsOptionsReferrerACL
- type ResourceRuleReplaceParamsOptionsRequestLimiter
- type ResourceRuleReplaceParamsOptionsResponseHeadersHidingPolicy
- type ResourceRuleReplaceParamsOptionsRewrite
- type ResourceRuleReplaceParamsOptionsSecureKey
- type ResourceRuleReplaceParamsOptionsSlice
- type ResourceRuleReplaceParamsOptionsSni
- type ResourceRuleReplaceParamsOptionsStale
- type ResourceRuleReplaceParamsOptionsStaticHeadersdeprecated
- type ResourceRuleReplaceParamsOptionsStaticRequestHeaders
- type ResourceRuleReplaceParamsOptionsStaticResponseHeaders
- type ResourceRuleReplaceParamsOptionsStaticResponseHeadersValue
- type ResourceRuleReplaceParamsOptionsUserAgentACL
- type ResourceRuleReplaceParamsOptionsWaap
- type ResourceRuleReplaceParamsOptionsWebsockets
- type ResourceRuleReplaceParamsOverrideOriginProtocol
- type ResourceRuleService
- func (r *ResourceRuleService) Delete(ctx context.Context, ruleID int64, body ResourceRuleDeleteParams, ...) (err error)
- func (r *ResourceRuleService) Get(ctx context.Context, ruleID int64, query ResourceRuleGetParams, ...) (res *CdnResourceRule, err error)
- func (r *ResourceRuleService) List(ctx context.Context, resourceID int64, opts ...option.RequestOption) (res *[]CdnResourceRule, err error)
- func (r *ResourceRuleService) New(ctx context.Context, resourceID int64, body ResourceRuleNewParams, ...) (res *CdnResourceRule, err error)
- func (r *ResourceRuleService) Replace(ctx context.Context, ruleID int64, params ResourceRuleReplaceParams, ...) (res *CdnResourceRule, err error)
- func (r *ResourceRuleService) Update(ctx context.Context, ruleID int64, params ResourceRuleUpdateParams, ...) (res *CdnResourceRule, err error)
- type ResourceRuleUpdateParams
- type ResourceRuleUpdateParamsOptions
- type ResourceRuleUpdateParamsOptionsAllowedHTTPMethods
- type ResourceRuleUpdateParamsOptionsBotProtection
- type ResourceRuleUpdateParamsOptionsBotProtectionBotChallenge
- type ResourceRuleUpdateParamsOptionsBrotliCompression
- type ResourceRuleUpdateParamsOptionsBrowserCacheSettings
- type ResourceRuleUpdateParamsOptionsCacheHTTPHeadersdeprecated
- type ResourceRuleUpdateParamsOptionsCors
- type ResourceRuleUpdateParamsOptionsCountryACL
- type ResourceRuleUpdateParamsOptionsDisableCachedeprecated
- type ResourceRuleUpdateParamsOptionsDisableProxyForceRanges
- type ResourceRuleUpdateParamsOptionsEdgeCacheSettings
- type ResourceRuleUpdateParamsOptionsFastedge
- type ResourceRuleUpdateParamsOptionsFastedgeOnRequestBody
- type ResourceRuleUpdateParamsOptionsFastedgeOnRequestHeaders
- type ResourceRuleUpdateParamsOptionsFastedgeOnResponseBody
- type ResourceRuleUpdateParamsOptionsFastedgeOnResponseHeaders
- type ResourceRuleUpdateParamsOptionsFetchCompressed
- type ResourceRuleUpdateParamsOptionsFollowOriginRedirect
- type ResourceRuleUpdateParamsOptionsForceReturn
- type ResourceRuleUpdateParamsOptionsForceReturnTimeInterval
- type ResourceRuleUpdateParamsOptionsForwardHostHeader
- type ResourceRuleUpdateParamsOptionsGzipOn
- type ResourceRuleUpdateParamsOptionsHostHeader
- type ResourceRuleUpdateParamsOptionsIPAddressACL
- type ResourceRuleUpdateParamsOptionsIgnoreCookie
- type ResourceRuleUpdateParamsOptionsIgnoreQueryString
- type ResourceRuleUpdateParamsOptionsImageStack
- type ResourceRuleUpdateParamsOptionsLimitBandwidth
- type ResourceRuleUpdateParamsOptionsProxyCacheKey
- type ResourceRuleUpdateParamsOptionsProxyCacheMethodsSet
- type ResourceRuleUpdateParamsOptionsProxyConnectTimeout
- type ResourceRuleUpdateParamsOptionsProxyReadTimeout
- type ResourceRuleUpdateParamsOptionsQueryParamsBlacklist
- type ResourceRuleUpdateParamsOptionsQueryParamsWhitelist
- type ResourceRuleUpdateParamsOptionsQueryStringForwarding
- type ResourceRuleUpdateParamsOptionsRedirectHTTPSToHTTP
- type ResourceRuleUpdateParamsOptionsRedirectHTTPToHTTPS
- type ResourceRuleUpdateParamsOptionsReferrerACL
- type ResourceRuleUpdateParamsOptionsRequestLimiter
- type ResourceRuleUpdateParamsOptionsResponseHeadersHidingPolicy
- type ResourceRuleUpdateParamsOptionsRewrite
- type ResourceRuleUpdateParamsOptionsSecureKey
- type ResourceRuleUpdateParamsOptionsSlice
- type ResourceRuleUpdateParamsOptionsSni
- type ResourceRuleUpdateParamsOptionsStale
- type ResourceRuleUpdateParamsOptionsStaticHeadersdeprecated
- type ResourceRuleUpdateParamsOptionsStaticRequestHeaders
- type ResourceRuleUpdateParamsOptionsStaticResponseHeaders
- type ResourceRuleUpdateParamsOptionsStaticResponseHeadersValue
- type ResourceRuleUpdateParamsOptionsUserAgentACL
- type ResourceRuleUpdateParamsOptionsWaap
- type ResourceRuleUpdateParamsOptionsWebsockets
- type ResourceRuleUpdateParamsOverrideOriginProtocol
- type ResourceService
- func (r *ResourceService) Delete(ctx context.Context, resourceID int64, opts ...option.RequestOption) (err error)
- func (r *ResourceService) Get(ctx context.Context, resourceID int64, opts ...option.RequestOption) (res *CdnResource, err error)
- func (r *ResourceService) List(ctx context.Context, query ResourceListParams, opts ...option.RequestOption) (res *CdnResourceList, err error)
- func (r *ResourceService) New(ctx context.Context, body ResourceNewParams, opts ...option.RequestOption) (res *CdnResource, err error)
- func (r *ResourceService) Prefetch(ctx context.Context, resourceID int64, body ResourcePrefetchParams, ...) (err error)
- func (r *ResourceService) PrevalidateSslLeCertificate(ctx context.Context, resourceID int64, opts ...option.RequestOption) (err error)
- func (r *ResourceService) Purge(ctx context.Context, resourceID int64, body ResourcePurgeParams, ...) (err error)
- func (r *ResourceService) Replace(ctx context.Context, resourceID int64, body ResourceReplaceParams, ...) (res *CdnResource, err error)
- func (r *ResourceService) Update(ctx context.Context, resourceID int64, body ResourceUpdateParams, ...) (res *CdnResource, err error)
- type ResourceShieldReplaceParams
- type ResourceShieldService
- type ResourceUpdateParams
- type ResourceUpdateParamsOptions
- type ResourceUpdateParamsOptionsAllowedHTTPMethods
- type ResourceUpdateParamsOptionsBotProtection
- type ResourceUpdateParamsOptionsBotProtectionBotChallenge
- type ResourceUpdateParamsOptionsBrotliCompression
- type ResourceUpdateParamsOptionsBrowserCacheSettings
- type ResourceUpdateParamsOptionsCacheHTTPHeadersdeprecated
- type ResourceUpdateParamsOptionsCors
- type ResourceUpdateParamsOptionsCountryACL
- type ResourceUpdateParamsOptionsDisableCachedeprecated
- type ResourceUpdateParamsOptionsDisableProxyForceRanges
- type ResourceUpdateParamsOptionsEdgeCacheSettings
- type ResourceUpdateParamsOptionsFastedge
- type ResourceUpdateParamsOptionsFastedgeOnRequestBody
- type ResourceUpdateParamsOptionsFastedgeOnRequestHeaders
- type ResourceUpdateParamsOptionsFastedgeOnResponseBody
- type ResourceUpdateParamsOptionsFastedgeOnResponseHeaders
- type ResourceUpdateParamsOptionsFetchCompressed
- type ResourceUpdateParamsOptionsFollowOriginRedirect
- type ResourceUpdateParamsOptionsForceReturn
- type ResourceUpdateParamsOptionsForceReturnTimeInterval
- type ResourceUpdateParamsOptionsForwardHostHeader
- type ResourceUpdateParamsOptionsGzipOn
- type ResourceUpdateParamsOptionsHostHeader
- type ResourceUpdateParamsOptionsHttp3Enabled
- type ResourceUpdateParamsOptionsIPAddressACL
- type ResourceUpdateParamsOptionsIgnoreCookie
- type ResourceUpdateParamsOptionsIgnoreQueryString
- type ResourceUpdateParamsOptionsImageStack
- type ResourceUpdateParamsOptionsLimitBandwidth
- type ResourceUpdateParamsOptionsProxyCacheKey
- type ResourceUpdateParamsOptionsProxyCacheMethodsSet
- type ResourceUpdateParamsOptionsProxyConnectTimeout
- type ResourceUpdateParamsOptionsProxyReadTimeout
- type ResourceUpdateParamsOptionsQueryParamsBlacklist
- type ResourceUpdateParamsOptionsQueryParamsWhitelist
- type ResourceUpdateParamsOptionsQueryStringForwarding
- type ResourceUpdateParamsOptionsRedirectHTTPSToHTTP
- type ResourceUpdateParamsOptionsRedirectHTTPToHTTPS
- type ResourceUpdateParamsOptionsReferrerACL
- type ResourceUpdateParamsOptionsRequestLimiter
- type ResourceUpdateParamsOptionsResponseHeadersHidingPolicy
- type ResourceUpdateParamsOptionsRewrite
- type ResourceUpdateParamsOptionsSecureKey
- type ResourceUpdateParamsOptionsSlice
- type ResourceUpdateParamsOptionsSni
- type ResourceUpdateParamsOptionsStale
- type ResourceUpdateParamsOptionsStaticHeadersdeprecated
- type ResourceUpdateParamsOptionsStaticRequestHeaders
- type ResourceUpdateParamsOptionsStaticResponseHeaders
- type ResourceUpdateParamsOptionsStaticResponseHeadersValue
- type ResourceUpdateParamsOptionsTlsVersions
- type ResourceUpdateParamsOptionsUseDefaultLeChain
- type ResourceUpdateParamsOptionsUseDns01LeChallenge
- type ResourceUpdateParamsOptionsUseRsaLeCert
- type ResourceUpdateParamsOptionsUserAgentACL
- type ResourceUpdateParamsOptionsWaap
- type ResourceUpdateParamsOptionsWebsockets
- type ResourceUpdateParamsOriginProtocol
- type ResourceUsageStats
- type RuleTemplate
- type RuleTemplateList
- type RuleTemplateNewParams
- type RuleTemplateNewParamsOptions
- type RuleTemplateNewParamsOptionsAllowedHTTPMethods
- type RuleTemplateNewParamsOptionsBotProtection
- type RuleTemplateNewParamsOptionsBotProtectionBotChallenge
- type RuleTemplateNewParamsOptionsBrotliCompression
- type RuleTemplateNewParamsOptionsBrowserCacheSettings
- type RuleTemplateNewParamsOptionsCacheHTTPHeadersdeprecated
- type RuleTemplateNewParamsOptionsCors
- type RuleTemplateNewParamsOptionsCountryACL
- type RuleTemplateNewParamsOptionsDisableCachedeprecated
- type RuleTemplateNewParamsOptionsDisableProxyForceRanges
- type RuleTemplateNewParamsOptionsEdgeCacheSettings
- type RuleTemplateNewParamsOptionsFastedge
- type RuleTemplateNewParamsOptionsFastedgeOnRequestBody
- type RuleTemplateNewParamsOptionsFastedgeOnRequestHeaders
- type RuleTemplateNewParamsOptionsFastedgeOnResponseBody
- type RuleTemplateNewParamsOptionsFastedgeOnResponseHeaders
- type RuleTemplateNewParamsOptionsFetchCompressed
- type RuleTemplateNewParamsOptionsFollowOriginRedirect
- type RuleTemplateNewParamsOptionsForceReturn
- type RuleTemplateNewParamsOptionsForceReturnTimeInterval
- type RuleTemplateNewParamsOptionsForwardHostHeader
- type RuleTemplateNewParamsOptionsGzipOn
- type RuleTemplateNewParamsOptionsHostHeader
- type RuleTemplateNewParamsOptionsIPAddressACL
- type RuleTemplateNewParamsOptionsIgnoreCookie
- type RuleTemplateNewParamsOptionsIgnoreQueryString
- type RuleTemplateNewParamsOptionsImageStack
- type RuleTemplateNewParamsOptionsLimitBandwidth
- type RuleTemplateNewParamsOptionsProxyCacheKey
- type RuleTemplateNewParamsOptionsProxyCacheMethodsSet
- type RuleTemplateNewParamsOptionsProxyConnectTimeout
- type RuleTemplateNewParamsOptionsProxyReadTimeout
- type RuleTemplateNewParamsOptionsQueryParamsBlacklist
- type RuleTemplateNewParamsOptionsQueryParamsWhitelist
- type RuleTemplateNewParamsOptionsQueryStringForwarding
- type RuleTemplateNewParamsOptionsRedirectHTTPSToHTTP
- type RuleTemplateNewParamsOptionsRedirectHTTPToHTTPS
- type RuleTemplateNewParamsOptionsReferrerACL
- type RuleTemplateNewParamsOptionsRequestLimiter
- type RuleTemplateNewParamsOptionsResponseHeadersHidingPolicy
- type RuleTemplateNewParamsOptionsRewrite
- type RuleTemplateNewParamsOptionsSecureKey
- type RuleTemplateNewParamsOptionsSlice
- type RuleTemplateNewParamsOptionsSni
- type RuleTemplateNewParamsOptionsStale
- type RuleTemplateNewParamsOptionsStaticHeadersdeprecated
- type RuleTemplateNewParamsOptionsStaticRequestHeaders
- type RuleTemplateNewParamsOptionsStaticResponseHeaders
- type RuleTemplateNewParamsOptionsStaticResponseHeadersValue
- type RuleTemplateNewParamsOptionsUserAgentACL
- type RuleTemplateNewParamsOptionsWaap
- type RuleTemplateNewParamsOptionsWebsockets
- type RuleTemplateNewParamsOverrideOriginProtocol
- type RuleTemplateOptions
- type RuleTemplateOptionsAllowedHTTPMethods
- type RuleTemplateOptionsBotProtection
- type RuleTemplateOptionsBotProtectionBotChallenge
- type RuleTemplateOptionsBrotliCompression
- type RuleTemplateOptionsBrowserCacheSettings
- type RuleTemplateOptionsCacheHTTPHeadersdeprecated
- type RuleTemplateOptionsCors
- type RuleTemplateOptionsCountryACL
- type RuleTemplateOptionsDisableCachedeprecated
- type RuleTemplateOptionsDisableProxyForceRanges
- type RuleTemplateOptionsEdgeCacheSettings
- type RuleTemplateOptionsFastedge
- type RuleTemplateOptionsFastedgeOnRequestBody
- type RuleTemplateOptionsFastedgeOnRequestHeaders
- type RuleTemplateOptionsFastedgeOnResponseBody
- type RuleTemplateOptionsFastedgeOnResponseHeaders
- type RuleTemplateOptionsFetchCompressed
- type RuleTemplateOptionsFollowOriginRedirect
- type RuleTemplateOptionsForceReturn
- type RuleTemplateOptionsForceReturnTimeInterval
- type RuleTemplateOptionsForwardHostHeader
- type RuleTemplateOptionsGzipOn
- type RuleTemplateOptionsHostHeader
- type RuleTemplateOptionsIPAddressACL
- type RuleTemplateOptionsIgnoreCookie
- type RuleTemplateOptionsIgnoreQueryString
- type RuleTemplateOptionsImageStack
- type RuleTemplateOptionsLimitBandwidth
- type RuleTemplateOptionsProxyCacheKey
- type RuleTemplateOptionsProxyCacheMethodsSet
- type RuleTemplateOptionsProxyConnectTimeout
- type RuleTemplateOptionsProxyReadTimeout
- type RuleTemplateOptionsQueryParamsBlacklist
- type RuleTemplateOptionsQueryParamsWhitelist
- type RuleTemplateOptionsQueryStringForwarding
- type RuleTemplateOptionsRedirectHTTPSToHTTP
- type RuleTemplateOptionsRedirectHTTPToHTTPS
- type RuleTemplateOptionsReferrerACL
- type RuleTemplateOptionsRequestLimiter
- type RuleTemplateOptionsResponseHeadersHidingPolicy
- type RuleTemplateOptionsRewrite
- type RuleTemplateOptionsSecureKey
- type RuleTemplateOptionsSlice
- type RuleTemplateOptionsSni
- type RuleTemplateOptionsStale
- type RuleTemplateOptionsStaticHeadersdeprecated
- type RuleTemplateOptionsStaticRequestHeaders
- type RuleTemplateOptionsStaticResponseHeaders
- type RuleTemplateOptionsStaticResponseHeadersValue
- type RuleTemplateOptionsUserAgentACL
- type RuleTemplateOptionsWaap
- type RuleTemplateOptionsWebsockets
- type RuleTemplateOverrideOriginProtocol
- type RuleTemplateReplaceParams
- type RuleTemplateReplaceParamsOptions
- type RuleTemplateReplaceParamsOptionsAllowedHTTPMethods
- type RuleTemplateReplaceParamsOptionsBotProtection
- type RuleTemplateReplaceParamsOptionsBotProtectionBotChallenge
- type RuleTemplateReplaceParamsOptionsBrotliCompression
- type RuleTemplateReplaceParamsOptionsBrowserCacheSettings
- type RuleTemplateReplaceParamsOptionsCacheHTTPHeadersdeprecated
- type RuleTemplateReplaceParamsOptionsCors
- type RuleTemplateReplaceParamsOptionsCountryACL
- type RuleTemplateReplaceParamsOptionsDisableCachedeprecated
- type RuleTemplateReplaceParamsOptionsDisableProxyForceRanges
- type RuleTemplateReplaceParamsOptionsEdgeCacheSettings
- type RuleTemplateReplaceParamsOptionsFastedge
- type RuleTemplateReplaceParamsOptionsFastedgeOnRequestBody
- type RuleTemplateReplaceParamsOptionsFastedgeOnRequestHeaders
- type RuleTemplateReplaceParamsOptionsFastedgeOnResponseBody
- type RuleTemplateReplaceParamsOptionsFastedgeOnResponseHeaders
- type RuleTemplateReplaceParamsOptionsFetchCompressed
- type RuleTemplateReplaceParamsOptionsFollowOriginRedirect
- type RuleTemplateReplaceParamsOptionsForceReturn
- type RuleTemplateReplaceParamsOptionsForceReturnTimeInterval
- type RuleTemplateReplaceParamsOptionsForwardHostHeader
- type RuleTemplateReplaceParamsOptionsGzipOn
- type RuleTemplateReplaceParamsOptionsHostHeader
- type RuleTemplateReplaceParamsOptionsIPAddressACL
- type RuleTemplateReplaceParamsOptionsIgnoreCookie
- type RuleTemplateReplaceParamsOptionsIgnoreQueryString
- type RuleTemplateReplaceParamsOptionsImageStack
- type RuleTemplateReplaceParamsOptionsLimitBandwidth
- type RuleTemplateReplaceParamsOptionsProxyCacheKey
- type RuleTemplateReplaceParamsOptionsProxyCacheMethodsSet
- type RuleTemplateReplaceParamsOptionsProxyConnectTimeout
- type RuleTemplateReplaceParamsOptionsProxyReadTimeout
- type RuleTemplateReplaceParamsOptionsQueryParamsBlacklist
- type RuleTemplateReplaceParamsOptionsQueryParamsWhitelist
- type RuleTemplateReplaceParamsOptionsQueryStringForwarding
- type RuleTemplateReplaceParamsOptionsRedirectHTTPSToHTTP
- type RuleTemplateReplaceParamsOptionsRedirectHTTPToHTTPS
- type RuleTemplateReplaceParamsOptionsReferrerACL
- type RuleTemplateReplaceParamsOptionsRequestLimiter
- type RuleTemplateReplaceParamsOptionsResponseHeadersHidingPolicy
- type RuleTemplateReplaceParamsOptionsRewrite
- type RuleTemplateReplaceParamsOptionsSecureKey
- type RuleTemplateReplaceParamsOptionsSlice
- type RuleTemplateReplaceParamsOptionsSni
- type RuleTemplateReplaceParamsOptionsStale
- type RuleTemplateReplaceParamsOptionsStaticHeadersdeprecated
- type RuleTemplateReplaceParamsOptionsStaticRequestHeaders
- type RuleTemplateReplaceParamsOptionsStaticResponseHeaders
- type RuleTemplateReplaceParamsOptionsStaticResponseHeadersValue
- type RuleTemplateReplaceParamsOptionsUserAgentACL
- type RuleTemplateReplaceParamsOptionsWaap
- type RuleTemplateReplaceParamsOptionsWebsockets
- type RuleTemplateReplaceParamsOverrideOriginProtocol
- type RuleTemplateService
- func (r *RuleTemplateService) Delete(ctx context.Context, ruleTemplateID int64, opts ...option.RequestOption) (err error)
- func (r *RuleTemplateService) Get(ctx context.Context, ruleTemplateID int64, opts ...option.RequestOption) (res *RuleTemplate, err error)
- func (r *RuleTemplateService) List(ctx context.Context, opts ...option.RequestOption) (res *RuleTemplateList, err error)
- func (r *RuleTemplateService) New(ctx context.Context, body RuleTemplateNewParams, opts ...option.RequestOption) (res *RuleTemplate, err error)
- func (r *RuleTemplateService) Replace(ctx context.Context, ruleTemplateID int64, body RuleTemplateReplaceParams, ...) (res *RuleTemplate, err error)
- func (r *RuleTemplateService) Update(ctx context.Context, ruleTemplateID int64, body RuleTemplateUpdateParams, ...) (res *RuleTemplate, err error)
- type RuleTemplateUpdateParams
- type RuleTemplateUpdateParamsOptions
- type RuleTemplateUpdateParamsOptionsAllowedHTTPMethods
- type RuleTemplateUpdateParamsOptionsBotProtection
- type RuleTemplateUpdateParamsOptionsBotProtectionBotChallenge
- type RuleTemplateUpdateParamsOptionsBrotliCompression
- type RuleTemplateUpdateParamsOptionsBrowserCacheSettings
- type RuleTemplateUpdateParamsOptionsCacheHTTPHeadersdeprecated
- type RuleTemplateUpdateParamsOptionsCors
- type RuleTemplateUpdateParamsOptionsCountryACL
- type RuleTemplateUpdateParamsOptionsDisableCachedeprecated
- type RuleTemplateUpdateParamsOptionsDisableProxyForceRanges
- type RuleTemplateUpdateParamsOptionsEdgeCacheSettings
- type RuleTemplateUpdateParamsOptionsFastedge
- type RuleTemplateUpdateParamsOptionsFastedgeOnRequestBody
- type RuleTemplateUpdateParamsOptionsFastedgeOnRequestHeaders
- type RuleTemplateUpdateParamsOptionsFastedgeOnResponseBody
- type RuleTemplateUpdateParamsOptionsFastedgeOnResponseHeaders
- type RuleTemplateUpdateParamsOptionsFetchCompressed
- type RuleTemplateUpdateParamsOptionsFollowOriginRedirect
- type RuleTemplateUpdateParamsOptionsForceReturn
- type RuleTemplateUpdateParamsOptionsForceReturnTimeInterval
- type RuleTemplateUpdateParamsOptionsForwardHostHeader
- type RuleTemplateUpdateParamsOptionsGzipOn
- type RuleTemplateUpdateParamsOptionsHostHeader
- type RuleTemplateUpdateParamsOptionsIPAddressACL
- type RuleTemplateUpdateParamsOptionsIgnoreCookie
- type RuleTemplateUpdateParamsOptionsIgnoreQueryString
- type RuleTemplateUpdateParamsOptionsImageStack
- type RuleTemplateUpdateParamsOptionsLimitBandwidth
- type RuleTemplateUpdateParamsOptionsProxyCacheKey
- type RuleTemplateUpdateParamsOptionsProxyCacheMethodsSet
- type RuleTemplateUpdateParamsOptionsProxyConnectTimeout
- type RuleTemplateUpdateParamsOptionsProxyReadTimeout
- type RuleTemplateUpdateParamsOptionsQueryParamsBlacklist
- type RuleTemplateUpdateParamsOptionsQueryParamsWhitelist
- type RuleTemplateUpdateParamsOptionsQueryStringForwarding
- type RuleTemplateUpdateParamsOptionsRedirectHTTPSToHTTP
- type RuleTemplateUpdateParamsOptionsRedirectHTTPToHTTPS
- type RuleTemplateUpdateParamsOptionsReferrerACL
- type RuleTemplateUpdateParamsOptionsRequestLimiter
- type RuleTemplateUpdateParamsOptionsResponseHeadersHidingPolicy
- type RuleTemplateUpdateParamsOptionsRewrite
- type RuleTemplateUpdateParamsOptionsSecureKey
- type RuleTemplateUpdateParamsOptionsSlice
- type RuleTemplateUpdateParamsOptionsSni
- type RuleTemplateUpdateParamsOptionsStale
- type RuleTemplateUpdateParamsOptionsStaticHeadersdeprecated
- type RuleTemplateUpdateParamsOptionsStaticRequestHeaders
- type RuleTemplateUpdateParamsOptionsStaticResponseHeaders
- type RuleTemplateUpdateParamsOptionsStaticResponseHeadersValue
- type RuleTemplateUpdateParamsOptionsUserAgentACL
- type RuleTemplateUpdateParamsOptionsWaap
- type RuleTemplateUpdateParamsOptionsWebsockets
- type RuleTemplateUpdateParamsOverrideOriginProtocol
- type ShieldAggregatedStats
- type ShieldListResponse
- type ShieldService
- type SslDetail
- type SslDetailList
- type SslRequestStatus
- type SslRequestStatusLatestStatus
- type SslRequestStatusStatus
- type StatisticGetLogsUsageAggregatedParams
- type StatisticGetLogsUsageSeriesParams
- type StatisticGetResourceUsageAggregatedParams
- type StatisticGetResourceUsageSeriesParams
- type StatisticGetShieldUsageAggregatedParams
- type StatisticGetShieldUsageSeriesParams
- type StatisticService
- func (r *StatisticService) GetLogsUsageAggregated(ctx context.Context, query StatisticGetLogsUsageAggregatedParams, ...) (res *LogsAggregatedStats, err error)
- func (r *StatisticService) GetLogsUsageSeries(ctx context.Context, query StatisticGetLogsUsageSeriesParams, ...) (res *UsageSeriesStats, err error)
- func (r *StatisticService) GetResourceUsageAggregated(ctx context.Context, query StatisticGetResourceUsageAggregatedParams, ...) (res *ResourceAggregatedStats, err error)
- func (r *StatisticService) GetResourceUsageSeries(ctx context.Context, query StatisticGetResourceUsageSeriesParams, ...) (res *ResourceUsageStats, err error)
- func (r *StatisticService) GetShieldUsageAggregated(ctx context.Context, query StatisticGetShieldUsageAggregatedParams, ...) (res *ShieldAggregatedStats, err error)
- func (r *StatisticService) GetShieldUsageSeries(ctx context.Context, query StatisticGetShieldUsageSeriesParams, ...) (res *UsageSeriesStats, err error)
- type TrustedCaCertificateListParams
- type TrustedCaCertificateNewParams
- type TrustedCaCertificateReplaceParams
- type TrustedCaCertificateService
- func (r *TrustedCaCertificateService) Delete(ctx context.Context, id int64, opts ...option.RequestOption) (err error)
- func (r *TrustedCaCertificateService) Get(ctx context.Context, id int64, opts ...option.RequestOption) (res *CaCertificate, err error)
- func (r *TrustedCaCertificateService) List(ctx context.Context, query TrustedCaCertificateListParams, ...) (res *CaCertificateList, err error)
- func (r *TrustedCaCertificateService) New(ctx context.Context, body TrustedCaCertificateNewParams, ...) (res *CaCertificate, err error)
- func (r *TrustedCaCertificateService) Replace(ctx context.Context, id int64, body TrustedCaCertificateReplaceParams, ...) (res *CaCertificate, err error)
- type UsageSeriesStat
- type UsageSeriesStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlibabaRegion ¶ added in v0.17.0
type AlibabaRegion struct {
// Region ID.
ID int64 `json:"id"`
// Region code.
Code string `json:"code"`
// Region name.
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Code respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (AlibabaRegion) RawJSON ¶ added in v0.17.0
func (r AlibabaRegion) RawJSON() string
Returns the unmodified JSON received from the API
func (*AlibabaRegion) UnmarshalJSON ¶ added in v0.17.0
func (r *AlibabaRegion) UnmarshalJSON(data []byte) error
type AlibabaRegions ¶ added in v0.17.0
type AlibabaRegions []AlibabaRegion
type AuditLogListParams ¶
type AuditLogListParams struct {
// Client ID.
ClientID param.Opt[int64] `query:"client_id,omitzero" json:"-"`
// Maximum number of items in response.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// End of the requested time period (ISO 8601/RFC 3339 format, UTC.)
//
// You can specify a date with a time separated by a space, or just a date.
//
// Examples:
//
// - &`max_requested_at`=2021-05-05 12:00:00
// - &`max_requested_at`=2021-05-05
MaxRequestedAt param.Opt[string] `query:"max_requested_at,omitzero" json:"-"`
// HTTP method type of requests.
//
// Use upper case only.
//
// Example:
//
// - ?method=DELETE
Method param.Opt[string] `query:"method,omitzero" json:"-"`
// Beginning of the requested time period (ISO 8601/RFC 3339 format, UTC.)
//
// You can specify a date with a time separated by a space, or just a date.
//
// Examples:
//
// - &`min_requested_at`=2021-05-05 12:00:00
// - &`min_requested_at`=2021-05-05
MinRequestedAt param.Opt[string] `query:"min_requested_at,omitzero" json:"-"`
// Offset relative to the beginning of activity logs.
Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
// Exact URL path.
Path param.Opt[string] `query:"path,omitzero" json:"-"`
// Exact IP address from which requests are sent.
RemoteIPAddress param.Opt[string] `query:"remote_ip_address,omitzero" json:"-"`
// Status code returned in the response.
//
// Specify the first numbers of a status code to get requests for a group of status
// codes.
//
// To filter the activity logs by 4xx codes, use:
//
// - &`status_code`=4 -
StatusCode param.Opt[int64] `query:"status_code,omitzero" json:"-"`
// Permanent API token ID. Requests made with this token should be displayed.
TokenID param.Opt[int64] `query:"token_id,omitzero" json:"-"`
// User ID.
UserID param.Opt[int64] `query:"user_id,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (AuditLogListParams) URLQuery ¶
func (r AuditLogListParams) URLQuery() (v url.Values, err error)
URLQuery serializes AuditLogListParams's query parameters as `url.Values`.
type AuditLogService ¶
type AuditLogService struct {
Options []option.RequestOption
}
AuditLogService 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 NewAuditLogService method instead.
func NewAuditLogService ¶
func NewAuditLogService(opts ...option.RequestOption) (r AuditLogService)
NewAuditLogService 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 (*AuditLogService) Get ¶
func (r *AuditLogService) Get(ctx context.Context, logID int64, opts ...option.RequestOption) (res *CdnAuditLogEntry, err error)
Get information about CDN activity logs record.
func (*AuditLogService) List ¶
func (r *AuditLogService) List(ctx context.Context, query AuditLogListParams, opts ...option.RequestOption) (res *pagination.OffsetPage[CdnAuditLogEntry], err error)
Get information about all CDN activity logs records.
func (*AuditLogService) ListAutoPaging ¶
func (r *AuditLogService) ListAutoPaging(ctx context.Context, query AuditLogListParams, opts ...option.RequestOption) *pagination.OffsetPageAutoPager[CdnAuditLogEntry]
Get information about all CDN activity logs records.
type AwsRegion ¶ added in v0.17.0
type AwsRegion struct {
// Region ID.
ID int64 `json:"id"`
// Region code.
Code string `json:"code"`
// Region name.
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Code respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*AwsRegion) UnmarshalJSON ¶ added in v0.17.0
type AwsRegions ¶ added in v0.17.0
type AwsRegions []AwsRegion
type CaCertificate ¶
type CaCertificate struct {
// CA certificate ID.
ID int64 `json:"id"`
// Name of the certification center that issued the CA certificate.
CertIssuer string `json:"cert_issuer"`
// Alternative domain names that the CA certificate secures.
CertSubjectAlt string `json:"cert_subject_alt"`
// Domain name that the CA certificate secures.
CertSubjectCn string `json:"cert_subject_cn"`
// Defines whether the certificate has been deleted. Parameter is **deprecated**.
//
// Possible values:
//
// - **true** - Certificate has been deleted.
// - **false** - Certificate has not been deleted.
Deleted bool `json:"deleted"`
// Defines whether the CA certificate is used by a CDN resource.
//
// Possible values:
//
// - **true** - Certificate is used by a CDN resource.
// - **false** - Certificate is not used by a CDN resource.
HasRelatedResources bool `json:"hasRelatedResources"`
// CA certificate name.
Name string `json:"name"`
// Parameter is **deprecated**.
SslCertificateChain string `json:"sslCertificateChain"`
// Date when the CA certificate become untrusted (ISO 8601/RFC 3339 format, UTC.)
ValidityNotAfter string `json:"validity_not_after"`
// Date when the CA certificate become valid (ISO 8601/RFC 3339 format, UTC.)
ValidityNotBefore string `json:"validity_not_before"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
CertIssuer respjson.Field
CertSubjectAlt respjson.Field
CertSubjectCn respjson.Field
Deleted respjson.Field
HasRelatedResources respjson.Field
Name respjson.Field
SslCertificateChain respjson.Field
ValidityNotAfter respjson.Field
ValidityNotBefore respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CaCertificate) RawJSON ¶
func (r CaCertificate) RawJSON() string
Returns the unmodified JSON received from the API
func (*CaCertificate) UnmarshalJSON ¶
func (r *CaCertificate) UnmarshalJSON(data []byte) error
type CaCertificateList ¶
type CaCertificateList []CaCertificate
type CdnAccount ¶
type CdnAccount struct {
// Account ID.
ID int64 `json:"id"`
// Defines whether resources will be deactivated automatically by inactivity.
//
// Possible values:
//
// - **true** - Resources will be deactivated.
// - **false** - Resources will not be deactivated.
AutoSuspendEnabled bool `json:"auto_suspend_enabled"`
// Limit on the number of rules for each CDN resource.
CdnResourcesRulesMaxCount int64 `json:"cdn_resources_rules_max_count"`
// Domain zone to which a CNAME record of your CDN resources should be pointed.
Cname string `json:"cname"`
// Date of the first synchronization with the Platform (ISO 8601/RFC 3339 format,
// UTC.)
Created string `json:"created"`
// Information about the CDN service status.
Service CdnAccountService `json:"service"`
// Date of the last update of information about CDN service (ISO 8601/RFC 3339
// format, UTC.)
Updated string `json:"updated"`
// Defines whether custom balancing is used for content delivery.
//
// Possible values:
//
// - **true** - Custom balancing is used for content delivery.
// - **false** - Custom balancing is not used for content delivery.
UseBalancer bool `json:"use_balancer"`
// CDN traffic usage limit in gigabytes.
//
// When the limit is reached, we will send an email notification.
UtilizationLevel int64 `json:"utilization_level"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AutoSuspendEnabled respjson.Field
CdnResourcesRulesMaxCount respjson.Field
Cname respjson.Field
Created respjson.Field
Service respjson.Field
Updated respjson.Field
UseBalancer respjson.Field
UtilizationLevel respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CdnAccount) RawJSON ¶
func (r CdnAccount) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnAccount) UnmarshalJSON ¶
func (r *CdnAccount) UnmarshalJSON(data []byte) error
type CdnAccountLimits ¶
type CdnAccountLimits struct {
// Account ID.
ID int64 `json:"id"`
// Maximum number of origins that can be added to the origin group on your tariff
// plan.
OriginsInGroupLimit int64 `json:"origins_in_group_limit"`
// Maximum number of CDN resources that can be created on your tariff plan.
ResourcesLimit int64 `json:"resources_limit"`
// Maximum number of rules that can be created per CDN resource on your tariff
// plan.
RulesLimit int64 `json:"rules_limit"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
OriginsInGroupLimit respjson.Field
ResourcesLimit respjson.Field
RulesLimit respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CdnAccountLimits) RawJSON ¶
func (r CdnAccountLimits) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnAccountLimits) UnmarshalJSON ¶
func (r *CdnAccountLimits) UnmarshalJSON(data []byte) error
type CdnAccountService ¶
type CdnAccountService struct {
// Defines whether the CDN service is activated.
//
// Possible values:
//
// - **true** - Service is activated.
// - **false** - Service is not activated.
Enabled bool `json:"enabled"`
// CDN service status.
//
// Possible values:
//
// - **new** - CDN service is not activated.
// - **trial** - Free trial is in progress.
// - **trialend** - Free trial has ended and CDN service is stopped. All CDN
// resources are suspended.
// - **activating** - CDN service is being activated. It can take up to 15 minutes.
// - **active** - CDN service is active.
// - **paused** - CDN service is stopped. All CDN resources are suspended.
// - **deleted** - CDN service is stopped. All CDN resources are deleted.
Status string `json:"status"`
// Date of the last CDN service status update (ISO 8601/RFC 3339 format, UTC.)
Updated string `json:"updated"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Status respjson.Field
Updated respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Information about the CDN service status.
func (CdnAccountService) RawJSON ¶
func (r CdnAccountService) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnAccountService) UnmarshalJSON ¶
func (r *CdnAccountService) UnmarshalJSON(data []byte) error
type CdnAuditLogEntry ¶
type CdnAuditLogEntry struct {
// Activity logs record ID.
ID int64 `json:"id"`
// State of a requested object before and after the request.
Actions []CdnAuditLogEntryAction `json:"actions"`
// ID of the client who made the request.
ClientID int64 `json:"client_id"`
// Request body.
Data any `json:"data"`
// Host from which the request was made.
Host string `json:"host"`
// Request HTTP method.
Method string `json:"method"`
// Request URL.
Path string `json:"path"`
// Request parameters.
QueryParams string `json:"query_params"`
// IP address from which the request was made.
RemoteIPAddress string `json:"remote_ip_address"`
// Date and time when the request was made.
RequestedAt string `json:"requested_at"`
// Status code that is returned in the response.
StatusCode int64 `json:"status_code"`
// Permanent API token ID with which the request was made.
TokenID int64 `json:"token_id"`
// ID of the user who made the request.
UserID int64 `json:"user_id"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Actions respjson.Field
ClientID respjson.Field
Data respjson.Field
Host respjson.Field
Method respjson.Field
Path respjson.Field
QueryParams respjson.Field
RemoteIPAddress respjson.Field
RequestedAt respjson.Field
StatusCode respjson.Field
TokenID respjson.Field
UserID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CdnAuditLogEntry) RawJSON ¶
func (r CdnAuditLogEntry) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnAuditLogEntry) UnmarshalJSON ¶
func (r *CdnAuditLogEntry) UnmarshalJSON(data []byte) error
type CdnAuditLogEntryAction ¶
type CdnAuditLogEntryAction struct {
// Type of change.
//
// Possible values:
//
// - **D** - Object is deleted.
// - **C** - Object is created.
// - **U** - Object is updated.
ActionType string `json:"action_type"`
// JSON representation of object after the request.
StateAfterRequest any `json:"state_after_request"`
// JSON representation of object before the request.
StateBeforeRequest any `json:"state_before_request"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ActionType respjson.Field
StateAfterRequest respjson.Field
StateBeforeRequest respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CdnAuditLogEntryAction) RawJSON ¶
func (r CdnAuditLogEntryAction) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnAuditLogEntryAction) UnmarshalJSON ¶
func (r *CdnAuditLogEntryAction) UnmarshalJSON(data []byte) error
type CdnAvailableFeatures ¶
type CdnAvailableFeatures struct {
// Account ID.
ID int64 `json:"id"`
// Free features available for your account.
FreeFeatures []CdnAvailableFeaturesFreeFeature `json:"free_features"`
// Paid features available for your account.
PaidFeatures []CdnAvailableFeaturesPaidFeature `json:"paid_features"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
FreeFeatures respjson.Field
PaidFeatures respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CdnAvailableFeatures) RawJSON ¶
func (r CdnAvailableFeatures) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnAvailableFeatures) UnmarshalJSON ¶
func (r *CdnAvailableFeatures) UnmarshalJSON(data []byte) error
type CdnAvailableFeaturesFreeFeature ¶
type CdnAvailableFeaturesFreeFeature struct {
// Date and time when the feature was activated (ISO 8601/RFC 3339 format, UTC.)
CreateDate string `json:"create_date"`
// Feature ID.
FeatureID int64 `json:"feature_id"`
// Internal feature activation ID.
FreeFeatureID int64 `json:"free_feature_id"`
// Feature name.
Name string `json:"name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreateDate respjson.Field
FeatureID respjson.Field
FreeFeatureID respjson.Field
Name respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CdnAvailableFeaturesFreeFeature) RawJSON ¶
func (r CdnAvailableFeaturesFreeFeature) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnAvailableFeaturesFreeFeature) UnmarshalJSON ¶
func (r *CdnAvailableFeaturesFreeFeature) UnmarshalJSON(data []byte) error
type CdnAvailableFeaturesPaidFeature ¶
type CdnAvailableFeaturesPaidFeature struct {
// Date and time when the feature was activated (ISO 8601/RFC 3339 format, UTC.)
CreateDate string `json:"create_date"`
// Feature ID.
FeatureID int64 `json:"feature_id"`
// Feature name.
Name string `json:"name"`
// Internal feature activation ID.
PaidFeatureID int64 `json:"paid_feature_id"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CreateDate respjson.Field
FeatureID respjson.Field
Name respjson.Field
PaidFeatureID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CdnAvailableFeaturesPaidFeature) RawJSON ¶
func (r CdnAvailableFeaturesPaidFeature) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnAvailableFeaturesPaidFeature) UnmarshalJSON ¶
func (r *CdnAvailableFeaturesPaidFeature) UnmarshalJSON(data []byte) error
type CdnListPurgeStatusesParams ¶
type CdnListPurgeStatusesParams struct {
// Purges associated with a specific resource CNAME.
//
// Example:
//
// - &cname=example.com
Cname param.Opt[string] `query:"cname,omitzero" json:"-"`
// Start date and time of the requested time period (ISO 8601/RFC 3339 format,
// UTC.)
//
// Examples:
//
// - &`from_created`=2021-06-14T00:00:00Z
// - &`from_created`=2021-06-14T00:00:00.000Z
FromCreated param.Opt[string] `query:"from_created,omitzero" json:"-"`
// Maximum number of purges in the response.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Number of purge requests in the response to skip starting from the beginning of
// the requested period.
Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
// Purge requests with a certain purge type.
//
// Possible values:
//
// - **`purge_by_pattern`** - Purge by Pattern.
// - **`purge_by_url`** - Purge by URL.
// - **`purge_all`** - Purge All.
PurgeType param.Opt[string] `query:"purge_type,omitzero" json:"-"`
// Purge with a certain status.
//
// Possible values:
//
// - **In progress**
// - **Successful**
// - **Failed**
// - **Status report disabled**
Status param.Opt[string] `query:"status,omitzero" json:"-"`
// End date and time of the requested time period (ISO 8601/RFC 3339 format, UTC.)
//
// Examples:
//
// - &`to_created`=2021-06-15T00:00:00Z
// - &`to_created`=2021-06-15T00:00:00.000Z
ToCreated param.Opt[string] `query:"to_created,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (CdnListPurgeStatusesParams) URLQuery ¶
func (r CdnListPurgeStatusesParams) URLQuery() (v url.Values, err error)
URLQuery serializes CdnListPurgeStatusesParams's query parameters as `url.Values`.
type CdnLogEntry ¶
type CdnLogEntry struct {
// Contains requested logs.
Data []CdnLogEntryData `json:"data"`
// Contains meta-information.
Meta CdnLogEntryMeta `json:"meta"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
Meta respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CdnLogEntry) RawJSON ¶
func (r CdnLogEntry) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnLogEntry) UnmarshalJSON ¶
func (r *CdnLogEntry) UnmarshalJSON(data []byte) error
type CdnLogEntryData ¶
type CdnLogEntryData struct {
// Cache status: HIT, MISS, etc.
CacheStatus string `json:"cache_status"`
// IP address from that the request was received.
ClientIP string `json:"client_ip"`
// CDN resource custom domain.
Cname string `json:"cname"`
// Data center where the request was processed.
Datacenter string `json:"datacenter"`
// HTTP method used in the request.
Method string `json:"method"`
// Path requested.
Path string `json:"path"`
// Value of 'Referer' header.
Referer string `json:"referer"`
// CDN resource ID.
ResourceID int64 `json:"resource_id"`
// Value of the Content-Type HTTP header, indicating the MIME type of the resource
// being transmitted.
SentHTTPContentType string `json:"sent_http_content_type"`
// Response size in bytes.
Size int64 `json:"size"`
// HTTP status code.
Status int64 `json:"status"`
// Time required to transmit a complete TCP segment: from the first bit to the
// last.
TcpinfoRtt int64 `json:"tcpinfo_rtt"`
// Log timestamp.
Timestamp int64 `json:"timestamp"`
// Value of 'User-Agent' header.
UserAgent string `json:"user_agent"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CacheStatus respjson.Field
ClientIP respjson.Field
Cname respjson.Field
Datacenter respjson.Field
Method respjson.Field
Path respjson.Field
Referer respjson.Field
ResourceID respjson.Field
SentHTTPContentType respjson.Field
Size respjson.Field
Status respjson.Field
TcpinfoRtt respjson.Field
Timestamp respjson.Field
UserAgent respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CdnLogEntryData) RawJSON ¶
func (r CdnLogEntryData) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnLogEntryData) UnmarshalJSON ¶
func (r *CdnLogEntryData) UnmarshalJSON(data []byte) error
type CdnLogEntryMeta ¶
type CdnLogEntryMeta struct {
// Total number of records which match given parameters.
Count int64 `json:"count"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Count respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Contains meta-information.
func (CdnLogEntryMeta) RawJSON ¶
func (r CdnLogEntryMeta) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnLogEntryMeta) UnmarshalJSON ¶
func (r *CdnLogEntryMeta) UnmarshalJSON(data []byte) error
type CdnMetrics ¶
type CdnMetrics struct {
// If no grouping was requested then "data" holds an array of metric values. If at
// least one field is specified in "group_by" then "data" is an object whose
// properties are groups, which may include other groups; the last group will hold
// array of metrics values.
Data CdnMetricsDataUnion `json:"data"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Data respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CdnMetrics) RawJSON ¶
func (r CdnMetrics) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnMetrics) UnmarshalJSON ¶
func (r *CdnMetrics) UnmarshalJSON(data []byte) error
type CdnMetricsDataUnion ¶
type CdnMetricsDataUnion struct {
// This field will be present if the value is a [CdnMetricsValues] instead of an
// object.
OfCdnMetricsValues CdnMetricsValues `json:",inline"`
// This field is from variant [CdnMetricsGroups].
Group CdnMetricsValues `json:"group"`
JSON struct {
OfCdnMetricsValues respjson.Field
Group respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
CdnMetricsDataUnion contains all possible properties and values from CdnMetricsValues, CdnMetricsGroups.
Use the methods beginning with 'As' to cast the union to one of its variants.
If the underlying value is not a json object, one of the following properties will be valid: OfCdnMetricsValues]
func (CdnMetricsDataUnion) AsCdnMetricsGroups ¶
func (u CdnMetricsDataUnion) AsCdnMetricsGroups() (v CdnMetricsGroups)
func (CdnMetricsDataUnion) AsCdnMetricsValues ¶
func (u CdnMetricsDataUnion) AsCdnMetricsValues() (v CdnMetricsValues)
func (CdnMetricsDataUnion) RawJSON ¶
func (u CdnMetricsDataUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnMetricsDataUnion) UnmarshalJSON ¶
func (r *CdnMetricsDataUnion) UnmarshalJSON(data []byte) error
type CdnMetricsGroups ¶
type CdnMetricsGroups struct {
// List of requested metrics sorted by timestamp in ascending order.
Group CdnMetricsValues `json:"group"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Group respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CdnMetricsGroups) RawJSON ¶
func (r CdnMetricsGroups) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnMetricsGroups) UnmarshalJSON ¶
func (r *CdnMetricsGroups) UnmarshalJSON(data []byte) error
type CdnMetricsValue ¶
type CdnMetricsValue struct {
// Metrics value.
Metric float64 `json:"metric"`
// Start timestamp of interval.
Timestamp int64 `json:"timestamp"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Metric respjson.Field
Timestamp respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CdnMetricsValue) RawJSON ¶
func (r CdnMetricsValue) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnMetricsValue) UnmarshalJSON ¶
func (r *CdnMetricsValue) UnmarshalJSON(data []byte) error
type CdnMetricsValues ¶
type CdnMetricsValues []CdnMetricsValue
type CdnResource ¶
type CdnResource struct {
// CDN resource ID.
ID int64 `json:"id"`
// Enables or disables a CDN resource.
//
// Possible values:
//
// - **true** - CDN resource is active. Content is being delivered.
// - **false** - CDN resource is deactivated. Content is not being delivered.
Active bool `json:"active"`
// Defines whether the CDN resource can be used for purge by URLs feature.
//
// It's available only in case the CDN resource has enabled `ignore_vary_header`
// option.
CanPurgeByURLs bool `json:"can_purge_by_urls"`
// ID of an account to which the CDN resource belongs.
Client int64 `json:"client"`
// Delivery domains that will be used for content delivery through a CDN.
//
// Delivery domains should be added to your DNS settings.
Cname string `json:"cname"`
// Date of CDN resource creation.
Created string `json:"created"`
// Defines whether CDN resource has been deleted.
//
// Possible values:
//
// - **true** - CDN resource is deleted.
// - **false** - CDN resource is not deleted.
Deleted bool `json:"deleted"`
// Optional comment describing the CDN resource.
Description string `json:"description"`
// Enables or disables a CDN resource change by a user.
//
// Possible values:
//
// - **true** - CDN resource is enabled and can be changed. Content can be
// delivered.
// - **false** - CDN resource is disabled and cannot be changed. Content can not be
// delivered.
Enabled bool `json:"enabled"`
// Defines whether the CDN resource has a custom configuration.
//
// Possible values:
//
// - **true** - CDN resource has a custom configuration. You cannot change resource
// settings, except for the SSL certificate. To change other settings, contact
// technical support.
// - **false** - CDN resource has a regular configuration. You can change CDN
// resource settings.
FullCustomEnabled bool `json:"full_custom_enabled"`
// Defines whether a CDN resource has a cache zone shared with other CDN resources.
//
// Possible values:
//
// - **true** - CDN resource is main and has a shared caching zone with other CDN
// resources, which are called reserve.
// - **false** - CDN resource is reserve and it has a shared caching zone with the
// main CDN resource. You cannot change some options, create rules, set up origin
// shielding and use the reserve resource for Streaming.
// - **null** - CDN resource does not have a shared cache zone.
//
// The main CDN resource is specified in the `primary_resource` field. It cannot be
// suspended unless all related reserve CDN resources are suspended.
IsPrimary bool `json:"is_primary,nullable"`
// CDN resource name.
Name string `json:"name,nullable"`
// List of options that can be configured for the CDN resource.
//
// In case of `null` value the option is not added to the CDN resource. Option may
// inherit its value from the global account settings.
Options CdnResourceOptions `json:"options"`
// Origin group ID with which the CDN resource is associated.
//
// You can use either the `origin` or `originGroup` parameter in the request.
OriginGroup int64 `json:"originGroup"`
// Origin group name.
OriginGroupName string `json:"originGroup_name"`
// Protocol used by CDN servers to request content from an origin source.
//
// Possible values:
//
// - **HTTPS** - CDN servers will connect to the origin via HTTPS.
// - **HTTP** - CDN servers will connect to the origin via HTTP.
// - **MATCH** - connection protocol will be chosen automatically (content on the
// origin source should be available for the CDN both through HTTP and HTTPS).
//
// If protocol is not specified, HTTP is used to connect to an origin server.
//
// Any of "HTTP", "HTTPS", "MATCH".
OriginProtocol CdnResourceOriginProtocol `json:"originProtocol"`
// Defines whether the CDN resource has a preset applied.
//
// Possible values:
//
// - **true** - CDN resource has a preset applied. CDN resource options included in
// the preset cannot be edited.
// - **false** - CDN resource does not have a preset applied.
PresetApplied bool `json:"preset_applied"`
// ID of the main CDN resource which has a shared caching zone with a reserve CDN
// resource.
//
// If the parameter is not empty, then the current CDN resource is the reserve. You
// cannot change some options, create rules, set up origin shielding, or use the
// reserve CDN resource for Streaming.
PrimaryResource int64 `json:"primary_resource,nullable"`
// ID of the trusted CA certificate used to verify an origin.
//
// It can be used only with `"proxy_ssl_enabled": true`.
ProxySslCa int64 `json:"proxy_ssl_ca,nullable"`
// ID of the SSL certificate used to verify an origin.
//
// It can be used only with `"proxy_ssl_enabled": true`.
ProxySslData int64 `json:"proxy_ssl_data,nullable"`
// Enables or disables SSL certificate validation of the origin server before
// completing any connection.
//
// Possible values:
//
// - **true** - Origin SSL certificate validation is enabled.
// - **false** - Origin SSL certificate validation is disabled.
ProxySslEnabled bool `json:"proxy_ssl_enabled"`
// Rules configured for the CDN resource.
Rules []any `json:"rules"`
// Additional delivery domains (CNAMEs) that will be used to deliver content via
// the CDN.
//
// Up to ten additional CNAMEs are possible.
SecondaryHostnames []string `json:"secondaryHostnames" format:"domain"`
// Name of the origin shielding location data center.
//
// Parameter returns **null** if origin shielding is disabled.
ShieldDc string `json:"shield_dc,nullable"`
// Defines whether origin shield is active and working for the CDN resource.
//
// Possible values:
//
// - **true** - Origin shield is active.
// - **false** - Origin shield is not active.
ShieldEnabled bool `json:"shield_enabled"`
// Defines whether the origin shield with a dynamic location is enabled for the CDN
// resource.
//
// To manage origin shielding, you must contact customer support.
ShieldRoutingMap int64 `json:"shield_routing_map,nullable"`
// Defines whether origin shielding feature is enabled for the resource.
//
// Possible values:
//
// - **true** - Origin shielding is enabled.
// - **false** - Origin shielding is disabled.
Shielded bool `json:"shielded"`
// ID of the SSL certificate linked to the CDN resource.
//
// Can be used only with `"sslEnabled": true`.
SslData int64 `json:"sslData,nullable"`
// Defines whether the HTTPS protocol enabled for content delivery.
//
// Possible values:
//
// - **true** - HTTPS is enabled.
// - **false** - HTTPS is disabled.
SslEnabled bool `json:"sslEnabled"`
// CDN resource status.
//
// Possible values:
//
// - **active** - CDN resource is active. Content is available to users.
// - **suspended** - CDN resource is suspended. Content is not available to users.
// - **processed** - CDN resource has recently been created and is currently being
// processed. It will take about fifteen minutes to propagate it to all
// locations.
// - **deleted** - CDN resource is deleted.
//
// Any of "active", "suspended", "processed", "deleted".
Status CdnResourceStatus `json:"status"`
// Date when the CDN resource was suspended automatically if there is no traffic on
// it for 90 days.
//
// Not specified if the resource was not stopped due to lack of traffic.
SuspendDate string `json:"suspend_date,nullable"`
// Defines whether the CDN resource has been automatically suspended because there
// was no traffic on it for 90 days.
//
// Possible values:
//
// - **true** - CDN resource is currently automatically suspended.
// - **false** - CDN resource is not automatically suspended.
//
// You can enable CDN resource using the `active` field. If there is no traffic on
// the CDN resource within seven days following activation, it will be suspended
// again.
//
// To avoid CDN resource suspension due to no traffic, contact technical support.
Suspended bool `json:"suspended"`
// Date of the last CDN resource update.
Updated string `json:"updated"`
// Defines whether the CDN resource is integrated with the Streaming Platform.
//
// Possible values:
//
// - **true** - CDN resource is configured for Streaming Platform. Changing
// resource settings can affect its operation.
// - **false** - CDN resource is not configured for Streaming Platform.
VpEnabled bool `json:"vp_enabled"`
// The ID of the associated WAAP domain.
WaapDomainID string `json:"waap_domain_id,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Active respjson.Field
CanPurgeByURLs respjson.Field
Client respjson.Field
Cname respjson.Field
Created respjson.Field
Deleted respjson.Field
Description respjson.Field
Enabled respjson.Field
FullCustomEnabled respjson.Field
IsPrimary respjson.Field
Name respjson.Field
Options respjson.Field
OriginGroup respjson.Field
OriginGroupName respjson.Field
OriginProtocol respjson.Field
PresetApplied respjson.Field
PrimaryResource respjson.Field
ProxySslCa respjson.Field
ProxySslData respjson.Field
ProxySslEnabled respjson.Field
Rules respjson.Field
SecondaryHostnames respjson.Field
ShieldDc respjson.Field
ShieldEnabled respjson.Field
ShieldRoutingMap respjson.Field
Shielded respjson.Field
SslData respjson.Field
SslEnabled respjson.Field
Status respjson.Field
SuspendDate respjson.Field
Suspended respjson.Field
Updated respjson.Field
VpEnabled respjson.Field
WaapDomainID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CdnResource) RawJSON ¶
func (r CdnResource) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResource) UnmarshalJSON ¶
func (r *CdnResource) UnmarshalJSON(data []byte) error
type CdnResourceList ¶
type CdnResourceList []CdnResource
type CdnResourceOptions ¶
type CdnResourceOptions struct {
// HTTP methods allowed for content requests from the CDN.
AllowedHTTPMethods CdnResourceOptionsAllowedHTTPMethods `json:"allowedHttpMethods,nullable"`
// Allows to prevent online services from overloading and ensure your business
// workflow running smoothly.
BotProtection CdnResourceOptionsBotProtection `json:"bot_protection,nullable"`
// Compresses content with Brotli on the CDN side. CDN servers will request only
// uncompressed content from the origin.
//
// Notes:
//
// 1. CDN only supports "Brotli compression" when the "origin shielding" feature is
// activated.
// 2. If a precache server is not active for a CDN resource, no compression occurs,
// even if the option is enabled.
// 3. `brotli_compression` is not supported with `fetch_compressed` or `slice`
// options enabled.
// 4. `fetch_compressed` option in CDN resource settings overrides
// `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN
// resource and want to enable `brotli_compression` in a rule, you must specify
// `fetch_compressed:false` in the rule.
BrotliCompression CdnResourceOptionsBrotliCompression `json:"brotli_compression,nullable"`
// Cache expiration time for users browsers in seconds.
//
// Cache expiration time is applied to the following response codes: 200, 201, 204,
// 206, 301, 302, 303, 304, 307, 308.
//
// Responses with other codes will not be cached.
BrowserCacheSettings CdnResourceOptionsBrowserCacheSettings `json:"browser_cache_settings,nullable"`
// **Legacy option**. Use the `response_headers_hiding_policy` option instead.
//
// HTTP Headers that must be included in the response.
//
// Deprecated: deprecated
CacheHTTPHeaders CdnResourceOptionsCacheHTTPHeaders `json:"cache_http_headers,nullable"`
// Enables or disables CORS (Cross-Origin Resource Sharing) header support.
//
// CORS header support allows the CDN to add the Access-Control-Allow-Origin header
// to a response to a browser.
Cors CdnResourceOptionsCors `json:"cors,nullable"`
// Enables control access to content for specified countries.
CountryACL CdnResourceOptionsCountryACL `json:"country_acl,nullable"`
// **Legacy option**. Use the `edge_cache_settings` option instead.
//
// Allows the complete disabling of content caching.
//
// Deprecated: deprecated
DisableCache CdnResourceOptionsDisableCache `json:"disable_cache,nullable"`
// Allows 206 responses regardless of the settings of an origin source.
DisableProxyForceRanges CdnResourceOptionsDisableProxyForceRanges `json:"disable_proxy_force_ranges,nullable"`
// Cache expiration time for CDN servers.
//
// `value` and `default` fields cannot be used simultaneously.
EdgeCacheSettings CdnResourceOptionsEdgeCacheSettings `json:"edge_cache_settings,nullable"`
// Allows to configure FastEdge app to be called on different request/response
// phases.
//
// Note: At least one of `on_request_headers`, `on_request_body`,
// `on_response_headers`, or `on_response_body` must be specified.
Fastedge CdnResourceOptionsFastedge `json:"fastedge,nullable"`
// Makes the CDN request compressed content from the origin.
//
// The origin server should support compression. CDN servers will not decompress
// your content even if a user browser does not accept compression.
//
// Notes:
//
// 1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or
// `slice` options enabled.
// 2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If
// you enable it in CDN resource and want to use `gzipON` and
// `brotli_compression` in a rule, you have to specify
// `"fetch_compressed": false` in the rule.
FetchCompressed CdnResourceOptionsFetchCompressed `json:"fetch_compressed,nullable"`
// Enables redirection from origin. If the origin server returns a redirect, the
// option allows the CDN to pull the requested content from the origin server that
// was returned in the redirect.
FollowOriginRedirect CdnResourceOptionsFollowOriginRedirect `json:"follow_origin_redirect,nullable"`
// Applies custom HTTP response codes for CDN content.
//
// The following codes are reserved by our system and cannot be specified in this
// option: 408, 444, 477, 494, 495, 496, 497, 499.
ForceReturn CdnResourceOptionsForceReturn `json:"force_return,nullable"`
// Forwards the Host header from a end-user request to an origin server.
//
// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
ForwardHostHeader CdnResourceOptionsForwardHostHeader `json:"forward_host_header,nullable"`
// Compresses content with gzip on the CDN end. CDN servers will request only
// uncompressed content from the origin.
//
// Notes:
//
// 1. Compression with gzip is not supported with `fetch_compressed` or `slice`
// options enabled.
// 2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in
// rules. If you enable `fetch_compressed` in CDN resource and want to enable
// `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
GzipOn CdnResourceOptionsGzipOn `json:"gzipOn,nullable"`
// Sets the Host header that CDN servers use when request content from an origin
// server. Your server must be able to process requests with the chosen header.
//
// If the option is `null`, the Host Header value is equal to first CNAME.
//
// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
HostHeader CdnResourceOptionsHostHeader `json:"hostHeader,nullable"`
// Enables HTTP/3 protocol for content delivery.
//
// `http3_enabled` option works only with `"sslEnabled": true`.
Http3Enabled CdnResourceOptionsHttp3Enabled `json:"http3_enabled,nullable"`
// Defines whether the files with the Set-Cookies header are cached as one file or
// as different ones.
IgnoreCookie CdnResourceOptionsIgnoreCookie `json:"ignore_cookie,nullable"`
// How a file with different query strings is cached: either as one object (option
// is enabled) or as different objects (option is disabled.)
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
IgnoreQueryString CdnResourceOptionsIgnoreQueryString `json:"ignoreQueryString,nullable"`
// Transforms JPG and PNG images (for example, resize or crop) and automatically
// converts them to WebP or AVIF format.
ImageStack CdnResourceOptionsImageStack `json:"image_stack,nullable"`
// Controls access to the CDN resource content for specific IP addresses.
//
// If you want to use IPs from our CDN servers IP list for IP ACL configuration,
// you have to independently monitor their relevance. We recommend you use a script
// for automatically update IP ACL.
// [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
IPAddressACL CdnResourceOptionsIPAddressACL `json:"ip_address_acl,nullable"`
// Allows to control the download speed per connection.
LimitBandwidth CdnResourceOptionsLimitBandwidth `json:"limit_bandwidth,nullable"`
// Allows you to modify your cache key. If omitted, the default value is
// `$request_uri`.
//
// Combine the specified variables to create a key for caching.
//
// - **$`request_uri`**
// - **$scheme**
// - **$uri**
//
// **Warning**: Enabling and changing this option can invalidate your current cache
// and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will
// not work.
ProxyCacheKey CdnResourceOptionsProxyCacheKey `json:"proxy_cache_key,nullable"`
// Caching for POST requests along with default GET and HEAD.
ProxyCacheMethodsSet CdnResourceOptionsProxyCacheMethodsSet `json:"proxy_cache_methods_set,nullable"`
// The time limit for establishing a connection with the origin.
ProxyConnectTimeout CdnResourceOptionsProxyConnectTimeout `json:"proxy_connect_timeout,nullable"`
// The time limit for receiving a partial response from the origin. If no response
// is received within this time, the connection will be closed.
//
// **Note:** When used with a WebSocket connection, this option supports values
// only in the range 1–20 seconds (instead of the usual 1–30 seconds).
ProxyReadTimeout CdnResourceOptionsProxyReadTimeout `json:"proxy_read_timeout,nullable"`
// Files with the specified query parameters are cached as one object, files with
// other parameters are cached as different objects.
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
QueryParamsBlacklist CdnResourceOptionsQueryParamsBlacklist `json:"query_params_blacklist,nullable"`
// Files with the specified query parameters are cached as different objects, files
// with other parameters are cached as one object.
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
QueryParamsWhitelist CdnResourceOptionsQueryParamsWhitelist `json:"query_params_whitelist,nullable"`
// The Query String Forwarding feature allows for the seamless transfer of
// parameters embedded in playlist files to the corresponding media chunk files.
// This functionality ensures that specific attributes, such as authentication
// tokens or tracking information, are consistently passed along from the playlist
// manifest to the individual media segments. This is particularly useful for
// maintaining continuity in security, analytics, and any other parameter-based
// operations across the entire media delivery workflow.
QueryStringForwarding CdnResourceOptionsQueryStringForwarding `json:"query_string_forwarding,nullable"`
// Enables redirect from HTTP to HTTPS.
//
// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
// simultaneously.
RedirectHTTPToHTTPS CdnResourceOptionsRedirectHTTPToHTTPS `json:"redirect_http_to_https,nullable"`
// Enables redirect from HTTPS to HTTP.
//
// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
// simultaneously.
RedirectHTTPSToHTTP CdnResourceOptionsRedirectHTTPSToHTTP `json:"redirect_https_to_http,nullable"`
// Controls access to the CDN resource content for specified domain names.
ReferrerACL CdnResourceOptionsReferrerACL `json:"referrer_acl,nullable"`
// Option allows to limit the amount of HTTP requests.
RequestLimiter CdnResourceOptionsRequestLimiter `json:"request_limiter,nullable"`
// Hides HTTP headers from an origin server in the CDN response.
ResponseHeadersHidingPolicy CdnResourceOptionsResponseHeadersHidingPolicy `json:"response_headers_hiding_policy,nullable"`
// Changes and redirects requests from the CDN to the origin. It operates according
// to the
// [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite)
// configuration.
Rewrite CdnResourceOptionsRewrite `json:"rewrite,nullable"`
// Configures access with tokenized URLs. This makes impossible to access content
// without a valid (unexpired) token.
SecureKey CdnResourceOptionsSecureKey `json:"secure_key,nullable"`
// Requests and caches files larger than 10 MB in parts (no larger than 10 MB per
// part.) This reduces time to first byte.
//
// The option is based on the
// [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
//
// Notes:
//
// 1. Origin must support HTTP Range requests.
// 2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed`
// options enabled.
Slice CdnResourceOptionsSlice `json:"slice,nullable"`
// The hostname that is added to SNI requests from CDN servers to the origin server
// via HTTPS.
//
// SNI is generally only required if your origin uses shared hosting or does not
// have a dedicated IP address. If the origin server presents multiple
// certificates, SNI allows the origin server to know which certificate to use for
// the connection.
//
// The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
Sni CdnResourceOptionsSni `json:"sni,nullable"`
// Serves stale cached content in case of origin unavailability.
Stale CdnResourceOptionsStale `json:"stale,nullable"`
// Custom HTTP Headers that a CDN server adds to a response.
StaticResponseHeaders CdnResourceOptionsStaticResponseHeaders `json:"static_response_headers,nullable"`
// **Legacy option**. Use the `static_response_headers` option instead.
//
// Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP
// Headers can be specified. May contain a header with multiple values.
//
// Deprecated: deprecated
StaticHeaders CdnResourceOptionsStaticHeaders `json:"staticHeaders,nullable"`
// Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP
// Headers can be specified.
StaticRequestHeaders CdnResourceOptionsStaticRequestHeaders `json:"staticRequestHeaders,nullable"`
// List of SSL/TLS protocol versions allowed for HTTPS connections from end users
// to the domain.
//
// When the option is disabled, all protocols versions are allowed.
TlsVersions CdnResourceOptionsTlsVersions `json:"tls_versions,nullable"`
// Let's Encrypt certificate chain.
//
// The specified chain will be used during the next Let's Encrypt certificate issue
// or renewal.
UseDefaultLeChain CdnResourceOptionsUseDefaultLeChain `json:"use_default_le_chain,nullable"`
// DNS-01 challenge to issue a Let's Encrypt certificate for the resource.
//
// DNS service should be activated to enable this option.
UseDns01LeChallenge CdnResourceOptionsUseDns01LeChallenge `json:"use_dns01_le_challenge,nullable"`
// RSA Let's Encrypt certificate type for the CDN resource.
//
// The specified value will be used during the next Let's Encrypt certificate issue
// or renewal.
UseRsaLeCert CdnResourceOptionsUseRsaLeCert `json:"use_rsa_le_cert,nullable"`
// Controls access to the content for specified User-Agents.
UserAgentACL CdnResourceOptionsUserAgentACL `json:"user_agent_acl,nullable"`
// Allows to enable WAAP (Web Application and API Protection).
Waap CdnResourceOptionsWaap `json:"waap,nullable"`
// Enables or disables WebSockets connections to an origin server.
Websockets CdnResourceOptionsWebsockets `json:"websockets,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AllowedHTTPMethods respjson.Field
BotProtection respjson.Field
BrotliCompression respjson.Field
BrowserCacheSettings respjson.Field
CacheHTTPHeaders respjson.Field
Cors respjson.Field
CountryACL respjson.Field
DisableCache respjson.Field
DisableProxyForceRanges respjson.Field
EdgeCacheSettings respjson.Field
Fastedge respjson.Field
FetchCompressed respjson.Field
FollowOriginRedirect respjson.Field
ForceReturn respjson.Field
ForwardHostHeader respjson.Field
GzipOn respjson.Field
HostHeader respjson.Field
Http3Enabled respjson.Field
IgnoreCookie respjson.Field
IgnoreQueryString respjson.Field
ImageStack respjson.Field
IPAddressACL respjson.Field
LimitBandwidth respjson.Field
ProxyCacheKey respjson.Field
ProxyCacheMethodsSet respjson.Field
ProxyConnectTimeout respjson.Field
ProxyReadTimeout respjson.Field
QueryParamsBlacklist respjson.Field
QueryParamsWhitelist respjson.Field
QueryStringForwarding respjson.Field
RedirectHTTPToHTTPS respjson.Field
RedirectHTTPSToHTTP respjson.Field
ReferrerACL respjson.Field
RequestLimiter respjson.Field
ResponseHeadersHidingPolicy respjson.Field
Rewrite respjson.Field
SecureKey respjson.Field
Slice respjson.Field
Sni respjson.Field
Stale respjson.Field
StaticResponseHeaders respjson.Field
StaticHeaders respjson.Field
StaticRequestHeaders respjson.Field
TlsVersions respjson.Field
UseDefaultLeChain respjson.Field
UseDns01LeChallenge respjson.Field
UseRsaLeCert respjson.Field
UserAgentACL respjson.Field
Waap respjson.Field
Websockets respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
List of options that can be configured for the CDN resource.
In case of `null` value the option is not added to the CDN resource. Option may inherit its value from the global account settings.
func (CdnResourceOptions) RawJSON ¶
func (r CdnResourceOptions) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptions) UnmarshalJSON ¶
func (r *CdnResourceOptions) UnmarshalJSON(data []byte) error
type CdnResourceOptionsAllowedHTTPMethods ¶
type CdnResourceOptionsAllowedHTTPMethods struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
Value []string `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
HTTP methods allowed for content requests from the CDN.
func (CdnResourceOptionsAllowedHTTPMethods) RawJSON ¶
func (r CdnResourceOptionsAllowedHTTPMethods) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsAllowedHTTPMethods) UnmarshalJSON ¶
func (r *CdnResourceOptionsAllowedHTTPMethods) UnmarshalJSON(data []byte) error
type CdnResourceOptionsBotProtection ¶
type CdnResourceOptionsBotProtection struct {
// Controls the bot challenge module state.
BotChallenge CdnResourceOptionsBotProtectionBotChallenge `json:"bot_challenge,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
BotChallenge respjson.Field
Enabled respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Allows to prevent online services from overloading and ensure your business workflow running smoothly.
func (CdnResourceOptionsBotProtection) RawJSON ¶
func (r CdnResourceOptionsBotProtection) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsBotProtection) UnmarshalJSON ¶
func (r *CdnResourceOptionsBotProtection) UnmarshalJSON(data []byte) error
type CdnResourceOptionsBotProtectionBotChallenge ¶
type CdnResourceOptionsBotProtectionBotChallenge struct {
// Possible values:
//
// - **true** - Bot challenge is enabled.
// - **false** - Bot challenge is disabled.
Enabled bool `json:"enabled"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Controls the bot challenge module state.
func (CdnResourceOptionsBotProtectionBotChallenge) RawJSON ¶
func (r CdnResourceOptionsBotProtectionBotChallenge) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsBotProtectionBotChallenge) UnmarshalJSON ¶
func (r *CdnResourceOptionsBotProtectionBotChallenge) UnmarshalJSON(data []byte) error
type CdnResourceOptionsBrotliCompression ¶
type CdnResourceOptionsBrotliCompression struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Allows to select the content types you want to compress.
//
// `text/html` is a mandatory content type.
//
// Any of "application/javascript", "application/json",
// "application/vnd.ms-fontobject", "application/wasm", "application/x-font-ttf",
// "application/x-javascript", "application/xml", "application/xml+rss",
// "image/svg+xml", "image/x-icon", "text/css", "text/html", "text/javascript",
// "text/plain", "text/xml".
Value []string `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Compresses content with Brotli on the CDN side. CDN servers will request only uncompressed content from the origin.
Notes:
- CDN only supports "Brotli compression" when the "origin shielding" feature is activated.
- If a precache server is not active for a CDN resource, no compression occurs, even if the option is enabled.
- `brotli_compression` is not supported with `fetch_compressed` or `slice` options enabled.
- `fetch_compressed` option in CDN resource settings overrides `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN resource and want to enable `brotli_compression` in a rule, you must specify `fetch_compressed:false` in the rule.
func (CdnResourceOptionsBrotliCompression) RawJSON ¶
func (r CdnResourceOptionsBrotliCompression) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsBrotliCompression) UnmarshalJSON ¶
func (r *CdnResourceOptionsBrotliCompression) UnmarshalJSON(data []byte) error
type CdnResourceOptionsBrowserCacheSettings ¶
type CdnResourceOptionsBrowserCacheSettings struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Set the cache expiration time to '0s' to disable caching.
//
// The maximum duration is any equivalent to `1y`.
Value string `json:"value,required" format:"nginx time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Cache expiration time for users browsers in seconds.
Cache expiration time is applied to the following response codes: 200, 201, 204, 206, 301, 302, 303, 304, 307, 308.
Responses with other codes will not be cached.
func (CdnResourceOptionsBrowserCacheSettings) RawJSON ¶
func (r CdnResourceOptionsBrowserCacheSettings) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsBrowserCacheSettings) UnmarshalJSON ¶
func (r *CdnResourceOptionsBrowserCacheSettings) UnmarshalJSON(data []byte) error
type CdnResourceOptionsCacheHTTPHeaders
deprecated
type CdnResourceOptionsCacheHTTPHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
Value []string `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
**Legacy option**. Use the `response_headers_hiding_policy` option instead.
HTTP Headers that must be included in the response.
Deprecated: deprecated
func (CdnResourceOptionsCacheHTTPHeaders) RawJSON ¶
func (r CdnResourceOptionsCacheHTTPHeaders) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsCacheHTTPHeaders) UnmarshalJSON ¶
func (r *CdnResourceOptionsCacheHTTPHeaders) UnmarshalJSON(data []byte) error
type CdnResourceOptionsCors ¶
type CdnResourceOptionsCors struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Value of the Access-Control-Allow-Origin header.
//
// Possible values:
//
// - **Adds \* as the Access-Control-Allow-Origin header value** - Content will be
// uploaded for requests from any domain. `"value": ["*"]`
// - **Adds "$http_origin" as the Access-Control-Allow-Origin header value if the
// origin matches one of the listed domains** - Content will be uploaded only for
// requests from the domains specified in the field.
// `"value": ["domain.com", "second.dom.com"]`
// - **Adds "$http_origin" as the Access-Control-Allow-Origin header value** -
// Content will be uploaded for requests from any domain, and the domain from
// which the request was sent will be added to the "Access-Control-Allow-Origin"
// header in the response. `"value": ["$http_origin"]`
Value []string `json:"value,required"`
// Defines whether the Access-Control-Allow-Origin header should be added to a
// response from CDN regardless of response code.
//
// Possible values:
//
// - **true** - Header will be added to a response regardless of response code.
// - **false** - Header will only be added to responses with codes: 200, 201, 204,
// 206, 301, 302, 303, 304, 307, 308.
Always bool `json:"always"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
Always respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Enables or disables CORS (Cross-Origin Resource Sharing) header support.
CORS header support allows the CDN to add the Access-Control-Allow-Origin header to a response to a browser.
func (CdnResourceOptionsCors) RawJSON ¶
func (r CdnResourceOptionsCors) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsCors) UnmarshalJSON ¶
func (r *CdnResourceOptionsCors) UnmarshalJSON(data []byte) error
type CdnResourceOptionsCountryACL ¶
type CdnResourceOptionsCountryACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of countries according to ISO-3166-1.
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of countries for which access is prohibited.
// - **deny** - List of countries for which access is allowed.
ExceptedValues []string `json:"excepted_values,required" format:"country-code"`
// Defines the type of CDN resource access policy.
//
// Possible values:
//
// - **allow** - Access is allowed for all the countries except for those specified
// in `excepted_values` field.
// - **deny** - Access is denied for all the countries except for those specified
// in `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
ExceptedValues respjson.Field
PolicyType respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Enables control access to content for specified countries.
func (CdnResourceOptionsCountryACL) RawJSON ¶
func (r CdnResourceOptionsCountryACL) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsCountryACL) UnmarshalJSON ¶
func (r *CdnResourceOptionsCountryACL) UnmarshalJSON(data []byte) error
type CdnResourceOptionsDisableCache
deprecated
type CdnResourceOptionsDisableCache struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - content caching is disabled.
// - **false** - content caching is enabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
**Legacy option**. Use the `edge_cache_settings` option instead.
Allows the complete disabling of content caching.
Deprecated: deprecated
func (CdnResourceOptionsDisableCache) RawJSON ¶
func (r CdnResourceOptionsDisableCache) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsDisableCache) UnmarshalJSON ¶
func (r *CdnResourceOptionsDisableCache) UnmarshalJSON(data []byte) error
type CdnResourceOptionsDisableProxyForceRanges ¶
type CdnResourceOptionsDisableProxyForceRanges struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Allows 206 responses regardless of the settings of an origin source.
func (CdnResourceOptionsDisableProxyForceRanges) RawJSON ¶
func (r CdnResourceOptionsDisableProxyForceRanges) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsDisableProxyForceRanges) UnmarshalJSON ¶
func (r *CdnResourceOptionsDisableProxyForceRanges) UnmarshalJSON(data []byte) error
type CdnResourceOptionsEdgeCacheSettings ¶
type CdnResourceOptionsEdgeCacheSettings struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// A MAP object representing the caching time in seconds for a response with a
// specific response code.
//
// These settings have a higher priority than the `value` field.
//
// - Use `any` key to specify caching time for all response codes.
// - Use `0s` value to disable caching for a specific response code.
CustomValues map[string]string `json:"custom_values" format:"nginx time"`
// Enables content caching according to the origin cache settings.
//
// The value is applied to the following response codes 200, 201, 204, 206, 301,
// 302, 303, 304, 307, 308, if an origin server does not have caching HTTP headers.
//
// Responses with other codes will not be cached.
//
// The maximum duration is any equivalent to `1y`.
Default string `json:"default" format:"nginx time"`
// Caching time.
//
// The value is applied to the following response codes: 200, 206, 301, 302.
// Responses with codes 4xx, 5xx will not be cached.
//
// Use `0s` to disable caching.
//
// The maximum duration is any equivalent to `1y`.
Value string `json:"value" format:"nginx time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
CustomValues respjson.Field
Default respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Cache expiration time for CDN servers.
`value` and `default` fields cannot be used simultaneously.
func (CdnResourceOptionsEdgeCacheSettings) RawJSON ¶
func (r CdnResourceOptionsEdgeCacheSettings) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsEdgeCacheSettings) UnmarshalJSON ¶
func (r *CdnResourceOptionsEdgeCacheSettings) UnmarshalJSON(data []byte) error
type CdnResourceOptionsFastedge ¶
type CdnResourceOptionsFastedge struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Allows to configure FastEdge application that will be called to handle request
// body as soon as CDN receives incoming HTTP request.
OnRequestBody CdnResourceOptionsFastedgeOnRequestBody `json:"on_request_body"`
// Allows to configure FastEdge application that will be called to handle request
// headers as soon as CDN receives incoming HTTP request.
OnRequestHeaders CdnResourceOptionsFastedgeOnRequestHeaders `json:"on_request_headers"`
// Allows to configure FastEdge application that will be called to handle response
// body before CDN sends the HTTP response.
OnResponseBody CdnResourceOptionsFastedgeOnResponseBody `json:"on_response_body"`
// Allows to configure FastEdge application that will be called to handle response
// headers before CDN sends the HTTP response.
OnResponseHeaders CdnResourceOptionsFastedgeOnResponseHeaders `json:"on_response_headers"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
OnRequestBody respjson.Field
OnRequestHeaders respjson.Field
OnResponseBody respjson.Field
OnResponseHeaders respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Allows to configure FastEdge app to be called on different request/response phases.
Note: At least one of `on_request_headers`, `on_request_body`, `on_response_headers`, or `on_response_body` must be specified.
func (CdnResourceOptionsFastedge) RawJSON ¶
func (r CdnResourceOptionsFastedge) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsFastedge) UnmarshalJSON ¶
func (r *CdnResourceOptionsFastedge) UnmarshalJSON(data []byte) error
type CdnResourceOptionsFastedgeOnRequestBody ¶
type CdnResourceOptionsFastedgeOnRequestBody struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled bool `json:"enabled"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge bool `json:"execute_on_edge"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield bool `json:"execute_on_shield"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError bool `json:"interrupt_on_error"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AppID respjson.Field
Enabled respjson.Field
ExecuteOnEdge respjson.Field
ExecuteOnShield respjson.Field
InterruptOnError respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Allows to configure FastEdge application that will be called to handle request body as soon as CDN receives incoming HTTP request.
func (CdnResourceOptionsFastedgeOnRequestBody) RawJSON ¶
func (r CdnResourceOptionsFastedgeOnRequestBody) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsFastedgeOnRequestBody) UnmarshalJSON ¶
func (r *CdnResourceOptionsFastedgeOnRequestBody) UnmarshalJSON(data []byte) error
type CdnResourceOptionsFastedgeOnRequestHeaders ¶
type CdnResourceOptionsFastedgeOnRequestHeaders struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled bool `json:"enabled"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge bool `json:"execute_on_edge"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield bool `json:"execute_on_shield"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError bool `json:"interrupt_on_error"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AppID respjson.Field
Enabled respjson.Field
ExecuteOnEdge respjson.Field
ExecuteOnShield respjson.Field
InterruptOnError respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request.
func (CdnResourceOptionsFastedgeOnRequestHeaders) RawJSON ¶
func (r CdnResourceOptionsFastedgeOnRequestHeaders) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsFastedgeOnRequestHeaders) UnmarshalJSON ¶
func (r *CdnResourceOptionsFastedgeOnRequestHeaders) UnmarshalJSON(data []byte) error
type CdnResourceOptionsFastedgeOnResponseBody ¶
type CdnResourceOptionsFastedgeOnResponseBody struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled bool `json:"enabled"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge bool `json:"execute_on_edge"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield bool `json:"execute_on_shield"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError bool `json:"interrupt_on_error"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AppID respjson.Field
Enabled respjson.Field
ExecuteOnEdge respjson.Field
ExecuteOnShield respjson.Field
InterruptOnError respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Allows to configure FastEdge application that will be called to handle response body before CDN sends the HTTP response.
func (CdnResourceOptionsFastedgeOnResponseBody) RawJSON ¶
func (r CdnResourceOptionsFastedgeOnResponseBody) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsFastedgeOnResponseBody) UnmarshalJSON ¶
func (r *CdnResourceOptionsFastedgeOnResponseBody) UnmarshalJSON(data []byte) error
type CdnResourceOptionsFastedgeOnResponseHeaders ¶
type CdnResourceOptionsFastedgeOnResponseHeaders struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled bool `json:"enabled"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge bool `json:"execute_on_edge"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield bool `json:"execute_on_shield"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError bool `json:"interrupt_on_error"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AppID respjson.Field
Enabled respjson.Field
ExecuteOnEdge respjson.Field
ExecuteOnShield respjson.Field
InterruptOnError respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Allows to configure FastEdge application that will be called to handle response headers before CDN sends the HTTP response.
func (CdnResourceOptionsFastedgeOnResponseHeaders) RawJSON ¶
func (r CdnResourceOptionsFastedgeOnResponseHeaders) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsFastedgeOnResponseHeaders) UnmarshalJSON ¶
func (r *CdnResourceOptionsFastedgeOnResponseHeaders) UnmarshalJSON(data []byte) error
type CdnResourceOptionsFetchCompressed ¶
type CdnResourceOptionsFetchCompressed struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Makes the CDN request compressed content from the origin.
The origin server should support compression. CDN servers will not decompress your content even if a user browser does not accept compression.
Notes:
- `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or `slice` options enabled.
- `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If you enable it in CDN resource and want to use `gzipON` and `brotli_compression` in a rule, you have to specify `"fetch_compressed": false` in the rule.
func (CdnResourceOptionsFetchCompressed) RawJSON ¶
func (r CdnResourceOptionsFetchCompressed) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsFetchCompressed) UnmarshalJSON ¶
func (r *CdnResourceOptionsFetchCompressed) UnmarshalJSON(data []byte) error
type CdnResourceOptionsFollowOriginRedirect ¶
type CdnResourceOptionsFollowOriginRedirect struct {
// Redirect status code that the origin server returns.
//
// To serve up to date content to end users, you will need to purge the cache after
// managing the option.
//
// Any of 301, 302, 303, 307, 308.
Codes []int64 `json:"codes,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Codes respjson.Field
Enabled respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Enables redirection from origin. If the origin server returns a redirect, the option allows the CDN to pull the requested content from the origin server that was returned in the redirect.
func (CdnResourceOptionsFollowOriginRedirect) RawJSON ¶
func (r CdnResourceOptionsFollowOriginRedirect) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsFollowOriginRedirect) UnmarshalJSON ¶
func (r *CdnResourceOptionsFollowOriginRedirect) UnmarshalJSON(data []byte) error
type CdnResourceOptionsForceReturn ¶
type CdnResourceOptionsForceReturn struct {
// URL for redirection or text.
Body string `json:"body,required"`
// Status code value.
Code int64 `json:"code,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Controls the time at which a custom HTTP response code should be applied. By
// default, a custom HTTP response code is applied at any time.
TimeInterval CdnResourceOptionsForceReturnTimeInterval `json:"time_interval,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Body respjson.Field
Code respjson.Field
Enabled respjson.Field
TimeInterval respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Applies custom HTTP response codes for CDN content.
The following codes are reserved by our system and cannot be specified in this option: 408, 444, 477, 494, 495, 496, 497, 499.
func (CdnResourceOptionsForceReturn) RawJSON ¶
func (r CdnResourceOptionsForceReturn) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsForceReturn) UnmarshalJSON ¶
func (r *CdnResourceOptionsForceReturn) UnmarshalJSON(data []byte) error
type CdnResourceOptionsForceReturnTimeInterval ¶
type CdnResourceOptionsForceReturnTimeInterval struct {
// Time until which a custom HTTP response code should be applied. Indicated in
// 24-hour format.
EndTime string `json:"end_time,required"`
// Time from which a custom HTTP response code should be applied. Indicated in
// 24-hour format.
StartTime string `json:"start_time,required"`
// Time zone used to calculate time.
TimeZone string `json:"time_zone" format:"timezone"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
EndTime respjson.Field
StartTime respjson.Field
TimeZone respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Controls the time at which a custom HTTP response code should be applied. By default, a custom HTTP response code is applied at any time.
func (CdnResourceOptionsForceReturnTimeInterval) RawJSON ¶
func (r CdnResourceOptionsForceReturnTimeInterval) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsForceReturnTimeInterval) UnmarshalJSON ¶
func (r *CdnResourceOptionsForceReturnTimeInterval) UnmarshalJSON(data []byte) error
type CdnResourceOptionsForwardHostHeader ¶
type CdnResourceOptionsForwardHostHeader struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Forwards the Host header from a end-user request to an origin server.
`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
func (CdnResourceOptionsForwardHostHeader) RawJSON ¶
func (r CdnResourceOptionsForwardHostHeader) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsForwardHostHeader) UnmarshalJSON ¶
func (r *CdnResourceOptionsForwardHostHeader) UnmarshalJSON(data []byte) error
type CdnResourceOptionsGzipOn ¶
type CdnResourceOptionsGzipOn struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Compresses content with gzip on the CDN end. CDN servers will request only uncompressed content from the origin.
Notes:
- Compression with gzip is not supported with `fetch_compressed` or `slice` options enabled.
- `fetch_compressed` option in CDN resource settings overrides `gzipON` in rules. If you enable `fetch_compressed` in CDN resource and want to enable `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
func (CdnResourceOptionsGzipOn) RawJSON ¶
func (r CdnResourceOptionsGzipOn) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsGzipOn) UnmarshalJSON ¶
func (r *CdnResourceOptionsGzipOn) UnmarshalJSON(data []byte) error
type CdnResourceOptionsHostHeader ¶
type CdnResourceOptionsHostHeader struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Host Header value.
Value string `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Sets the Host header that CDN servers use when request content from an origin server. Your server must be able to process requests with the chosen header.
If the option is `null`, the Host Header value is equal to first CNAME.
`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
func (CdnResourceOptionsHostHeader) RawJSON ¶
func (r CdnResourceOptionsHostHeader) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsHostHeader) UnmarshalJSON ¶
func (r *CdnResourceOptionsHostHeader) UnmarshalJSON(data []byte) error
type CdnResourceOptionsHttp3Enabled ¶
type CdnResourceOptionsHttp3Enabled struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Enables HTTP/3 protocol for content delivery.
`http3_enabled` option works only with `"sslEnabled": true`.
func (CdnResourceOptionsHttp3Enabled) RawJSON ¶
func (r CdnResourceOptionsHttp3Enabled) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsHttp3Enabled) UnmarshalJSON ¶
func (r *CdnResourceOptionsHttp3Enabled) UnmarshalJSON(data []byte) error
type CdnResourceOptionsIPAddressACL ¶
type CdnResourceOptionsIPAddressACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of IP addresses with a subnet mask.
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of IP addresses for which access is prohibited.
// - **deny** - List of IP addresses for which access is allowed.
//
// Examples:
//
// - `192.168.3.2/32`
// - `2a03:d000:2980:7::8/128`
ExceptedValues []string `json:"excepted_values,required" format:"ipv4net or ipv6net"`
// IP access policy type.
//
// Possible values:
//
// - **allow** - Allow access to all IPs except IPs specified in "excepted_values"
// field.
// - **deny** - Deny access to all IPs except IPs specified in "excepted_values"
// field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
ExceptedValues respjson.Field
PolicyType respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Controls access to the CDN resource content for specific IP addresses.
If you want to use IPs from our CDN servers IP list for IP ACL configuration, you have to independently monitor their relevance. We recommend you use a script for automatically update IP ACL. [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
func (CdnResourceOptionsIPAddressACL) RawJSON ¶
func (r CdnResourceOptionsIPAddressACL) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsIPAddressACL) UnmarshalJSON ¶
func (r *CdnResourceOptionsIPAddressACL) UnmarshalJSON(data []byte) error
type CdnResourceOptionsIgnoreCookie ¶
type CdnResourceOptionsIgnoreCookie struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled, files with cookies are cached as one file.
// - **false** - Option is disabled, files with cookies are cached as different
// files.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Defines whether the files with the Set-Cookies header are cached as one file or as different ones.
func (CdnResourceOptionsIgnoreCookie) RawJSON ¶
func (r CdnResourceOptionsIgnoreCookie) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsIgnoreCookie) UnmarshalJSON ¶
func (r *CdnResourceOptionsIgnoreCookie) UnmarshalJSON(data []byte) error
type CdnResourceOptionsIgnoreQueryString ¶
type CdnResourceOptionsIgnoreQueryString struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
How a file with different query strings is cached: either as one object (option is enabled) or as different objects (option is disabled.)
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
func (CdnResourceOptionsIgnoreQueryString) RawJSON ¶
func (r CdnResourceOptionsIgnoreQueryString) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsIgnoreQueryString) UnmarshalJSON ¶
func (r *CdnResourceOptionsIgnoreQueryString) UnmarshalJSON(data []byte) error
type CdnResourceOptionsImageStack ¶
type CdnResourceOptionsImageStack struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Enables or disables automatic conversion of JPEG and PNG images to AVI format.
AvifEnabled bool `json:"avif_enabled"`
// Enables or disables compression without quality loss for PNG format.
PngLossless bool `json:"png_lossless"`
// Defines quality settings for JPG and PNG images. The higher the value, the
// better the image quality, and the larger the file size after conversion.
Quality int64 `json:"quality"`
// Enables or disables automatic conversion of JPEG and PNG images to WebP format.
WebpEnabled bool `json:"webp_enabled"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
AvifEnabled respjson.Field
PngLossless respjson.Field
Quality respjson.Field
WebpEnabled respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Transforms JPG and PNG images (for example, resize or crop) and automatically converts them to WebP or AVIF format.
func (CdnResourceOptionsImageStack) RawJSON ¶
func (r CdnResourceOptionsImageStack) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsImageStack) UnmarshalJSON ¶
func (r *CdnResourceOptionsImageStack) UnmarshalJSON(data []byte) error
type CdnResourceOptionsLimitBandwidth ¶
type CdnResourceOptionsLimitBandwidth struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Method of controlling the download speed per connection.
//
// Possible values:
//
// - **static** - Use speed and buffer fields to set the download speed limit.
// - **dynamic** - Use query strings **speed** and **buffer** to set the download
// speed limit.
//
// # For example, when requesting content at the link
//
// “`
// http://cdn.example.com/video.mp4?speed=50k&buffer=500k
// “`
//
// the download speed will be limited to 50kB/s after 500 kB.
//
// Any of "static", "dynamic".
LimitType string `json:"limit_type,required"`
// Amount of downloaded data after which the user will be rate limited.
Buffer int64 `json:"buffer"`
// Maximum download speed per connection.
Speed int64 `json:"speed"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
LimitType respjson.Field
Buffer respjson.Field
Speed respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Allows to control the download speed per connection.
func (CdnResourceOptionsLimitBandwidth) RawJSON ¶
func (r CdnResourceOptionsLimitBandwidth) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsLimitBandwidth) UnmarshalJSON ¶
func (r *CdnResourceOptionsLimitBandwidth) UnmarshalJSON(data []byte) error
type CdnResourceOptionsProxyCacheKey ¶
type CdnResourceOptionsProxyCacheKey struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Key for caching.
Value string `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Allows you to modify your cache key. If omitted, the default value is `$request_uri`.
Combine the specified variables to create a key for caching.
- **$`request_uri`** - **$scheme** - **$uri**
**Warning**: Enabling and changing this option can invalidate your current cache and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will not work.
func (CdnResourceOptionsProxyCacheKey) RawJSON ¶
func (r CdnResourceOptionsProxyCacheKey) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsProxyCacheKey) UnmarshalJSON ¶
func (r *CdnResourceOptionsProxyCacheKey) UnmarshalJSON(data []byte) error
type CdnResourceOptionsProxyCacheMethodsSet ¶
type CdnResourceOptionsProxyCacheMethodsSet struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Caching for POST requests along with default GET and HEAD.
func (CdnResourceOptionsProxyCacheMethodsSet) RawJSON ¶
func (r CdnResourceOptionsProxyCacheMethodsSet) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsProxyCacheMethodsSet) UnmarshalJSON ¶
func (r *CdnResourceOptionsProxyCacheMethodsSet) UnmarshalJSON(data []byte) error
type CdnResourceOptionsProxyConnectTimeout ¶
type CdnResourceOptionsProxyConnectTimeout struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Timeout value in seconds.
//
// Supported range: **1s - 5s**.
Value string `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The time limit for establishing a connection with the origin.
func (CdnResourceOptionsProxyConnectTimeout) RawJSON ¶
func (r CdnResourceOptionsProxyConnectTimeout) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsProxyConnectTimeout) UnmarshalJSON ¶
func (r *CdnResourceOptionsProxyConnectTimeout) UnmarshalJSON(data []byte) error
type CdnResourceOptionsProxyReadTimeout ¶
type CdnResourceOptionsProxyReadTimeout struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Timeout value in seconds.
//
// Supported range: **1s - 30s**.
Value string `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The time limit for receiving a partial response from the origin. If no response is received within this time, the connection will be closed.
**Note:** When used with a WebSocket connection, this option supports values only in the range 1–20 seconds (instead of the usual 1–30 seconds).
func (CdnResourceOptionsProxyReadTimeout) RawJSON ¶
func (r CdnResourceOptionsProxyReadTimeout) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsProxyReadTimeout) UnmarshalJSON ¶
func (r *CdnResourceOptionsProxyReadTimeout) UnmarshalJSON(data []byte) error
type CdnResourceOptionsQueryParamsBlacklist ¶
type CdnResourceOptionsQueryParamsBlacklist struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of query parameters.
Value []string `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Files with the specified query parameters are cached as one object, files with other parameters are cached as different objects.
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
func (CdnResourceOptionsQueryParamsBlacklist) RawJSON ¶
func (r CdnResourceOptionsQueryParamsBlacklist) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsQueryParamsBlacklist) UnmarshalJSON ¶
func (r *CdnResourceOptionsQueryParamsBlacklist) UnmarshalJSON(data []byte) error
type CdnResourceOptionsQueryParamsWhitelist ¶
type CdnResourceOptionsQueryParamsWhitelist struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of query parameters.
Value []string `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Files with the specified query parameters are cached as different objects, files with other parameters are cached as one object.
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
func (CdnResourceOptionsQueryParamsWhitelist) RawJSON ¶
func (r CdnResourceOptionsQueryParamsWhitelist) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsQueryParamsWhitelist) UnmarshalJSON ¶
func (r *CdnResourceOptionsQueryParamsWhitelist) UnmarshalJSON(data []byte) error
type CdnResourceOptionsQueryStringForwarding ¶
type CdnResourceOptionsQueryStringForwarding struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// The `forward_from_files_types` field specifies the types of playlist files from
// which parameters will be extracted and forwarded. This typically includes
// formats that list multiple media chunk references, such as HLS and DASH
// playlists. Parameters associated with these playlist files (like query strings
// or headers) will be propagated to the chunks they reference.
ForwardFromFileTypes []string `json:"forward_from_file_types,required"`
// The field specifies the types of media chunk files to which parameters,
// extracted from playlist files, will be forwarded. These refer to the actual
// segments of media content that are delivered to viewers. Ensuring the correct
// parameters are forwarded to these files is crucial for maintaining the integrity
// of the streaming session.
ForwardToFileTypes []string `json:"forward_to_file_types,required"`
// The `forward_except_keys` field provides a mechanism to exclude specific
// parameters from being forwarded from playlist files to media chunk files. By
// listing certain keys in this field, you can ensure that these parameters are
// omitted during the forwarding process. This is particularly useful for
// preventing sensitive or irrelevant information from being included in requests
// for media chunks, thereby enhancing security and optimizing performance.
ForwardExceptKeys []string `json:"forward_except_keys"`
// The `forward_only_keys` field allows for granular control over which specific
// parameters are forwarded from playlist files to media chunk files. By specifying
// certain keys, only those parameters will be propagated, ensuring that only
// relevant information is passed along. This is particularly useful for security
// and performance optimization, as it prevents unnecessary or sensitive data from
// being included in requests for media chunks.
ForwardOnlyKeys []string `json:"forward_only_keys"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
ForwardFromFileTypes respjson.Field
ForwardToFileTypes respjson.Field
ForwardExceptKeys respjson.Field
ForwardOnlyKeys respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The Query String Forwarding feature allows for the seamless transfer of parameters embedded in playlist files to the corresponding media chunk files. This functionality ensures that specific attributes, such as authentication tokens or tracking information, are consistently passed along from the playlist manifest to the individual media segments. This is particularly useful for maintaining continuity in security, analytics, and any other parameter-based operations across the entire media delivery workflow.
func (CdnResourceOptionsQueryStringForwarding) RawJSON ¶
func (r CdnResourceOptionsQueryStringForwarding) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsQueryStringForwarding) UnmarshalJSON ¶
func (r *CdnResourceOptionsQueryStringForwarding) UnmarshalJSON(data []byte) error
type CdnResourceOptionsRedirectHTTPSToHTTP ¶
type CdnResourceOptionsRedirectHTTPSToHTTP struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Enables redirect from HTTPS to HTTP.
`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.
func (CdnResourceOptionsRedirectHTTPSToHTTP) RawJSON ¶
func (r CdnResourceOptionsRedirectHTTPSToHTTP) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsRedirectHTTPSToHTTP) UnmarshalJSON ¶
func (r *CdnResourceOptionsRedirectHTTPSToHTTP) UnmarshalJSON(data []byte) error
type CdnResourceOptionsRedirectHTTPToHTTPS ¶
type CdnResourceOptionsRedirectHTTPToHTTPS struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Enables redirect from HTTP to HTTPS.
`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.
func (CdnResourceOptionsRedirectHTTPToHTTPS) RawJSON ¶
func (r CdnResourceOptionsRedirectHTTPToHTTPS) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsRedirectHTTPToHTTPS) UnmarshalJSON ¶
func (r *CdnResourceOptionsRedirectHTTPToHTTPS) UnmarshalJSON(data []byte) error
type CdnResourceOptionsReferrerACL ¶
type CdnResourceOptionsReferrerACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of domain names or wildcard domains (without protocol: `http://` or
// `https://`.)
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of domain names for which access is prohibited.
// - **deny** - List of IP domain names for which access is allowed.
//
// Examples:
//
// - `example.com`
// - `*.example.com`
ExceptedValues []string `json:"excepted_values,required" format:"domain or wildcard"`
// Policy type.
//
// Possible values:
//
// - **allow** - Allow access to all domain names except the domain names specified
// in `excepted_values` field.
// - **deny** - Deny access to all domain names except the domain names specified
// in `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
ExceptedValues respjson.Field
PolicyType respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Controls access to the CDN resource content for specified domain names.
func (CdnResourceOptionsReferrerACL) RawJSON ¶
func (r CdnResourceOptionsReferrerACL) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsReferrerACL) UnmarshalJSON ¶
func (r *CdnResourceOptionsReferrerACL) UnmarshalJSON(data []byte) error
type CdnResourceOptionsRequestLimiter ¶
type CdnResourceOptionsRequestLimiter struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Maximum request rate.
Rate int64 `json:"rate,required"`
Burst int64 `json:"burst"`
Delay int64 `json:"delay"`
// Units of measurement for the `rate` field.
//
// Possible values:
//
// - **r/s** - Requests per second.
// - **r/m** - Requests per minute.
//
// If the rate is less than one request per second, it is specified in request per
// minute (r/m.)
//
// Any of "r/s", "r/m".
RateUnit string `json:"rate_unit"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Rate respjson.Field
Burst respjson.Field
Delay respjson.Field
RateUnit respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Option allows to limit the amount of HTTP requests.
func (CdnResourceOptionsRequestLimiter) RawJSON ¶
func (r CdnResourceOptionsRequestLimiter) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsRequestLimiter) UnmarshalJSON ¶
func (r *CdnResourceOptionsRequestLimiter) UnmarshalJSON(data []byte) error
type CdnResourceOptionsResponseHeadersHidingPolicy ¶
type CdnResourceOptionsResponseHeadersHidingPolicy struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of HTTP headers.
//
// Parameter meaning depends on the value of the `mode` field:
//
// - **show** - List of HTTP headers to hide from response.
// - **hide** - List of HTTP headers to include in response. Other HTTP headers
// will be hidden.
//
// The following headers are required and cannot be hidden from response:
//
// - `Connection`
// - `Content-Length`
// - `Content-Type`
// - `Date`
// - `Server`
Excepted []string `json:"excepted,required" format:"http_header"`
// How HTTP headers are hidden from the response.
//
// Possible values:
//
// - **show** - Hide only HTTP headers listed in the `excepted` field.
// - **hide** - Hide all HTTP headers except headers listed in the "excepted"
// field.
//
// Any of "hide", "show".
Mode string `json:"mode,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Excepted respjson.Field
Mode respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Hides HTTP headers from an origin server in the CDN response.
func (CdnResourceOptionsResponseHeadersHidingPolicy) RawJSON ¶
func (r CdnResourceOptionsResponseHeadersHidingPolicy) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsResponseHeadersHidingPolicy) UnmarshalJSON ¶
func (r *CdnResourceOptionsResponseHeadersHidingPolicy) UnmarshalJSON(data []byte) error
type CdnResourceOptionsRewrite ¶
type CdnResourceOptionsRewrite struct {
// Path for the Rewrite option.
//
// Example:
//
// - `/(.*) /media/$1`
Body string `json:"body,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Flag for the Rewrite option.
//
// Possible values:
//
// - **last** - Stop processing the current set of `ngx_http_rewrite_module`
// directives and start a search for a new location matching changed URI.
// - **break** - Stop processing the current set of the Rewrite option.
// - **redirect** - Return a temporary redirect with the 302 code; used when a
// replacement string does not start with `http://`, `https://`, or `$scheme`.
// - **permanent** - Return a permanent redirect with the 301 code.
//
// Any of "break", "last", "redirect", "permanent".
Flag string `json:"flag"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Body respjson.Field
Enabled respjson.Field
Flag respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Changes and redirects requests from the CDN to the origin. It operates according to the [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite) configuration.
func (CdnResourceOptionsRewrite) RawJSON ¶
func (r CdnResourceOptionsRewrite) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsRewrite) UnmarshalJSON ¶
func (r *CdnResourceOptionsRewrite) UnmarshalJSON(data []byte) error
type CdnResourceOptionsSecureKey ¶
type CdnResourceOptionsSecureKey struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Key generated on your side that will be used for URL signing.
Key string `json:"key,required"`
// Type of URL signing.
//
// Possible types:
//
// - **Type 0** - Includes end user IP to secure token generation.
// - **Type 2** - Excludes end user IP from secure token generation.
//
// Any of 0, 2.
Type int64 `json:"type"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Key respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Configures access with tokenized URLs. This makes impossible to access content without a valid (unexpired) token.
func (CdnResourceOptionsSecureKey) RawJSON ¶
func (r CdnResourceOptionsSecureKey) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsSecureKey) UnmarshalJSON ¶
func (r *CdnResourceOptionsSecureKey) UnmarshalJSON(data []byte) error
type CdnResourceOptionsSlice ¶
type CdnResourceOptionsSlice struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Requests and caches files larger than 10 MB in parts (no larger than 10 MB per part.) This reduces time to first byte.
The option is based on the [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
Notes:
- Origin must support HTTP Range requests.
- Not supported with `gzipON`, `brotli_compression` or `fetch_compressed` options enabled.
func (CdnResourceOptionsSlice) RawJSON ¶
func (r CdnResourceOptionsSlice) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsSlice) UnmarshalJSON ¶
func (r *CdnResourceOptionsSlice) UnmarshalJSON(data []byte) error
type CdnResourceOptionsSni ¶
type CdnResourceOptionsSni struct {
// Custom SNI hostname.
//
// It is required if `sni_type` is set to custom.
CustomHostname string `json:"custom_hostname,required" format:"domain"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// SNI (Server Name Indication) type.
//
// Possible values:
//
// - **dynamic** - SNI hostname depends on `hostHeader` and `forward_host_header`
// options. It has several possible combinations:
// - If the `hostHeader` option is enabled and specified, SNI hostname matches the
// Host header.
// - If the `forward_host_header` option is enabled and has true value, SNI
// hostname matches the Host header used in the request made to a CDN.
// - If the `hostHeader` and `forward_host_header` options are disabled, SNI
// hostname matches the primary CNAME.
// - **custom** - custom SNI hostname is in use.
//
// Any of "dynamic", "custom".
SniType string `json:"sni_type"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CustomHostname respjson.Field
Enabled respjson.Field
SniType respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The hostname that is added to SNI requests from CDN servers to the origin server via HTTPS.
SNI is generally only required if your origin uses shared hosting or does not have a dedicated IP address. If the origin server presents multiple certificates, SNI allows the origin server to know which certificate to use for the connection.
The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
func (CdnResourceOptionsSni) RawJSON ¶
func (r CdnResourceOptionsSni) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsSni) UnmarshalJSON ¶
func (r *CdnResourceOptionsSni) UnmarshalJSON(data []byte) error
type CdnResourceOptionsStale ¶
type CdnResourceOptionsStale struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Defines list of errors for which "Always online" option is applied.
//
// Any of "error", "http_403", "http_404", "http_429", "http_500", "http_502",
// "http_503", "http_504", "invalid_header", "timeout", "updating".
Value []string `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Serves stale cached content in case of origin unavailability.
func (CdnResourceOptionsStale) RawJSON ¶
func (r CdnResourceOptionsStale) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsStale) UnmarshalJSON ¶
func (r *CdnResourceOptionsStale) UnmarshalJSON(data []byte) error
type CdnResourceOptionsStaticHeaders
deprecated
type CdnResourceOptionsStaticHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// A MAP for static headers in a format of `header_name: header_value`.
//
// Restrictions:
//
// - **Header name** - Maximum 128 symbols, may contain Latin letters (A-Z, a-z),
// numbers (0-9), dashes, and underscores.
// - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
// (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
// with a letter, number, asterisk or {.
Value any `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
**Legacy option**. Use the `static_response_headers` option instead.
Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP Headers can be specified. May contain a header with multiple values.
Deprecated: deprecated
func (CdnResourceOptionsStaticHeaders) RawJSON ¶
func (r CdnResourceOptionsStaticHeaders) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsStaticHeaders) UnmarshalJSON ¶
func (r *CdnResourceOptionsStaticHeaders) UnmarshalJSON(data []byte) error
type CdnResourceOptionsStaticRequestHeaders ¶
type CdnResourceOptionsStaticRequestHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// A MAP for static headers in a format of `header_name: header_value`.
//
// Restrictions:
//
// - **Header name** - Maximum 255 symbols, may contain Latin letters (A-Z, a-z),
// numbers (0-9), dashes, and underscores.
// - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
// (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
// with a letter, number, asterisk or {.
Value map[string]string `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP Headers can be specified.
func (CdnResourceOptionsStaticRequestHeaders) RawJSON ¶
func (r CdnResourceOptionsStaticRequestHeaders) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsStaticRequestHeaders) UnmarshalJSON ¶
func (r *CdnResourceOptionsStaticRequestHeaders) UnmarshalJSON(data []byte) error
type CdnResourceOptionsStaticResponseHeaders ¶
type CdnResourceOptionsStaticResponseHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
Value []CdnResourceOptionsStaticResponseHeadersValue `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Custom HTTP Headers that a CDN server adds to a response.
func (CdnResourceOptionsStaticResponseHeaders) RawJSON ¶
func (r CdnResourceOptionsStaticResponseHeaders) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsStaticResponseHeaders) UnmarshalJSON ¶
func (r *CdnResourceOptionsStaticResponseHeaders) UnmarshalJSON(data []byte) error
type CdnResourceOptionsStaticResponseHeadersValue ¶
type CdnResourceOptionsStaticResponseHeadersValue struct {
// HTTP Header name.
//
// Restrictions:
//
// - Maximum 128 symbols.
// - Latin letters (A-Z, a-z,) numbers (0-9,) dashes, and underscores only.
Name string `json:"name,required"`
// Header value.
//
// Restrictions:
//
// - Maximum 512 symbols.
// - Letters (a-z), numbers (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+
// /|\";:?.,><{}[]).
// - Must start with a letter, number, asterisk or {.
// - Multiple values can be added.
Value []string `json:"value,required"`
// Defines whether the header will be added to a response from CDN regardless of
// response code.
//
// Possible values:
//
// - **true** - Header will be added to a response from CDN regardless of response
// code.
// - **false** - Header will be added only to the following response codes: 200,
// 201, 204, 206, 301, 302, 303, 304, 307, 308.
Always bool `json:"always"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Name respjson.Field
Value respjson.Field
Always respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CdnResourceOptionsStaticResponseHeadersValue) RawJSON ¶
func (r CdnResourceOptionsStaticResponseHeadersValue) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsStaticResponseHeadersValue) UnmarshalJSON ¶
func (r *CdnResourceOptionsStaticResponseHeadersValue) UnmarshalJSON(data []byte) error
type CdnResourceOptionsTlsVersions ¶
type CdnResourceOptionsTlsVersions struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of SSL/TLS protocol versions (case sensitive).
//
// Any of "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3".
Value []string `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
List of SSL/TLS protocol versions allowed for HTTPS connections from end users to the domain.
When the option is disabled, all protocols versions are allowed.
func (CdnResourceOptionsTlsVersions) RawJSON ¶
func (r CdnResourceOptionsTlsVersions) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsTlsVersions) UnmarshalJSON ¶
func (r *CdnResourceOptionsTlsVersions) UnmarshalJSON(data []byte) error
type CdnResourceOptionsUseDefaultLeChain ¶
type CdnResourceOptionsUseDefaultLeChain struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Default Let's Encrypt certificate chain. This is a deprecated
// version, use it only for compatibilities with Android devices 7.1.1 or lower.
// - **false** - Alternative Let's Encrypt certificate chain.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Let's Encrypt certificate chain.
The specified chain will be used during the next Let's Encrypt certificate issue or renewal.
func (CdnResourceOptionsUseDefaultLeChain) RawJSON ¶
func (r CdnResourceOptionsUseDefaultLeChain) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsUseDefaultLeChain) UnmarshalJSON ¶
func (r *CdnResourceOptionsUseDefaultLeChain) UnmarshalJSON(data []byte) error
type CdnResourceOptionsUseDns01LeChallenge ¶
type CdnResourceOptionsUseDns01LeChallenge struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - DNS-01 challenge is used to issue Let's Encrypt certificate.
// - **false** - HTTP-01 challenge is used to issue Let's Encrypt certificate.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
DNS-01 challenge to issue a Let's Encrypt certificate for the resource.
DNS service should be activated to enable this option.
func (CdnResourceOptionsUseDns01LeChallenge) RawJSON ¶
func (r CdnResourceOptionsUseDns01LeChallenge) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsUseDns01LeChallenge) UnmarshalJSON ¶
func (r *CdnResourceOptionsUseDns01LeChallenge) UnmarshalJSON(data []byte) error
type CdnResourceOptionsUseRsaLeCert ¶
type CdnResourceOptionsUseRsaLeCert struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - RSA Let's Encrypt certificate.
// - **false** - ECDSA Let's Encrypt certificate.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
RSA Let's Encrypt certificate type for the CDN resource.
The specified value will be used during the next Let's Encrypt certificate issue or renewal.
func (CdnResourceOptionsUseRsaLeCert) RawJSON ¶
func (r CdnResourceOptionsUseRsaLeCert) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsUseRsaLeCert) UnmarshalJSON ¶
func (r *CdnResourceOptionsUseRsaLeCert) UnmarshalJSON(data []byte) error
type CdnResourceOptionsUserAgentACL ¶
type CdnResourceOptionsUserAgentACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of User-Agents that will be allowed/denied.
//
// The meaning of the parameter depends on `policy_type`:
//
// - **allow** - List of User-Agents for which access is prohibited.
// - **deny** - List of User-Agents for which access is allowed.
//
// Use an empty string `""` to allow/deny access when the User-Agent header is
// empty.
ExceptedValues []string `json:"excepted_values,required" format:"user_agent"`
// User-Agents policy type.
//
// Possible values:
//
// - **allow** - Allow access for all User-Agents except specified in
// `excepted_values` field.
// - **deny** - Deny access for all User-Agents except specified in
// `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
ExceptedValues respjson.Field
PolicyType respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Controls access to the content for specified User-Agents.
func (CdnResourceOptionsUserAgentACL) RawJSON ¶
func (r CdnResourceOptionsUserAgentACL) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsUserAgentACL) UnmarshalJSON ¶
func (r *CdnResourceOptionsUserAgentACL) UnmarshalJSON(data []byte) error
type CdnResourceOptionsWaap ¶
type CdnResourceOptionsWaap struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Allows to enable WAAP (Web Application and API Protection).
func (CdnResourceOptionsWaap) RawJSON ¶
func (r CdnResourceOptionsWaap) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsWaap) UnmarshalJSON ¶
func (r *CdnResourceOptionsWaap) UnmarshalJSON(data []byte) error
type CdnResourceOptionsWebsockets ¶
type CdnResourceOptionsWebsockets struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Enables or disables WebSockets connections to an origin server.
func (CdnResourceOptionsWebsockets) RawJSON ¶
func (r CdnResourceOptionsWebsockets) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceOptionsWebsockets) UnmarshalJSON ¶
func (r *CdnResourceOptionsWebsockets) UnmarshalJSON(data []byte) error
type CdnResourceOriginProtocol ¶
type CdnResourceOriginProtocol string
Protocol used by CDN servers to request content from an origin source.
Possible values:
- **HTTPS** - CDN servers will connect to the origin via HTTPS.
- **HTTP** - CDN servers will connect to the origin via HTTP.
- **MATCH** - connection protocol will be chosen automatically (content on the origin source should be available for the CDN both through HTTP and HTTPS).
If protocol is not specified, HTTP is used to connect to an origin server.
const ( CdnResourceOriginProtocolHTTP CdnResourceOriginProtocol = "HTTP" CdnResourceOriginProtocolHTTPS CdnResourceOriginProtocol = "HTTPS" CdnResourceOriginProtocolMatch CdnResourceOriginProtocol = "MATCH" )
type CdnResourceRule ¶
type CdnResourceRule struct {
// Rule ID.
ID int64 `json:"id"`
// Enables or disables a rule.
//
// Possible values:
//
// - **true** - Rule is active, rule settings are applied.
// - **false** - Rule is inactive, rule settings are not applied.
Active bool `json:"active"`
// Defines whether the rule has been deleted.
//
// Possible values:
//
// - **true** - Rule has been deleted.
// - **false** - Rule has not been deleted.
Deleted bool `json:"deleted"`
// Rule name.
Name string `json:"name"`
// List of options that can be configured for the rule.
//
// In case of `null` value the option is not added to the rule. Option inherits its
// value from the CDN resource settings.
Options CdnResourceRuleOptions `json:"options"`
// ID of the origin group to which the rule is applied.
//
// If the origin group is not specified, the rule is applied to the origin group
// that the CDN resource is associated with.
OriginGroup int64 `json:"originGroup,nullable"`
// Protocol used by CDN servers to request content from an origin source.
//
// Possible values:
//
// - **HTTPS** - CDN servers connect to origin via HTTPS protocol.
// - **HTTP** - CDN servers connect to origin via HTTP protocol.
// - **MATCH** - Connection protocol is chosen automatically; in this case, content
// on origin source should be available for the CDN both through HTTP and HTTPS
// protocols.
//
// Any of "HTTPS", "HTTP", "MATCH".
OriginProtocol CdnResourceRuleOriginProtocol `json:"originProtocol"`
// Sets a protocol other than the one specified in the CDN resource settings to
// connect to the origin.
//
// Possible values:
//
// - **HTTPS** - CDN servers connect to origin via HTTPS protocol.
// - **HTTP** - CDN servers connect to origin via HTTP protocol.
// - **MATCH** - Connection protocol is chosen automatically; in this case, content
// on origin source should be available for the CDN both through HTTP and HTTPS
// protocols.
// - **null** - `originProtocol` setting is inherited from the CDN resource
// settings.
//
// Any of "HTTPS", "HTTP", "MATCH".
OverrideOriginProtocol CdnResourceRuleOverrideOriginProtocol `json:"overrideOriginProtocol,nullable"`
// Defines whether the rule has an applied preset.
//
// Possible values:
//
// - **true** - Rule has a preset applied.
// - **false** - Rule does not have a preset applied.
//
// If a preset is applied to the rule, the options included in the preset cannot be
// edited for the rule.
PresetApplied bool `json:"preset_applied"`
// ID of the rule with which the current rule is synchronized within the CDN
// resource shared cache zone feature.
PrimaryRule int64 `json:"primary_rule,nullable"`
// Path to the file or folder for which the rule will be applied.
//
// The rule is applied if the requested URI matches the rule path.
//
// We add a leading forward slash to any rule path. Specify a path without a
// forward slash.
Rule string `json:"rule"`
// Rule type.
//
// Possible values:
//
// - **Type 0** - Regular expression. Must start with '^/' or '/'.
// - **Type 1** - Regular expression. Note that for this rule type we automatically
// add / to each rule pattern before your regular expression. This type is
// **legacy**, please use Type 0.
RuleType int64 `json:"ruleType"`
// Rule execution order: from lowest (1) to highest.
//
// If requested URI matches multiple rules, the one higher in the order of the
// rules will be applied.
Weight int64 `json:"weight"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Active respjson.Field
Deleted respjson.Field
Name respjson.Field
Options respjson.Field
OriginGroup respjson.Field
OriginProtocol respjson.Field
OverrideOriginProtocol respjson.Field
PresetApplied respjson.Field
PrimaryRule respjson.Field
Rule respjson.Field
RuleType respjson.Field
Weight respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CdnResourceRule) RawJSON ¶
func (r CdnResourceRule) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRule) UnmarshalJSON ¶
func (r *CdnResourceRule) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptions ¶
type CdnResourceRuleOptions struct {
// HTTP methods allowed for content requests from the CDN.
AllowedHTTPMethods CdnResourceRuleOptionsAllowedHTTPMethods `json:"allowedHttpMethods,nullable"`
// Allows to prevent online services from overloading and ensure your business
// workflow running smoothly.
BotProtection CdnResourceRuleOptionsBotProtection `json:"bot_protection,nullable"`
// Compresses content with Brotli on the CDN side. CDN servers will request only
// uncompressed content from the origin.
//
// Notes:
//
// 1. CDN only supports "Brotli compression" when the "origin shielding" feature is
// activated.
// 2. If a precache server is not active for a CDN resource, no compression occurs,
// even if the option is enabled.
// 3. `brotli_compression` is not supported with `fetch_compressed` or `slice`
// options enabled.
// 4. `fetch_compressed` option in CDN resource settings overrides
// `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN
// resource and want to enable `brotli_compression` in a rule, you must specify
// `fetch_compressed:false` in the rule.
BrotliCompression CdnResourceRuleOptionsBrotliCompression `json:"brotli_compression,nullable"`
// Cache expiration time for users browsers in seconds.
//
// Cache expiration time is applied to the following response codes: 200, 201, 204,
// 206, 301, 302, 303, 304, 307, 308.
//
// Responses with other codes will not be cached.
BrowserCacheSettings CdnResourceRuleOptionsBrowserCacheSettings `json:"browser_cache_settings,nullable"`
// **Legacy option**. Use the `response_headers_hiding_policy` option instead.
//
// HTTP Headers that must be included in the response.
//
// Deprecated: deprecated
CacheHTTPHeaders CdnResourceRuleOptionsCacheHTTPHeaders `json:"cache_http_headers,nullable"`
// Enables or disables CORS (Cross-Origin Resource Sharing) header support.
//
// CORS header support allows the CDN to add the Access-Control-Allow-Origin header
// to a response to a browser.
Cors CdnResourceRuleOptionsCors `json:"cors,nullable"`
// Enables control access to content for specified countries.
CountryACL CdnResourceRuleOptionsCountryACL `json:"country_acl,nullable"`
// **Legacy option**. Use the `edge_cache_settings` option instead.
//
// Allows the complete disabling of content caching.
//
// Deprecated: deprecated
DisableCache CdnResourceRuleOptionsDisableCache `json:"disable_cache,nullable"`
// Allows 206 responses regardless of the settings of an origin source.
DisableProxyForceRanges CdnResourceRuleOptionsDisableProxyForceRanges `json:"disable_proxy_force_ranges,nullable"`
// Cache expiration time for CDN servers.
//
// `value` and `default` fields cannot be used simultaneously.
EdgeCacheSettings CdnResourceRuleOptionsEdgeCacheSettings `json:"edge_cache_settings,nullable"`
// Allows to configure FastEdge app to be called on different request/response
// phases.
//
// Note: At least one of `on_request_headers`, `on_request_body`,
// `on_response_headers`, or `on_response_body` must be specified.
Fastedge CdnResourceRuleOptionsFastedge `json:"fastedge,nullable"`
// Makes the CDN request compressed content from the origin.
//
// The origin server should support compression. CDN servers will not decompress
// your content even if a user browser does not accept compression.
//
// Notes:
//
// 1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or
// `slice` options enabled.
// 2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If
// you enable it in CDN resource and want to use `gzipON` and
// `brotli_compression` in a rule, you have to specify
// `"fetch_compressed": false` in the rule.
FetchCompressed CdnResourceRuleOptionsFetchCompressed `json:"fetch_compressed,nullable"`
// Enables redirection from origin. If the origin server returns a redirect, the
// option allows the CDN to pull the requested content from the origin server that
// was returned in the redirect.
FollowOriginRedirect CdnResourceRuleOptionsFollowOriginRedirect `json:"follow_origin_redirect,nullable"`
// Applies custom HTTP response codes for CDN content.
//
// The following codes are reserved by our system and cannot be specified in this
// option: 408, 444, 477, 494, 495, 496, 497, 499.
ForceReturn CdnResourceRuleOptionsForceReturn `json:"force_return,nullable"`
// Forwards the Host header from a end-user request to an origin server.
//
// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
ForwardHostHeader CdnResourceRuleOptionsForwardHostHeader `json:"forward_host_header,nullable"`
// Compresses content with gzip on the CDN end. CDN servers will request only
// uncompressed content from the origin.
//
// Notes:
//
// 1. Compression with gzip is not supported with `fetch_compressed` or `slice`
// options enabled.
// 2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in
// rules. If you enable `fetch_compressed` in CDN resource and want to enable
// `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
GzipOn CdnResourceRuleOptionsGzipOn `json:"gzipOn,nullable"`
// Sets the Host header that CDN servers use when request content from an origin
// server. Your server must be able to process requests with the chosen header.
//
// If the option is `null`, the Host Header value is equal to first CNAME.
//
// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
HostHeader CdnResourceRuleOptionsHostHeader `json:"hostHeader,nullable"`
// Defines whether the files with the Set-Cookies header are cached as one file or
// as different ones.
IgnoreCookie CdnResourceRuleOptionsIgnoreCookie `json:"ignore_cookie,nullable"`
// How a file with different query strings is cached: either as one object (option
// is enabled) or as different objects (option is disabled.)
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
IgnoreQueryString CdnResourceRuleOptionsIgnoreQueryString `json:"ignoreQueryString,nullable"`
// Transforms JPG and PNG images (for example, resize or crop) and automatically
// converts them to WebP or AVIF format.
ImageStack CdnResourceRuleOptionsImageStack `json:"image_stack,nullable"`
// Controls access to the CDN resource content for specific IP addresses.
//
// If you want to use IPs from our CDN servers IP list for IP ACL configuration,
// you have to independently monitor their relevance. We recommend you use a script
// for automatically update IP ACL.
// [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
IPAddressACL CdnResourceRuleOptionsIPAddressACL `json:"ip_address_acl,nullable"`
// Allows to control the download speed per connection.
LimitBandwidth CdnResourceRuleOptionsLimitBandwidth `json:"limit_bandwidth,nullable"`
// Allows you to modify your cache key. If omitted, the default value is
// `$request_uri`.
//
// Combine the specified variables to create a key for caching.
//
// - **$`request_uri`**
// - **$scheme**
// - **$uri**
//
// **Warning**: Enabling and changing this option can invalidate your current cache
// and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will
// not work.
ProxyCacheKey CdnResourceRuleOptionsProxyCacheKey `json:"proxy_cache_key,nullable"`
// Caching for POST requests along with default GET and HEAD.
ProxyCacheMethodsSet CdnResourceRuleOptionsProxyCacheMethodsSet `json:"proxy_cache_methods_set,nullable"`
// The time limit for establishing a connection with the origin.
ProxyConnectTimeout CdnResourceRuleOptionsProxyConnectTimeout `json:"proxy_connect_timeout,nullable"`
// The time limit for receiving a partial response from the origin. If no response
// is received within this time, the connection will be closed.
//
// **Note:** When used with a WebSocket connection, this option supports values
// only in the range 1–20 seconds (instead of the usual 1–30 seconds).
ProxyReadTimeout CdnResourceRuleOptionsProxyReadTimeout `json:"proxy_read_timeout,nullable"`
// Files with the specified query parameters are cached as one object, files with
// other parameters are cached as different objects.
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
QueryParamsBlacklist CdnResourceRuleOptionsQueryParamsBlacklist `json:"query_params_blacklist,nullable"`
// Files with the specified query parameters are cached as different objects, files
// with other parameters are cached as one object.
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
QueryParamsWhitelist CdnResourceRuleOptionsQueryParamsWhitelist `json:"query_params_whitelist,nullable"`
// The Query String Forwarding feature allows for the seamless transfer of
// parameters embedded in playlist files to the corresponding media chunk files.
// This functionality ensures that specific attributes, such as authentication
// tokens or tracking information, are consistently passed along from the playlist
// manifest to the individual media segments. This is particularly useful for
// maintaining continuity in security, analytics, and any other parameter-based
// operations across the entire media delivery workflow.
QueryStringForwarding CdnResourceRuleOptionsQueryStringForwarding `json:"query_string_forwarding,nullable"`
// Enables redirect from HTTP to HTTPS.
//
// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
// simultaneously.
RedirectHTTPToHTTPS CdnResourceRuleOptionsRedirectHTTPToHTTPS `json:"redirect_http_to_https,nullable"`
// Enables redirect from HTTPS to HTTP.
//
// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
// simultaneously.
RedirectHTTPSToHTTP CdnResourceRuleOptionsRedirectHTTPSToHTTP `json:"redirect_https_to_http,nullable"`
// Controls access to the CDN resource content for specified domain names.
ReferrerACL CdnResourceRuleOptionsReferrerACL `json:"referrer_acl,nullable"`
// Option allows to limit the amount of HTTP requests.
RequestLimiter CdnResourceRuleOptionsRequestLimiter `json:"request_limiter,nullable"`
// Hides HTTP headers from an origin server in the CDN response.
ResponseHeadersHidingPolicy CdnResourceRuleOptionsResponseHeadersHidingPolicy `json:"response_headers_hiding_policy,nullable"`
// Changes and redirects requests from the CDN to the origin. It operates according
// to the
// [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite)
// configuration.
Rewrite CdnResourceRuleOptionsRewrite `json:"rewrite,nullable"`
// Configures access with tokenized URLs. This makes impossible to access content
// without a valid (unexpired) token.
SecureKey CdnResourceRuleOptionsSecureKey `json:"secure_key,nullable"`
// Requests and caches files larger than 10 MB in parts (no larger than 10 MB per
// part.) This reduces time to first byte.
//
// The option is based on the
// [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
//
// Notes:
//
// 1. Origin must support HTTP Range requests.
// 2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed`
// options enabled.
Slice CdnResourceRuleOptionsSlice `json:"slice,nullable"`
// The hostname that is added to SNI requests from CDN servers to the origin server
// via HTTPS.
//
// SNI is generally only required if your origin uses shared hosting or does not
// have a dedicated IP address. If the origin server presents multiple
// certificates, SNI allows the origin server to know which certificate to use for
// the connection.
//
// The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
Sni CdnResourceRuleOptionsSni `json:"sni,nullable"`
// Serves stale cached content in case of origin unavailability.
Stale CdnResourceRuleOptionsStale `json:"stale,nullable"`
// Custom HTTP Headers that a CDN server adds to a response.
StaticResponseHeaders CdnResourceRuleOptionsStaticResponseHeaders `json:"static_response_headers,nullable"`
// **Legacy option**. Use the `static_response_headers` option instead.
//
// Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP
// Headers can be specified. May contain a header with multiple values.
//
// Deprecated: deprecated
StaticHeaders CdnResourceRuleOptionsStaticHeaders `json:"staticHeaders,nullable"`
// Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP
// Headers can be specified.
StaticRequestHeaders CdnResourceRuleOptionsStaticRequestHeaders `json:"staticRequestHeaders,nullable"`
// Controls access to the content for specified User-Agents.
UserAgentACL CdnResourceRuleOptionsUserAgentACL `json:"user_agent_acl,nullable"`
// Allows to enable WAAP (Web Application and API Protection).
Waap CdnResourceRuleOptionsWaap `json:"waap,nullable"`
// Enables or disables WebSockets connections to an origin server.
Websockets CdnResourceRuleOptionsWebsockets `json:"websockets,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AllowedHTTPMethods respjson.Field
BotProtection respjson.Field
BrotliCompression respjson.Field
BrowserCacheSettings respjson.Field
CacheHTTPHeaders respjson.Field
Cors respjson.Field
CountryACL respjson.Field
DisableCache respjson.Field
DisableProxyForceRanges respjson.Field
EdgeCacheSettings respjson.Field
Fastedge respjson.Field
FetchCompressed respjson.Field
FollowOriginRedirect respjson.Field
ForceReturn respjson.Field
ForwardHostHeader respjson.Field
GzipOn respjson.Field
HostHeader respjson.Field
IgnoreCookie respjson.Field
IgnoreQueryString respjson.Field
ImageStack respjson.Field
IPAddressACL respjson.Field
LimitBandwidth respjson.Field
ProxyCacheKey respjson.Field
ProxyCacheMethodsSet respjson.Field
ProxyConnectTimeout respjson.Field
ProxyReadTimeout respjson.Field
QueryParamsBlacklist respjson.Field
QueryParamsWhitelist respjson.Field
QueryStringForwarding respjson.Field
RedirectHTTPToHTTPS respjson.Field
RedirectHTTPSToHTTP respjson.Field
ReferrerACL respjson.Field
RequestLimiter respjson.Field
ResponseHeadersHidingPolicy respjson.Field
Rewrite respjson.Field
SecureKey respjson.Field
Slice respjson.Field
Sni respjson.Field
Stale respjson.Field
StaticResponseHeaders respjson.Field
StaticHeaders respjson.Field
StaticRequestHeaders respjson.Field
UserAgentACL respjson.Field
Waap respjson.Field
Websockets respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
List of options that can be configured for the rule.
In case of `null` value the option is not added to the rule. Option inherits its value from the CDN resource settings.
func (CdnResourceRuleOptions) RawJSON ¶
func (r CdnResourceRuleOptions) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptions) UnmarshalJSON ¶
func (r *CdnResourceRuleOptions) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsAllowedHTTPMethods ¶
type CdnResourceRuleOptionsAllowedHTTPMethods struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
Value []string `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
HTTP methods allowed for content requests from the CDN.
func (CdnResourceRuleOptionsAllowedHTTPMethods) RawJSON ¶
func (r CdnResourceRuleOptionsAllowedHTTPMethods) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsAllowedHTTPMethods) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsAllowedHTTPMethods) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsBotProtection ¶
type CdnResourceRuleOptionsBotProtection struct {
// Controls the bot challenge module state.
BotChallenge CdnResourceRuleOptionsBotProtectionBotChallenge `json:"bot_challenge,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
BotChallenge respjson.Field
Enabled respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Allows to prevent online services from overloading and ensure your business workflow running smoothly.
func (CdnResourceRuleOptionsBotProtection) RawJSON ¶
func (r CdnResourceRuleOptionsBotProtection) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsBotProtection) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsBotProtection) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsBotProtectionBotChallenge ¶
type CdnResourceRuleOptionsBotProtectionBotChallenge struct {
// Possible values:
//
// - **true** - Bot challenge is enabled.
// - **false** - Bot challenge is disabled.
Enabled bool `json:"enabled"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Controls the bot challenge module state.
func (CdnResourceRuleOptionsBotProtectionBotChallenge) RawJSON ¶
func (r CdnResourceRuleOptionsBotProtectionBotChallenge) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsBotProtectionBotChallenge) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsBotProtectionBotChallenge) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsBrotliCompression ¶
type CdnResourceRuleOptionsBrotliCompression struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Allows to select the content types you want to compress.
//
// `text/html` is a mandatory content type.
//
// Any of "application/javascript", "application/json",
// "application/vnd.ms-fontobject", "application/wasm", "application/x-font-ttf",
// "application/x-javascript", "application/xml", "application/xml+rss",
// "image/svg+xml", "image/x-icon", "text/css", "text/html", "text/javascript",
// "text/plain", "text/xml".
Value []string `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Compresses content with Brotli on the CDN side. CDN servers will request only uncompressed content from the origin.
Notes:
- CDN only supports "Brotli compression" when the "origin shielding" feature is activated.
- If a precache server is not active for a CDN resource, no compression occurs, even if the option is enabled.
- `brotli_compression` is not supported with `fetch_compressed` or `slice` options enabled.
- `fetch_compressed` option in CDN resource settings overrides `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN resource and want to enable `brotli_compression` in a rule, you must specify `fetch_compressed:false` in the rule.
func (CdnResourceRuleOptionsBrotliCompression) RawJSON ¶
func (r CdnResourceRuleOptionsBrotliCompression) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsBrotliCompression) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsBrotliCompression) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsBrowserCacheSettings ¶
type CdnResourceRuleOptionsBrowserCacheSettings struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Set the cache expiration time to '0s' to disable caching.
//
// The maximum duration is any equivalent to `1y`.
Value string `json:"value,required" format:"nginx time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Cache expiration time for users browsers in seconds.
Cache expiration time is applied to the following response codes: 200, 201, 204, 206, 301, 302, 303, 304, 307, 308.
Responses with other codes will not be cached.
func (CdnResourceRuleOptionsBrowserCacheSettings) RawJSON ¶
func (r CdnResourceRuleOptionsBrowserCacheSettings) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsBrowserCacheSettings) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsBrowserCacheSettings) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsCacheHTTPHeaders
deprecated
type CdnResourceRuleOptionsCacheHTTPHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
Value []string `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
**Legacy option**. Use the `response_headers_hiding_policy` option instead.
HTTP Headers that must be included in the response.
Deprecated: deprecated
func (CdnResourceRuleOptionsCacheHTTPHeaders) RawJSON ¶
func (r CdnResourceRuleOptionsCacheHTTPHeaders) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsCacheHTTPHeaders) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsCacheHTTPHeaders) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsCors ¶
type CdnResourceRuleOptionsCors struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Value of the Access-Control-Allow-Origin header.
//
// Possible values:
//
// - **Adds \* as the Access-Control-Allow-Origin header value** - Content will be
// uploaded for requests from any domain. `"value": ["*"]`
// - **Adds "$http_origin" as the Access-Control-Allow-Origin header value if the
// origin matches one of the listed domains** - Content will be uploaded only for
// requests from the domains specified in the field.
// `"value": ["domain.com", "second.dom.com"]`
// - **Adds "$http_origin" as the Access-Control-Allow-Origin header value** -
// Content will be uploaded for requests from any domain, and the domain from
// which the request was sent will be added to the "Access-Control-Allow-Origin"
// header in the response. `"value": ["$http_origin"]`
Value []string `json:"value,required"`
// Defines whether the Access-Control-Allow-Origin header should be added to a
// response from CDN regardless of response code.
//
// Possible values:
//
// - **true** - Header will be added to a response regardless of response code.
// - **false** - Header will only be added to responses with codes: 200, 201, 204,
// 206, 301, 302, 303, 304, 307, 308.
Always bool `json:"always"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
Always respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Enables or disables CORS (Cross-Origin Resource Sharing) header support.
CORS header support allows the CDN to add the Access-Control-Allow-Origin header to a response to a browser.
func (CdnResourceRuleOptionsCors) RawJSON ¶
func (r CdnResourceRuleOptionsCors) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsCors) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsCors) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsCountryACL ¶
type CdnResourceRuleOptionsCountryACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of countries according to ISO-3166-1.
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of countries for which access is prohibited.
// - **deny** - List of countries for which access is allowed.
ExceptedValues []string `json:"excepted_values,required" format:"country-code"`
// Defines the type of CDN resource access policy.
//
// Possible values:
//
// - **allow** - Access is allowed for all the countries except for those specified
// in `excepted_values` field.
// - **deny** - Access is denied for all the countries except for those specified
// in `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
ExceptedValues respjson.Field
PolicyType respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Enables control access to content for specified countries.
func (CdnResourceRuleOptionsCountryACL) RawJSON ¶
func (r CdnResourceRuleOptionsCountryACL) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsCountryACL) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsCountryACL) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsDisableCache
deprecated
type CdnResourceRuleOptionsDisableCache struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - content caching is disabled.
// - **false** - content caching is enabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
**Legacy option**. Use the `edge_cache_settings` option instead.
Allows the complete disabling of content caching.
Deprecated: deprecated
func (CdnResourceRuleOptionsDisableCache) RawJSON ¶
func (r CdnResourceRuleOptionsDisableCache) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsDisableCache) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsDisableCache) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsDisableProxyForceRanges ¶
type CdnResourceRuleOptionsDisableProxyForceRanges struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Allows 206 responses regardless of the settings of an origin source.
func (CdnResourceRuleOptionsDisableProxyForceRanges) RawJSON ¶
func (r CdnResourceRuleOptionsDisableProxyForceRanges) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsDisableProxyForceRanges) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsDisableProxyForceRanges) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsEdgeCacheSettings ¶
type CdnResourceRuleOptionsEdgeCacheSettings struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// A MAP object representing the caching time in seconds for a response with a
// specific response code.
//
// These settings have a higher priority than the `value` field.
//
// - Use `any` key to specify caching time for all response codes.
// - Use `0s` value to disable caching for a specific response code.
CustomValues map[string]string `json:"custom_values" format:"nginx time"`
// Enables content caching according to the origin cache settings.
//
// The value is applied to the following response codes 200, 201, 204, 206, 301,
// 302, 303, 304, 307, 308, if an origin server does not have caching HTTP headers.
//
// Responses with other codes will not be cached.
//
// The maximum duration is any equivalent to `1y`.
Default string `json:"default" format:"nginx time"`
// Caching time.
//
// The value is applied to the following response codes: 200, 206, 301, 302.
// Responses with codes 4xx, 5xx will not be cached.
//
// Use `0s` to disable caching.
//
// The maximum duration is any equivalent to `1y`.
Value string `json:"value" format:"nginx time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
CustomValues respjson.Field
Default respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Cache expiration time for CDN servers.
`value` and `default` fields cannot be used simultaneously.
func (CdnResourceRuleOptionsEdgeCacheSettings) RawJSON ¶
func (r CdnResourceRuleOptionsEdgeCacheSettings) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsEdgeCacheSettings) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsEdgeCacheSettings) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsFastedge ¶
type CdnResourceRuleOptionsFastedge struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Allows to configure FastEdge application that will be called to handle request
// body as soon as CDN receives incoming HTTP request.
OnRequestBody CdnResourceRuleOptionsFastedgeOnRequestBody `json:"on_request_body"`
// Allows to configure FastEdge application that will be called to handle request
// headers as soon as CDN receives incoming HTTP request.
OnRequestHeaders CdnResourceRuleOptionsFastedgeOnRequestHeaders `json:"on_request_headers"`
// Allows to configure FastEdge application that will be called to handle response
// body before CDN sends the HTTP response.
OnResponseBody CdnResourceRuleOptionsFastedgeOnResponseBody `json:"on_response_body"`
// Allows to configure FastEdge application that will be called to handle response
// headers before CDN sends the HTTP response.
OnResponseHeaders CdnResourceRuleOptionsFastedgeOnResponseHeaders `json:"on_response_headers"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
OnRequestBody respjson.Field
OnRequestHeaders respjson.Field
OnResponseBody respjson.Field
OnResponseHeaders respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Allows to configure FastEdge app to be called on different request/response phases.
Note: At least one of `on_request_headers`, `on_request_body`, `on_response_headers`, or `on_response_body` must be specified.
func (CdnResourceRuleOptionsFastedge) RawJSON ¶
func (r CdnResourceRuleOptionsFastedge) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsFastedge) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsFastedge) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsFastedgeOnRequestBody ¶
type CdnResourceRuleOptionsFastedgeOnRequestBody struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled bool `json:"enabled"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge bool `json:"execute_on_edge"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield bool `json:"execute_on_shield"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError bool `json:"interrupt_on_error"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AppID respjson.Field
Enabled respjson.Field
ExecuteOnEdge respjson.Field
ExecuteOnShield respjson.Field
InterruptOnError respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Allows to configure FastEdge application that will be called to handle request body as soon as CDN receives incoming HTTP request.
func (CdnResourceRuleOptionsFastedgeOnRequestBody) RawJSON ¶
func (r CdnResourceRuleOptionsFastedgeOnRequestBody) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsFastedgeOnRequestBody) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsFastedgeOnRequestBody) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsFastedgeOnRequestHeaders ¶
type CdnResourceRuleOptionsFastedgeOnRequestHeaders struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled bool `json:"enabled"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge bool `json:"execute_on_edge"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield bool `json:"execute_on_shield"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError bool `json:"interrupt_on_error"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AppID respjson.Field
Enabled respjson.Field
ExecuteOnEdge respjson.Field
ExecuteOnShield respjson.Field
InterruptOnError respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request.
func (CdnResourceRuleOptionsFastedgeOnRequestHeaders) RawJSON ¶
func (r CdnResourceRuleOptionsFastedgeOnRequestHeaders) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsFastedgeOnRequestHeaders) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsFastedgeOnRequestHeaders) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsFastedgeOnResponseBody ¶
type CdnResourceRuleOptionsFastedgeOnResponseBody struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled bool `json:"enabled"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge bool `json:"execute_on_edge"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield bool `json:"execute_on_shield"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError bool `json:"interrupt_on_error"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AppID respjson.Field
Enabled respjson.Field
ExecuteOnEdge respjson.Field
ExecuteOnShield respjson.Field
InterruptOnError respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Allows to configure FastEdge application that will be called to handle response body before CDN sends the HTTP response.
func (CdnResourceRuleOptionsFastedgeOnResponseBody) RawJSON ¶
func (r CdnResourceRuleOptionsFastedgeOnResponseBody) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsFastedgeOnResponseBody) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsFastedgeOnResponseBody) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsFastedgeOnResponseHeaders ¶
type CdnResourceRuleOptionsFastedgeOnResponseHeaders struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled bool `json:"enabled"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge bool `json:"execute_on_edge"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield bool `json:"execute_on_shield"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError bool `json:"interrupt_on_error"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AppID respjson.Field
Enabled respjson.Field
ExecuteOnEdge respjson.Field
ExecuteOnShield respjson.Field
InterruptOnError respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Allows to configure FastEdge application that will be called to handle response headers before CDN sends the HTTP response.
func (CdnResourceRuleOptionsFastedgeOnResponseHeaders) RawJSON ¶
func (r CdnResourceRuleOptionsFastedgeOnResponseHeaders) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsFastedgeOnResponseHeaders) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsFastedgeOnResponseHeaders) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsFetchCompressed ¶
type CdnResourceRuleOptionsFetchCompressed struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Makes the CDN request compressed content from the origin.
The origin server should support compression. CDN servers will not decompress your content even if a user browser does not accept compression.
Notes:
- `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or `slice` options enabled.
- `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If you enable it in CDN resource and want to use `gzipON` and `brotli_compression` in a rule, you have to specify `"fetch_compressed": false` in the rule.
func (CdnResourceRuleOptionsFetchCompressed) RawJSON ¶
func (r CdnResourceRuleOptionsFetchCompressed) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsFetchCompressed) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsFetchCompressed) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsFollowOriginRedirect ¶
type CdnResourceRuleOptionsFollowOriginRedirect struct {
// Redirect status code that the origin server returns.
//
// To serve up to date content to end users, you will need to purge the cache after
// managing the option.
//
// Any of 301, 302, 303, 307, 308.
Codes []int64 `json:"codes,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Codes respjson.Field
Enabled respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Enables redirection from origin. If the origin server returns a redirect, the option allows the CDN to pull the requested content from the origin server that was returned in the redirect.
func (CdnResourceRuleOptionsFollowOriginRedirect) RawJSON ¶
func (r CdnResourceRuleOptionsFollowOriginRedirect) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsFollowOriginRedirect) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsFollowOriginRedirect) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsForceReturn ¶
type CdnResourceRuleOptionsForceReturn struct {
// URL for redirection or text.
Body string `json:"body,required"`
// Status code value.
Code int64 `json:"code,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Controls the time at which a custom HTTP response code should be applied. By
// default, a custom HTTP response code is applied at any time.
TimeInterval CdnResourceRuleOptionsForceReturnTimeInterval `json:"time_interval,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Body respjson.Field
Code respjson.Field
Enabled respjson.Field
TimeInterval respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Applies custom HTTP response codes for CDN content.
The following codes are reserved by our system and cannot be specified in this option: 408, 444, 477, 494, 495, 496, 497, 499.
func (CdnResourceRuleOptionsForceReturn) RawJSON ¶
func (r CdnResourceRuleOptionsForceReturn) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsForceReturn) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsForceReturn) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsForceReturnTimeInterval ¶
type CdnResourceRuleOptionsForceReturnTimeInterval struct {
// Time until which a custom HTTP response code should be applied. Indicated in
// 24-hour format.
EndTime string `json:"end_time,required"`
// Time from which a custom HTTP response code should be applied. Indicated in
// 24-hour format.
StartTime string `json:"start_time,required"`
// Time zone used to calculate time.
TimeZone string `json:"time_zone" format:"timezone"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
EndTime respjson.Field
StartTime respjson.Field
TimeZone respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Controls the time at which a custom HTTP response code should be applied. By default, a custom HTTP response code is applied at any time.
func (CdnResourceRuleOptionsForceReturnTimeInterval) RawJSON ¶
func (r CdnResourceRuleOptionsForceReturnTimeInterval) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsForceReturnTimeInterval) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsForceReturnTimeInterval) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsForwardHostHeader ¶
type CdnResourceRuleOptionsForwardHostHeader struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Forwards the Host header from a end-user request to an origin server.
`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
func (CdnResourceRuleOptionsForwardHostHeader) RawJSON ¶
func (r CdnResourceRuleOptionsForwardHostHeader) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsForwardHostHeader) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsForwardHostHeader) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsGzipOn ¶
type CdnResourceRuleOptionsGzipOn struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Compresses content with gzip on the CDN end. CDN servers will request only uncompressed content from the origin.
Notes:
- Compression with gzip is not supported with `fetch_compressed` or `slice` options enabled.
- `fetch_compressed` option in CDN resource settings overrides `gzipON` in rules. If you enable `fetch_compressed` in CDN resource and want to enable `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
func (CdnResourceRuleOptionsGzipOn) RawJSON ¶
func (r CdnResourceRuleOptionsGzipOn) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsGzipOn) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsGzipOn) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsHostHeader ¶
type CdnResourceRuleOptionsHostHeader struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Host Header value.
Value string `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Sets the Host header that CDN servers use when request content from an origin server. Your server must be able to process requests with the chosen header.
If the option is `null`, the Host Header value is equal to first CNAME.
`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
func (CdnResourceRuleOptionsHostHeader) RawJSON ¶
func (r CdnResourceRuleOptionsHostHeader) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsHostHeader) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsHostHeader) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsIPAddressACL ¶
type CdnResourceRuleOptionsIPAddressACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of IP addresses with a subnet mask.
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of IP addresses for which access is prohibited.
// - **deny** - List of IP addresses for which access is allowed.
//
// Examples:
//
// - `192.168.3.2/32`
// - `2a03:d000:2980:7::8/128`
ExceptedValues []string `json:"excepted_values,required" format:"ipv4net or ipv6net"`
// IP access policy type.
//
// Possible values:
//
// - **allow** - Allow access to all IPs except IPs specified in "excepted_values"
// field.
// - **deny** - Deny access to all IPs except IPs specified in "excepted_values"
// field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
ExceptedValues respjson.Field
PolicyType respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Controls access to the CDN resource content for specific IP addresses.
If you want to use IPs from our CDN servers IP list for IP ACL configuration, you have to independently monitor their relevance. We recommend you use a script for automatically update IP ACL. [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
func (CdnResourceRuleOptionsIPAddressACL) RawJSON ¶
func (r CdnResourceRuleOptionsIPAddressACL) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsIPAddressACL) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsIPAddressACL) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsIgnoreCookie ¶
type CdnResourceRuleOptionsIgnoreCookie struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled, files with cookies are cached as one file.
// - **false** - Option is disabled, files with cookies are cached as different
// files.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Defines whether the files with the Set-Cookies header are cached as one file or as different ones.
func (CdnResourceRuleOptionsIgnoreCookie) RawJSON ¶
func (r CdnResourceRuleOptionsIgnoreCookie) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsIgnoreCookie) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsIgnoreCookie) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsIgnoreQueryString ¶
type CdnResourceRuleOptionsIgnoreQueryString struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
How a file with different query strings is cached: either as one object (option is enabled) or as different objects (option is disabled.)
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
func (CdnResourceRuleOptionsIgnoreQueryString) RawJSON ¶
func (r CdnResourceRuleOptionsIgnoreQueryString) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsIgnoreQueryString) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsIgnoreQueryString) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsImageStack ¶
type CdnResourceRuleOptionsImageStack struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Enables or disables automatic conversion of JPEG and PNG images to AVI format.
AvifEnabled bool `json:"avif_enabled"`
// Enables or disables compression without quality loss for PNG format.
PngLossless bool `json:"png_lossless"`
// Defines quality settings for JPG and PNG images. The higher the value, the
// better the image quality, and the larger the file size after conversion.
Quality int64 `json:"quality"`
// Enables or disables automatic conversion of JPEG and PNG images to WebP format.
WebpEnabled bool `json:"webp_enabled"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
AvifEnabled respjson.Field
PngLossless respjson.Field
Quality respjson.Field
WebpEnabled respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Transforms JPG and PNG images (for example, resize or crop) and automatically converts them to WebP or AVIF format.
func (CdnResourceRuleOptionsImageStack) RawJSON ¶
func (r CdnResourceRuleOptionsImageStack) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsImageStack) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsImageStack) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsLimitBandwidth ¶
type CdnResourceRuleOptionsLimitBandwidth struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Method of controlling the download speed per connection.
//
// Possible values:
//
// - **static** - Use speed and buffer fields to set the download speed limit.
// - **dynamic** - Use query strings **speed** and **buffer** to set the download
// speed limit.
//
// # For example, when requesting content at the link
//
// “`
// http://cdn.example.com/video.mp4?speed=50k&buffer=500k
// “`
//
// the download speed will be limited to 50kB/s after 500 kB.
//
// Any of "static", "dynamic".
LimitType string `json:"limit_type,required"`
// Amount of downloaded data after which the user will be rate limited.
Buffer int64 `json:"buffer"`
// Maximum download speed per connection.
Speed int64 `json:"speed"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
LimitType respjson.Field
Buffer respjson.Field
Speed respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Allows to control the download speed per connection.
func (CdnResourceRuleOptionsLimitBandwidth) RawJSON ¶
func (r CdnResourceRuleOptionsLimitBandwidth) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsLimitBandwidth) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsLimitBandwidth) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsProxyCacheKey ¶
type CdnResourceRuleOptionsProxyCacheKey struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Key for caching.
Value string `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Allows you to modify your cache key. If omitted, the default value is `$request_uri`.
Combine the specified variables to create a key for caching.
- **$`request_uri`** - **$scheme** - **$uri**
**Warning**: Enabling and changing this option can invalidate your current cache and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will not work.
func (CdnResourceRuleOptionsProxyCacheKey) RawJSON ¶
func (r CdnResourceRuleOptionsProxyCacheKey) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsProxyCacheKey) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsProxyCacheKey) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsProxyCacheMethodsSet ¶
type CdnResourceRuleOptionsProxyCacheMethodsSet struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Caching for POST requests along with default GET and HEAD.
func (CdnResourceRuleOptionsProxyCacheMethodsSet) RawJSON ¶
func (r CdnResourceRuleOptionsProxyCacheMethodsSet) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsProxyCacheMethodsSet) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsProxyCacheMethodsSet) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsProxyConnectTimeout ¶
type CdnResourceRuleOptionsProxyConnectTimeout struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Timeout value in seconds.
//
// Supported range: **1s - 5s**.
Value string `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The time limit for establishing a connection with the origin.
func (CdnResourceRuleOptionsProxyConnectTimeout) RawJSON ¶
func (r CdnResourceRuleOptionsProxyConnectTimeout) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsProxyConnectTimeout) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsProxyConnectTimeout) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsProxyReadTimeout ¶
type CdnResourceRuleOptionsProxyReadTimeout struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Timeout value in seconds.
//
// Supported range: **1s - 30s**.
Value string `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The time limit for receiving a partial response from the origin. If no response is received within this time, the connection will be closed.
**Note:** When used with a WebSocket connection, this option supports values only in the range 1–20 seconds (instead of the usual 1–30 seconds).
func (CdnResourceRuleOptionsProxyReadTimeout) RawJSON ¶
func (r CdnResourceRuleOptionsProxyReadTimeout) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsProxyReadTimeout) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsProxyReadTimeout) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsQueryParamsBlacklist ¶
type CdnResourceRuleOptionsQueryParamsBlacklist struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of query parameters.
Value []string `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Files with the specified query parameters are cached as one object, files with other parameters are cached as different objects.
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
func (CdnResourceRuleOptionsQueryParamsBlacklist) RawJSON ¶
func (r CdnResourceRuleOptionsQueryParamsBlacklist) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsQueryParamsBlacklist) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsQueryParamsBlacklist) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsQueryParamsWhitelist ¶
type CdnResourceRuleOptionsQueryParamsWhitelist struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of query parameters.
Value []string `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Files with the specified query parameters are cached as different objects, files with other parameters are cached as one object.
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
func (CdnResourceRuleOptionsQueryParamsWhitelist) RawJSON ¶
func (r CdnResourceRuleOptionsQueryParamsWhitelist) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsQueryParamsWhitelist) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsQueryParamsWhitelist) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsQueryStringForwarding ¶
type CdnResourceRuleOptionsQueryStringForwarding struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// The `forward_from_files_types` field specifies the types of playlist files from
// which parameters will be extracted and forwarded. This typically includes
// formats that list multiple media chunk references, such as HLS and DASH
// playlists. Parameters associated with these playlist files (like query strings
// or headers) will be propagated to the chunks they reference.
ForwardFromFileTypes []string `json:"forward_from_file_types,required"`
// The field specifies the types of media chunk files to which parameters,
// extracted from playlist files, will be forwarded. These refer to the actual
// segments of media content that are delivered to viewers. Ensuring the correct
// parameters are forwarded to these files is crucial for maintaining the integrity
// of the streaming session.
ForwardToFileTypes []string `json:"forward_to_file_types,required"`
// The `forward_except_keys` field provides a mechanism to exclude specific
// parameters from being forwarded from playlist files to media chunk files. By
// listing certain keys in this field, you can ensure that these parameters are
// omitted during the forwarding process. This is particularly useful for
// preventing sensitive or irrelevant information from being included in requests
// for media chunks, thereby enhancing security and optimizing performance.
ForwardExceptKeys []string `json:"forward_except_keys"`
// The `forward_only_keys` field allows for granular control over which specific
// parameters are forwarded from playlist files to media chunk files. By specifying
// certain keys, only those parameters will be propagated, ensuring that only
// relevant information is passed along. This is particularly useful for security
// and performance optimization, as it prevents unnecessary or sensitive data from
// being included in requests for media chunks.
ForwardOnlyKeys []string `json:"forward_only_keys"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
ForwardFromFileTypes respjson.Field
ForwardToFileTypes respjson.Field
ForwardExceptKeys respjson.Field
ForwardOnlyKeys respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The Query String Forwarding feature allows for the seamless transfer of parameters embedded in playlist files to the corresponding media chunk files. This functionality ensures that specific attributes, such as authentication tokens or tracking information, are consistently passed along from the playlist manifest to the individual media segments. This is particularly useful for maintaining continuity in security, analytics, and any other parameter-based operations across the entire media delivery workflow.
func (CdnResourceRuleOptionsQueryStringForwarding) RawJSON ¶
func (r CdnResourceRuleOptionsQueryStringForwarding) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsQueryStringForwarding) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsQueryStringForwarding) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsRedirectHTTPSToHTTP ¶
type CdnResourceRuleOptionsRedirectHTTPSToHTTP struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Enables redirect from HTTPS to HTTP.
`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.
func (CdnResourceRuleOptionsRedirectHTTPSToHTTP) RawJSON ¶
func (r CdnResourceRuleOptionsRedirectHTTPSToHTTP) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsRedirectHTTPSToHTTP) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsRedirectHTTPSToHTTP) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsRedirectHTTPToHTTPS ¶
type CdnResourceRuleOptionsRedirectHTTPToHTTPS struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Enables redirect from HTTP to HTTPS.
`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.
func (CdnResourceRuleOptionsRedirectHTTPToHTTPS) RawJSON ¶
func (r CdnResourceRuleOptionsRedirectHTTPToHTTPS) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsRedirectHTTPToHTTPS) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsRedirectHTTPToHTTPS) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsReferrerACL ¶
type CdnResourceRuleOptionsReferrerACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of domain names or wildcard domains (without protocol: `http://` or
// `https://`.)
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of domain names for which access is prohibited.
// - **deny** - List of IP domain names for which access is allowed.
//
// Examples:
//
// - `example.com`
// - `*.example.com`
ExceptedValues []string `json:"excepted_values,required" format:"domain or wildcard"`
// Policy type.
//
// Possible values:
//
// - **allow** - Allow access to all domain names except the domain names specified
// in `excepted_values` field.
// - **deny** - Deny access to all domain names except the domain names specified
// in `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
ExceptedValues respjson.Field
PolicyType respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Controls access to the CDN resource content for specified domain names.
func (CdnResourceRuleOptionsReferrerACL) RawJSON ¶
func (r CdnResourceRuleOptionsReferrerACL) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsReferrerACL) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsReferrerACL) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsRequestLimiter ¶
type CdnResourceRuleOptionsRequestLimiter struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Maximum request rate.
Rate int64 `json:"rate,required"`
Burst int64 `json:"burst"`
Delay int64 `json:"delay"`
// Units of measurement for the `rate` field.
//
// Possible values:
//
// - **r/s** - Requests per second.
// - **r/m** - Requests per minute.
//
// If the rate is less than one request per second, it is specified in request per
// minute (r/m.)
//
// Any of "r/s", "r/m".
RateUnit string `json:"rate_unit"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Rate respjson.Field
Burst respjson.Field
Delay respjson.Field
RateUnit respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Option allows to limit the amount of HTTP requests.
func (CdnResourceRuleOptionsRequestLimiter) RawJSON ¶
func (r CdnResourceRuleOptionsRequestLimiter) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsRequestLimiter) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsRequestLimiter) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsResponseHeadersHidingPolicy ¶
type CdnResourceRuleOptionsResponseHeadersHidingPolicy struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of HTTP headers.
//
// Parameter meaning depends on the value of the `mode` field:
//
// - **show** - List of HTTP headers to hide from response.
// - **hide** - List of HTTP headers to include in response. Other HTTP headers
// will be hidden.
//
// The following headers are required and cannot be hidden from response:
//
// - `Connection`
// - `Content-Length`
// - `Content-Type`
// - `Date`
// - `Server`
Excepted []string `json:"excepted,required" format:"http_header"`
// How HTTP headers are hidden from the response.
//
// Possible values:
//
// - **show** - Hide only HTTP headers listed in the `excepted` field.
// - **hide** - Hide all HTTP headers except headers listed in the "excepted"
// field.
//
// Any of "hide", "show".
Mode string `json:"mode,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Excepted respjson.Field
Mode respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Hides HTTP headers from an origin server in the CDN response.
func (CdnResourceRuleOptionsResponseHeadersHidingPolicy) RawJSON ¶
func (r CdnResourceRuleOptionsResponseHeadersHidingPolicy) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsResponseHeadersHidingPolicy) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsResponseHeadersHidingPolicy) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsRewrite ¶
type CdnResourceRuleOptionsRewrite struct {
// Path for the Rewrite option.
//
// Example:
//
// - `/(.*) /media/$1`
Body string `json:"body,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Flag for the Rewrite option.
//
// Possible values:
//
// - **last** - Stop processing the current set of `ngx_http_rewrite_module`
// directives and start a search for a new location matching changed URI.
// - **break** - Stop processing the current set of the Rewrite option.
// - **redirect** - Return a temporary redirect with the 302 code; used when a
// replacement string does not start with `http://`, `https://`, or `$scheme`.
// - **permanent** - Return a permanent redirect with the 301 code.
//
// Any of "break", "last", "redirect", "permanent".
Flag string `json:"flag"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Body respjson.Field
Enabled respjson.Field
Flag respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Changes and redirects requests from the CDN to the origin. It operates according to the [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite) configuration.
func (CdnResourceRuleOptionsRewrite) RawJSON ¶
func (r CdnResourceRuleOptionsRewrite) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsRewrite) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsRewrite) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsSecureKey ¶
type CdnResourceRuleOptionsSecureKey struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Key generated on your side that will be used for URL signing.
Key string `json:"key,required"`
// Type of URL signing.
//
// Possible types:
//
// - **Type 0** - Includes end user IP to secure token generation.
// - **Type 2** - Excludes end user IP from secure token generation.
//
// Any of 0, 2.
Type int64 `json:"type"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Key respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Configures access with tokenized URLs. This makes impossible to access content without a valid (unexpired) token.
func (CdnResourceRuleOptionsSecureKey) RawJSON ¶
func (r CdnResourceRuleOptionsSecureKey) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsSecureKey) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsSecureKey) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsSlice ¶
type CdnResourceRuleOptionsSlice struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Requests and caches files larger than 10 MB in parts (no larger than 10 MB per part.) This reduces time to first byte.
The option is based on the [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
Notes:
- Origin must support HTTP Range requests.
- Not supported with `gzipON`, `brotli_compression` or `fetch_compressed` options enabled.
func (CdnResourceRuleOptionsSlice) RawJSON ¶
func (r CdnResourceRuleOptionsSlice) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsSlice) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsSlice) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsSni ¶
type CdnResourceRuleOptionsSni struct {
// Custom SNI hostname.
//
// It is required if `sni_type` is set to custom.
CustomHostname string `json:"custom_hostname,required" format:"domain"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// SNI (Server Name Indication) type.
//
// Possible values:
//
// - **dynamic** - SNI hostname depends on `hostHeader` and `forward_host_header`
// options. It has several possible combinations:
// - If the `hostHeader` option is enabled and specified, SNI hostname matches the
// Host header.
// - If the `forward_host_header` option is enabled and has true value, SNI
// hostname matches the Host header used in the request made to a CDN.
// - If the `hostHeader` and `forward_host_header` options are disabled, SNI
// hostname matches the primary CNAME.
// - **custom** - custom SNI hostname is in use.
//
// Any of "dynamic", "custom".
SniType string `json:"sni_type"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CustomHostname respjson.Field
Enabled respjson.Field
SniType respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The hostname that is added to SNI requests from CDN servers to the origin server via HTTPS.
SNI is generally only required if your origin uses shared hosting or does not have a dedicated IP address. If the origin server presents multiple certificates, SNI allows the origin server to know which certificate to use for the connection.
The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
func (CdnResourceRuleOptionsSni) RawJSON ¶
func (r CdnResourceRuleOptionsSni) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsSni) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsSni) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsStale ¶
type CdnResourceRuleOptionsStale struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Defines list of errors for which "Always online" option is applied.
//
// Any of "error", "http_403", "http_404", "http_429", "http_500", "http_502",
// "http_503", "http_504", "invalid_header", "timeout", "updating".
Value []string `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Serves stale cached content in case of origin unavailability.
func (CdnResourceRuleOptionsStale) RawJSON ¶
func (r CdnResourceRuleOptionsStale) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsStale) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsStale) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsStaticHeaders
deprecated
type CdnResourceRuleOptionsStaticHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// A MAP for static headers in a format of `header_name: header_value`.
//
// Restrictions:
//
// - **Header name** - Maximum 128 symbols, may contain Latin letters (A-Z, a-z),
// numbers (0-9), dashes, and underscores.
// - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
// (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
// with a letter, number, asterisk or {.
Value any `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
**Legacy option**. Use the `static_response_headers` option instead.
Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP Headers can be specified. May contain a header with multiple values.
Deprecated: deprecated
func (CdnResourceRuleOptionsStaticHeaders) RawJSON ¶
func (r CdnResourceRuleOptionsStaticHeaders) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsStaticHeaders) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsStaticHeaders) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsStaticRequestHeaders ¶
type CdnResourceRuleOptionsStaticRequestHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// A MAP for static headers in a format of `header_name: header_value`.
//
// Restrictions:
//
// - **Header name** - Maximum 255 symbols, may contain Latin letters (A-Z, a-z),
// numbers (0-9), dashes, and underscores.
// - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
// (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
// with a letter, number, asterisk or {.
Value map[string]string `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP Headers can be specified.
func (CdnResourceRuleOptionsStaticRequestHeaders) RawJSON ¶
func (r CdnResourceRuleOptionsStaticRequestHeaders) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsStaticRequestHeaders) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsStaticRequestHeaders) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsStaticResponseHeaders ¶
type CdnResourceRuleOptionsStaticResponseHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
Value []CdnResourceRuleOptionsStaticResponseHeadersValue `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Custom HTTP Headers that a CDN server adds to a response.
func (CdnResourceRuleOptionsStaticResponseHeaders) RawJSON ¶
func (r CdnResourceRuleOptionsStaticResponseHeaders) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsStaticResponseHeaders) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsStaticResponseHeaders) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsStaticResponseHeadersValue ¶
type CdnResourceRuleOptionsStaticResponseHeadersValue struct {
// HTTP Header name.
//
// Restrictions:
//
// - Maximum 128 symbols.
// - Latin letters (A-Z, a-z,) numbers (0-9,) dashes, and underscores only.
Name string `json:"name,required"`
// Header value.
//
// Restrictions:
//
// - Maximum 512 symbols.
// - Letters (a-z), numbers (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+
// /|\";:?.,><{}[]).
// - Must start with a letter, number, asterisk or {.
// - Multiple values can be added.
Value []string `json:"value,required"`
// Defines whether the header will be added to a response from CDN regardless of
// response code.
//
// Possible values:
//
// - **true** - Header will be added to a response from CDN regardless of response
// code.
// - **false** - Header will be added only to the following response codes: 200,
// 201, 204, 206, 301, 302, 303, 304, 307, 308.
Always bool `json:"always"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Name respjson.Field
Value respjson.Field
Always respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (CdnResourceRuleOptionsStaticResponseHeadersValue) RawJSON ¶
func (r CdnResourceRuleOptionsStaticResponseHeadersValue) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsStaticResponseHeadersValue) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsStaticResponseHeadersValue) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsUserAgentACL ¶
type CdnResourceRuleOptionsUserAgentACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of User-Agents that will be allowed/denied.
//
// The meaning of the parameter depends on `policy_type`:
//
// - **allow** - List of User-Agents for which access is prohibited.
// - **deny** - List of User-Agents for which access is allowed.
//
// Use an empty string `""` to allow/deny access when the User-Agent header is
// empty.
ExceptedValues []string `json:"excepted_values,required" format:"user_agent"`
// User-Agents policy type.
//
// Possible values:
//
// - **allow** - Allow access for all User-Agents except specified in
// `excepted_values` field.
// - **deny** - Deny access for all User-Agents except specified in
// `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
ExceptedValues respjson.Field
PolicyType respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Controls access to the content for specified User-Agents.
func (CdnResourceRuleOptionsUserAgentACL) RawJSON ¶
func (r CdnResourceRuleOptionsUserAgentACL) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsUserAgentACL) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsUserAgentACL) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsWaap ¶
type CdnResourceRuleOptionsWaap struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Allows to enable WAAP (Web Application and API Protection).
func (CdnResourceRuleOptionsWaap) RawJSON ¶
func (r CdnResourceRuleOptionsWaap) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsWaap) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsWaap) UnmarshalJSON(data []byte) error
type CdnResourceRuleOptionsWebsockets ¶
type CdnResourceRuleOptionsWebsockets struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Enables or disables WebSockets connections to an origin server.
func (CdnResourceRuleOptionsWebsockets) RawJSON ¶
func (r CdnResourceRuleOptionsWebsockets) RawJSON() string
Returns the unmodified JSON received from the API
func (*CdnResourceRuleOptionsWebsockets) UnmarshalJSON ¶
func (r *CdnResourceRuleOptionsWebsockets) UnmarshalJSON(data []byte) error
type CdnResourceRuleOriginProtocol ¶
type CdnResourceRuleOriginProtocol string
Protocol used by CDN servers to request content from an origin source.
Possible values:
- **HTTPS** - CDN servers connect to origin via HTTPS protocol.
- **HTTP** - CDN servers connect to origin via HTTP protocol.
- **MATCH** - Connection protocol is chosen automatically; in this case, content on origin source should be available for the CDN both through HTTP and HTTPS protocols.
const ( CdnResourceRuleOriginProtocolHTTPS CdnResourceRuleOriginProtocol = "HTTPS" CdnResourceRuleOriginProtocolHTTP CdnResourceRuleOriginProtocol = "HTTP" CdnResourceRuleOriginProtocolMatch CdnResourceRuleOriginProtocol = "MATCH" )
type CdnResourceRuleOverrideOriginProtocol ¶
type CdnResourceRuleOverrideOriginProtocol string
Sets a protocol other than the one specified in the CDN resource settings to connect to the origin.
Possible values:
- **HTTPS** - CDN servers connect to origin via HTTPS protocol.
- **HTTP** - CDN servers connect to origin via HTTP protocol.
- **MATCH** - Connection protocol is chosen automatically; in this case, content on origin source should be available for the CDN both through HTTP and HTTPS protocols.
- **null** - `originProtocol` setting is inherited from the CDN resource settings.
const ( CdnResourceRuleOverrideOriginProtocolHTTPS CdnResourceRuleOverrideOriginProtocol = "HTTPS" CdnResourceRuleOverrideOriginProtocolHTTP CdnResourceRuleOverrideOriginProtocol = "HTTP" CdnResourceRuleOverrideOriginProtocolMatch CdnResourceRuleOverrideOriginProtocol = "MATCH" )
type CdnResourceStatus ¶
type CdnResourceStatus string
CDN resource status.
Possible values:
- **active** - CDN resource is active. Content is available to users.
- **suspended** - CDN resource is suspended. Content is not available to users.
- **processed** - CDN resource has recently been created and is currently being processed. It will take about fifteen minutes to propagate it to all locations.
- **deleted** - CDN resource is deleted.
const ( CdnResourceStatusActive CdnResourceStatus = "active" CdnResourceStatusSuspended CdnResourceStatus = "suspended" CdnResourceStatusProcessed CdnResourceStatus = "processed" CdnResourceStatusDeleted CdnResourceStatus = "deleted" )
type CdnService ¶
type CdnService struct {
Options []option.RequestOption
Resources ResourceService
Shields ShieldService
OriginGroups OriginGroupService
RuleTemplates RuleTemplateService
Certificates CertificateService
TrustedCaCertificates TrustedCaCertificateService
AuditLogs AuditLogService
Logs LogService
LogsUploader LogsUploaderService
Statistics StatisticService
NetworkCapacity NetworkCapacityService
Metrics MetricService
IPRanges IPRangeService
}
CdnService 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 NewCdnService method instead.
func NewCdnService ¶
func NewCdnService(opts ...option.RequestOption) (r CdnService)
NewCdnService 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 (*CdnService) GetAccountLimits ¶
func (r *CdnService) GetAccountLimits(ctx context.Context, opts ...option.RequestOption) (res *CdnAccountLimits, err error)
Get information about CDN service limits.
func (*CdnService) GetAccountOverview ¶
func (r *CdnService) GetAccountOverview(ctx context.Context, opts ...option.RequestOption) (res *CdnAccount, err error)
Get information about CDN service.
func (*CdnService) GetAvailableFeatures ¶
func (r *CdnService) GetAvailableFeatures(ctx context.Context, opts ...option.RequestOption) (res *CdnAvailableFeatures, err error)
Get information about available CDN features.
func (*CdnService) ListAlibabaRegions ¶ added in v0.17.0
func (r *CdnService) ListAlibabaRegions(ctx context.Context, opts ...option.RequestOption) (res *AlibabaRegions, err error)
Get the list of Alibaba Cloud regions.
func (*CdnService) ListAwsRegions ¶ added in v0.17.0
func (r *CdnService) ListAwsRegions(ctx context.Context, opts ...option.RequestOption) (res *AwsRegions, err error)
Get the list of Amazon AWS regions.
func (*CdnService) ListPurgeStatuses ¶
func (r *CdnService) ListPurgeStatuses(ctx context.Context, query CdnListPurgeStatusesParams, opts ...option.RequestOption) (res *[]PurgeStatus, err error)
Get purges history.
func (*CdnService) UpdateAccount ¶
func (r *CdnService) UpdateAccount(ctx context.Context, body CdnUpdateAccountParams, opts ...option.RequestOption) (res *CdnAccount, err error)
Change information about CDN service.
type CdnUpdateAccountParams ¶
type CdnUpdateAccountParams struct {
// CDN traffic usage limit in gigabytes.
//
// When the limit is reached, we will send an email notification.
UtilizationLevel param.Opt[int64] `json:"utilization_level,omitzero"`
// contains filtered or unexported fields
}
func (CdnUpdateAccountParams) MarshalJSON ¶
func (r CdnUpdateAccountParams) MarshalJSON() (data []byte, err error)
func (*CdnUpdateAccountParams) UnmarshalJSON ¶
func (r *CdnUpdateAccountParams) UnmarshalJSON(data []byte) error
type CertificateGetStatusParams ¶
type CertificateGetStatusParams struct {
// Listed fields will be excluded from the response.
Exclude []string `query:"exclude,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (CertificateGetStatusParams) URLQuery ¶
func (r CertificateGetStatusParams) URLQuery() (v url.Values, err error)
URLQuery serializes CertificateGetStatusParams's query parameters as `url.Values`.
type CertificateListParams ¶
type CertificateListParams struct {
// How the SSL certificate was issued.
//
// Possible values:
//
// - **true** – Certificate was issued automatically.
// - **false** – Certificate was added by a user.
Automated param.Opt[bool] `query:"automated,omitzero" json:"-"`
// CDN resource ID for which certificates are requested.
ResourceID param.Opt[int64] `query:"resource_id,omitzero" json:"-"`
// Date and time when the certificate become untrusted (ISO 8601/RFC 3339 format,
// UTC.)
//
// Response will contain only certificates valid until the specified time.
ValidityNotAfterLte param.Opt[string] `query:"validity_not_after_lte,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (CertificateListParams) URLQuery ¶
func (r CertificateListParams) URLQuery() (v url.Values, err error)
URLQuery serializes CertificateListParams's query parameters as `url.Values`.
type CertificateNewParams ¶
type CertificateNewParams struct {
// This field is a request body variant, only one variant field can be set.
OfOwnCertificate *CertificateNewParamsBodyOwnCertificate `json:",inline"`
// This field is a request body variant, only one variant field can be set.
OfLetSEncryptCertificate *CertificateNewParamsBodyLetSEncryptCertificate `json:",inline"`
// contains filtered or unexported fields
}
func (CertificateNewParams) MarshalJSON ¶
func (u CertificateNewParams) MarshalJSON() ([]byte, error)
func (*CertificateNewParams) UnmarshalJSON ¶
func (r *CertificateNewParams) UnmarshalJSON(data []byte) error
type CertificateNewParamsBodyLetSEncryptCertificate ¶
type CertificateNewParamsBodyLetSEncryptCertificate struct {
// Must be **true** to issue certificate automatically.
Automated bool `json:"automated,required"`
// SSL certificate name. It must be unique.
Name string `json:"name,required"`
// contains filtered or unexported fields
}
The properties Automated, Name are required.
func (CertificateNewParamsBodyLetSEncryptCertificate) MarshalJSON ¶
func (r CertificateNewParamsBodyLetSEncryptCertificate) MarshalJSON() (data []byte, err error)
func (*CertificateNewParamsBodyLetSEncryptCertificate) UnmarshalJSON ¶
func (r *CertificateNewParamsBodyLetSEncryptCertificate) UnmarshalJSON(data []byte) error
type CertificateNewParamsBodyOwnCertificate ¶
type CertificateNewParamsBodyOwnCertificate struct {
// SSL certificate name.
//
// It must be unique.
Name string `json:"name,required"`
// Public part of the SSL certificate.
//
// All chain of the SSL certificate should be added.
SslCertificate string `json:"sslCertificate,required"`
// Private key of the SSL certificate.
SslPrivateKey string `json:"sslPrivateKey,required"`
// Defines whether to check the SSL certificate for a signature from a trusted
// certificate authority.
//
// Possible values:
//
// - **true** - SSL certificate must be verified to be signed by a trusted
// certificate authority.
// - **false** - SSL certificate will not be verified to be signed by a trusted
// certificate authority.
ValidateRootCa param.Opt[bool] `json:"validate_root_ca,omitzero"`
// contains filtered or unexported fields
}
The properties Name, SslCertificate, SslPrivateKey are required.
func (CertificateNewParamsBodyOwnCertificate) MarshalJSON ¶
func (r CertificateNewParamsBodyOwnCertificate) MarshalJSON() (data []byte, err error)
func (*CertificateNewParamsBodyOwnCertificate) UnmarshalJSON ¶
func (r *CertificateNewParamsBodyOwnCertificate) UnmarshalJSON(data []byte) error
type CertificateReplaceParams ¶
type CertificateReplaceParams struct {
// SSL certificate name.
//
// It must be unique.
Name string `json:"name,required"`
// Public part of the SSL certificate.
//
// All chain of the SSL certificate should be added.
SslCertificate string `json:"sslCertificate,required"`
// Private key of the SSL certificate.
SslPrivateKey string `json:"sslPrivateKey,required"`
// Defines whether to check the SSL certificate for a signature from a trusted
// certificate authority.
//
// Possible values:
//
// - **true** - SSL certificate must be verified to be signed by a trusted
// certificate authority.
// - **false** - SSL certificate will not be verified to be signed by a trusted
// certificate authority.
ValidateRootCa param.Opt[bool] `json:"validate_root_ca,omitzero"`
// contains filtered or unexported fields
}
func (CertificateReplaceParams) MarshalJSON ¶
func (r CertificateReplaceParams) MarshalJSON() (data []byte, err error)
func (*CertificateReplaceParams) UnmarshalJSON ¶
func (r *CertificateReplaceParams) UnmarshalJSON(data []byte) error
type CertificateService ¶
type CertificateService struct {
Options []option.RequestOption
}
CertificateService 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 NewCertificateService method instead.
func NewCertificateService ¶
func NewCertificateService(opts ...option.RequestOption) (r CertificateService)
NewCertificateService 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 (*CertificateService) Delete ¶
func (r *CertificateService) Delete(ctx context.Context, sslID int64, opts ...option.RequestOption) (err error)
Delete SSL certificate
func (*CertificateService) ForceRetry ¶
func (r *CertificateService) ForceRetry(ctx context.Context, certID int64, opts ...option.RequestOption) (err error)
Force retry issuance of Let's Encrypt certificate if the previous attempt was failed.
func (*CertificateService) Get ¶
func (r *CertificateService) Get(ctx context.Context, sslID int64, opts ...option.RequestOption) (res *SslDetail, err error)
Get SSL certificate details
func (*CertificateService) GetStatus ¶
func (r *CertificateService) GetStatus(ctx context.Context, certID int64, query CertificateGetStatusParams, opts ...option.RequestOption) (res *SslRequestStatus, err error)
Get details about the latest Let's Encrypt certificate issuing attempt for the CDN resource. Returns attempts in all statuses.
func (*CertificateService) List ¶
func (r *CertificateService) List(ctx context.Context, query CertificateListParams, opts ...option.RequestOption) (res *SslDetailList, err error)
Get information about SSL certificates.
func (*CertificateService) New ¶
func (r *CertificateService) New(ctx context.Context, body CertificateNewParams, opts ...option.RequestOption) (err error)
Add an SSL certificate for content delivery over HTTPS protocol.
Enter all strings of the certificate(s) and the private key into one string parameter. Each certificate and the private key in chain should be separated by the "\n" symbol, as shown in the example.
Additionally, you can add a Let's Encrypt certificate. In this case, certificate and private key will be generated automatically after attaching this certificate to your CDN resource.
func (*CertificateService) Renew ¶
func (r *CertificateService) Renew(ctx context.Context, certID int64, opts ...option.RequestOption) (err error)
Renew free Let's Encrypt certificate for the CDN resource. It can take up to fifteen minutes.
func (*CertificateService) Replace ¶
func (r *CertificateService) Replace(ctx context.Context, sslID int64, body CertificateReplaceParams, opts ...option.RequestOption) (res *SslDetail, err error)
Change SSL certificate
type IPRangeListIPsParams ¶ added in v0.18.0
type IPRangeListIPsParams struct {
// Optional format override. When set, this takes precedence over the `Accept`
// header.
//
// Any of "json", "plain".
Format IPRangeListIPsParamsFormat `query:"format,omitzero" json:"-"`
// Any of "application/json", "text/plain".
Accept IPRangeListIPsParamsAccept `header:"Accept,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (IPRangeListIPsParams) URLQuery ¶ added in v0.18.0
func (r IPRangeListIPsParams) URLQuery() (v url.Values, err error)
URLQuery serializes IPRangeListIPsParams's query parameters as `url.Values`.
type IPRangeListIPsParamsAccept ¶ added in v0.18.0
type IPRangeListIPsParamsAccept string
const ( IPRangeListIPsParamsAcceptApplicationJson IPRangeListIPsParamsAccept = "application/json" IPRangeListIPsParamsAcceptTextPlain IPRangeListIPsParamsAccept = "text/plain" )
type IPRangeListIPsParamsFormat ¶ added in v0.18.0
type IPRangeListIPsParamsFormat string
Optional format override. When set, this takes precedence over the `Accept` header.
const ( IPRangeListIPsParamsFormatJson IPRangeListIPsParamsFormat = "json" IPRangeListIPsParamsFormatPlain IPRangeListIPsParamsFormat = "plain" )
type IPRangeListParams ¶ added in v0.18.0
type IPRangeListParams struct {
// Optional format override. When set, this takes precedence over the `Accept`
// header.
//
// Any of "json", "plain".
Format IPRangeListParamsFormat `query:"format,omitzero" json:"-"`
// Any of "application/json", "text/plain".
Accept IPRangeListParamsAccept `header:"Accept,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (IPRangeListParams) URLQuery ¶ added in v0.18.0
func (r IPRangeListParams) URLQuery() (v url.Values, err error)
URLQuery serializes IPRangeListParams's query parameters as `url.Values`.
type IPRangeListParamsAccept ¶ added in v0.18.0
type IPRangeListParamsAccept string
const ( IPRangeListParamsAcceptApplicationJson IPRangeListParamsAccept = "application/json" IPRangeListParamsAcceptTextPlain IPRangeListParamsAccept = "text/plain" )
type IPRangeListParamsFormat ¶ added in v0.18.0
type IPRangeListParamsFormat string
Optional format override. When set, this takes precedence over the `Accept` header.
const ( IPRangeListParamsFormatJson IPRangeListParamsFormat = "json" IPRangeListParamsFormatPlain IPRangeListParamsFormat = "plain" )
type IPRangeService ¶
type IPRangeService struct {
Options []option.RequestOption
}
IPRangeService 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 NewIPRangeService method instead.
func NewIPRangeService ¶
func NewIPRangeService(opts ...option.RequestOption) (r IPRangeService)
NewIPRangeService 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 (*IPRangeService) List ¶
func (r *IPRangeService) List(ctx context.Context, params IPRangeListParams, opts ...option.RequestOption) (res *PublicNetworkList, err error)
Get all CDN networks that can be used to pull content from your origin.
This list is updated periodically. If you want to use network from this list to configure IP ACL on your origin, you need to independently monitor its relevance. We recommend using a script for automatically update IP ACL.
This request does not require authorization.
func (*IPRangeService) ListIPs ¶
func (r *IPRangeService) ListIPs(ctx context.Context, params IPRangeListIPsParams, opts ...option.RequestOption) (res *PublicIPList, err error)
Get all IP addresses of CDN servers that can be used to pull content from your origin.
This list is updated periodically. If you want to use IP from this list to configure IP ACL in your origin, you need to independently monitor its relevance. We recommend using a script to automatically update IP ACL.
This request does not require authorization.
type LogDownloadParams ¶
type LogDownloadParams struct {
// Output format.
//
// Possible values:
//
// - csv
// - tsv
Format string `query:"format,required" json:"-"`
// Start date and time of the requested time period (ISO 8601/RFC 3339 format,
// UTC.)
//
// Difference between "from" and "to" cannot exceed 6 hours.
//
// Examples:
//
// - &from=2021-06-14T00:00:00Z
// - &from=2021-06-14T00:00:00.000Z
From string `query:"from,required" json:"-"`
// End date and time of the requested time period (ISO 8601/RFC 3339 format, UTC.)
//
// Difference between "from" and "to" cannot exceed 6 hours.
//
// Examples:
//
// - &to=2021-06-15T00:00:00Z
// - &to=2021-06-15T00:00:00.000Z
To string `query:"to,required" json:"-"`
// Caching status. Possible values: 'MISS', 'BYPASS', 'EXPIRED', 'STALE',
// 'PENDING', 'UPDATING', 'REVALIDATED', 'HIT', '-'.
CacheStatusEq param.Opt[string] `query:"cache_status__eq,omitzero" json:"-"`
// List of caching statuses. Possible values: 'MISS', 'BYPASS', 'EXPIRED', 'STALE',
// 'PENDING', 'UPDATING', 'REVALIDATED', 'HIT', '-'. Values should be separated by
// a comma.
CacheStatusIn param.Opt[string] `query:"cache_status__in,omitzero" json:"-"`
// Caching status not equal to the specified value. Possible values: 'MISS',
// 'BYPASS', 'EXPIRED', 'STALE', 'PENDING', 'UPDATING', 'REVALIDATED', 'HIT', '-'.
CacheStatusNe param.Opt[string] `query:"cache_status__ne,omitzero" json:"-"`
// List of caching statuses not equal to the specified values. Possible values:
// 'MISS', 'BYPASS', 'EXPIRED', 'STALE', 'PENDING', 'UPDATING', 'REVALIDATED',
// 'HIT', '-'. Values should be separated by a comma.
CacheStatusNotIn param.Opt[string] `query:"cache_status__not_in,omitzero" json:"-"`
// IP address of the client who sent the request.
ClientIPEq param.Opt[string] `query:"client_ip__eq,omitzero" json:"-"`
// List of IP addresses of the clients who sent the request.
ClientIPIn param.Opt[string] `query:"client_ip__in,omitzero" json:"-"`
// IP address of the client who did not send the request.
ClientIPNe param.Opt[string] `query:"client_ip__ne,omitzero" json:"-"`
// List of IP addresses of the clients who did not send the request.
ClientIPNotIn param.Opt[string] `query:"client_ip__not_in,omitzero" json:"-"`
// Part of the custom domain of the requested CDN resource. Minimum length is 3
// characters.
CnameContains param.Opt[string] `query:"cname__contains,omitzero" json:"-"`
// Custom domain of the requested CDN resource.
CnameEq param.Opt[string] `query:"cname__eq,omitzero" json:"-"`
// List of custom domains of the requested CDN resource. Values should be separated
// by a comma.
CnameIn param.Opt[string] `query:"cname__in,omitzero" json:"-"`
// Custom domain of the requested CDN resource not equal to the specified value.
CnameNe param.Opt[string] `query:"cname__ne,omitzero" json:"-"`
// List of custom domains of the requested CDN resource not equal to the specified
// values. Values should be separated by a comma.
CnameNotIn param.Opt[string] `query:"cname__not_in,omitzero" json:"-"`
// Data center where request was processed.
DatacenterEq param.Opt[string] `query:"datacenter__eq,omitzero" json:"-"`
// List of data centers where request was processed. Values should be separated by
// a comma.
DatacenterIn param.Opt[string] `query:"datacenter__in,omitzero" json:"-"`
// Data center where request was not processed.
DatacenterNe param.Opt[string] `query:"datacenter__ne,omitzero" json:"-"`
// List of data centers where request was not processed. Values should be separated
// by a comma.
DatacenterNotIn param.Opt[string] `query:"datacenter__not_in,omitzero" json:"-"`
// A comma-separated list of returned fields.
//
// Supported fields are presented in the responses section.
//
// Example:
//
// - &fields=timestamp,path,status
Fields param.Opt[string] `query:"fields,omitzero" json:"-"`
// Maximum number of log records in the response.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Request HTTP method. Possible values: 'CONNECT', 'DELETE', 'GET', 'HEAD',
// 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'.
MethodEq param.Opt[string] `query:"method__eq,omitzero" json:"-"`
// Request HTTP method. Possible values: 'CONNECT', 'DELETE', 'GET', 'HEAD',
// 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'. Values should be separated by a
// comma.
MethodIn param.Opt[string] `query:"method__in,omitzero" json:"-"`
// Request HTTP method. Possible values: 'CONNECT', 'DELETE', 'GET', 'HEAD',
// 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'.
MethodNe param.Opt[string] `query:"method__ne,omitzero" json:"-"`
// Request HTTP method. Possible values: 'CONNECT', 'DELETE', 'GET', 'HEAD',
// 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'. Values should be separated by a
// comma.
MethodNotIn param.Opt[string] `query:"method__not_in,omitzero" json:"-"`
// Number of log records to skip starting from the beginning of the requested
// period.
Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
// ID of the requested CDN resource equal to the specified value.
ResourceIDEq param.Opt[int64] `query:"resource_id__eq,omitzero" json:"-"`
// ID of the requested CDN resource greater than the specified value.
ResourceIDGt param.Opt[int64] `query:"resource_id__gt,omitzero" json:"-"`
// ID of the requested CDN resource greater than or equal to the specified value.
ResourceIDGte param.Opt[int64] `query:"resource_id__gte,omitzero" json:"-"`
// List of IDs of the requested CDN resource. Values should be separated by a
// comma.
ResourceIDIn param.Opt[string] `query:"resource_id__in,omitzero" json:"-"`
// ID of the requested CDN resource less than the specified value.
ResourceIDLt param.Opt[int64] `query:"resource_id__lt,omitzero" json:"-"`
// ID of the requested CDN resource less than or equal to the specified value.
ResourceIDLte param.Opt[int64] `query:"resource_id__lte,omitzero" json:"-"`
// ID of the requested CDN resource not equal to the specified value.
ResourceIDNe param.Opt[int64] `query:"resource_id__ne,omitzero" json:"-"`
// List of IDs of the requested CDN resource not equal to the specified values.
// Values should be separated by a comma.
ResourceIDNotIn param.Opt[string] `query:"resource_id__not_in,omitzero" json:"-"`
// Response size in bytes equal to the specified value.
SizeEq param.Opt[int64] `query:"size__eq,omitzero" json:"-"`
// Response size in bytes greater than the specified value.
SizeGt param.Opt[int64] `query:"size__gt,omitzero" json:"-"`
// Response size in bytes greater than or equal to the specified value.
SizeGte param.Opt[int64] `query:"size__gte,omitzero" json:"-"`
// List of response sizes in bytes. Values should be separated by a comma.
SizeIn param.Opt[string] `query:"size__in,omitzero" json:"-"`
// Response size in bytes less than the specified value.
SizeLt param.Opt[int64] `query:"size__lt,omitzero" json:"-"`
// Response size in bytes less than or equal to the specified value.
SizeLte param.Opt[int64] `query:"size__lte,omitzero" json:"-"`
// Response size in bytes not equal to the specified value.
SizeNe param.Opt[int64] `query:"size__ne,omitzero" json:"-"`
// List of response sizes in bytes not equal to the specified values. Values should
// be separated by
SizeNotIn param.Opt[string] `query:"size__not_in,omitzero" json:"-"`
// Sorting rules.
//
// Possible values:
//
// - **method** - Request HTTP method.
// - **`client_ip`** - IP address of the client who sent the request.
// - **status** - Status code in the response.
// - **size** - Response size in bytes.
// - **cname** - Custom domain of the requested resource.
// - **`resource_id`** - ID of the requested CDN resource.
// - **`cache_status`** - Caching status.
// - **datacenter** - Data center where request was processed.
// - **timestamp** - Date and time when the request was made.
//
// May include multiple values separated by a comma.
//
// Example:
//
// - &sort=-timestamp,status
Sort param.Opt[string] `query:"sort,omitzero" json:"-"`
// Status code in the response equal to the specified value.
StatusEq param.Opt[int64] `query:"status__eq,omitzero" json:"-"`
// Status code in the response greater than the specified value.
StatusGt param.Opt[int64] `query:"status__gt,omitzero" json:"-"`
// Status code in the response greater than or equal to the specified value.
StatusGte param.Opt[int64] `query:"status__gte,omitzero" json:"-"`
// List of status codes in the response. Values should be separated by a comma.
StatusIn param.Opt[string] `query:"status__in,omitzero" json:"-"`
// Status code in the response less than the specified value.
StatusLt param.Opt[int64] `query:"status__lt,omitzero" json:"-"`
// Status code in the response less than or equal to the specified value.
StatusLte param.Opt[int64] `query:"status__lte,omitzero" json:"-"`
// Status code in the response not equal to the specified value.
StatusNe param.Opt[int64] `query:"status__ne,omitzero" json:"-"`
// List of status codes not in the response. Values should be separated by a comma.
StatusNotIn param.Opt[string] `query:"status__not_in,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (LogDownloadParams) URLQuery ¶
func (r LogDownloadParams) URLQuery() (v url.Values, err error)
URLQuery serializes LogDownloadParams's query parameters as `url.Values`.
type LogListParams ¶
type LogListParams struct {
// Start date and time of the requested time period (ISO 8601/RFC 3339 format,
// UTC.)
//
// Difference between "from" and "to" cannot exceed 6 hours.
//
// Examples:
//
// - &from=2021-06-14T00:00:00Z
// - &from=2021-06-14T00:00:00.000Z
From string `query:"from,required" json:"-"`
// End date and time of the requested time period (ISO 8601/RFC 3339 format, UTC.)
//
// Difference between "from" and "to" cannot exceed 6 hours.
//
// Examples:
//
// - &to=2021-06-15T00:00:00Z
// - &to=2021-06-15T00:00:00.000Z
To string `query:"to,required" json:"-"`
// Caching status. Possible values: 'MISS', 'BYPASS', 'EXPIRED', 'STALE',
// 'PENDING', 'UPDATING', 'REVALIDATED', 'HIT', '-'.
CacheStatusEq param.Opt[string] `query:"cache_status__eq,omitzero" json:"-"`
// List of caching statuses. Possible values: 'MISS', 'BYPASS', 'EXPIRED', 'STALE',
// 'PENDING', 'UPDATING', 'REVALIDATED', 'HIT', '-'. Values should be separated by
// a comma.
CacheStatusIn param.Opt[string] `query:"cache_status__in,omitzero" json:"-"`
// Caching status not equal to the specified value. Possible values: 'MISS',
// 'BYPASS', 'EXPIRED', 'STALE', 'PENDING', 'UPDATING', 'REVALIDATED', 'HIT', '-'.
CacheStatusNe param.Opt[string] `query:"cache_status__ne,omitzero" json:"-"`
// List of caching statuses not equal to the specified values. Possible values:
// 'MISS', 'BYPASS', 'EXPIRED', 'STALE', 'PENDING', 'UPDATING', 'REVALIDATED',
// 'HIT', '-'. Values should be separated by a comma.
CacheStatusNotIn param.Opt[string] `query:"cache_status__not_in,omitzero" json:"-"`
// IP address of the client who sent the request.
ClientIPEq param.Opt[string] `query:"client_ip__eq,omitzero" json:"-"`
// List of IP addresses of the clients who sent the request.
ClientIPIn param.Opt[string] `query:"client_ip__in,omitzero" json:"-"`
// IP address of the client who did not send the request.
ClientIPNe param.Opt[string] `query:"client_ip__ne,omitzero" json:"-"`
// List of IP addresses of the clients who did not send the request.
ClientIPNotIn param.Opt[string] `query:"client_ip__not_in,omitzero" json:"-"`
// Part of the custom domain of the requested CDN resource. Minimum length is 3
// characters.
CnameContains param.Opt[string] `query:"cname__contains,omitzero" json:"-"`
// Custom domain of the requested CDN resource.
CnameEq param.Opt[string] `query:"cname__eq,omitzero" json:"-"`
// List of custom domains of the requested CDN resource. Values should be separated
// by a comma.
CnameIn param.Opt[string] `query:"cname__in,omitzero" json:"-"`
// Custom domain of the requested CDN resource not equal to the specified value.
CnameNe param.Opt[string] `query:"cname__ne,omitzero" json:"-"`
// List of custom domains of the requested CDN resource not equal to the specified
// values. Values should be separated by a comma.
CnameNotIn param.Opt[string] `query:"cname__not_in,omitzero" json:"-"`
// Data center where request was processed.
DatacenterEq param.Opt[string] `query:"datacenter__eq,omitzero" json:"-"`
// List of data centers where request was processed. Values should be separated by
// a comma.
DatacenterIn param.Opt[string] `query:"datacenter__in,omitzero" json:"-"`
// Data center where request was not processed.
DatacenterNe param.Opt[string] `query:"datacenter__ne,omitzero" json:"-"`
// List of data centers where request was not processed. Values should be separated
// by a comma.
DatacenterNotIn param.Opt[string] `query:"datacenter__not_in,omitzero" json:"-"`
// A comma-separated list of returned fields.
//
// Supported fields are presented in the responses section.
//
// Example:
//
// - &fields=timestamp,path,status
Fields param.Opt[string] `query:"fields,omitzero" json:"-"`
// Maximum number of log records in the response.
Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
// Request HTTP method. Possible values: 'CONNECT', 'DELETE', 'GET', 'HEAD',
// 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'.
MethodEq param.Opt[string] `query:"method__eq,omitzero" json:"-"`
// Request HTTP method. Possible values: 'CONNECT', 'DELETE', 'GET', 'HEAD',
// 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'. Values should be separated by a
// comma.
MethodIn param.Opt[string] `query:"method__in,omitzero" json:"-"`
// Request HTTP method. Possible values: 'CONNECT', 'DELETE', 'GET', 'HEAD',
// 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'.
MethodNe param.Opt[string] `query:"method__ne,omitzero" json:"-"`
// Request HTTP method. Possible values: 'CONNECT', 'DELETE', 'GET', 'HEAD',
// 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'. Values should be separated by a
// comma.
MethodNotIn param.Opt[string] `query:"method__not_in,omitzero" json:"-"`
// Number of log records to skip starting from the beginning of the requested
// period.
Offset param.Opt[int64] `query:"offset,omitzero" json:"-"`
// Sorting rules.
//
// Possible values:
//
// - **method** - Request HTTP method.
// - **`client_ip`** - IP address of the client who sent the request.
// - **status** - Status code in the response.
// - **size** - Response size in bytes.
// - **cname** - Custom domain of the requested resource.
// - **`resource_id`** - ID of the requested CDN resource.
// - **`cache_status`** - Caching status.
// - **datacenter** - Data center where request was processed.
// - **timestamp** - Date and time when the request was made.
//
// Parameter may have multiple values separated by a comma.
//
// By default, ascending sorting is applied. To sort in descending order, add '-'
// prefix.
//
// Example:
//
// - &ordering=-timestamp,status
Ordering param.Opt[string] `query:"ordering,omitzero" json:"-"`
// ID of the requested CDN resource equal to the specified value.
ResourceIDEq param.Opt[int64] `query:"resource_id__eq,omitzero" json:"-"`
// ID of the requested CDN resource greater than the specified value.
ResourceIDGt param.Opt[int64] `query:"resource_id__gt,omitzero" json:"-"`
// ID of the requested CDN resource greater than or equal to the specified value.
ResourceIDGte param.Opt[int64] `query:"resource_id__gte,omitzero" json:"-"`
// List of IDs of the requested CDN resource. Values should be separated by a
// comma.
ResourceIDIn param.Opt[string] `query:"resource_id__in,omitzero" json:"-"`
// ID of the requested CDN resource less than the specified value.
ResourceIDLt param.Opt[int64] `query:"resource_id__lt,omitzero" json:"-"`
// ID of the requested CDN resource less than or equal to the specified value.
ResourceIDLte param.Opt[int64] `query:"resource_id__lte,omitzero" json:"-"`
// ID of the requested CDN resource not equal to the specified value.
ResourceIDNe param.Opt[int64] `query:"resource_id__ne,omitzero" json:"-"`
// List of IDs of the requested CDN resource not equal to the specified values.
// Values should be separated by a comma.
ResourceIDNotIn param.Opt[string] `query:"resource_id__not_in,omitzero" json:"-"`
// Response size in bytes equal to the specified value.
SizeEq param.Opt[int64] `query:"size__eq,omitzero" json:"-"`
// Response size in bytes greater than the specified value.
SizeGt param.Opt[int64] `query:"size__gt,omitzero" json:"-"`
// Response size in bytes greater than or equal to the specified value.
SizeGte param.Opt[int64] `query:"size__gte,omitzero" json:"-"`
// List of response sizes in bytes. Values should be separated by a comma.
SizeIn param.Opt[string] `query:"size__in,omitzero" json:"-"`
// Response size in bytes less than the specified value.
SizeLt param.Opt[int64] `query:"size__lt,omitzero" json:"-"`
// Response size in bytes less than or equal to the specified value.
SizeLte param.Opt[int64] `query:"size__lte,omitzero" json:"-"`
// Response size in bytes not equal to the specified value.
SizeNe param.Opt[int64] `query:"size__ne,omitzero" json:"-"`
// List of response sizes in bytes not equal to the specified values. Values should
// be separated by
SizeNotIn param.Opt[string] `query:"size__not_in,omitzero" json:"-"`
// Status code in the response equal to the specified value.
StatusEq param.Opt[int64] `query:"status__eq,omitzero" json:"-"`
// Status code in the response greater than the specified value.
StatusGt param.Opt[int64] `query:"status__gt,omitzero" json:"-"`
// Status code in the response greater than or equal to the specified value.
StatusGte param.Opt[int64] `query:"status__gte,omitzero" json:"-"`
// List of status codes in the response. Values should be separated by a comma.
StatusIn param.Opt[string] `query:"status__in,omitzero" json:"-"`
// Status code in the response less than the specified value.
StatusLt param.Opt[int64] `query:"status__lt,omitzero" json:"-"`
// Status code in the response less than or equal to the specified value.
StatusLte param.Opt[int64] `query:"status__lte,omitzero" json:"-"`
// Status code in the response not equal to the specified value.
StatusNe param.Opt[int64] `query:"status__ne,omitzero" json:"-"`
// List of status codes not in the response. Values should be separated by a comma.
StatusNotIn param.Opt[string] `query:"status__not_in,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (LogListParams) URLQuery ¶
func (r LogListParams) URLQuery() (v url.Values, err error)
URLQuery serializes LogListParams's query parameters as `url.Values`.
type LogService ¶
type LogService struct {
Options []option.RequestOption
}
LogService 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 NewLogService method instead.
func NewLogService ¶
func NewLogService(opts ...option.RequestOption) (r LogService)
NewLogService 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 (*LogService) Download ¶
func (r *LogService) Download(ctx context.Context, query LogDownloadParams, opts ...option.RequestOption) (res *http.Response, err error)
Download CDN logs for up to 3 days starting today.
You can filter logs using query params by client IP, CDN resource, date, path and etc.
func (*LogService) List ¶
func (r *LogService) List(ctx context.Context, query LogListParams, opts ...option.RequestOption) (res *pagination.OffsetPageCdnLogs[CdnLogEntryData], err error)
Get CDN logs for up to 3 days starting today.
You can filter logs using query parameters by client IP, CDN resource, date, path and etc.
To filter the CDN logs by 2xx status codes, use:
- &`status__gte`=200&`status__lt`=300
func (*LogService) ListAutoPaging ¶
func (r *LogService) ListAutoPaging(ctx context.Context, query LogListParams, opts ...option.RequestOption) *pagination.OffsetPageCdnLogsAutoPager[CdnLogEntryData]
Get CDN logs for up to 3 days starting today.
You can filter logs using query parameters by client IP, CDN resource, date, path and etc.
To filter the CDN logs by 2xx status codes, use:
- &`status__gte`=200&`status__lt`=300
type LogsAggregatedStats ¶
type LogsAggregatedStats struct {
// CDN resource ID for which statistics data is shown.
Number1Example any `json:"1 (example)"`
// Statistics parameters.
Metrics any `json:"metrics"`
// Number of resources that used Logs uploader.
RawLogsUsage string `json:"raw_logs_usage"`
// Resources IDs by which statistics data is grouped..
Resource any `json:"resource"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Number1Example respjson.Field
Metrics respjson.Field
RawLogsUsage respjson.Field
Resource respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (LogsAggregatedStats) RawJSON ¶
func (r LogsAggregatedStats) RawJSON() string
Returns the unmodified JSON received from the API
func (*LogsAggregatedStats) UnmarshalJSON ¶
func (r *LogsAggregatedStats) UnmarshalJSON(data []byte) error
type LogsUploaderConfig ¶
type LogsUploaderConfig struct {
ID int64 `json:"id"`
// Client that owns the config.
ClientID int64 `json:"client_id"`
// Time when the config was created.
Created time.Time `json:"created" format:"date-time"`
// Enables or disables the config.
Enabled bool `json:"enabled"`
// If set to true, the config will be applied to all CDN resources. If set to
// false, the config will be applied to the resources specified in the `resources`
// field.
ForAllResources bool `json:"for_all_resources"`
// Name of the config.
Name string `json:"name"`
// ID of the policy that should be assigned to given config.
Policy int64 `json:"policy"`
// List of resource IDs to which the config should be applied.
Resources []int64 `json:"resources"`
// Validation status of the logs uploader config.
Status LogsUploaderConfigStatus `json:"status"`
// ID of the target to which logs should be uploaded.
Target int64 `json:"target"`
// Time when the config was updated.
Updated time.Time `json:"updated" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
ClientID respjson.Field
Created respjson.Field
Enabled respjson.Field
ForAllResources respjson.Field
Name respjson.Field
Policy respjson.Field
Resources respjson.Field
Status respjson.Field
Target respjson.Field
Updated respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (LogsUploaderConfig) RawJSON ¶
func (r LogsUploaderConfig) RawJSON() string
Returns the unmodified JSON received from the API
func (*LogsUploaderConfig) UnmarshalJSON ¶
func (r *LogsUploaderConfig) UnmarshalJSON(data []byte) error
type LogsUploaderConfigList ¶
type LogsUploaderConfigList []LogsUploaderConfig
type LogsUploaderConfigListParams ¶
type LogsUploaderConfigListParams struct {
// Search by config name or id.
Search param.Opt[string] `query:"search,omitzero" json:"-"`
// Filter by ids of CDN resources that are assigned to given config.
ResourceIDs []int64 `query:"resource_ids,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (LogsUploaderConfigListParams) URLQuery ¶
func (r LogsUploaderConfigListParams) URLQuery() (v url.Values, err error)
URLQuery serializes LogsUploaderConfigListParams's query parameters as `url.Values`.
type LogsUploaderConfigNewParams ¶
type LogsUploaderConfigNewParams struct {
// Name of the config.
Name string `json:"name,required"`
// ID of the policy that should be assigned to given config.
Policy int64 `json:"policy,required"`
// ID of the target to which logs should be uploaded.
Target int64 `json:"target,required"`
// Enables or disables the config.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// If set to true, the config will be applied to all CDN resources. If set to
// false, the config will be applied to the resources specified in the `resources`
// field.
ForAllResources param.Opt[bool] `json:"for_all_resources,omitzero"`
// List of resource IDs to which the config should be applied.
Resources []int64 `json:"resources,omitzero"`
// contains filtered or unexported fields
}
func (LogsUploaderConfigNewParams) MarshalJSON ¶
func (r LogsUploaderConfigNewParams) MarshalJSON() (data []byte, err error)
func (*LogsUploaderConfigNewParams) UnmarshalJSON ¶
func (r *LogsUploaderConfigNewParams) UnmarshalJSON(data []byte) error
type LogsUploaderConfigReplaceParams ¶
type LogsUploaderConfigReplaceParams struct {
// Name of the config.
Name string `json:"name,required"`
// ID of the policy that should be assigned to given config.
Policy int64 `json:"policy,required"`
// ID of the target to which logs should be uploaded.
Target int64 `json:"target,required"`
// Enables or disables the config.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// If set to true, the config will be applied to all CDN resources. If set to
// false, the config will be applied to the resources specified in the `resources`
// field.
ForAllResources param.Opt[bool] `json:"for_all_resources,omitzero"`
// List of resource IDs to which the config should be applied.
Resources []int64 `json:"resources,omitzero"`
// contains filtered or unexported fields
}
func (LogsUploaderConfigReplaceParams) MarshalJSON ¶
func (r LogsUploaderConfigReplaceParams) MarshalJSON() (data []byte, err error)
func (*LogsUploaderConfigReplaceParams) UnmarshalJSON ¶
func (r *LogsUploaderConfigReplaceParams) UnmarshalJSON(data []byte) error
type LogsUploaderConfigService ¶
type LogsUploaderConfigService struct {
Options []option.RequestOption
}
LogsUploaderConfigService 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 NewLogsUploaderConfigService method instead.
func NewLogsUploaderConfigService ¶
func NewLogsUploaderConfigService(opts ...option.RequestOption) (r LogsUploaderConfigService)
NewLogsUploaderConfigService 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 (*LogsUploaderConfigService) Delete ¶
func (r *LogsUploaderConfigService) Delete(ctx context.Context, id int64, opts ...option.RequestOption) (err error)
Delete the logs uploader config from the system permanently.
Notes:
- **Irreversibility**: This action is irreversible. Once deleted, the logs uploader config cannot be recovered.
func (*LogsUploaderConfigService) Get ¶
func (r *LogsUploaderConfigService) Get(ctx context.Context, id int64, opts ...option.RequestOption) (res *LogsUploaderConfig, err error)
Get information about logs uploader config.
func (*LogsUploaderConfigService) List ¶
func (r *LogsUploaderConfigService) List(ctx context.Context, query LogsUploaderConfigListParams, opts ...option.RequestOption) (res *LogsUploaderConfigList, err error)
Get list of logs uploader configs.
func (*LogsUploaderConfigService) New ¶
func (r *LogsUploaderConfigService) New(ctx context.Context, body LogsUploaderConfigNewParams, opts ...option.RequestOption) (res *LogsUploaderConfig, err error)
Create logs uploader config.
func (*LogsUploaderConfigService) Replace ¶
func (r *LogsUploaderConfigService) Replace(ctx context.Context, id int64, body LogsUploaderConfigReplaceParams, opts ...option.RequestOption) (res *LogsUploaderConfig, err error)
Change logs uploader config.
func (*LogsUploaderConfigService) Update ¶
func (r *LogsUploaderConfigService) Update(ctx context.Context, id int64, body LogsUploaderConfigUpdateParams, opts ...option.RequestOption) (res *LogsUploaderConfig, err error)
Change logs uploader config partially.
func (*LogsUploaderConfigService) Validate ¶
func (r *LogsUploaderConfigService) Validate(ctx context.Context, id int64, opts ...option.RequestOption) (res *LogsUploaderValidation, err error)
Validate logs uploader config.
type LogsUploaderConfigStatus ¶
type LogsUploaderConfigStatus struct {
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
LogsUploaderValidation
}
Validation status of the logs uploader config.
func (LogsUploaderConfigStatus) RawJSON ¶
func (r LogsUploaderConfigStatus) RawJSON() string
Returns the unmodified JSON received from the API
func (*LogsUploaderConfigStatus) UnmarshalJSON ¶
func (r *LogsUploaderConfigStatus) UnmarshalJSON(data []byte) error
type LogsUploaderConfigUpdateParams ¶
type LogsUploaderConfigUpdateParams struct {
// Enables or disables the config.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// If set to true, the config will be applied to all CDN resources. If set to
// false, the config will be applied to the resources specified in the `resources`
// field.
ForAllResources param.Opt[bool] `json:"for_all_resources,omitzero"`
// Name of the config.
Name param.Opt[string] `json:"name,omitzero"`
// ID of the policy that should be assigned to given config.
Policy param.Opt[int64] `json:"policy,omitzero"`
// ID of the target to which logs should be uploaded.
Target param.Opt[int64] `json:"target,omitzero"`
// List of resource IDs to which the config should be applied.
Resources []int64 `json:"resources,omitzero"`
// contains filtered or unexported fields
}
func (LogsUploaderConfigUpdateParams) MarshalJSON ¶
func (r LogsUploaderConfigUpdateParams) MarshalJSON() (data []byte, err error)
func (*LogsUploaderConfigUpdateParams) UnmarshalJSON ¶
func (r *LogsUploaderConfigUpdateParams) UnmarshalJSON(data []byte) error
type LogsUploaderPolicy ¶
type LogsUploaderPolicy struct {
ID int64 `json:"id"`
// Client that owns the policy.
ClientID int64 `json:"client_id"`
// Time when logs uploader policy was created.
Created time.Time `json:"created" format:"date-time"`
// Date format for logs.
DateFormat string `json:"date_format"`
// Description of the policy.
Description string `json:"description"`
// When set to true, the service sanitizes string values by escaping characters
// that may be unsafe for transport, logging, or downstream processing.
//
// The following categories of characters are escaped:
//
// - Control and non-printable characters
// - Quotation marks and escape characters
// - Characters outside the standard ASCII range
//
// The resulting output contains only printable ASCII characters.
EscapeSpecialCharacters bool `json:"escape_special_characters"`
// Field delimiter for logs.
FieldDelimiter string `json:"field_delimiter"`
// Field separator for logs.
FieldSeparator string `json:"field_separator"`
// List of fields to include in logs.
Fields []string `json:"fields"`
// Template for log file name.
FileNameTemplate string `json:"file_name_template"`
// Format type for logs.
//
// Possible values:
//
// - **""** - empty, it means it will apply the format configurations from the
// policy.
// - **"json"** - output the logs as json lines.
//
// Any of "json", "".
FormatType LogsUploaderPolicyFormatType `json:"format_type"`
// Include empty logs in the upload.
IncludeEmptyLogs bool `json:"include_empty_logs"`
// Include logs from origin shielding in the upload.
IncludeShieldLogs bool `json:"include_shield_logs"`
// Name of the policy.
Name string `json:"name"`
// List of logs uploader configs that use this policy.
RelatedUploaderConfigs []int64 `json:"related_uploader_configs"`
// Interval in minutes to retry failed uploads.
RetryIntervalMinutes int64 `json:"retry_interval_minutes"`
// Interval in minutes to rotate logs.
RotateIntervalMinutes int64 `json:"rotate_interval_minutes"`
// Threshold in lines to rotate logs.
RotateThresholdLines int64 `json:"rotate_threshold_lines"`
// Threshold in MB to rotate logs.
RotateThresholdMB int64 `json:"rotate_threshold_mb,nullable"`
// Tags allow for dynamic decoration of logs by adding predefined fields to the log
// format. These tags serve as customizable key-value pairs that can be included in
// log entries to enhance context and readability.
Tags map[string]string `json:"tags"`
// Time when logs uploader policy was updated.
Updated time.Time `json:"updated" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
ClientID respjson.Field
Created respjson.Field
DateFormat respjson.Field
Description respjson.Field
EscapeSpecialCharacters respjson.Field
FieldDelimiter respjson.Field
FieldSeparator respjson.Field
Fields respjson.Field
FileNameTemplate respjson.Field
FormatType respjson.Field
IncludeEmptyLogs respjson.Field
IncludeShieldLogs respjson.Field
Name respjson.Field
RelatedUploaderConfigs respjson.Field
RetryIntervalMinutes respjson.Field
RotateIntervalMinutes respjson.Field
RotateThresholdLines respjson.Field
RotateThresholdMB respjson.Field
Tags respjson.Field
Updated respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (LogsUploaderPolicy) RawJSON ¶
func (r LogsUploaderPolicy) RawJSON() string
Returns the unmodified JSON received from the API
func (*LogsUploaderPolicy) UnmarshalJSON ¶
func (r *LogsUploaderPolicy) UnmarshalJSON(data []byte) error
type LogsUploaderPolicyFormatType ¶ added in v0.29.0
type LogsUploaderPolicyFormatType string
Format type for logs.
Possible values:
- **""** - empty, it means it will apply the format configurations from the policy.
- **"json"** - output the logs as json lines.
const ( LogsUploaderPolicyFormatTypeJson LogsUploaderPolicyFormatType = "json" LogsUploaderPolicyFormatTypeEmpty LogsUploaderPolicyFormatType = "" )
type LogsUploaderPolicyList ¶
type LogsUploaderPolicyList []LogsUploaderPolicy
type LogsUploaderPolicyListParams ¶
type LogsUploaderPolicyListParams struct {
// Search by policy name or id.
Search param.Opt[string] `query:"search,omitzero" json:"-"`
// Filter by ids of related logs uploader configs that use given policy.
ConfigIDs []int64 `query:"config_ids,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (LogsUploaderPolicyListParams) URLQuery ¶
func (r LogsUploaderPolicyListParams) URLQuery() (v url.Values, err error)
URLQuery serializes LogsUploaderPolicyListParams's query parameters as `url.Values`.
type LogsUploaderPolicyNewParams ¶
type LogsUploaderPolicyNewParams struct {
// Threshold in MB to rotate logs.
RotateThresholdMB param.Opt[int64] `json:"rotate_threshold_mb,omitzero"`
// Date format for logs.
DateFormat param.Opt[string] `json:"date_format,omitzero"`
// Description of the policy.
Description param.Opt[string] `json:"description,omitzero"`
// When set to true, the service sanitizes string values by escaping characters
// that may be unsafe for transport, logging, or downstream processing.
//
// The following categories of characters are escaped:
//
// - Control and non-printable characters
// - Quotation marks and escape characters
// - Characters outside the standard ASCII range
//
// The resulting output contains only printable ASCII characters.
EscapeSpecialCharacters param.Opt[bool] `json:"escape_special_characters,omitzero"`
// Field delimiter for logs.
FieldDelimiter param.Opt[string] `json:"field_delimiter,omitzero"`
// Field separator for logs.
FieldSeparator param.Opt[string] `json:"field_separator,omitzero"`
// Template for log file name.
FileNameTemplate param.Opt[string] `json:"file_name_template,omitzero"`
// Include empty logs in the upload.
IncludeEmptyLogs param.Opt[bool] `json:"include_empty_logs,omitzero"`
// Include logs from origin shielding in the upload.
IncludeShieldLogs param.Opt[bool] `json:"include_shield_logs,omitzero"`
// Name of the policy.
Name param.Opt[string] `json:"name,omitzero"`
// Interval in minutes to retry failed uploads.
RetryIntervalMinutes param.Opt[int64] `json:"retry_interval_minutes,omitzero"`
// Interval in minutes to rotate logs.
RotateIntervalMinutes param.Opt[int64] `json:"rotate_interval_minutes,omitzero"`
// Threshold in lines to rotate logs.
RotateThresholdLines param.Opt[int64] `json:"rotate_threshold_lines,omitzero"`
// List of fields to include in logs.
Fields []string `json:"fields,omitzero"`
// Format type for logs.
//
// Possible values:
//
// - **""** - empty, it means it will apply the format configurations from the
// policy.
// - **"json"** - output the logs as json lines.
//
// Any of "json", "".
FormatType LogsUploaderPolicyNewParamsFormatType `json:"format_type,omitzero"`
// Tags allow for dynamic decoration of logs by adding predefined fields to the log
// format. These tags serve as customizable key-value pairs that can be included in
// log entries to enhance context and readability.
Tags map[string]string `json:"tags,omitzero"`
// contains filtered or unexported fields
}
func (LogsUploaderPolicyNewParams) MarshalJSON ¶
func (r LogsUploaderPolicyNewParams) MarshalJSON() (data []byte, err error)
func (*LogsUploaderPolicyNewParams) UnmarshalJSON ¶
func (r *LogsUploaderPolicyNewParams) UnmarshalJSON(data []byte) error
type LogsUploaderPolicyNewParamsFormatType ¶ added in v0.29.0
type LogsUploaderPolicyNewParamsFormatType string
Format type for logs.
Possible values:
- **""** - empty, it means it will apply the format configurations from the policy.
- **"json"** - output the logs as json lines.
const ( LogsUploaderPolicyNewParamsFormatTypeJson LogsUploaderPolicyNewParamsFormatType = "json" LogsUploaderPolicyNewParamsFormatTypeEmpty LogsUploaderPolicyNewParamsFormatType = "" )
type LogsUploaderPolicyReplaceParams ¶
type LogsUploaderPolicyReplaceParams struct {
// Threshold in MB to rotate logs.
RotateThresholdMB param.Opt[int64] `json:"rotate_threshold_mb,omitzero"`
// Date format for logs.
DateFormat param.Opt[string] `json:"date_format,omitzero"`
// Description of the policy.
Description param.Opt[string] `json:"description,omitzero"`
// When set to true, the service sanitizes string values by escaping characters
// that may be unsafe for transport, logging, or downstream processing.
//
// The following categories of characters are escaped:
//
// - Control and non-printable characters
// - Quotation marks and escape characters
// - Characters outside the standard ASCII range
//
// The resulting output contains only printable ASCII characters.
EscapeSpecialCharacters param.Opt[bool] `json:"escape_special_characters,omitzero"`
// Field delimiter for logs.
FieldDelimiter param.Opt[string] `json:"field_delimiter,omitzero"`
// Field separator for logs.
FieldSeparator param.Opt[string] `json:"field_separator,omitzero"`
// Template for log file name.
FileNameTemplate param.Opt[string] `json:"file_name_template,omitzero"`
// Include empty logs in the upload.
IncludeEmptyLogs param.Opt[bool] `json:"include_empty_logs,omitzero"`
// Include logs from origin shielding in the upload.
IncludeShieldLogs param.Opt[bool] `json:"include_shield_logs,omitzero"`
// Name of the policy.
Name param.Opt[string] `json:"name,omitzero"`
// Interval in minutes to retry failed uploads.
RetryIntervalMinutes param.Opt[int64] `json:"retry_interval_minutes,omitzero"`
// Interval in minutes to rotate logs.
RotateIntervalMinutes param.Opt[int64] `json:"rotate_interval_minutes,omitzero"`
// Threshold in lines to rotate logs.
RotateThresholdLines param.Opt[int64] `json:"rotate_threshold_lines,omitzero"`
// List of fields to include in logs.
Fields []string `json:"fields,omitzero"`
// Format type for logs.
//
// Possible values:
//
// - **""** - empty, it means it will apply the format configurations from the
// policy.
// - **"json"** - output the logs as json lines.
//
// Any of "json", "".
FormatType LogsUploaderPolicyReplaceParamsFormatType `json:"format_type,omitzero"`
// Tags allow for dynamic decoration of logs by adding predefined fields to the log
// format. These tags serve as customizable key-value pairs that can be included in
// log entries to enhance context and readability.
Tags map[string]string `json:"tags,omitzero"`
// contains filtered or unexported fields
}
func (LogsUploaderPolicyReplaceParams) MarshalJSON ¶
func (r LogsUploaderPolicyReplaceParams) MarshalJSON() (data []byte, err error)
func (*LogsUploaderPolicyReplaceParams) UnmarshalJSON ¶
func (r *LogsUploaderPolicyReplaceParams) UnmarshalJSON(data []byte) error
type LogsUploaderPolicyReplaceParamsFormatType ¶ added in v0.29.0
type LogsUploaderPolicyReplaceParamsFormatType string
Format type for logs.
Possible values:
- **""** - empty, it means it will apply the format configurations from the policy.
- **"json"** - output the logs as json lines.
const ( LogsUploaderPolicyReplaceParamsFormatTypeJson LogsUploaderPolicyReplaceParamsFormatType = "json" LogsUploaderPolicyReplaceParamsFormatTypeEmpty LogsUploaderPolicyReplaceParamsFormatType = "" )
type LogsUploaderPolicyService ¶
type LogsUploaderPolicyService struct {
Options []option.RequestOption
}
LogsUploaderPolicyService 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 NewLogsUploaderPolicyService method instead.
func NewLogsUploaderPolicyService ¶
func NewLogsUploaderPolicyService(opts ...option.RequestOption) (r LogsUploaderPolicyService)
NewLogsUploaderPolicyService 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 (*LogsUploaderPolicyService) Delete ¶
func (r *LogsUploaderPolicyService) Delete(ctx context.Context, id int64, opts ...option.RequestOption) (err error)
Delete the logs uploader policy from the system permanently.
Notes:
- **Irreversibility**: This action is irreversible. Once deleted, the logs uploader policy cannot be recovered.
func (*LogsUploaderPolicyService) Get ¶
func (r *LogsUploaderPolicyService) Get(ctx context.Context, id int64, opts ...option.RequestOption) (res *LogsUploaderPolicy, err error)
Get information about logs uploader policy.
func (*LogsUploaderPolicyService) List ¶
func (r *LogsUploaderPolicyService) List(ctx context.Context, query LogsUploaderPolicyListParams, opts ...option.RequestOption) (res *LogsUploaderPolicyList, err error)
Get list of logs uploader policies.
func (*LogsUploaderPolicyService) ListFields ¶
func (r *LogsUploaderPolicyService) ListFields(ctx context.Context, opts ...option.RequestOption) (res *[]string, err error)
Get list of available fields for logs uploader policy.
func (*LogsUploaderPolicyService) New ¶
func (r *LogsUploaderPolicyService) New(ctx context.Context, body LogsUploaderPolicyNewParams, opts ...option.RequestOption) (res *LogsUploaderPolicy, err error)
Create logs uploader policy.
func (*LogsUploaderPolicyService) Replace ¶
func (r *LogsUploaderPolicyService) Replace(ctx context.Context, id int64, body LogsUploaderPolicyReplaceParams, opts ...option.RequestOption) (res *LogsUploaderPolicy, err error)
Change logs uploader policy.
func (*LogsUploaderPolicyService) Update ¶
func (r *LogsUploaderPolicyService) Update(ctx context.Context, id int64, body LogsUploaderPolicyUpdateParams, opts ...option.RequestOption) (res *LogsUploaderPolicy, err error)
Change logs uploader policy partially.
type LogsUploaderPolicyUpdateParams ¶
type LogsUploaderPolicyUpdateParams struct {
// Threshold in MB to rotate logs.
RotateThresholdMB param.Opt[int64] `json:"rotate_threshold_mb,omitzero"`
// Date format for logs.
DateFormat param.Opt[string] `json:"date_format,omitzero"`
// Description of the policy.
Description param.Opt[string] `json:"description,omitzero"`
// When set to true, the service sanitizes string values by escaping characters
// that may be unsafe for transport, logging, or downstream processing.
//
// The following categories of characters are escaped:
//
// - Control and non-printable characters
// - Quotation marks and escape characters
// - Characters outside the standard ASCII range
//
// The resulting output contains only printable ASCII characters.
EscapeSpecialCharacters param.Opt[bool] `json:"escape_special_characters,omitzero"`
// Field delimiter for logs.
FieldDelimiter param.Opt[string] `json:"field_delimiter,omitzero"`
// Field separator for logs.
FieldSeparator param.Opt[string] `json:"field_separator,omitzero"`
// Template for log file name.
FileNameTemplate param.Opt[string] `json:"file_name_template,omitzero"`
// Include empty logs in the upload.
IncludeEmptyLogs param.Opt[bool] `json:"include_empty_logs,omitzero"`
// Include logs from origin shielding in the upload.
IncludeShieldLogs param.Opt[bool] `json:"include_shield_logs,omitzero"`
// Name of the policy.
Name param.Opt[string] `json:"name,omitzero"`
// Interval in minutes to retry failed uploads.
RetryIntervalMinutes param.Opt[int64] `json:"retry_interval_minutes,omitzero"`
// Interval in minutes to rotate logs.
RotateIntervalMinutes param.Opt[int64] `json:"rotate_interval_minutes,omitzero"`
// Threshold in lines to rotate logs.
RotateThresholdLines param.Opt[int64] `json:"rotate_threshold_lines,omitzero"`
// List of fields to include in logs.
Fields []string `json:"fields,omitzero"`
// Format type for logs.
//
// Possible values:
//
// - **""** - empty, it means it will apply the format configurations from the
// policy.
// - **"json"** - output the logs as json lines.
//
// Any of "json", "".
FormatType LogsUploaderPolicyUpdateParamsFormatType `json:"format_type,omitzero"`
// Tags allow for dynamic decoration of logs by adding predefined fields to the log
// format. These tags serve as customizable key-value pairs that can be included in
// log entries to enhance context and readability.
Tags map[string]string `json:"tags,omitzero"`
// contains filtered or unexported fields
}
func (LogsUploaderPolicyUpdateParams) MarshalJSON ¶
func (r LogsUploaderPolicyUpdateParams) MarshalJSON() (data []byte, err error)
func (*LogsUploaderPolicyUpdateParams) UnmarshalJSON ¶
func (r *LogsUploaderPolicyUpdateParams) UnmarshalJSON(data []byte) error
type LogsUploaderPolicyUpdateParamsFormatType ¶ added in v0.29.0
type LogsUploaderPolicyUpdateParamsFormatType string
Format type for logs.
Possible values:
- **""** - empty, it means it will apply the format configurations from the policy.
- **"json"** - output the logs as json lines.
const ( LogsUploaderPolicyUpdateParamsFormatTypeJson LogsUploaderPolicyUpdateParamsFormatType = "json" LogsUploaderPolicyUpdateParamsFormatTypeEmpty LogsUploaderPolicyUpdateParamsFormatType = "" )
type LogsUploaderService ¶
type LogsUploaderService struct {
Options []option.RequestOption
Policies LogsUploaderPolicyService
Targets LogsUploaderTargetService
Configs LogsUploaderConfigService
}
LogsUploaderService 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 NewLogsUploaderService method instead.
func NewLogsUploaderService ¶
func NewLogsUploaderService(opts ...option.RequestOption) (r LogsUploaderService)
NewLogsUploaderService 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 LogsUploaderTarget ¶
type LogsUploaderTarget struct {
ID int64 `json:"id"`
// Client that owns the target.
ClientID int64 `json:"client_id"`
// Config for specific storage type.
Config LogsUploaderTargetConfigUnion `json:"config"`
// Time when logs uploader target was created.
Created time.Time `json:"created" format:"date-time"`
// Description of the target.
Description string `json:"description"`
// Name of the target.
Name string `json:"name"`
// List of logs uploader configs that use this target.
RelatedUploaderConfigs []int64 `json:"related_uploader_configs"`
// Validation status of the logs uploader target. Informs if the specified target
// is reachable.
Status LogsUploaderTargetStatus `json:"status"`
// Type of storage for logs.
//
// Any of "s3_gcore", "s3_amazon", "s3_oss", "s3_other", "s3_v1", "ftp", "sftp",
// "http".
StorageType LogsUploaderTargetStorageType `json:"storage_type"`
// Time when logs uploader target was updated.
Updated time.Time `json:"updated" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
ClientID respjson.Field
Config respjson.Field
Created respjson.Field
Description respjson.Field
Name respjson.Field
RelatedUploaderConfigs respjson.Field
Status respjson.Field
StorageType respjson.Field
Updated respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (LogsUploaderTarget) RawJSON ¶
func (r LogsUploaderTarget) RawJSON() string
Returns the unmodified JSON received from the API
func (*LogsUploaderTarget) UnmarshalJSON ¶
func (r *LogsUploaderTarget) UnmarshalJSON(data []byte) error
type LogsUploaderTargetConfigFtpConfig ¶
type LogsUploaderTargetConfigFtpConfig struct {
Directory string `json:"directory,nullable"`
Hostname string `json:"hostname"`
TimeoutSeconds int64 `json:"timeout_seconds"`
User string `json:"user"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Directory respjson.Field
Hostname respjson.Field
TimeoutSeconds respjson.Field
User respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (LogsUploaderTargetConfigFtpConfig) RawJSON ¶
func (r LogsUploaderTargetConfigFtpConfig) RawJSON() string
Returns the unmodified JSON received from the API
func (*LogsUploaderTargetConfigFtpConfig) UnmarshalJSON ¶
func (r *LogsUploaderTargetConfigFtpConfig) UnmarshalJSON(data []byte) error
type LogsUploaderTargetConfigHTTPConfig ¶
type LogsUploaderTargetConfigHTTPConfig struct {
Append LogsUploaderTargetConfigHTTPConfigAppend `json:"append"`
Auth LogsUploaderTargetConfigHTTPConfigAuth `json:"auth"`
// Any of "json", "text".
ContentType string `json:"content_type"`
Retry LogsUploaderTargetConfigHTTPConfigRetry `json:"retry"`
Upload LogsUploaderTargetConfigHTTPConfigUpload `json:"upload"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Append respjson.Field
Auth respjson.Field
ContentType respjson.Field
Retry respjson.Field
Upload respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (LogsUploaderTargetConfigHTTPConfig) RawJSON ¶
func (r LogsUploaderTargetConfigHTTPConfig) RawJSON() string
Returns the unmodified JSON received from the API
func (*LogsUploaderTargetConfigHTTPConfig) UnmarshalJSON ¶
func (r *LogsUploaderTargetConfigHTTPConfig) UnmarshalJSON(data []byte) error
type LogsUploaderTargetConfigHTTPConfigAppend ¶
type LogsUploaderTargetConfigHTTPConfigAppend struct {
Headers map[string]string `json:"headers"`
// Any of "POST", "PUT".
Method string `json:"method"`
ResponseActions []LogsUploaderTargetConfigHTTPConfigAppendResponseAction `json:"response_actions"`
TimeoutSeconds int64 `json:"timeout_seconds"`
URL string `json:"url"`
UseCompression bool `json:"use_compression"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Headers respjson.Field
Method respjson.Field
ResponseActions respjson.Field
TimeoutSeconds respjson.Field
URL respjson.Field
UseCompression respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (LogsUploaderTargetConfigHTTPConfigAppend) RawJSON ¶
func (r LogsUploaderTargetConfigHTTPConfigAppend) RawJSON() string
Returns the unmodified JSON received from the API
func (*LogsUploaderTargetConfigHTTPConfigAppend) UnmarshalJSON ¶
func (r *LogsUploaderTargetConfigHTTPConfigAppend) UnmarshalJSON(data []byte) error
type LogsUploaderTargetConfigHTTPConfigAppendResponseAction ¶
type LogsUploaderTargetConfigHTTPConfigAppendResponseAction struct {
// Any of "drop", "retry", "append".
Action string `json:"action"`
Description string `json:"description"`
MatchPayload string `json:"match_payload"`
MatchStatusCode int64 `json:"match_status_code"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Action respjson.Field
Description respjson.Field
MatchPayload respjson.Field
MatchStatusCode respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (LogsUploaderTargetConfigHTTPConfigAppendResponseAction) RawJSON ¶
func (r LogsUploaderTargetConfigHTTPConfigAppendResponseAction) RawJSON() string
Returns the unmodified JSON received from the API
func (*LogsUploaderTargetConfigHTTPConfigAppendResponseAction) UnmarshalJSON ¶
func (r *LogsUploaderTargetConfigHTTPConfigAppendResponseAction) UnmarshalJSON(data []byte) error
type LogsUploaderTargetConfigHTTPConfigAuth ¶
type LogsUploaderTargetConfigHTTPConfigAuth struct {
Config LogsUploaderTargetConfigHTTPConfigAuthConfig `json:"config"`
// Any of "token".
Type string `json:"type"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Config respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (LogsUploaderTargetConfigHTTPConfigAuth) RawJSON ¶
func (r LogsUploaderTargetConfigHTTPConfigAuth) RawJSON() string
Returns the unmodified JSON received from the API
func (*LogsUploaderTargetConfigHTTPConfigAuth) UnmarshalJSON ¶
func (r *LogsUploaderTargetConfigHTTPConfigAuth) UnmarshalJSON(data []byte) error
type LogsUploaderTargetConfigHTTPConfigAuthConfig ¶
type LogsUploaderTargetConfigHTTPConfigAuthConfig struct {
Token string `json:"token"`
HeaderName string `json:"header_name"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Token respjson.Field
HeaderName respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (LogsUploaderTargetConfigHTTPConfigAuthConfig) RawJSON ¶
func (r LogsUploaderTargetConfigHTTPConfigAuthConfig) RawJSON() string
Returns the unmodified JSON received from the API
func (*LogsUploaderTargetConfigHTTPConfigAuthConfig) UnmarshalJSON ¶
func (r *LogsUploaderTargetConfigHTTPConfigAuthConfig) UnmarshalJSON(data []byte) error
type LogsUploaderTargetConfigHTTPConfigRetry ¶
type LogsUploaderTargetConfigHTTPConfigRetry struct {
Headers map[string]string `json:"headers"`
// Any of "POST", "PUT".
Method string `json:"method"`
ResponseActions []LogsUploaderTargetConfigHTTPConfigRetryResponseAction `json:"response_actions"`
TimeoutSeconds int64 `json:"timeout_seconds"`
URL string `json:"url"`
UseCompression bool `json:"use_compression"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Headers respjson.Field
Method respjson.Field
ResponseActions respjson.Field
TimeoutSeconds respjson.Field
URL respjson.Field
UseCompression respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (LogsUploaderTargetConfigHTTPConfigRetry) RawJSON ¶
func (r LogsUploaderTargetConfigHTTPConfigRetry) RawJSON() string
Returns the unmodified JSON received from the API
func (*LogsUploaderTargetConfigHTTPConfigRetry) UnmarshalJSON ¶
func (r *LogsUploaderTargetConfigHTTPConfigRetry) UnmarshalJSON(data []byte) error
type LogsUploaderTargetConfigHTTPConfigRetryResponseAction ¶
type LogsUploaderTargetConfigHTTPConfigRetryResponseAction struct {
// Any of "drop", "retry", "append".
Action string `json:"action"`
Description string `json:"description"`
MatchPayload string `json:"match_payload"`
MatchStatusCode int64 `json:"match_status_code"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Action respjson.Field
Description respjson.Field
MatchPayload respjson.Field
MatchStatusCode respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (LogsUploaderTargetConfigHTTPConfigRetryResponseAction) RawJSON ¶
func (r LogsUploaderTargetConfigHTTPConfigRetryResponseAction) RawJSON() string
Returns the unmodified JSON received from the API
func (*LogsUploaderTargetConfigHTTPConfigRetryResponseAction) UnmarshalJSON ¶
func (r *LogsUploaderTargetConfigHTTPConfigRetryResponseAction) UnmarshalJSON(data []byte) error
type LogsUploaderTargetConfigHTTPConfigUpload ¶
type LogsUploaderTargetConfigHTTPConfigUpload struct {
Headers map[string]string `json:"headers"`
// Any of "POST", "PUT".
Method string `json:"method"`
ResponseActions []LogsUploaderTargetConfigHTTPConfigUploadResponseAction `json:"response_actions"`
TimeoutSeconds int64 `json:"timeout_seconds"`
URL string `json:"url"`
UseCompression bool `json:"use_compression"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Headers respjson.Field
Method respjson.Field
ResponseActions respjson.Field
TimeoutSeconds respjson.Field
URL respjson.Field
UseCompression respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (LogsUploaderTargetConfigHTTPConfigUpload) RawJSON ¶
func (r LogsUploaderTargetConfigHTTPConfigUpload) RawJSON() string
Returns the unmodified JSON received from the API
func (*LogsUploaderTargetConfigHTTPConfigUpload) UnmarshalJSON ¶
func (r *LogsUploaderTargetConfigHTTPConfigUpload) UnmarshalJSON(data []byte) error
type LogsUploaderTargetConfigHTTPConfigUploadResponseAction ¶
type LogsUploaderTargetConfigHTTPConfigUploadResponseAction struct {
// Any of "drop", "retry", "append".
Action string `json:"action"`
Description string `json:"description"`
MatchPayload string `json:"match_payload"`
MatchStatusCode int64 `json:"match_status_code"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Action respjson.Field
Description respjson.Field
MatchPayload respjson.Field
MatchStatusCode respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (LogsUploaderTargetConfigHTTPConfigUploadResponseAction) RawJSON ¶
func (r LogsUploaderTargetConfigHTTPConfigUploadResponseAction) RawJSON() string
Returns the unmodified JSON received from the API
func (*LogsUploaderTargetConfigHTTPConfigUploadResponseAction) UnmarshalJSON ¶
func (r *LogsUploaderTargetConfigHTTPConfigUploadResponseAction) UnmarshalJSON(data []byte) error
type LogsUploaderTargetConfigObject ¶
type LogsUploaderTargetConfigObject struct {
AccessKeyID string `json:"access_key_id"`
BucketName string `json:"bucket_name"`
Directory string `json:"directory,nullable"`
Region string `json:"region,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AccessKeyID respjson.Field
BucketName respjson.Field
Directory respjson.Field
Region respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (LogsUploaderTargetConfigObject) RawJSON ¶
func (r LogsUploaderTargetConfigObject) RawJSON() string
Returns the unmodified JSON received from the API
func (*LogsUploaderTargetConfigObject) UnmarshalJSON ¶
func (r *LogsUploaderTargetConfigObject) UnmarshalJSON(data []byte) error
type LogsUploaderTargetConfigS3AmazonConfig ¶
type LogsUploaderTargetConfigS3AmazonConfig struct {
AccessKeyID string `json:"access_key_id"`
BucketName string `json:"bucket_name"`
Directory string `json:"directory,nullable"`
Region string `json:"region"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AccessKeyID respjson.Field
BucketName respjson.Field
Directory respjson.Field
Region respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (LogsUploaderTargetConfigS3AmazonConfig) RawJSON ¶
func (r LogsUploaderTargetConfigS3AmazonConfig) RawJSON() string
Returns the unmodified JSON received from the API
func (*LogsUploaderTargetConfigS3AmazonConfig) UnmarshalJSON ¶
func (r *LogsUploaderTargetConfigS3AmazonConfig) UnmarshalJSON(data []byte) error
type LogsUploaderTargetConfigS3GcoreConfig ¶
type LogsUploaderTargetConfigS3GcoreConfig struct {
AccessKeyID string `json:"access_key_id"`
BucketName string `json:"bucket_name"`
Directory string `json:"directory,nullable"`
Endpoint string `json:"endpoint"`
Region string `json:"region"`
UsePathStyle bool `json:"use_path_style"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AccessKeyID respjson.Field
BucketName respjson.Field
Directory respjson.Field
Endpoint respjson.Field
Region respjson.Field
UsePathStyle respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (LogsUploaderTargetConfigS3GcoreConfig) RawJSON ¶
func (r LogsUploaderTargetConfigS3GcoreConfig) RawJSON() string
Returns the unmodified JSON received from the API
func (*LogsUploaderTargetConfigS3GcoreConfig) UnmarshalJSON ¶
func (r *LogsUploaderTargetConfigS3GcoreConfig) UnmarshalJSON(data []byte) error
type LogsUploaderTargetConfigSftpConfig ¶
type LogsUploaderTargetConfigSftpConfig struct {
Hostname string `json:"hostname,required"`
User string `json:"user,required"`
Directory string `json:"directory,nullable"`
KeyPassphrase string `json:"key_passphrase,nullable"`
Password string `json:"password,nullable"`
PrivateKey string `json:"private_key,nullable"`
TimeoutSeconds int64 `json:"timeout_seconds"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Hostname respjson.Field
User respjson.Field
Directory respjson.Field
KeyPassphrase respjson.Field
Password respjson.Field
PrivateKey respjson.Field
TimeoutSeconds respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (LogsUploaderTargetConfigSftpConfig) RawJSON ¶
func (r LogsUploaderTargetConfigSftpConfig) RawJSON() string
Returns the unmodified JSON received from the API
func (*LogsUploaderTargetConfigSftpConfig) UnmarshalJSON ¶
func (r *LogsUploaderTargetConfigSftpConfig) UnmarshalJSON(data []byte) error
type LogsUploaderTargetConfigUnion ¶
type LogsUploaderTargetConfigUnion struct {
AccessKeyID string `json:"access_key_id"`
BucketName string `json:"bucket_name"`
Directory string `json:"directory"`
// This field is from variant [LogsUploaderTargetConfigS3GcoreConfig].
Endpoint string `json:"endpoint"`
Region string `json:"region"`
// This field is from variant [LogsUploaderTargetConfigS3GcoreConfig].
UsePathStyle bool `json:"use_path_style"`
Hostname string `json:"hostname"`
TimeoutSeconds int64 `json:"timeout_seconds"`
User string `json:"user"`
// This field is from variant [LogsUploaderTargetConfigSftpConfig].
KeyPassphrase string `json:"key_passphrase"`
// This field is from variant [LogsUploaderTargetConfigSftpConfig].
Password string `json:"password"`
// This field is from variant [LogsUploaderTargetConfigSftpConfig].
PrivateKey string `json:"private_key"`
// This field is from variant [LogsUploaderTargetConfigHTTPConfig].
Append LogsUploaderTargetConfigHTTPConfigAppend `json:"append"`
// This field is from variant [LogsUploaderTargetConfigHTTPConfig].
Auth LogsUploaderTargetConfigHTTPConfigAuth `json:"auth"`
// This field is from variant [LogsUploaderTargetConfigHTTPConfig].
ContentType string `json:"content_type"`
// This field is from variant [LogsUploaderTargetConfigHTTPConfig].
Retry LogsUploaderTargetConfigHTTPConfigRetry `json:"retry"`
// This field is from variant [LogsUploaderTargetConfigHTTPConfig].
Upload LogsUploaderTargetConfigHTTPConfigUpload `json:"upload"`
JSON struct {
AccessKeyID respjson.Field
BucketName respjson.Field
Directory respjson.Field
Endpoint respjson.Field
Region respjson.Field
UsePathStyle respjson.Field
Hostname respjson.Field
TimeoutSeconds respjson.Field
User respjson.Field
KeyPassphrase respjson.Field
Password respjson.Field
PrivateKey respjson.Field
Append respjson.Field
Auth respjson.Field
ContentType respjson.Field
Retry respjson.Field
Upload respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
LogsUploaderTargetConfigUnion contains all possible properties and values from LogsUploaderTargetConfigS3GcoreConfig, LogsUploaderTargetConfigS3AmazonConfig, LogsUploaderTargetConfigObject, LogsUploaderTargetConfigS3GcoreConfig, LogsUploaderTargetConfigS3GcoreConfig, LogsUploaderTargetConfigFtpConfig, LogsUploaderTargetConfigSftpConfig, LogsUploaderTargetConfigHTTPConfig.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (LogsUploaderTargetConfigUnion) AsFtpConfig ¶
func (u LogsUploaderTargetConfigUnion) AsFtpConfig() (v LogsUploaderTargetConfigFtpConfig)
func (LogsUploaderTargetConfigUnion) AsHTTPConfig ¶
func (u LogsUploaderTargetConfigUnion) AsHTTPConfig() (v LogsUploaderTargetConfigHTTPConfig)
func (LogsUploaderTargetConfigUnion) AsLogsUploaderTargetConfigObject ¶
func (u LogsUploaderTargetConfigUnion) AsLogsUploaderTargetConfigObject() (v LogsUploaderTargetConfigObject)
func (LogsUploaderTargetConfigUnion) AsLogsUploaderTargetConfigS3GcoreConfig ¶
func (u LogsUploaderTargetConfigUnion) AsLogsUploaderTargetConfigS3GcoreConfig() (v LogsUploaderTargetConfigS3GcoreConfig)
func (LogsUploaderTargetConfigUnion) AsS3AmazonConfig ¶
func (u LogsUploaderTargetConfigUnion) AsS3AmazonConfig() (v LogsUploaderTargetConfigS3AmazonConfig)
func (LogsUploaderTargetConfigUnion) AsS3GcoreConfig ¶
func (u LogsUploaderTargetConfigUnion) AsS3GcoreConfig() (v LogsUploaderTargetConfigS3GcoreConfig)
func (LogsUploaderTargetConfigUnion) AsSftpConfig ¶
func (u LogsUploaderTargetConfigUnion) AsSftpConfig() (v LogsUploaderTargetConfigSftpConfig)
func (LogsUploaderTargetConfigUnion) AsVariant2 ¶
func (u LogsUploaderTargetConfigUnion) AsVariant2() (v LogsUploaderTargetConfigS3GcoreConfig)
func (LogsUploaderTargetConfigUnion) RawJSON ¶
func (u LogsUploaderTargetConfigUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*LogsUploaderTargetConfigUnion) UnmarshalJSON ¶
func (r *LogsUploaderTargetConfigUnion) UnmarshalJSON(data []byte) error
type LogsUploaderTargetList ¶
type LogsUploaderTargetList []LogsUploaderTarget
type LogsUploaderTargetListParams ¶
type LogsUploaderTargetListParams struct {
// Search by target name or id.
Search param.Opt[string] `query:"search,omitzero" json:"-"`
// Filter by ids of related logs uploader configs that use given target.
ConfigIDs []int64 `query:"config_ids,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (LogsUploaderTargetListParams) URLQuery ¶
func (r LogsUploaderTargetListParams) URLQuery() (v url.Values, err error)
URLQuery serializes LogsUploaderTargetListParams's query parameters as `url.Values`.
type LogsUploaderTargetNewParams ¶
type LogsUploaderTargetNewParams struct {
// Config for specific storage type.
Config LogsUploaderTargetNewParamsConfigUnion `json:"config,omitzero,required"`
// Type of storage for logs.
//
// Any of "s3_gcore", "s3_amazon", "s3_oss", "s3_other", "s3_v1", "ftp", "sftp",
// "http".
StorageType LogsUploaderTargetNewParamsStorageType `json:"storage_type,omitzero,required"`
// Description of the target.
Description param.Opt[string] `json:"description,omitzero"`
// Name of the target.
Name param.Opt[string] `json:"name,omitzero"`
// contains filtered or unexported fields
}
func (LogsUploaderTargetNewParams) MarshalJSON ¶
func (r LogsUploaderTargetNewParams) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetNewParams) UnmarshalJSON ¶
func (r *LogsUploaderTargetNewParams) UnmarshalJSON(data []byte) error
type LogsUploaderTargetNewParamsConfigFtpConfig ¶
type LogsUploaderTargetNewParamsConfigFtpConfig struct {
Hostname string `json:"hostname,required"`
Password string `json:"password,required"`
User string `json:"user,required"`
Directory param.Opt[string] `json:"directory,omitzero"`
TimeoutSeconds param.Opt[int64] `json:"timeout_seconds,omitzero"`
// contains filtered or unexported fields
}
The properties Hostname, Password, User are required.
func (LogsUploaderTargetNewParamsConfigFtpConfig) MarshalJSON ¶
func (r LogsUploaderTargetNewParamsConfigFtpConfig) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetNewParamsConfigFtpConfig) UnmarshalJSON ¶
func (r *LogsUploaderTargetNewParamsConfigFtpConfig) UnmarshalJSON(data []byte) error
type LogsUploaderTargetNewParamsConfigHTTPConfig ¶
type LogsUploaderTargetNewParamsConfigHTTPConfig struct {
Upload LogsUploaderTargetNewParamsConfigHTTPConfigUpload `json:"upload,omitzero,required"`
Append LogsUploaderTargetNewParamsConfigHTTPConfigAppend `json:"append,omitzero"`
Auth LogsUploaderTargetNewParamsConfigHTTPConfigAuth `json:"auth,omitzero"`
// Any of "json", "text".
ContentType string `json:"content_type,omitzero"`
Retry LogsUploaderTargetNewParamsConfigHTTPConfigRetry `json:"retry,omitzero"`
// contains filtered or unexported fields
}
The property Upload is required.
func (LogsUploaderTargetNewParamsConfigHTTPConfig) MarshalJSON ¶
func (r LogsUploaderTargetNewParamsConfigHTTPConfig) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetNewParamsConfigHTTPConfig) UnmarshalJSON ¶
func (r *LogsUploaderTargetNewParamsConfigHTTPConfig) UnmarshalJSON(data []byte) error
type LogsUploaderTargetNewParamsConfigHTTPConfigAppend ¶
type LogsUploaderTargetNewParamsConfigHTTPConfigAppend struct {
URL string `json:"url,required"`
TimeoutSeconds param.Opt[int64] `json:"timeout_seconds,omitzero"`
UseCompression param.Opt[bool] `json:"use_compression,omitzero"`
Headers map[string]string `json:"headers,omitzero"`
// Any of "POST", "PUT".
Method string `json:"method,omitzero"`
ResponseActions []LogsUploaderTargetNewParamsConfigHTTPConfigAppendResponseAction `json:"response_actions,omitzero"`
// contains filtered or unexported fields
}
The property URL is required.
func (LogsUploaderTargetNewParamsConfigHTTPConfigAppend) MarshalJSON ¶
func (r LogsUploaderTargetNewParamsConfigHTTPConfigAppend) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetNewParamsConfigHTTPConfigAppend) UnmarshalJSON ¶
func (r *LogsUploaderTargetNewParamsConfigHTTPConfigAppend) UnmarshalJSON(data []byte) error
type LogsUploaderTargetNewParamsConfigHTTPConfigAppendResponseAction ¶
type LogsUploaderTargetNewParamsConfigHTTPConfigAppendResponseAction struct {
// Any of "drop", "retry", "append".
Action string `json:"action,omitzero,required"`
Description param.Opt[string] `json:"description,omitzero"`
MatchPayload param.Opt[string] `json:"match_payload,omitzero"`
MatchStatusCode param.Opt[int64] `json:"match_status_code,omitzero"`
// contains filtered or unexported fields
}
The property Action is required.
func (LogsUploaderTargetNewParamsConfigHTTPConfigAppendResponseAction) MarshalJSON ¶
func (r LogsUploaderTargetNewParamsConfigHTTPConfigAppendResponseAction) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetNewParamsConfigHTTPConfigAppendResponseAction) UnmarshalJSON ¶
func (r *LogsUploaderTargetNewParamsConfigHTTPConfigAppendResponseAction) UnmarshalJSON(data []byte) error
type LogsUploaderTargetNewParamsConfigHTTPConfigAuth ¶
type LogsUploaderTargetNewParamsConfigHTTPConfigAuth struct {
Config LogsUploaderTargetNewParamsConfigHTTPConfigAuthConfig `json:"config,omitzero,required"`
// Any of "token".
Type string `json:"type,omitzero,required"`
// contains filtered or unexported fields
}
The properties Config, Type are required.
func (LogsUploaderTargetNewParamsConfigHTTPConfigAuth) MarshalJSON ¶
func (r LogsUploaderTargetNewParamsConfigHTTPConfigAuth) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetNewParamsConfigHTTPConfigAuth) UnmarshalJSON ¶
func (r *LogsUploaderTargetNewParamsConfigHTTPConfigAuth) UnmarshalJSON(data []byte) error
type LogsUploaderTargetNewParamsConfigHTTPConfigAuthConfig ¶
type LogsUploaderTargetNewParamsConfigHTTPConfigAuthConfig struct {
Token string `json:"token,required"`
HeaderName string `json:"header_name,required"`
// contains filtered or unexported fields
}
The properties Token, HeaderName are required.
func (LogsUploaderTargetNewParamsConfigHTTPConfigAuthConfig) MarshalJSON ¶
func (r LogsUploaderTargetNewParamsConfigHTTPConfigAuthConfig) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetNewParamsConfigHTTPConfigAuthConfig) UnmarshalJSON ¶
func (r *LogsUploaderTargetNewParamsConfigHTTPConfigAuthConfig) UnmarshalJSON(data []byte) error
type LogsUploaderTargetNewParamsConfigHTTPConfigRetry ¶
type LogsUploaderTargetNewParamsConfigHTTPConfigRetry struct {
URL string `json:"url,required"`
TimeoutSeconds param.Opt[int64] `json:"timeout_seconds,omitzero"`
UseCompression param.Opt[bool] `json:"use_compression,omitzero"`
Headers map[string]string `json:"headers,omitzero"`
// Any of "POST", "PUT".
Method string `json:"method,omitzero"`
ResponseActions []LogsUploaderTargetNewParamsConfigHTTPConfigRetryResponseAction `json:"response_actions,omitzero"`
// contains filtered or unexported fields
}
The property URL is required.
func (LogsUploaderTargetNewParamsConfigHTTPConfigRetry) MarshalJSON ¶
func (r LogsUploaderTargetNewParamsConfigHTTPConfigRetry) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetNewParamsConfigHTTPConfigRetry) UnmarshalJSON ¶
func (r *LogsUploaderTargetNewParamsConfigHTTPConfigRetry) UnmarshalJSON(data []byte) error
type LogsUploaderTargetNewParamsConfigHTTPConfigRetryResponseAction ¶
type LogsUploaderTargetNewParamsConfigHTTPConfigRetryResponseAction struct {
// Any of "drop", "retry", "append".
Action string `json:"action,omitzero,required"`
Description param.Opt[string] `json:"description,omitzero"`
MatchPayload param.Opt[string] `json:"match_payload,omitzero"`
MatchStatusCode param.Opt[int64] `json:"match_status_code,omitzero"`
// contains filtered or unexported fields
}
The property Action is required.
func (LogsUploaderTargetNewParamsConfigHTTPConfigRetryResponseAction) MarshalJSON ¶
func (r LogsUploaderTargetNewParamsConfigHTTPConfigRetryResponseAction) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetNewParamsConfigHTTPConfigRetryResponseAction) UnmarshalJSON ¶
func (r *LogsUploaderTargetNewParamsConfigHTTPConfigRetryResponseAction) UnmarshalJSON(data []byte) error
type LogsUploaderTargetNewParamsConfigHTTPConfigUpload ¶
type LogsUploaderTargetNewParamsConfigHTTPConfigUpload struct {
URL string `json:"url,required"`
TimeoutSeconds param.Opt[int64] `json:"timeout_seconds,omitzero"`
UseCompression param.Opt[bool] `json:"use_compression,omitzero"`
Headers map[string]string `json:"headers,omitzero"`
// Any of "POST", "PUT".
Method string `json:"method,omitzero"`
ResponseActions []LogsUploaderTargetNewParamsConfigHTTPConfigUploadResponseAction `json:"response_actions,omitzero"`
// contains filtered or unexported fields
}
The property URL is required.
func (LogsUploaderTargetNewParamsConfigHTTPConfigUpload) MarshalJSON ¶
func (r LogsUploaderTargetNewParamsConfigHTTPConfigUpload) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetNewParamsConfigHTTPConfigUpload) UnmarshalJSON ¶
func (r *LogsUploaderTargetNewParamsConfigHTTPConfigUpload) UnmarshalJSON(data []byte) error
type LogsUploaderTargetNewParamsConfigHTTPConfigUploadResponseAction ¶
type LogsUploaderTargetNewParamsConfigHTTPConfigUploadResponseAction struct {
// Any of "drop", "retry", "append".
Action string `json:"action,omitzero,required"`
Description param.Opt[string] `json:"description,omitzero"`
MatchPayload param.Opt[string] `json:"match_payload,omitzero"`
MatchStatusCode param.Opt[int64] `json:"match_status_code,omitzero"`
// contains filtered or unexported fields
}
The property Action is required.
func (LogsUploaderTargetNewParamsConfigHTTPConfigUploadResponseAction) MarshalJSON ¶
func (r LogsUploaderTargetNewParamsConfigHTTPConfigUploadResponseAction) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetNewParamsConfigHTTPConfigUploadResponseAction) UnmarshalJSON ¶
func (r *LogsUploaderTargetNewParamsConfigHTTPConfigUploadResponseAction) UnmarshalJSON(data []byte) error
type LogsUploaderTargetNewParamsConfigS3AmazonConfig ¶
type LogsUploaderTargetNewParamsConfigS3AmazonConfig struct {
AccessKeyID string `json:"access_key_id,required"`
BucketName string `json:"bucket_name,required"`
Region string `json:"region,required"`
SecretAccessKey string `json:"secret_access_key,required"`
Directory param.Opt[string] `json:"directory,omitzero"`
// contains filtered or unexported fields
}
The properties AccessKeyID, BucketName, Region, SecretAccessKey are required.
func (LogsUploaderTargetNewParamsConfigS3AmazonConfig) MarshalJSON ¶
func (r LogsUploaderTargetNewParamsConfigS3AmazonConfig) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetNewParamsConfigS3AmazonConfig) UnmarshalJSON ¶
func (r *LogsUploaderTargetNewParamsConfigS3AmazonConfig) UnmarshalJSON(data []byte) error
type LogsUploaderTargetNewParamsConfigS3GcoreConfig ¶
type LogsUploaderTargetNewParamsConfigS3GcoreConfig struct {
AccessKeyID string `json:"access_key_id,required"`
BucketName string `json:"bucket_name,required"`
Endpoint string `json:"endpoint,required"`
Region string `json:"region,required"`
SecretAccessKey string `json:"secret_access_key,required"`
Directory param.Opt[string] `json:"directory,omitzero"`
UsePathStyle param.Opt[bool] `json:"use_path_style,omitzero"`
// contains filtered or unexported fields
}
The properties AccessKeyID, BucketName, Endpoint, Region, SecretAccessKey are required.
func (LogsUploaderTargetNewParamsConfigS3GcoreConfig) MarshalJSON ¶
func (r LogsUploaderTargetNewParamsConfigS3GcoreConfig) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetNewParamsConfigS3GcoreConfig) UnmarshalJSON ¶
func (r *LogsUploaderTargetNewParamsConfigS3GcoreConfig) UnmarshalJSON(data []byte) error
type LogsUploaderTargetNewParamsConfigS3OssConfig ¶
type LogsUploaderTargetNewParamsConfigS3OssConfig struct {
AccessKeyID string `json:"access_key_id,required"`
BucketName string `json:"bucket_name,required"`
SecretAccessKey string `json:"secret_access_key,required"`
Directory param.Opt[string] `json:"directory,omitzero"`
Region param.Opt[string] `json:"region,omitzero"`
// contains filtered or unexported fields
}
The properties AccessKeyID, BucketName, SecretAccessKey are required.
func (LogsUploaderTargetNewParamsConfigS3OssConfig) MarshalJSON ¶
func (r LogsUploaderTargetNewParamsConfigS3OssConfig) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetNewParamsConfigS3OssConfig) UnmarshalJSON ¶
func (r *LogsUploaderTargetNewParamsConfigS3OssConfig) UnmarshalJSON(data []byte) error
type LogsUploaderTargetNewParamsConfigS3OtherConfig ¶
type LogsUploaderTargetNewParamsConfigS3OtherConfig struct {
AccessKeyID string `json:"access_key_id,required"`
BucketName string `json:"bucket_name,required"`
Endpoint string `json:"endpoint,required"`
Region string `json:"region,required"`
SecretAccessKey string `json:"secret_access_key,required"`
Directory param.Opt[string] `json:"directory,omitzero"`
UsePathStyle param.Opt[bool] `json:"use_path_style,omitzero"`
// contains filtered or unexported fields
}
The properties AccessKeyID, BucketName, Endpoint, Region, SecretAccessKey are required.
func (LogsUploaderTargetNewParamsConfigS3OtherConfig) MarshalJSON ¶
func (r LogsUploaderTargetNewParamsConfigS3OtherConfig) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetNewParamsConfigS3OtherConfig) UnmarshalJSON ¶
func (r *LogsUploaderTargetNewParamsConfigS3OtherConfig) UnmarshalJSON(data []byte) error
type LogsUploaderTargetNewParamsConfigS3V1Config ¶
type LogsUploaderTargetNewParamsConfigS3V1Config struct {
AccessKeyID string `json:"access_key_id,required"`
BucketName string `json:"bucket_name,required"`
Endpoint string `json:"endpoint,required"`
Region string `json:"region,required"`
SecretAccessKey string `json:"secret_access_key,required"`
Directory param.Opt[string] `json:"directory,omitzero"`
UsePathStyle param.Opt[bool] `json:"use_path_style,omitzero"`
// contains filtered or unexported fields
}
The properties AccessKeyID, BucketName, Endpoint, Region, SecretAccessKey are required.
func (LogsUploaderTargetNewParamsConfigS3V1Config) MarshalJSON ¶
func (r LogsUploaderTargetNewParamsConfigS3V1Config) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetNewParamsConfigS3V1Config) UnmarshalJSON ¶
func (r *LogsUploaderTargetNewParamsConfigS3V1Config) UnmarshalJSON(data []byte) error
type LogsUploaderTargetNewParamsConfigSftpConfig ¶
type LogsUploaderTargetNewParamsConfigSftpConfig struct {
Hostname string `json:"hostname,required"`
User string `json:"user,required"`
Directory param.Opt[string] `json:"directory,omitzero"`
KeyPassphrase param.Opt[string] `json:"key_passphrase,omitzero"`
Password param.Opt[string] `json:"password,omitzero"`
PrivateKey param.Opt[string] `json:"private_key,omitzero"`
TimeoutSeconds param.Opt[int64] `json:"timeout_seconds,omitzero"`
// contains filtered or unexported fields
}
The properties Hostname, User are required.
func (LogsUploaderTargetNewParamsConfigSftpConfig) MarshalJSON ¶
func (r LogsUploaderTargetNewParamsConfigSftpConfig) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetNewParamsConfigSftpConfig) UnmarshalJSON ¶
func (r *LogsUploaderTargetNewParamsConfigSftpConfig) UnmarshalJSON(data []byte) error
type LogsUploaderTargetNewParamsConfigUnion ¶
type LogsUploaderTargetNewParamsConfigUnion struct {
OfS3GcoreConfig *LogsUploaderTargetNewParamsConfigS3GcoreConfig `json:",omitzero,inline"`
OfS3AmazonConfig *LogsUploaderTargetNewParamsConfigS3AmazonConfig `json:",omitzero,inline"`
OfS3OssConfig *LogsUploaderTargetNewParamsConfigS3OssConfig `json:",omitzero,inline"`
OfS3OtherConfig *LogsUploaderTargetNewParamsConfigS3OtherConfig `json:",omitzero,inline"`
OfS3V1Config *LogsUploaderTargetNewParamsConfigS3V1Config `json:",omitzero,inline"`
OfFtpConfig *LogsUploaderTargetNewParamsConfigFtpConfig `json:",omitzero,inline"`
OfSftpConfig *LogsUploaderTargetNewParamsConfigSftpConfig `json:",omitzero,inline"`
OfHTTPConfig *LogsUploaderTargetNewParamsConfigHTTPConfig `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (LogsUploaderTargetNewParamsConfigUnion) GetAccessKeyID ¶
func (u LogsUploaderTargetNewParamsConfigUnion) GetAccessKeyID() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetNewParamsConfigUnion) GetAppend ¶
func (u LogsUploaderTargetNewParamsConfigUnion) GetAppend() *LogsUploaderTargetNewParamsConfigHTTPConfigAppend
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetNewParamsConfigUnion) GetAuth ¶
func (u LogsUploaderTargetNewParamsConfigUnion) GetAuth() *LogsUploaderTargetNewParamsConfigHTTPConfigAuth
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetNewParamsConfigUnion) GetBucketName ¶
func (u LogsUploaderTargetNewParamsConfigUnion) GetBucketName() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetNewParamsConfigUnion) GetContentType ¶
func (u LogsUploaderTargetNewParamsConfigUnion) GetContentType() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetNewParamsConfigUnion) GetDirectory ¶
func (u LogsUploaderTargetNewParamsConfigUnion) GetDirectory() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetNewParamsConfigUnion) GetEndpoint ¶
func (u LogsUploaderTargetNewParamsConfigUnion) GetEndpoint() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetNewParamsConfigUnion) GetHostname ¶
func (u LogsUploaderTargetNewParamsConfigUnion) GetHostname() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetNewParamsConfigUnion) GetKeyPassphrase ¶
func (u LogsUploaderTargetNewParamsConfigUnion) GetKeyPassphrase() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetNewParamsConfigUnion) GetPassword ¶
func (u LogsUploaderTargetNewParamsConfigUnion) GetPassword() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetNewParamsConfigUnion) GetPrivateKey ¶
func (u LogsUploaderTargetNewParamsConfigUnion) GetPrivateKey() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetNewParamsConfigUnion) GetRegion ¶
func (u LogsUploaderTargetNewParamsConfigUnion) GetRegion() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetNewParamsConfigUnion) GetRetry ¶
func (u LogsUploaderTargetNewParamsConfigUnion) GetRetry() *LogsUploaderTargetNewParamsConfigHTTPConfigRetry
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetNewParamsConfigUnion) GetSecretAccessKey ¶
func (u LogsUploaderTargetNewParamsConfigUnion) GetSecretAccessKey() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetNewParamsConfigUnion) GetTimeoutSeconds ¶
func (u LogsUploaderTargetNewParamsConfigUnion) GetTimeoutSeconds() *int64
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetNewParamsConfigUnion) GetUpload ¶
func (u LogsUploaderTargetNewParamsConfigUnion) GetUpload() *LogsUploaderTargetNewParamsConfigHTTPConfigUpload
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetNewParamsConfigUnion) GetUsePathStyle ¶
func (u LogsUploaderTargetNewParamsConfigUnion) GetUsePathStyle() *bool
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetNewParamsConfigUnion) GetUser ¶
func (u LogsUploaderTargetNewParamsConfigUnion) GetUser() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetNewParamsConfigUnion) MarshalJSON ¶
func (u LogsUploaderTargetNewParamsConfigUnion) MarshalJSON() ([]byte, error)
func (*LogsUploaderTargetNewParamsConfigUnion) UnmarshalJSON ¶
func (u *LogsUploaderTargetNewParamsConfigUnion) UnmarshalJSON(data []byte) error
type LogsUploaderTargetNewParamsStorageType ¶
type LogsUploaderTargetNewParamsStorageType string
Type of storage for logs.
const ( LogsUploaderTargetNewParamsStorageTypeS3Gcore LogsUploaderTargetNewParamsStorageType = "s3_gcore" LogsUploaderTargetNewParamsStorageTypeS3Amazon LogsUploaderTargetNewParamsStorageType = "s3_amazon" LogsUploaderTargetNewParamsStorageTypeS3Oss LogsUploaderTargetNewParamsStorageType = "s3_oss" LogsUploaderTargetNewParamsStorageTypeS3Other LogsUploaderTargetNewParamsStorageType = "s3_other" LogsUploaderTargetNewParamsStorageTypeS3V1 LogsUploaderTargetNewParamsStorageType = "s3_v1" LogsUploaderTargetNewParamsStorageTypeFtp LogsUploaderTargetNewParamsStorageType = "ftp" LogsUploaderTargetNewParamsStorageTypeSftp LogsUploaderTargetNewParamsStorageType = "sftp" LogsUploaderTargetNewParamsStorageTypeHTTP LogsUploaderTargetNewParamsStorageType = "http" )
type LogsUploaderTargetReplaceParams ¶
type LogsUploaderTargetReplaceParams struct {
// Config for specific storage type.
Config LogsUploaderTargetReplaceParamsConfigUnion `json:"config,omitzero,required"`
// Type of storage for logs.
//
// Any of "s3_gcore", "s3_amazon", "s3_oss", "s3_other", "s3_v1", "ftp", "sftp",
// "http".
StorageType LogsUploaderTargetReplaceParamsStorageType `json:"storage_type,omitzero,required"`
// Description of the target.
Description param.Opt[string] `json:"description,omitzero"`
// Name of the target.
Name param.Opt[string] `json:"name,omitzero"`
// contains filtered or unexported fields
}
func (LogsUploaderTargetReplaceParams) MarshalJSON ¶
func (r LogsUploaderTargetReplaceParams) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetReplaceParams) UnmarshalJSON ¶
func (r *LogsUploaderTargetReplaceParams) UnmarshalJSON(data []byte) error
type LogsUploaderTargetReplaceParamsConfigFtpConfig ¶
type LogsUploaderTargetReplaceParamsConfigFtpConfig struct {
Hostname string `json:"hostname,required"`
Password string `json:"password,required"`
User string `json:"user,required"`
Directory param.Opt[string] `json:"directory,omitzero"`
TimeoutSeconds param.Opt[int64] `json:"timeout_seconds,omitzero"`
// contains filtered or unexported fields
}
The properties Hostname, Password, User are required.
func (LogsUploaderTargetReplaceParamsConfigFtpConfig) MarshalJSON ¶
func (r LogsUploaderTargetReplaceParamsConfigFtpConfig) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetReplaceParamsConfigFtpConfig) UnmarshalJSON ¶
func (r *LogsUploaderTargetReplaceParamsConfigFtpConfig) UnmarshalJSON(data []byte) error
type LogsUploaderTargetReplaceParamsConfigHTTPConfig ¶
type LogsUploaderTargetReplaceParamsConfigHTTPConfig struct {
Upload LogsUploaderTargetReplaceParamsConfigHTTPConfigUpload `json:"upload,omitzero,required"`
Append LogsUploaderTargetReplaceParamsConfigHTTPConfigAppend `json:"append,omitzero"`
Auth LogsUploaderTargetReplaceParamsConfigHTTPConfigAuth `json:"auth,omitzero"`
// Any of "json", "text".
ContentType string `json:"content_type,omitzero"`
Retry LogsUploaderTargetReplaceParamsConfigHTTPConfigRetry `json:"retry,omitzero"`
// contains filtered or unexported fields
}
The property Upload is required.
func (LogsUploaderTargetReplaceParamsConfigHTTPConfig) MarshalJSON ¶
func (r LogsUploaderTargetReplaceParamsConfigHTTPConfig) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetReplaceParamsConfigHTTPConfig) UnmarshalJSON ¶
func (r *LogsUploaderTargetReplaceParamsConfigHTTPConfig) UnmarshalJSON(data []byte) error
type LogsUploaderTargetReplaceParamsConfigHTTPConfigAppend ¶
type LogsUploaderTargetReplaceParamsConfigHTTPConfigAppend struct {
URL string `json:"url,required"`
TimeoutSeconds param.Opt[int64] `json:"timeout_seconds,omitzero"`
UseCompression param.Opt[bool] `json:"use_compression,omitzero"`
Headers map[string]string `json:"headers,omitzero"`
// Any of "POST", "PUT".
Method string `json:"method,omitzero"`
ResponseActions []LogsUploaderTargetReplaceParamsConfigHTTPConfigAppendResponseAction `json:"response_actions,omitzero"`
// contains filtered or unexported fields
}
The property URL is required.
func (LogsUploaderTargetReplaceParamsConfigHTTPConfigAppend) MarshalJSON ¶
func (r LogsUploaderTargetReplaceParamsConfigHTTPConfigAppend) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetReplaceParamsConfigHTTPConfigAppend) UnmarshalJSON ¶
func (r *LogsUploaderTargetReplaceParamsConfigHTTPConfigAppend) UnmarshalJSON(data []byte) error
type LogsUploaderTargetReplaceParamsConfigHTTPConfigAppendResponseAction ¶
type LogsUploaderTargetReplaceParamsConfigHTTPConfigAppendResponseAction struct {
// Any of "drop", "retry", "append".
Action string `json:"action,omitzero,required"`
Description param.Opt[string] `json:"description,omitzero"`
MatchPayload param.Opt[string] `json:"match_payload,omitzero"`
MatchStatusCode param.Opt[int64] `json:"match_status_code,omitzero"`
// contains filtered or unexported fields
}
The property Action is required.
func (LogsUploaderTargetReplaceParamsConfigHTTPConfigAppendResponseAction) MarshalJSON ¶
func (r LogsUploaderTargetReplaceParamsConfigHTTPConfigAppendResponseAction) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetReplaceParamsConfigHTTPConfigAppendResponseAction) UnmarshalJSON ¶
func (r *LogsUploaderTargetReplaceParamsConfigHTTPConfigAppendResponseAction) UnmarshalJSON(data []byte) error
type LogsUploaderTargetReplaceParamsConfigHTTPConfigAuth ¶
type LogsUploaderTargetReplaceParamsConfigHTTPConfigAuth struct {
Config LogsUploaderTargetReplaceParamsConfigHTTPConfigAuthConfig `json:"config,omitzero,required"`
// Any of "token".
Type string `json:"type,omitzero,required"`
// contains filtered or unexported fields
}
The properties Config, Type are required.
func (LogsUploaderTargetReplaceParamsConfigHTTPConfigAuth) MarshalJSON ¶
func (r LogsUploaderTargetReplaceParamsConfigHTTPConfigAuth) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetReplaceParamsConfigHTTPConfigAuth) UnmarshalJSON ¶
func (r *LogsUploaderTargetReplaceParamsConfigHTTPConfigAuth) UnmarshalJSON(data []byte) error
type LogsUploaderTargetReplaceParamsConfigHTTPConfigAuthConfig ¶
type LogsUploaderTargetReplaceParamsConfigHTTPConfigAuthConfig struct {
Token string `json:"token,required"`
HeaderName string `json:"header_name,required"`
// contains filtered or unexported fields
}
The properties Token, HeaderName are required.
func (LogsUploaderTargetReplaceParamsConfigHTTPConfigAuthConfig) MarshalJSON ¶
func (r LogsUploaderTargetReplaceParamsConfigHTTPConfigAuthConfig) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetReplaceParamsConfigHTTPConfigAuthConfig) UnmarshalJSON ¶
func (r *LogsUploaderTargetReplaceParamsConfigHTTPConfigAuthConfig) UnmarshalJSON(data []byte) error
type LogsUploaderTargetReplaceParamsConfigHTTPConfigRetry ¶
type LogsUploaderTargetReplaceParamsConfigHTTPConfigRetry struct {
URL string `json:"url,required"`
TimeoutSeconds param.Opt[int64] `json:"timeout_seconds,omitzero"`
UseCompression param.Opt[bool] `json:"use_compression,omitzero"`
Headers map[string]string `json:"headers,omitzero"`
// Any of "POST", "PUT".
Method string `json:"method,omitzero"`
ResponseActions []LogsUploaderTargetReplaceParamsConfigHTTPConfigRetryResponseAction `json:"response_actions,omitzero"`
// contains filtered or unexported fields
}
The property URL is required.
func (LogsUploaderTargetReplaceParamsConfigHTTPConfigRetry) MarshalJSON ¶
func (r LogsUploaderTargetReplaceParamsConfigHTTPConfigRetry) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetReplaceParamsConfigHTTPConfigRetry) UnmarshalJSON ¶
func (r *LogsUploaderTargetReplaceParamsConfigHTTPConfigRetry) UnmarshalJSON(data []byte) error
type LogsUploaderTargetReplaceParamsConfigHTTPConfigRetryResponseAction ¶
type LogsUploaderTargetReplaceParamsConfigHTTPConfigRetryResponseAction struct {
// Any of "drop", "retry", "append".
Action string `json:"action,omitzero,required"`
Description param.Opt[string] `json:"description,omitzero"`
MatchPayload param.Opt[string] `json:"match_payload,omitzero"`
MatchStatusCode param.Opt[int64] `json:"match_status_code,omitzero"`
// contains filtered or unexported fields
}
The property Action is required.
func (LogsUploaderTargetReplaceParamsConfigHTTPConfigRetryResponseAction) MarshalJSON ¶
func (r LogsUploaderTargetReplaceParamsConfigHTTPConfigRetryResponseAction) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetReplaceParamsConfigHTTPConfigRetryResponseAction) UnmarshalJSON ¶
func (r *LogsUploaderTargetReplaceParamsConfigHTTPConfigRetryResponseAction) UnmarshalJSON(data []byte) error
type LogsUploaderTargetReplaceParamsConfigHTTPConfigUpload ¶
type LogsUploaderTargetReplaceParamsConfigHTTPConfigUpload struct {
URL string `json:"url,required"`
TimeoutSeconds param.Opt[int64] `json:"timeout_seconds,omitzero"`
UseCompression param.Opt[bool] `json:"use_compression,omitzero"`
Headers map[string]string `json:"headers,omitzero"`
// Any of "POST", "PUT".
Method string `json:"method,omitzero"`
ResponseActions []LogsUploaderTargetReplaceParamsConfigHTTPConfigUploadResponseAction `json:"response_actions,omitzero"`
// contains filtered or unexported fields
}
The property URL is required.
func (LogsUploaderTargetReplaceParamsConfigHTTPConfigUpload) MarshalJSON ¶
func (r LogsUploaderTargetReplaceParamsConfigHTTPConfigUpload) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetReplaceParamsConfigHTTPConfigUpload) UnmarshalJSON ¶
func (r *LogsUploaderTargetReplaceParamsConfigHTTPConfigUpload) UnmarshalJSON(data []byte) error
type LogsUploaderTargetReplaceParamsConfigHTTPConfigUploadResponseAction ¶
type LogsUploaderTargetReplaceParamsConfigHTTPConfigUploadResponseAction struct {
// Any of "drop", "retry", "append".
Action string `json:"action,omitzero,required"`
Description param.Opt[string] `json:"description,omitzero"`
MatchPayload param.Opt[string] `json:"match_payload,omitzero"`
MatchStatusCode param.Opt[int64] `json:"match_status_code,omitzero"`
// contains filtered or unexported fields
}
The property Action is required.
func (LogsUploaderTargetReplaceParamsConfigHTTPConfigUploadResponseAction) MarshalJSON ¶
func (r LogsUploaderTargetReplaceParamsConfigHTTPConfigUploadResponseAction) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetReplaceParamsConfigHTTPConfigUploadResponseAction) UnmarshalJSON ¶
func (r *LogsUploaderTargetReplaceParamsConfigHTTPConfigUploadResponseAction) UnmarshalJSON(data []byte) error
type LogsUploaderTargetReplaceParamsConfigS3AmazonConfig ¶
type LogsUploaderTargetReplaceParamsConfigS3AmazonConfig struct {
AccessKeyID string `json:"access_key_id,required"`
BucketName string `json:"bucket_name,required"`
Region string `json:"region,required"`
SecretAccessKey string `json:"secret_access_key,required"`
Directory param.Opt[string] `json:"directory,omitzero"`
// contains filtered or unexported fields
}
The properties AccessKeyID, BucketName, Region, SecretAccessKey are required.
func (LogsUploaderTargetReplaceParamsConfigS3AmazonConfig) MarshalJSON ¶
func (r LogsUploaderTargetReplaceParamsConfigS3AmazonConfig) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetReplaceParamsConfigS3AmazonConfig) UnmarshalJSON ¶
func (r *LogsUploaderTargetReplaceParamsConfigS3AmazonConfig) UnmarshalJSON(data []byte) error
type LogsUploaderTargetReplaceParamsConfigS3GcoreConfig ¶
type LogsUploaderTargetReplaceParamsConfigS3GcoreConfig struct {
AccessKeyID string `json:"access_key_id,required"`
BucketName string `json:"bucket_name,required"`
Endpoint string `json:"endpoint,required"`
Region string `json:"region,required"`
SecretAccessKey string `json:"secret_access_key,required"`
Directory param.Opt[string] `json:"directory,omitzero"`
UsePathStyle param.Opt[bool] `json:"use_path_style,omitzero"`
// contains filtered or unexported fields
}
The properties AccessKeyID, BucketName, Endpoint, Region, SecretAccessKey are required.
func (LogsUploaderTargetReplaceParamsConfigS3GcoreConfig) MarshalJSON ¶
func (r LogsUploaderTargetReplaceParamsConfigS3GcoreConfig) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetReplaceParamsConfigS3GcoreConfig) UnmarshalJSON ¶
func (r *LogsUploaderTargetReplaceParamsConfigS3GcoreConfig) UnmarshalJSON(data []byte) error
type LogsUploaderTargetReplaceParamsConfigS3OssConfig ¶
type LogsUploaderTargetReplaceParamsConfigS3OssConfig struct {
AccessKeyID string `json:"access_key_id,required"`
BucketName string `json:"bucket_name,required"`
SecretAccessKey string `json:"secret_access_key,required"`
Directory param.Opt[string] `json:"directory,omitzero"`
Region param.Opt[string] `json:"region,omitzero"`
// contains filtered or unexported fields
}
The properties AccessKeyID, BucketName, SecretAccessKey are required.
func (LogsUploaderTargetReplaceParamsConfigS3OssConfig) MarshalJSON ¶
func (r LogsUploaderTargetReplaceParamsConfigS3OssConfig) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetReplaceParamsConfigS3OssConfig) UnmarshalJSON ¶
func (r *LogsUploaderTargetReplaceParamsConfigS3OssConfig) UnmarshalJSON(data []byte) error
type LogsUploaderTargetReplaceParamsConfigS3OtherConfig ¶
type LogsUploaderTargetReplaceParamsConfigS3OtherConfig struct {
AccessKeyID string `json:"access_key_id,required"`
BucketName string `json:"bucket_name,required"`
Endpoint string `json:"endpoint,required"`
Region string `json:"region,required"`
SecretAccessKey string `json:"secret_access_key,required"`
Directory param.Opt[string] `json:"directory,omitzero"`
UsePathStyle param.Opt[bool] `json:"use_path_style,omitzero"`
// contains filtered or unexported fields
}
The properties AccessKeyID, BucketName, Endpoint, Region, SecretAccessKey are required.
func (LogsUploaderTargetReplaceParamsConfigS3OtherConfig) MarshalJSON ¶
func (r LogsUploaderTargetReplaceParamsConfigS3OtherConfig) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetReplaceParamsConfigS3OtherConfig) UnmarshalJSON ¶
func (r *LogsUploaderTargetReplaceParamsConfigS3OtherConfig) UnmarshalJSON(data []byte) error
type LogsUploaderTargetReplaceParamsConfigS3V1Config ¶
type LogsUploaderTargetReplaceParamsConfigS3V1Config struct {
AccessKeyID string `json:"access_key_id,required"`
BucketName string `json:"bucket_name,required"`
Endpoint string `json:"endpoint,required"`
Region string `json:"region,required"`
SecretAccessKey string `json:"secret_access_key,required"`
Directory param.Opt[string] `json:"directory,omitzero"`
UsePathStyle param.Opt[bool] `json:"use_path_style,omitzero"`
// contains filtered or unexported fields
}
The properties AccessKeyID, BucketName, Endpoint, Region, SecretAccessKey are required.
func (LogsUploaderTargetReplaceParamsConfigS3V1Config) MarshalJSON ¶
func (r LogsUploaderTargetReplaceParamsConfigS3V1Config) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetReplaceParamsConfigS3V1Config) UnmarshalJSON ¶
func (r *LogsUploaderTargetReplaceParamsConfigS3V1Config) UnmarshalJSON(data []byte) error
type LogsUploaderTargetReplaceParamsConfigSftpConfig ¶
type LogsUploaderTargetReplaceParamsConfigSftpConfig struct {
Hostname string `json:"hostname,required"`
User string `json:"user,required"`
Directory param.Opt[string] `json:"directory,omitzero"`
KeyPassphrase param.Opt[string] `json:"key_passphrase,omitzero"`
Password param.Opt[string] `json:"password,omitzero"`
PrivateKey param.Opt[string] `json:"private_key,omitzero"`
TimeoutSeconds param.Opt[int64] `json:"timeout_seconds,omitzero"`
// contains filtered or unexported fields
}
The properties Hostname, User are required.
func (LogsUploaderTargetReplaceParamsConfigSftpConfig) MarshalJSON ¶
func (r LogsUploaderTargetReplaceParamsConfigSftpConfig) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetReplaceParamsConfigSftpConfig) UnmarshalJSON ¶
func (r *LogsUploaderTargetReplaceParamsConfigSftpConfig) UnmarshalJSON(data []byte) error
type LogsUploaderTargetReplaceParamsConfigUnion ¶
type LogsUploaderTargetReplaceParamsConfigUnion struct {
OfS3GcoreConfig *LogsUploaderTargetReplaceParamsConfigS3GcoreConfig `json:",omitzero,inline"`
OfS3AmazonConfig *LogsUploaderTargetReplaceParamsConfigS3AmazonConfig `json:",omitzero,inline"`
OfS3OssConfig *LogsUploaderTargetReplaceParamsConfigS3OssConfig `json:",omitzero,inline"`
OfS3OtherConfig *LogsUploaderTargetReplaceParamsConfigS3OtherConfig `json:",omitzero,inline"`
OfS3V1Config *LogsUploaderTargetReplaceParamsConfigS3V1Config `json:",omitzero,inline"`
OfFtpConfig *LogsUploaderTargetReplaceParamsConfigFtpConfig `json:",omitzero,inline"`
OfSftpConfig *LogsUploaderTargetReplaceParamsConfigSftpConfig `json:",omitzero,inline"`
OfHTTPConfig *LogsUploaderTargetReplaceParamsConfigHTTPConfig `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (LogsUploaderTargetReplaceParamsConfigUnion) GetAccessKeyID ¶
func (u LogsUploaderTargetReplaceParamsConfigUnion) GetAccessKeyID() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetReplaceParamsConfigUnion) GetAppend ¶
func (u LogsUploaderTargetReplaceParamsConfigUnion) GetAppend() *LogsUploaderTargetReplaceParamsConfigHTTPConfigAppend
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetReplaceParamsConfigUnion) GetAuth ¶
func (u LogsUploaderTargetReplaceParamsConfigUnion) GetAuth() *LogsUploaderTargetReplaceParamsConfigHTTPConfigAuth
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetReplaceParamsConfigUnion) GetBucketName ¶
func (u LogsUploaderTargetReplaceParamsConfigUnion) GetBucketName() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetReplaceParamsConfigUnion) GetContentType ¶
func (u LogsUploaderTargetReplaceParamsConfigUnion) GetContentType() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetReplaceParamsConfigUnion) GetDirectory ¶
func (u LogsUploaderTargetReplaceParamsConfigUnion) GetDirectory() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetReplaceParamsConfigUnion) GetEndpoint ¶
func (u LogsUploaderTargetReplaceParamsConfigUnion) GetEndpoint() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetReplaceParamsConfigUnion) GetHostname ¶
func (u LogsUploaderTargetReplaceParamsConfigUnion) GetHostname() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetReplaceParamsConfigUnion) GetKeyPassphrase ¶
func (u LogsUploaderTargetReplaceParamsConfigUnion) GetKeyPassphrase() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetReplaceParamsConfigUnion) GetPassword ¶
func (u LogsUploaderTargetReplaceParamsConfigUnion) GetPassword() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetReplaceParamsConfigUnion) GetPrivateKey ¶
func (u LogsUploaderTargetReplaceParamsConfigUnion) GetPrivateKey() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetReplaceParamsConfigUnion) GetRegion ¶
func (u LogsUploaderTargetReplaceParamsConfigUnion) GetRegion() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetReplaceParamsConfigUnion) GetRetry ¶
func (u LogsUploaderTargetReplaceParamsConfigUnion) GetRetry() *LogsUploaderTargetReplaceParamsConfigHTTPConfigRetry
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetReplaceParamsConfigUnion) GetSecretAccessKey ¶
func (u LogsUploaderTargetReplaceParamsConfigUnion) GetSecretAccessKey() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetReplaceParamsConfigUnion) GetTimeoutSeconds ¶
func (u LogsUploaderTargetReplaceParamsConfigUnion) GetTimeoutSeconds() *int64
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetReplaceParamsConfigUnion) GetUpload ¶
func (u LogsUploaderTargetReplaceParamsConfigUnion) GetUpload() *LogsUploaderTargetReplaceParamsConfigHTTPConfigUpload
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetReplaceParamsConfigUnion) GetUsePathStyle ¶
func (u LogsUploaderTargetReplaceParamsConfigUnion) GetUsePathStyle() *bool
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetReplaceParamsConfigUnion) GetUser ¶
func (u LogsUploaderTargetReplaceParamsConfigUnion) GetUser() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetReplaceParamsConfigUnion) MarshalJSON ¶
func (u LogsUploaderTargetReplaceParamsConfigUnion) MarshalJSON() ([]byte, error)
func (*LogsUploaderTargetReplaceParamsConfigUnion) UnmarshalJSON ¶
func (u *LogsUploaderTargetReplaceParamsConfigUnion) UnmarshalJSON(data []byte) error
type LogsUploaderTargetReplaceParamsStorageType ¶
type LogsUploaderTargetReplaceParamsStorageType string
Type of storage for logs.
const ( LogsUploaderTargetReplaceParamsStorageTypeS3Gcore LogsUploaderTargetReplaceParamsStorageType = "s3_gcore" LogsUploaderTargetReplaceParamsStorageTypeS3Amazon LogsUploaderTargetReplaceParamsStorageType = "s3_amazon" LogsUploaderTargetReplaceParamsStorageTypeS3Oss LogsUploaderTargetReplaceParamsStorageType = "s3_oss" LogsUploaderTargetReplaceParamsStorageTypeS3Other LogsUploaderTargetReplaceParamsStorageType = "s3_other" LogsUploaderTargetReplaceParamsStorageTypeS3V1 LogsUploaderTargetReplaceParamsStorageType = "s3_v1" LogsUploaderTargetReplaceParamsStorageTypeFtp LogsUploaderTargetReplaceParamsStorageType = "ftp" LogsUploaderTargetReplaceParamsStorageTypeSftp LogsUploaderTargetReplaceParamsStorageType = "sftp" LogsUploaderTargetReplaceParamsStorageTypeHTTP LogsUploaderTargetReplaceParamsStorageType = "http" )
type LogsUploaderTargetService ¶
type LogsUploaderTargetService struct {
Options []option.RequestOption
}
LogsUploaderTargetService 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 NewLogsUploaderTargetService method instead.
func NewLogsUploaderTargetService ¶
func NewLogsUploaderTargetService(opts ...option.RequestOption) (r LogsUploaderTargetService)
NewLogsUploaderTargetService 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 (*LogsUploaderTargetService) Delete ¶
func (r *LogsUploaderTargetService) Delete(ctx context.Context, id int64, opts ...option.RequestOption) (err error)
Delete the logs uploader target from the system permanently.
Notes:
- **Irreversibility**: This action is irreversible. Once deleted, the logs uploader target cannot be recovered.
func (*LogsUploaderTargetService) Get ¶
func (r *LogsUploaderTargetService) Get(ctx context.Context, id int64, opts ...option.RequestOption) (res *LogsUploaderTarget, err error)
Get information about logs uploader target.
func (*LogsUploaderTargetService) List ¶
func (r *LogsUploaderTargetService) List(ctx context.Context, query LogsUploaderTargetListParams, opts ...option.RequestOption) (res *LogsUploaderTargetList, err error)
Get list of logs uploader targets.
func (*LogsUploaderTargetService) New ¶
func (r *LogsUploaderTargetService) New(ctx context.Context, body LogsUploaderTargetNewParams, opts ...option.RequestOption) (res *LogsUploaderTarget, err error)
Create logs uploader target.
func (*LogsUploaderTargetService) Replace ¶
func (r *LogsUploaderTargetService) Replace(ctx context.Context, id int64, body LogsUploaderTargetReplaceParams, opts ...option.RequestOption) (res *LogsUploaderTarget, err error)
Change logs uploader target.
func (*LogsUploaderTargetService) Update ¶
func (r *LogsUploaderTargetService) Update(ctx context.Context, id int64, body LogsUploaderTargetUpdateParams, opts ...option.RequestOption) (res *LogsUploaderTarget, err error)
Change logs uploader target partially.
func (*LogsUploaderTargetService) Validate ¶
func (r *LogsUploaderTargetService) Validate(ctx context.Context, id int64, opts ...option.RequestOption) (res *LogsUploaderValidation, err error)
Validate logs uploader target.
type LogsUploaderTargetStatus ¶
type LogsUploaderTargetStatus struct {
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
LogsUploaderValidation
}
Validation status of the logs uploader target. Informs if the specified target is reachable.
func (LogsUploaderTargetStatus) RawJSON ¶
func (r LogsUploaderTargetStatus) RawJSON() string
Returns the unmodified JSON received from the API
func (*LogsUploaderTargetStatus) UnmarshalJSON ¶
func (r *LogsUploaderTargetStatus) UnmarshalJSON(data []byte) error
type LogsUploaderTargetStorageType ¶
type LogsUploaderTargetStorageType string
Type of storage for logs.
const ( LogsUploaderTargetStorageTypeS3Gcore LogsUploaderTargetStorageType = "s3_gcore" LogsUploaderTargetStorageTypeS3Amazon LogsUploaderTargetStorageType = "s3_amazon" LogsUploaderTargetStorageTypeS3Oss LogsUploaderTargetStorageType = "s3_oss" LogsUploaderTargetStorageTypeS3Other LogsUploaderTargetStorageType = "s3_other" LogsUploaderTargetStorageTypeS3V1 LogsUploaderTargetStorageType = "s3_v1" LogsUploaderTargetStorageTypeFtp LogsUploaderTargetStorageType = "ftp" LogsUploaderTargetStorageTypeSftp LogsUploaderTargetStorageType = "sftp" LogsUploaderTargetStorageTypeHTTP LogsUploaderTargetStorageType = "http" )
type LogsUploaderTargetUpdateParams ¶
type LogsUploaderTargetUpdateParams struct {
// Description of the target.
Description param.Opt[string] `json:"description,omitzero"`
// Name of the target.
Name param.Opt[string] `json:"name,omitzero"`
// Config for specific storage type.
Config LogsUploaderTargetUpdateParamsConfigUnion `json:"config,omitzero"`
// Type of storage for logs.
//
// Any of "s3_gcore", "s3_amazon", "s3_oss", "s3_other", "s3_v1", "ftp", "sftp",
// "http".
StorageType LogsUploaderTargetUpdateParamsStorageType `json:"storage_type,omitzero"`
// contains filtered or unexported fields
}
func (LogsUploaderTargetUpdateParams) MarshalJSON ¶
func (r LogsUploaderTargetUpdateParams) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetUpdateParams) UnmarshalJSON ¶
func (r *LogsUploaderTargetUpdateParams) UnmarshalJSON(data []byte) error
type LogsUploaderTargetUpdateParamsConfigFtpConfig ¶
type LogsUploaderTargetUpdateParamsConfigFtpConfig struct {
Hostname string `json:"hostname,required"`
Password string `json:"password,required"`
User string `json:"user,required"`
Directory param.Opt[string] `json:"directory,omitzero"`
TimeoutSeconds param.Opt[int64] `json:"timeout_seconds,omitzero"`
// contains filtered or unexported fields
}
The properties Hostname, Password, User are required.
func (LogsUploaderTargetUpdateParamsConfigFtpConfig) MarshalJSON ¶
func (r LogsUploaderTargetUpdateParamsConfigFtpConfig) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetUpdateParamsConfigFtpConfig) UnmarshalJSON ¶
func (r *LogsUploaderTargetUpdateParamsConfigFtpConfig) UnmarshalJSON(data []byte) error
type LogsUploaderTargetUpdateParamsConfigHTTPConfig ¶
type LogsUploaderTargetUpdateParamsConfigHTTPConfig struct {
Upload LogsUploaderTargetUpdateParamsConfigHTTPConfigUpload `json:"upload,omitzero,required"`
Append LogsUploaderTargetUpdateParamsConfigHTTPConfigAppend `json:"append,omitzero"`
Auth LogsUploaderTargetUpdateParamsConfigHTTPConfigAuth `json:"auth,omitzero"`
// Any of "json", "text".
ContentType string `json:"content_type,omitzero"`
Retry LogsUploaderTargetUpdateParamsConfigHTTPConfigRetry `json:"retry,omitzero"`
// contains filtered or unexported fields
}
The property Upload is required.
func (LogsUploaderTargetUpdateParamsConfigHTTPConfig) MarshalJSON ¶
func (r LogsUploaderTargetUpdateParamsConfigHTTPConfig) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetUpdateParamsConfigHTTPConfig) UnmarshalJSON ¶
func (r *LogsUploaderTargetUpdateParamsConfigHTTPConfig) UnmarshalJSON(data []byte) error
type LogsUploaderTargetUpdateParamsConfigHTTPConfigAppend ¶
type LogsUploaderTargetUpdateParamsConfigHTTPConfigAppend struct {
URL string `json:"url,required"`
TimeoutSeconds param.Opt[int64] `json:"timeout_seconds,omitzero"`
UseCompression param.Opt[bool] `json:"use_compression,omitzero"`
Headers map[string]string `json:"headers,omitzero"`
// Any of "POST", "PUT".
Method string `json:"method,omitzero"`
ResponseActions []LogsUploaderTargetUpdateParamsConfigHTTPConfigAppendResponseAction `json:"response_actions,omitzero"`
// contains filtered or unexported fields
}
The property URL is required.
func (LogsUploaderTargetUpdateParamsConfigHTTPConfigAppend) MarshalJSON ¶
func (r LogsUploaderTargetUpdateParamsConfigHTTPConfigAppend) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetUpdateParamsConfigHTTPConfigAppend) UnmarshalJSON ¶
func (r *LogsUploaderTargetUpdateParamsConfigHTTPConfigAppend) UnmarshalJSON(data []byte) error
type LogsUploaderTargetUpdateParamsConfigHTTPConfigAppendResponseAction ¶
type LogsUploaderTargetUpdateParamsConfigHTTPConfigAppendResponseAction struct {
// Any of "drop", "retry", "append".
Action string `json:"action,omitzero,required"`
Description param.Opt[string] `json:"description,omitzero"`
MatchPayload param.Opt[string] `json:"match_payload,omitzero"`
MatchStatusCode param.Opt[int64] `json:"match_status_code,omitzero"`
// contains filtered or unexported fields
}
The property Action is required.
func (LogsUploaderTargetUpdateParamsConfigHTTPConfigAppendResponseAction) MarshalJSON ¶
func (r LogsUploaderTargetUpdateParamsConfigHTTPConfigAppendResponseAction) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetUpdateParamsConfigHTTPConfigAppendResponseAction) UnmarshalJSON ¶
func (r *LogsUploaderTargetUpdateParamsConfigHTTPConfigAppendResponseAction) UnmarshalJSON(data []byte) error
type LogsUploaderTargetUpdateParamsConfigHTTPConfigAuth ¶
type LogsUploaderTargetUpdateParamsConfigHTTPConfigAuth struct {
Config LogsUploaderTargetUpdateParamsConfigHTTPConfigAuthConfig `json:"config,omitzero,required"`
// Any of "token".
Type string `json:"type,omitzero,required"`
// contains filtered or unexported fields
}
The properties Config, Type are required.
func (LogsUploaderTargetUpdateParamsConfigHTTPConfigAuth) MarshalJSON ¶
func (r LogsUploaderTargetUpdateParamsConfigHTTPConfigAuth) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetUpdateParamsConfigHTTPConfigAuth) UnmarshalJSON ¶
func (r *LogsUploaderTargetUpdateParamsConfigHTTPConfigAuth) UnmarshalJSON(data []byte) error
type LogsUploaderTargetUpdateParamsConfigHTTPConfigAuthConfig ¶
type LogsUploaderTargetUpdateParamsConfigHTTPConfigAuthConfig struct {
Token string `json:"token,required"`
HeaderName string `json:"header_name,required"`
// contains filtered or unexported fields
}
The properties Token, HeaderName are required.
func (LogsUploaderTargetUpdateParamsConfigHTTPConfigAuthConfig) MarshalJSON ¶
func (r LogsUploaderTargetUpdateParamsConfigHTTPConfigAuthConfig) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetUpdateParamsConfigHTTPConfigAuthConfig) UnmarshalJSON ¶
func (r *LogsUploaderTargetUpdateParamsConfigHTTPConfigAuthConfig) UnmarshalJSON(data []byte) error
type LogsUploaderTargetUpdateParamsConfigHTTPConfigRetry ¶
type LogsUploaderTargetUpdateParamsConfigHTTPConfigRetry struct {
URL string `json:"url,required"`
TimeoutSeconds param.Opt[int64] `json:"timeout_seconds,omitzero"`
UseCompression param.Opt[bool] `json:"use_compression,omitzero"`
Headers map[string]string `json:"headers,omitzero"`
// Any of "POST", "PUT".
Method string `json:"method,omitzero"`
ResponseActions []LogsUploaderTargetUpdateParamsConfigHTTPConfigRetryResponseAction `json:"response_actions,omitzero"`
// contains filtered or unexported fields
}
The property URL is required.
func (LogsUploaderTargetUpdateParamsConfigHTTPConfigRetry) MarshalJSON ¶
func (r LogsUploaderTargetUpdateParamsConfigHTTPConfigRetry) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetUpdateParamsConfigHTTPConfigRetry) UnmarshalJSON ¶
func (r *LogsUploaderTargetUpdateParamsConfigHTTPConfigRetry) UnmarshalJSON(data []byte) error
type LogsUploaderTargetUpdateParamsConfigHTTPConfigRetryResponseAction ¶
type LogsUploaderTargetUpdateParamsConfigHTTPConfigRetryResponseAction struct {
// Any of "drop", "retry", "append".
Action string `json:"action,omitzero,required"`
Description param.Opt[string] `json:"description,omitzero"`
MatchPayload param.Opt[string] `json:"match_payload,omitzero"`
MatchStatusCode param.Opt[int64] `json:"match_status_code,omitzero"`
// contains filtered or unexported fields
}
The property Action is required.
func (LogsUploaderTargetUpdateParamsConfigHTTPConfigRetryResponseAction) MarshalJSON ¶
func (r LogsUploaderTargetUpdateParamsConfigHTTPConfigRetryResponseAction) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetUpdateParamsConfigHTTPConfigRetryResponseAction) UnmarshalJSON ¶
func (r *LogsUploaderTargetUpdateParamsConfigHTTPConfigRetryResponseAction) UnmarshalJSON(data []byte) error
type LogsUploaderTargetUpdateParamsConfigHTTPConfigUpload ¶
type LogsUploaderTargetUpdateParamsConfigHTTPConfigUpload struct {
URL string `json:"url,required"`
TimeoutSeconds param.Opt[int64] `json:"timeout_seconds,omitzero"`
UseCompression param.Opt[bool] `json:"use_compression,omitzero"`
Headers map[string]string `json:"headers,omitzero"`
// Any of "POST", "PUT".
Method string `json:"method,omitzero"`
ResponseActions []LogsUploaderTargetUpdateParamsConfigHTTPConfigUploadResponseAction `json:"response_actions,omitzero"`
// contains filtered or unexported fields
}
The property URL is required.
func (LogsUploaderTargetUpdateParamsConfigHTTPConfigUpload) MarshalJSON ¶
func (r LogsUploaderTargetUpdateParamsConfigHTTPConfigUpload) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetUpdateParamsConfigHTTPConfigUpload) UnmarshalJSON ¶
func (r *LogsUploaderTargetUpdateParamsConfigHTTPConfigUpload) UnmarshalJSON(data []byte) error
type LogsUploaderTargetUpdateParamsConfigHTTPConfigUploadResponseAction ¶
type LogsUploaderTargetUpdateParamsConfigHTTPConfigUploadResponseAction struct {
// Any of "drop", "retry", "append".
Action string `json:"action,omitzero,required"`
Description param.Opt[string] `json:"description,omitzero"`
MatchPayload param.Opt[string] `json:"match_payload,omitzero"`
MatchStatusCode param.Opt[int64] `json:"match_status_code,omitzero"`
// contains filtered or unexported fields
}
The property Action is required.
func (LogsUploaderTargetUpdateParamsConfigHTTPConfigUploadResponseAction) MarshalJSON ¶
func (r LogsUploaderTargetUpdateParamsConfigHTTPConfigUploadResponseAction) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetUpdateParamsConfigHTTPConfigUploadResponseAction) UnmarshalJSON ¶
func (r *LogsUploaderTargetUpdateParamsConfigHTTPConfigUploadResponseAction) UnmarshalJSON(data []byte) error
type LogsUploaderTargetUpdateParamsConfigS3AmazonConfig ¶
type LogsUploaderTargetUpdateParamsConfigS3AmazonConfig struct {
AccessKeyID string `json:"access_key_id,required"`
BucketName string `json:"bucket_name,required"`
Region string `json:"region,required"`
SecretAccessKey string `json:"secret_access_key,required"`
Directory param.Opt[string] `json:"directory,omitzero"`
// contains filtered or unexported fields
}
The properties AccessKeyID, BucketName, Region, SecretAccessKey are required.
func (LogsUploaderTargetUpdateParamsConfigS3AmazonConfig) MarshalJSON ¶
func (r LogsUploaderTargetUpdateParamsConfigS3AmazonConfig) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetUpdateParamsConfigS3AmazonConfig) UnmarshalJSON ¶
func (r *LogsUploaderTargetUpdateParamsConfigS3AmazonConfig) UnmarshalJSON(data []byte) error
type LogsUploaderTargetUpdateParamsConfigS3GcoreConfig ¶
type LogsUploaderTargetUpdateParamsConfigS3GcoreConfig struct {
AccessKeyID string `json:"access_key_id,required"`
BucketName string `json:"bucket_name,required"`
Endpoint string `json:"endpoint,required"`
Region string `json:"region,required"`
SecretAccessKey string `json:"secret_access_key,required"`
Directory param.Opt[string] `json:"directory,omitzero"`
UsePathStyle param.Opt[bool] `json:"use_path_style,omitzero"`
// contains filtered or unexported fields
}
The properties AccessKeyID, BucketName, Endpoint, Region, SecretAccessKey are required.
func (LogsUploaderTargetUpdateParamsConfigS3GcoreConfig) MarshalJSON ¶
func (r LogsUploaderTargetUpdateParamsConfigS3GcoreConfig) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetUpdateParamsConfigS3GcoreConfig) UnmarshalJSON ¶
func (r *LogsUploaderTargetUpdateParamsConfigS3GcoreConfig) UnmarshalJSON(data []byte) error
type LogsUploaderTargetUpdateParamsConfigS3OssConfig ¶
type LogsUploaderTargetUpdateParamsConfigS3OssConfig struct {
AccessKeyID string `json:"access_key_id,required"`
BucketName string `json:"bucket_name,required"`
SecretAccessKey string `json:"secret_access_key,required"`
Directory param.Opt[string] `json:"directory,omitzero"`
Region param.Opt[string] `json:"region,omitzero"`
// contains filtered or unexported fields
}
The properties AccessKeyID, BucketName, SecretAccessKey are required.
func (LogsUploaderTargetUpdateParamsConfigS3OssConfig) MarshalJSON ¶
func (r LogsUploaderTargetUpdateParamsConfigS3OssConfig) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetUpdateParamsConfigS3OssConfig) UnmarshalJSON ¶
func (r *LogsUploaderTargetUpdateParamsConfigS3OssConfig) UnmarshalJSON(data []byte) error
type LogsUploaderTargetUpdateParamsConfigS3OtherConfig ¶
type LogsUploaderTargetUpdateParamsConfigS3OtherConfig struct {
AccessKeyID string `json:"access_key_id,required"`
BucketName string `json:"bucket_name,required"`
Endpoint string `json:"endpoint,required"`
Region string `json:"region,required"`
SecretAccessKey string `json:"secret_access_key,required"`
Directory param.Opt[string] `json:"directory,omitzero"`
UsePathStyle param.Opt[bool] `json:"use_path_style,omitzero"`
// contains filtered or unexported fields
}
The properties AccessKeyID, BucketName, Endpoint, Region, SecretAccessKey are required.
func (LogsUploaderTargetUpdateParamsConfigS3OtherConfig) MarshalJSON ¶
func (r LogsUploaderTargetUpdateParamsConfigS3OtherConfig) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetUpdateParamsConfigS3OtherConfig) UnmarshalJSON ¶
func (r *LogsUploaderTargetUpdateParamsConfigS3OtherConfig) UnmarshalJSON(data []byte) error
type LogsUploaderTargetUpdateParamsConfigS3V1Config ¶
type LogsUploaderTargetUpdateParamsConfigS3V1Config struct {
AccessKeyID string `json:"access_key_id,required"`
BucketName string `json:"bucket_name,required"`
Endpoint string `json:"endpoint,required"`
Region string `json:"region,required"`
SecretAccessKey string `json:"secret_access_key,required"`
Directory param.Opt[string] `json:"directory,omitzero"`
UsePathStyle param.Opt[bool] `json:"use_path_style,omitzero"`
// contains filtered or unexported fields
}
The properties AccessKeyID, BucketName, Endpoint, Region, SecretAccessKey are required.
func (LogsUploaderTargetUpdateParamsConfigS3V1Config) MarshalJSON ¶
func (r LogsUploaderTargetUpdateParamsConfigS3V1Config) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetUpdateParamsConfigS3V1Config) UnmarshalJSON ¶
func (r *LogsUploaderTargetUpdateParamsConfigS3V1Config) UnmarshalJSON(data []byte) error
type LogsUploaderTargetUpdateParamsConfigSftpConfig ¶
type LogsUploaderTargetUpdateParamsConfigSftpConfig struct {
Hostname string `json:"hostname,required"`
User string `json:"user,required"`
Directory param.Opt[string] `json:"directory,omitzero"`
KeyPassphrase param.Opt[string] `json:"key_passphrase,omitzero"`
Password param.Opt[string] `json:"password,omitzero"`
PrivateKey param.Opt[string] `json:"private_key,omitzero"`
TimeoutSeconds param.Opt[int64] `json:"timeout_seconds,omitzero"`
// contains filtered or unexported fields
}
The properties Hostname, User are required.
func (LogsUploaderTargetUpdateParamsConfigSftpConfig) MarshalJSON ¶
func (r LogsUploaderTargetUpdateParamsConfigSftpConfig) MarshalJSON() (data []byte, err error)
func (*LogsUploaderTargetUpdateParamsConfigSftpConfig) UnmarshalJSON ¶
func (r *LogsUploaderTargetUpdateParamsConfigSftpConfig) UnmarshalJSON(data []byte) error
type LogsUploaderTargetUpdateParamsConfigUnion ¶
type LogsUploaderTargetUpdateParamsConfigUnion struct {
OfS3GcoreConfig *LogsUploaderTargetUpdateParamsConfigS3GcoreConfig `json:",omitzero,inline"`
OfS3AmazonConfig *LogsUploaderTargetUpdateParamsConfigS3AmazonConfig `json:",omitzero,inline"`
OfS3OssConfig *LogsUploaderTargetUpdateParamsConfigS3OssConfig `json:",omitzero,inline"`
OfS3OtherConfig *LogsUploaderTargetUpdateParamsConfigS3OtherConfig `json:",omitzero,inline"`
OfS3V1Config *LogsUploaderTargetUpdateParamsConfigS3V1Config `json:",omitzero,inline"`
OfFtpConfig *LogsUploaderTargetUpdateParamsConfigFtpConfig `json:",omitzero,inline"`
OfSftpConfig *LogsUploaderTargetUpdateParamsConfigSftpConfig `json:",omitzero,inline"`
OfHTTPConfig *LogsUploaderTargetUpdateParamsConfigHTTPConfig `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (LogsUploaderTargetUpdateParamsConfigUnion) GetAccessKeyID ¶
func (u LogsUploaderTargetUpdateParamsConfigUnion) GetAccessKeyID() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetUpdateParamsConfigUnion) GetAppend ¶
func (u LogsUploaderTargetUpdateParamsConfigUnion) GetAppend() *LogsUploaderTargetUpdateParamsConfigHTTPConfigAppend
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetUpdateParamsConfigUnion) GetAuth ¶
func (u LogsUploaderTargetUpdateParamsConfigUnion) GetAuth() *LogsUploaderTargetUpdateParamsConfigHTTPConfigAuth
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetUpdateParamsConfigUnion) GetBucketName ¶
func (u LogsUploaderTargetUpdateParamsConfigUnion) GetBucketName() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetUpdateParamsConfigUnion) GetContentType ¶
func (u LogsUploaderTargetUpdateParamsConfigUnion) GetContentType() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetUpdateParamsConfigUnion) GetDirectory ¶
func (u LogsUploaderTargetUpdateParamsConfigUnion) GetDirectory() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetUpdateParamsConfigUnion) GetEndpoint ¶
func (u LogsUploaderTargetUpdateParamsConfigUnion) GetEndpoint() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetUpdateParamsConfigUnion) GetHostname ¶
func (u LogsUploaderTargetUpdateParamsConfigUnion) GetHostname() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetUpdateParamsConfigUnion) GetKeyPassphrase ¶
func (u LogsUploaderTargetUpdateParamsConfigUnion) GetKeyPassphrase() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetUpdateParamsConfigUnion) GetPassword ¶
func (u LogsUploaderTargetUpdateParamsConfigUnion) GetPassword() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetUpdateParamsConfigUnion) GetPrivateKey ¶
func (u LogsUploaderTargetUpdateParamsConfigUnion) GetPrivateKey() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetUpdateParamsConfigUnion) GetRegion ¶
func (u LogsUploaderTargetUpdateParamsConfigUnion) GetRegion() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetUpdateParamsConfigUnion) GetRetry ¶
func (u LogsUploaderTargetUpdateParamsConfigUnion) GetRetry() *LogsUploaderTargetUpdateParamsConfigHTTPConfigRetry
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetUpdateParamsConfigUnion) GetSecretAccessKey ¶
func (u LogsUploaderTargetUpdateParamsConfigUnion) GetSecretAccessKey() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetUpdateParamsConfigUnion) GetTimeoutSeconds ¶
func (u LogsUploaderTargetUpdateParamsConfigUnion) GetTimeoutSeconds() *int64
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetUpdateParamsConfigUnion) GetUpload ¶
func (u LogsUploaderTargetUpdateParamsConfigUnion) GetUpload() *LogsUploaderTargetUpdateParamsConfigHTTPConfigUpload
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetUpdateParamsConfigUnion) GetUsePathStyle ¶
func (u LogsUploaderTargetUpdateParamsConfigUnion) GetUsePathStyle() *bool
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetUpdateParamsConfigUnion) GetUser ¶
func (u LogsUploaderTargetUpdateParamsConfigUnion) GetUser() *string
Returns a pointer to the underlying variant's property, if present.
func (LogsUploaderTargetUpdateParamsConfigUnion) MarshalJSON ¶
func (u LogsUploaderTargetUpdateParamsConfigUnion) MarshalJSON() ([]byte, error)
func (*LogsUploaderTargetUpdateParamsConfigUnion) UnmarshalJSON ¶
func (u *LogsUploaderTargetUpdateParamsConfigUnion) UnmarshalJSON(data []byte) error
type LogsUploaderTargetUpdateParamsStorageType ¶
type LogsUploaderTargetUpdateParamsStorageType string
Type of storage for logs.
const ( LogsUploaderTargetUpdateParamsStorageTypeS3Gcore LogsUploaderTargetUpdateParamsStorageType = "s3_gcore" LogsUploaderTargetUpdateParamsStorageTypeS3Amazon LogsUploaderTargetUpdateParamsStorageType = "s3_amazon" LogsUploaderTargetUpdateParamsStorageTypeS3Oss LogsUploaderTargetUpdateParamsStorageType = "s3_oss" LogsUploaderTargetUpdateParamsStorageTypeS3Other LogsUploaderTargetUpdateParamsStorageType = "s3_other" LogsUploaderTargetUpdateParamsStorageTypeS3V1 LogsUploaderTargetUpdateParamsStorageType = "s3_v1" LogsUploaderTargetUpdateParamsStorageTypeFtp LogsUploaderTargetUpdateParamsStorageType = "ftp" LogsUploaderTargetUpdateParamsStorageTypeSftp LogsUploaderTargetUpdateParamsStorageType = "sftp" LogsUploaderTargetUpdateParamsStorageTypeHTTP LogsUploaderTargetUpdateParamsStorageType = "http" )
type LogsUploaderValidation ¶
type LogsUploaderValidation struct {
// Error code indicating the type of validation error.
Code int64 `json:"code"`
// Error message if the validation failed.
Details string `json:"details"`
// Status of the validation.
//
// Any of "in_progress", "successful", "failed".
Status LogsUploaderValidationStatus `json:"status"`
// Time when the validation status was updated.
Updated time.Time `json:"updated" format:"date-time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Code respjson.Field
Details respjson.Field
Status respjson.Field
Updated respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (LogsUploaderValidation) RawJSON ¶
func (r LogsUploaderValidation) RawJSON() string
Returns the unmodified JSON received from the API
func (*LogsUploaderValidation) UnmarshalJSON ¶
func (r *LogsUploaderValidation) UnmarshalJSON(data []byte) error
type LogsUploaderValidationStatus ¶
type LogsUploaderValidationStatus string
Status of the validation.
const ( LogsUploaderValidationStatusInProgress LogsUploaderValidationStatus = "in_progress" LogsUploaderValidationStatusSuccessful LogsUploaderValidationStatus = "successful" LogsUploaderValidationStatusFailed LogsUploaderValidationStatus = "failed" )
type MetricListParams ¶
type MetricListParams struct {
// Beginning period to fetch metrics (ISO 8601/RFC 3339 format, UTC.)
//
// Examples:
//
// - 2021-06-14T00:00:00Z
// - 2021-06-14T00:00:00.000Z
//
// The total number of points, which is determined as the difference between "from"
// and "to" divided by "granularity", cannot exceed 1440. Exception: "speed"
// metrics are limited to 72 points.
From string `json:"from,required"`
// Possible values:
//
// - **`edge_bandwidth`** - Bandwidth from client to CDN (bit/s.)
// - **`edge_requests`** - Number of requests per interval (requests/s.)
// - **`edge_requests_total`** - Total number of requests per interval.
// - **`edge_status_1xx`** - Number of 1xx status codes from edge.
// - **`edge_status_200`** - Number of 200 status codes from edge.
// - **`edge_status_204`** - Number of 204 status codes from edge.
// - **`edge_status_206`** - Number of 206 status codes from edge.
// - **`edge_status_2xx`** - Number of 2xx status codes from edge.
// - **`edge_status_301`** - Number of 301 status codes from edge.
// - **`edge_status_302`** - Number of 302 status codes from edge.
// - **`edge_status_304`** - Number of 304 status codes from edge.
// - **`edge_status_3xx`** - Number of 3xx status codes from edge.
// - **`edge_status_400`** - Number of 400 status codes from edge.
// - **`edge_status_401`** - Number of 401 status codes from edge.
// - **`edge_status_403`** - Number of 403 status codes from edge.
// - **`edge_status_404`** - Number of 404 status codes from edge.
// - **`edge_status_416`** - Number of 416 status codes from edge.
// - **`edge_status_429`** - Number of 429 status codes from edge.
// - **`edge_status_4xx`** - Number of 4xx status codes from edge.
// - **`edge_status_500`** - Number of 500 status codes from edge.
// - **`edge_status_501`** - Number of 501 status codes from edge.
// - **`edge_status_502`** - Number of 502 status codes from edge.
// - **`edge_status_503`** - Number of 503 status codes from edge.
// - **`edge_status_504`** - Number of 504 status codes from edge.
// - **`edge_status_505`** - Number of 505 status codes from edge.
// - **`edge_status_5xx`** - Number of 5xx status codes from edge.
// - **`edge_hit_ratio`** - Percent of cache hits (0.0 - 1.0).
// - **`edge_hit_bytes`** - Number of bytes sent back when cache hits.
// - **`origin_bandwidth`** - Bandwidth from CDN to Origin (bit/s.)
// - **`origin_requests`** - Number of requests per interval (requests/s.)
// - **`origin_status_1xx`** - Number of 1xx status from origin.
// - **`origin_status_200`** - Number of 200 status from origin.
// - **`origin_status_204`** - Number of 204 status from origin.
// - **`origin_status_206`** - Number of 206 status from origin.
// - **`origin_status_2xx`** - Number of 2xx status from origin.
// - **`origin_status_301`** - Number of 301 status from origin.
// - **`origin_status_302`** - Number of 302 status from origin.
// - **`origin_status_304`** - Number of 304 status from origin.
// - **`origin_status_3xx`** - Number of 3xx status from origin.
// - **`origin_status_400`** - Number of 400 status from origin.
// - **`origin_status_401`** - Number of 401 status from origin.
// - **`origin_status_403`** - Number of 403 status from origin.
// - **`origin_status_404`** - Number of 404 status from origin.
// - **`origin_status_416`** - Number of 416 status from origin.
// - **`origin_status_429`** - Number of 426 status from origin.
// - **`origin_status_4xx`** - Number of 4xx status from origin.
// - **`origin_status_500`** - Number of 500 status from origin.
// - **`origin_status_501`** - Number of 501 status from origin.
// - **`origin_status_502`** - Number of 502 status from origin.
// - **`origin_status_503`** - Number of 503 status from origin.
// - **`origin_status_504`** - Number of 504 status from origin.
// - **`origin_status_505`** - Number of 505 status from origin.
// - **`origin_status_5xx`** - Number of 5xx status from origin.
// - **`edge_download_speed`** - Download speed from edge in KB/s (includes only
// requests that status was in the range [200, 300].)
// - **`origin_download_speed`** - Download speed from origin in KB/s (includes
// only requests that status was in the range [200, 300].)
Metrics []string `json:"metrics,omitzero,required"`
// Specifies ending period to fetch metrics (ISO 8601/RFC 3339 format, UTC)
//
// Examples:
//
// - 2021-06-15T00:00:00Z
// - 2021-06-15T00:00:00.000Z
//
// The total number of points, which is determined as the difference between "from"
// and "to" divided by "granularity", cannot exceed 1440. Exception: "speed"
// metrics are limited to 72 points.
To string `json:"to,required"`
// Duration of the time blocks into which the data is divided. The value must
// correspond to the ISO 8601 period format.
//
// Examples:
//
// - P1D
// - PT5M
//
// Notes:
//
// - The total number of points, which is determined as the difference between
// "from" and "to" divided by "granularity", cannot exceed 1440. Exception:
// "speed" metrics are limited to 72 points.
// - For "speed" metrics the value must be a multiple of 5.
Granularity param.Opt[string] `json:"granularity,omitzero" format:"P(n)Y(n)M(n)DT(n)H(n)M)"`
// Each item represents one filter statement.
FilterBy []MetricListParamsFilterBy `json:"filter_by,omitzero"`
// Output data grouping.
//
// Possible values:
//
// - **resource** - Data is grouped by CDN resource.
// - **cname** - Data is grouped by common names.
// - **region** – Data is grouped by regions (continents.) Available for "speed"
// metrics only.
// - **isp** - Data is grouped by ISP names. Available for "speed" metrics only.
GroupBy []string `json:"group_by,omitzero"`
// contains filtered or unexported fields
}
func (MetricListParams) MarshalJSON ¶
func (r MetricListParams) MarshalJSON() (data []byte, err error)
func (*MetricListParams) UnmarshalJSON ¶
func (r *MetricListParams) UnmarshalJSON(data []byte) error
type MetricListParamsFilterBy ¶
type MetricListParamsFilterBy struct {
// Defines the parameters by that data can be filtered.
//
// Possible values:
//
// - **resource** - Data is filtered by CDN resource ID.
// - **cname** - Data is filtered by common name.
// - **region** - Data is filtered by region (continent.) Available for "speed"
// metrics only.
// - **isp** - Data is filtered by ISP name. Available for "speed" metrics only.
Field string `json:"field,required"`
// Comparison operator to be applied.
//
// Possible values:
//
// - **in** - 'IN' operator.
// - **`not_in`** - 'NOT IN' operator.
// - **gt** - '>' operator.
// - **gte** - '>=' operator.
// - **lt** - '<' operator.
// - **lte** - '<=' operator.
// - **eq** - '==' operator.
// - **ne** - '!=' operator.
// - **like** - 'LIKE' operator.
// - **`not_like`** - 'NOT LIKE' operator.
Op string `json:"op,required"`
// Contains one or more values to be compared against.
Values []MetricListParamsFilterByValueUnion `json:"values,omitzero,required"`
// contains filtered or unexported fields
}
The properties Field, Op, Values are required.
func (MetricListParamsFilterBy) MarshalJSON ¶
func (r MetricListParamsFilterBy) MarshalJSON() (data []byte, err error)
func (*MetricListParamsFilterBy) UnmarshalJSON ¶
func (r *MetricListParamsFilterBy) UnmarshalJSON(data []byte) error
type MetricListParamsFilterByValueUnion ¶
type MetricListParamsFilterByValueUnion struct {
OfFloat param.Opt[float64] `json:",omitzero,inline"`
OfString param.Opt[string] `json:",omitzero,inline"`
// contains filtered or unexported fields
}
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (MetricListParamsFilterByValueUnion) MarshalJSON ¶
func (u MetricListParamsFilterByValueUnion) MarshalJSON() ([]byte, error)
func (*MetricListParamsFilterByValueUnion) UnmarshalJSON ¶
func (u *MetricListParamsFilterByValueUnion) UnmarshalJSON(data []byte) error
type MetricService ¶
type MetricService struct {
Options []option.RequestOption
}
MetricService 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 NewMetricService method instead.
func NewMetricService ¶
func NewMetricService(opts ...option.RequestOption) (r MetricService)
NewMetricService 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 (*MetricService) List ¶
func (r *MetricService) List(ctx context.Context, body MetricListParams, opts ...option.RequestOption) (res *CdnMetrics, err error)
Get CDN metrics
type NetworkCapacity ¶
type NetworkCapacity []NetworkCapacityItem
type NetworkCapacityItem ¶
type NetworkCapacityItem struct {
// Network capacity in Gbit/s.
Capacity float64 `json:"capacity"`
// Country name.
Country string `json:"country"`
// ISO country code.
CountryCode string `json:"country_code"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Capacity respjson.Field
Country respjson.Field
CountryCode respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (NetworkCapacityItem) RawJSON ¶
func (r NetworkCapacityItem) RawJSON() string
Returns the unmodified JSON received from the API
func (*NetworkCapacityItem) UnmarshalJSON ¶
func (r *NetworkCapacityItem) UnmarshalJSON(data []byte) error
type NetworkCapacityService ¶
type NetworkCapacityService struct {
Options []option.RequestOption
}
NetworkCapacityService 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 NewNetworkCapacityService method instead.
func NewNetworkCapacityService ¶
func NewNetworkCapacityService(opts ...option.RequestOption) (r NetworkCapacityService)
NewNetworkCapacityService 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 (*NetworkCapacityService) List ¶
func (r *NetworkCapacityService) List(ctx context.Context, opts ...option.RequestOption) (res *NetworkCapacity, err error)
Get network capacity per country.
type OriginGroupListParams ¶
type OriginGroupListParams struct {
// Defines whether the origin group has related CDN resources.
//
// Possible values:
//
// - **true** – Origin group has related CDN resources.
// - **false** – Origin group does not have related CDN resources.
HasRelatedResources param.Opt[bool] `query:"has_related_resources,omitzero" json:"-"`
// Origin group name.
Name param.Opt[string] `query:"name,omitzero" json:"-"`
// Origin sources (IP addresses or domains) in the origin group.
Sources param.Opt[string] `query:"sources,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (OriginGroupListParams) URLQuery ¶
func (r OriginGroupListParams) URLQuery() (v url.Values, err error)
URLQuery serializes OriginGroupListParams's query parameters as `url.Values`.
type OriginGroupNewParams ¶
type OriginGroupNewParams struct {
// This field is a request body variant, only one variant field can be set.
OfNoneAuth *OriginGroupNewParamsBodyNoneAuth `json:",inline"`
// This field is a request body variant, only one variant field can be set.
OfAwsSignatureV4 *OriginGroupNewParamsBodyAwsSignatureV4 `json:",inline"`
// contains filtered or unexported fields
}
func (OriginGroupNewParams) MarshalJSON ¶
func (u OriginGroupNewParams) MarshalJSON() ([]byte, error)
func (*OriginGroupNewParams) UnmarshalJSON ¶
func (r *OriginGroupNewParams) UnmarshalJSON(data []byte) error
type OriginGroupNewParamsBodyAwsSignatureV4 ¶
type OriginGroupNewParamsBodyAwsSignatureV4 struct {
// Credentials to access the private bucket.
Auth OriginGroupNewParamsBodyAwsSignatureV4Auth `json:"auth,omitzero,required"`
// Authentication type.
//
// **awsSignatureV4** value is used for S3 storage.
AuthType string `json:"auth_type,required"`
// Origin group name.
Name string `json:"name,required"`
// Defines whether to use the next origin from the origin group if origin responds
// with the cases specified in `proxy_next_upstream`. If you enable it, you must
// specify cases in `proxy_next_upstream`.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
UseNext param.Opt[bool] `json:"use_next,omitzero"`
// Defines cases when the request should be passed on to the next origin.
//
// Possible values:
//
// - **error** - an error occurred while establishing a connection with the origin,
// passing a request to it, or reading the response header
// - **timeout** - a timeout has occurred while establishing a connection with the
// origin, passing a request to it, or reading the response header
// - **`invalid_header`** - a origin returned an empty or invalid response
// - **`http_403`** - a origin returned a response with the code 403
// - **`http_404`** - a origin returned a response with the code 404
// - **`http_429`** - a origin returned a response with the code 429
// - **`http_500`** - a origin returned a response with the code 500
// - **`http_502`** - a origin returned a response with the code 502
// - **`http_503`** - a origin returned a response with the code 503
// - **`http_504`** - a origin returned a response with the code 504
ProxyNextUpstream []string `json:"proxy_next_upstream,omitzero"`
// contains filtered or unexported fields
}
The properties Auth, AuthType, Name are required.
func (OriginGroupNewParamsBodyAwsSignatureV4) MarshalJSON ¶
func (r OriginGroupNewParamsBodyAwsSignatureV4) MarshalJSON() (data []byte, err error)
func (*OriginGroupNewParamsBodyAwsSignatureV4) UnmarshalJSON ¶
func (r *OriginGroupNewParamsBodyAwsSignatureV4) UnmarshalJSON(data []byte) error
type OriginGroupNewParamsBodyAwsSignatureV4Auth ¶
type OriginGroupNewParamsBodyAwsSignatureV4Auth struct {
// Access key ID for the S3 account.
//
// Restrictions:
//
// - Latin letters (A-Z, a-z), numbers (0-9), colon, dash, and underscore.
// - From 3 to 512 characters.
S3AccessKeyID string `json:"s3_access_key_id,required"`
// S3 bucket name.
//
// Restrictions:
//
// - Maximum 128 characters.
S3BucketName string `json:"s3_bucket_name,required"`
// Secret access key for the S3 account.
//
// Restrictions:
//
// - Latin letters (A-Z, a-z), numbers (0-9), pluses, slashes, dashes, colons and
// underscores.
// - If "s3_type": amazon, length should be 40 characters.
// - If "s3_type": other, length should be from 16 to 255 characters.
S3SecretAccessKey string `json:"s3_secret_access_key,required"`
// Storage type compatible with S3.
//
// Possible values:
//
// - **amazon** – AWS S3 storage.
// - **other** – Other (not AWS) S3 compatible storage.
S3Type string `json:"s3_type,required"`
// S3 storage region.
//
// The parameter is required, if "s3_type": amazon.
S3Region param.Opt[string] `json:"s3_region,omitzero"`
// S3 storage hostname.
//
// The parameter is required, if "s3_type": other.
S3StorageHostname param.Opt[string] `json:"s3_storage_hostname,omitzero"`
// contains filtered or unexported fields
}
Credentials to access the private bucket.
The properties S3AccessKeyID, S3BucketName, S3SecretAccessKey, S3Type are required.
func (OriginGroupNewParamsBodyAwsSignatureV4Auth) MarshalJSON ¶
func (r OriginGroupNewParamsBodyAwsSignatureV4Auth) MarshalJSON() (data []byte, err error)
func (*OriginGroupNewParamsBodyAwsSignatureV4Auth) UnmarshalJSON ¶
func (r *OriginGroupNewParamsBodyAwsSignatureV4Auth) UnmarshalJSON(data []byte) error
type OriginGroupNewParamsBodyNoneAuth ¶
type OriginGroupNewParamsBodyNoneAuth struct {
// Origin group name.
Name string `json:"name,required"`
// List of origin sources in the origin group.
Sources []OriginGroupNewParamsBodyNoneAuthSource `json:"sources,omitzero,required"`
// Origin authentication type.
//
// Possible values:
//
// - **none** - Used for public origins.
// - **awsSignatureV4** - Used for S3 storage.
AuthType param.Opt[string] `json:"auth_type,omitzero"`
// Defines whether to use the next origin from the origin group if origin responds
// with the cases specified in `proxy_next_upstream`. If you enable it, you must
// specify cases in `proxy_next_upstream`.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
UseNext param.Opt[bool] `json:"use_next,omitzero"`
// Defines cases when the request should be passed on to the next origin.
//
// Possible values:
//
// - **error** - an error occurred while establishing a connection with the origin,
// passing a request to it, or reading the response header
// - **timeout** - a timeout has occurred while establishing a connection with the
// origin, passing a request to it, or reading the response header
// - **`invalid_header`** - a origin returned an empty or invalid response
// - **`http_403`** - a origin returned a response with the code 403
// - **`http_404`** - a origin returned a response with the code 404
// - **`http_429`** - a origin returned a response with the code 429
// - **`http_500`** - a origin returned a response with the code 500
// - **`http_502`** - a origin returned a response with the code 502
// - **`http_503`** - a origin returned a response with the code 503
// - **`http_504`** - a origin returned a response with the code 504
ProxyNextUpstream []string `json:"proxy_next_upstream,omitzero"`
// contains filtered or unexported fields
}
The properties Name, Sources are required.
func (OriginGroupNewParamsBodyNoneAuth) MarshalJSON ¶
func (r OriginGroupNewParamsBodyNoneAuth) MarshalJSON() (data []byte, err error)
func (*OriginGroupNewParamsBodyNoneAuth) UnmarshalJSON ¶
func (r *OriginGroupNewParamsBodyNoneAuth) UnmarshalJSON(data []byte) error
type OriginGroupNewParamsBodyNoneAuthSource ¶
type OriginGroupNewParamsBodyNoneAuthSource struct {
// Defines whether the origin is a backup, meaning that it will not be used until
// one of active origins become unavailable.
//
// Possible values:
//
// - **true** - Origin is a backup.
// - **false** - Origin is not a backup.
Backup param.Opt[bool] `json:"backup,omitzero"`
// Enables or disables an origin source in the origin group.
//
// Possible values:
//
// - **true** - Origin is enabled and the CDN uses it to pull content.
// - **false** - Origin is disabled and the CDN does not use it to pull content.
//
// Origin group must contain at least one enabled origin.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// IP address or domain name of the origin and the port, if custom port is used.
Source param.Opt[string] `json:"source,omitzero"`
// contains filtered or unexported fields
}
func (OriginGroupNewParamsBodyNoneAuthSource) MarshalJSON ¶
func (r OriginGroupNewParamsBodyNoneAuthSource) MarshalJSON() (data []byte, err error)
func (*OriginGroupNewParamsBodyNoneAuthSource) UnmarshalJSON ¶
func (r *OriginGroupNewParamsBodyNoneAuthSource) UnmarshalJSON(data []byte) error
type OriginGroupReplaceParams ¶
type OriginGroupReplaceParams struct {
// This field is a request body variant, only one variant field can be set.
OfNoneAuth *OriginGroupReplaceParamsBodyNoneAuth `json:",inline"`
// This field is a request body variant, only one variant field can be set.
OfAwsSignatureV4 *OriginGroupReplaceParamsBodyAwsSignatureV4 `json:",inline"`
// contains filtered or unexported fields
}
func (OriginGroupReplaceParams) MarshalJSON ¶
func (u OriginGroupReplaceParams) MarshalJSON() ([]byte, error)
func (*OriginGroupReplaceParams) UnmarshalJSON ¶
func (r *OriginGroupReplaceParams) UnmarshalJSON(data []byte) error
type OriginGroupReplaceParamsBodyAwsSignatureV4 ¶
type OriginGroupReplaceParamsBodyAwsSignatureV4 struct {
// Credentials to access the private bucket.
Auth OriginGroupReplaceParamsBodyAwsSignatureV4Auth `json:"auth,omitzero,required"`
// Authentication type.
//
// **awsSignatureV4** value is used for S3 storage.
AuthType string `json:"auth_type,required"`
// Origin group name.
Name string `json:"name,required"`
// Parameter is **deprecated**.
Path string `json:"path,required"`
// Defines whether to use the next origin from the origin group if origin responds
// with the cases specified in `proxy_next_upstream`. If you enable it, you must
// specify cases in `proxy_next_upstream`.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
UseNext bool `json:"use_next,required"`
// Defines cases when the request should be passed on to the next origin.
//
// Possible values:
//
// - **error** - an error occurred while establishing a connection with the origin,
// passing a request to it, or reading the response header
// - **timeout** - a timeout has occurred while establishing a connection with the
// origin, passing a request to it, or reading the response header
// - **`invalid_header`** - a origin returned an empty or invalid response
// - **`http_403`** - a origin returned a response with the code 403
// - **`http_404`** - a origin returned a response with the code 404
// - **`http_429`** - a origin returned a response with the code 429
// - **`http_500`** - a origin returned a response with the code 500
// - **`http_502`** - a origin returned a response with the code 502
// - **`http_503`** - a origin returned a response with the code 503
// - **`http_504`** - a origin returned a response with the code 504
ProxyNextUpstream []string `json:"proxy_next_upstream,omitzero"`
// contains filtered or unexported fields
}
The properties Auth, AuthType, Name, Path, UseNext are required.
func (OriginGroupReplaceParamsBodyAwsSignatureV4) MarshalJSON ¶
func (r OriginGroupReplaceParamsBodyAwsSignatureV4) MarshalJSON() (data []byte, err error)
func (*OriginGroupReplaceParamsBodyAwsSignatureV4) UnmarshalJSON ¶
func (r *OriginGroupReplaceParamsBodyAwsSignatureV4) UnmarshalJSON(data []byte) error
type OriginGroupReplaceParamsBodyAwsSignatureV4Auth ¶
type OriginGroupReplaceParamsBodyAwsSignatureV4Auth struct {
// Access key ID for the S3 account.
//
// Restrictions:
//
// - Latin letters (A-Z, a-z), numbers (0-9), colon, dash, and underscore.
// - From 3 to 512 characters.
S3AccessKeyID string `json:"s3_access_key_id,required"`
// S3 bucket name.
//
// Restrictions:
//
// - Maximum 128 characters.
S3BucketName string `json:"s3_bucket_name,required"`
// Secret access key for the S3 account.
//
// Restrictions:
//
// - Latin letters (A-Z, a-z), numbers (0-9), pluses, slashes, dashes, colons and
// underscores.
// - If "s3_type": amazon, length should be 40 characters.
// - If "s3_type": other, length should be from 16 to 255 characters.
S3SecretAccessKey string `json:"s3_secret_access_key,required"`
// Storage type compatible with S3.
//
// Possible values:
//
// - **amazon** – AWS S3 storage.
// - **other** – Other (not AWS) S3 compatible storage.
S3Type string `json:"s3_type,required"`
// S3 storage region.
//
// The parameter is required, if "s3_type": amazon.
S3Region param.Opt[string] `json:"s3_region,omitzero"`
// S3 storage hostname.
//
// The parameter is required, if "s3_type": other.
S3StorageHostname param.Opt[string] `json:"s3_storage_hostname,omitzero"`
// contains filtered or unexported fields
}
Credentials to access the private bucket.
The properties S3AccessKeyID, S3BucketName, S3SecretAccessKey, S3Type are required.
func (OriginGroupReplaceParamsBodyAwsSignatureV4Auth) MarshalJSON ¶
func (r OriginGroupReplaceParamsBodyAwsSignatureV4Auth) MarshalJSON() (data []byte, err error)
func (*OriginGroupReplaceParamsBodyAwsSignatureV4Auth) UnmarshalJSON ¶
func (r *OriginGroupReplaceParamsBodyAwsSignatureV4Auth) UnmarshalJSON(data []byte) error
type OriginGroupReplaceParamsBodyNoneAuth ¶
type OriginGroupReplaceParamsBodyNoneAuth struct {
// Origin authentication type.
//
// Possible values:
//
// - **none** - Used for public origins.
// - **awsSignatureV4** - Used for S3 storage.
AuthType string `json:"auth_type,required"`
// Origin group name.
Name string `json:"name,required"`
// Parameter is **deprecated**.
Path string `json:"path,required"`
// List of origin sources in the origin group.
Sources []OriginGroupReplaceParamsBodyNoneAuthSource `json:"sources,omitzero,required"`
// Defines whether to use the next origin from the origin group if origin responds
// with the cases specified in `proxy_next_upstream`. If you enable it, you must
// specify cases in `proxy_next_upstream`.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
UseNext bool `json:"use_next,required"`
// Defines cases when the request should be passed on to the next origin.
//
// Possible values:
//
// - **error** - an error occurred while establishing a connection with the origin,
// passing a request to it, or reading the response header
// - **timeout** - a timeout has occurred while establishing a connection with the
// origin, passing a request to it, or reading the response header
// - **`invalid_header`** - a origin returned an empty or invalid response
// - **`http_403`** - a origin returned a response with the code 403
// - **`http_404`** - a origin returned a response with the code 404
// - **`http_429`** - a origin returned a response with the code 429
// - **`http_500`** - a origin returned a response with the code 500
// - **`http_502`** - a origin returned a response with the code 502
// - **`http_503`** - a origin returned a response with the code 503
// - **`http_504`** - a origin returned a response with the code 504
ProxyNextUpstream []string `json:"proxy_next_upstream,omitzero"`
// contains filtered or unexported fields
}
The properties AuthType, Name, Path, Sources, UseNext are required.
func (OriginGroupReplaceParamsBodyNoneAuth) MarshalJSON ¶
func (r OriginGroupReplaceParamsBodyNoneAuth) MarshalJSON() (data []byte, err error)
func (*OriginGroupReplaceParamsBodyNoneAuth) UnmarshalJSON ¶
func (r *OriginGroupReplaceParamsBodyNoneAuth) UnmarshalJSON(data []byte) error
type OriginGroupReplaceParamsBodyNoneAuthSource ¶
type OriginGroupReplaceParamsBodyNoneAuthSource struct {
// Defines whether the origin is a backup, meaning that it will not be used until
// one of active origins become unavailable.
//
// Possible values:
//
// - **true** - Origin is a backup.
// - **false** - Origin is not a backup.
Backup param.Opt[bool] `json:"backup,omitzero"`
// Enables or disables an origin source in the origin group.
//
// Possible values:
//
// - **true** - Origin is enabled and the CDN uses it to pull content.
// - **false** - Origin is disabled and the CDN does not use it to pull content.
//
// Origin group must contain at least one enabled origin.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// IP address or domain name of the origin and the port, if custom port is used.
Source param.Opt[string] `json:"source,omitzero"`
// contains filtered or unexported fields
}
func (OriginGroupReplaceParamsBodyNoneAuthSource) MarshalJSON ¶
func (r OriginGroupReplaceParamsBodyNoneAuthSource) MarshalJSON() (data []byte, err error)
func (*OriginGroupReplaceParamsBodyNoneAuthSource) UnmarshalJSON ¶
func (r *OriginGroupReplaceParamsBodyNoneAuthSource) UnmarshalJSON(data []byte) error
type OriginGroupService ¶
type OriginGroupService struct {
Options []option.RequestOption
}
OriginGroupService 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 NewOriginGroupService method instead.
func NewOriginGroupService ¶
func NewOriginGroupService(opts ...option.RequestOption) (r OriginGroupService)
NewOriginGroupService 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 (*OriginGroupService) Delete ¶
func (r *OriginGroupService) Delete(ctx context.Context, originGroupID int64, opts ...option.RequestOption) (err error)
Delete origin group
func (*OriginGroupService) Get ¶
func (r *OriginGroupService) Get(ctx context.Context, originGroupID int64, opts ...option.RequestOption) (res *OriginGroupsUnion, err error)
Get origin group details
func (*OriginGroupService) List ¶
func (r *OriginGroupService) List(ctx context.Context, query OriginGroupListParams, opts ...option.RequestOption) (res *OriginGroupsList, err error)
Get all origin groups and related origin sources.
func (*OriginGroupService) New ¶
func (r *OriginGroupService) New(ctx context.Context, body OriginGroupNewParams, opts ...option.RequestOption) (res *OriginGroupsUnion, err error)
Create an origin group with one or more origin sources.
func (*OriginGroupService) Replace ¶
func (r *OriginGroupService) Replace(ctx context.Context, originGroupID int64, body OriginGroupReplaceParams, opts ...option.RequestOption) (res *OriginGroupsUnion, err error)
Change origin group
func (*OriginGroupService) Update ¶
func (r *OriginGroupService) Update(ctx context.Context, originGroupID int64, body OriginGroupUpdateParams, opts ...option.RequestOption) (res *OriginGroupsUnion, err error)
Change origin group
type OriginGroupUpdateParams ¶
type OriginGroupUpdateParams struct {
// This field is a request body variant, only one variant field can be set.
OfNoneAuth *OriginGroupUpdateParamsBodyNoneAuth `json:",inline"`
// This field is a request body variant, only one variant field can be set.
OfAwsSignatureV4 *OriginGroupUpdateParamsBodyAwsSignatureV4 `json:",inline"`
// contains filtered or unexported fields
}
func (OriginGroupUpdateParams) MarshalJSON ¶
func (u OriginGroupUpdateParams) MarshalJSON() ([]byte, error)
func (*OriginGroupUpdateParams) UnmarshalJSON ¶
func (r *OriginGroupUpdateParams) UnmarshalJSON(data []byte) error
type OriginGroupUpdateParamsBodyAwsSignatureV4 ¶
type OriginGroupUpdateParamsBodyAwsSignatureV4 struct {
// Authentication type.
//
// **awsSignatureV4** value is used for S3 storage.
AuthType param.Opt[string] `json:"auth_type,omitzero"`
// Origin group name.
Name param.Opt[string] `json:"name,omitzero"`
// Parameter is **deprecated**.
Path param.Opt[string] `json:"path,omitzero"`
// Defines whether to use the next origin from the origin group if origin responds
// with the cases specified in `proxy_next_upstream`. If you enable it, you must
// specify cases in `proxy_next_upstream`.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
UseNext param.Opt[bool] `json:"use_next,omitzero"`
// Credentials to access the private bucket.
Auth OriginGroupUpdateParamsBodyAwsSignatureV4Auth `json:"auth,omitzero"`
// Defines cases when the request should be passed on to the next origin.
//
// Possible values:
//
// - **error** - an error occurred while establishing a connection with the origin,
// passing a request to it, or reading the response header
// - **timeout** - a timeout has occurred while establishing a connection with the
// origin, passing a request to it, or reading the response header
// - **`invalid_header`** - a origin returned an empty or invalid response
// - **`http_403`** - a origin returned a response with the code 403
// - **`http_404`** - a origin returned a response with the code 404
// - **`http_429`** - a origin returned a response with the code 429
// - **`http_500`** - a origin returned a response with the code 500
// - **`http_502`** - a origin returned a response with the code 502
// - **`http_503`** - a origin returned a response with the code 503
// - **`http_504`** - a origin returned a response with the code 504
ProxyNextUpstream []string `json:"proxy_next_upstream,omitzero"`
// contains filtered or unexported fields
}
func (OriginGroupUpdateParamsBodyAwsSignatureV4) MarshalJSON ¶
func (r OriginGroupUpdateParamsBodyAwsSignatureV4) MarshalJSON() (data []byte, err error)
func (*OriginGroupUpdateParamsBodyAwsSignatureV4) UnmarshalJSON ¶
func (r *OriginGroupUpdateParamsBodyAwsSignatureV4) UnmarshalJSON(data []byte) error
type OriginGroupUpdateParamsBodyAwsSignatureV4Auth ¶
type OriginGroupUpdateParamsBodyAwsSignatureV4Auth struct {
// Access key ID for the S3 account.
//
// Restrictions:
//
// - Latin letters (A-Z, a-z), numbers (0-9), colon, dash, and underscore.
// - From 3 to 512 characters.
S3AccessKeyID string `json:"s3_access_key_id,required"`
// S3 bucket name.
//
// Restrictions:
//
// - Maximum 128 characters.
S3BucketName string `json:"s3_bucket_name,required"`
// Secret access key for the S3 account.
//
// Restrictions:
//
// - Latin letters (A-Z, a-z), numbers (0-9), pluses, slashes, dashes, colons and
// underscores.
// - If "s3_type": amazon, length should be 40 characters.
// - If "s3_type": other, length should be from 16 to 255 characters.
S3SecretAccessKey string `json:"s3_secret_access_key,required"`
// Storage type compatible with S3.
//
// Possible values:
//
// - **amazon** – AWS S3 storage.
// - **other** – Other (not AWS) S3 compatible storage.
S3Type string `json:"s3_type,required"`
// S3 storage region.
//
// The parameter is required, if "s3_type": amazon.
S3Region param.Opt[string] `json:"s3_region,omitzero"`
// S3 storage hostname.
//
// The parameter is required, if "s3_type": other.
S3StorageHostname param.Opt[string] `json:"s3_storage_hostname,omitzero"`
// contains filtered or unexported fields
}
Credentials to access the private bucket.
The properties S3AccessKeyID, S3BucketName, S3SecretAccessKey, S3Type are required.
func (OriginGroupUpdateParamsBodyAwsSignatureV4Auth) MarshalJSON ¶
func (r OriginGroupUpdateParamsBodyAwsSignatureV4Auth) MarshalJSON() (data []byte, err error)
func (*OriginGroupUpdateParamsBodyAwsSignatureV4Auth) UnmarshalJSON ¶
func (r *OriginGroupUpdateParamsBodyAwsSignatureV4Auth) UnmarshalJSON(data []byte) error
type OriginGroupUpdateParamsBodyNoneAuth ¶
type OriginGroupUpdateParamsBodyNoneAuth struct {
// Origin group name.
Name string `json:"name,required"`
// Origin authentication type.
//
// Possible values:
//
// - **none** - Used for public origins.
// - **awsSignatureV4** - Used for S3 storage.
AuthType param.Opt[string] `json:"auth_type,omitzero"`
// Parameter is **deprecated**.
Path param.Opt[string] `json:"path,omitzero"`
// Defines whether to use the next origin from the origin group if origin responds
// with the cases specified in `proxy_next_upstream`. If you enable it, you must
// specify cases in `proxy_next_upstream`.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
UseNext param.Opt[bool] `json:"use_next,omitzero"`
// Defines cases when the request should be passed on to the next origin.
//
// Possible values:
//
// - **error** - an error occurred while establishing a connection with the origin,
// passing a request to it, or reading the response header
// - **timeout** - a timeout has occurred while establishing a connection with the
// origin, passing a request to it, or reading the response header
// - **`invalid_header`** - a origin returned an empty or invalid response
// - **`http_403`** - a origin returned a response with the code 403
// - **`http_404`** - a origin returned a response with the code 404
// - **`http_429`** - a origin returned a response with the code 429
// - **`http_500`** - a origin returned a response with the code 500
// - **`http_502`** - a origin returned a response with the code 502
// - **`http_503`** - a origin returned a response with the code 503
// - **`http_504`** - a origin returned a response with the code 504
ProxyNextUpstream []string `json:"proxy_next_upstream,omitzero"`
// List of origin sources in the origin group.
Sources []OriginGroupUpdateParamsBodyNoneAuthSource `json:"sources,omitzero"`
// contains filtered or unexported fields
}
The property Name is required.
func (OriginGroupUpdateParamsBodyNoneAuth) MarshalJSON ¶
func (r OriginGroupUpdateParamsBodyNoneAuth) MarshalJSON() (data []byte, err error)
func (*OriginGroupUpdateParamsBodyNoneAuth) UnmarshalJSON ¶
func (r *OriginGroupUpdateParamsBodyNoneAuth) UnmarshalJSON(data []byte) error
type OriginGroupUpdateParamsBodyNoneAuthSource ¶
type OriginGroupUpdateParamsBodyNoneAuthSource struct {
// Defines whether the origin is a backup, meaning that it will not be used until
// one of active origins become unavailable.
//
// Possible values:
//
// - **true** - Origin is a backup.
// - **false** - Origin is not a backup.
Backup param.Opt[bool] `json:"backup,omitzero"`
// Enables or disables an origin source in the origin group.
//
// Possible values:
//
// - **true** - Origin is enabled and the CDN uses it to pull content.
// - **false** - Origin is disabled and the CDN does not use it to pull content.
//
// Origin group must contain at least one enabled origin.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// IP address or domain name of the origin and the port, if custom port is used.
Source param.Opt[string] `json:"source,omitzero"`
// contains filtered or unexported fields
}
func (OriginGroupUpdateParamsBodyNoneAuthSource) MarshalJSON ¶
func (r OriginGroupUpdateParamsBodyNoneAuthSource) MarshalJSON() (data []byte, err error)
func (*OriginGroupUpdateParamsBodyNoneAuthSource) UnmarshalJSON ¶
func (r *OriginGroupUpdateParamsBodyNoneAuthSource) UnmarshalJSON(data []byte) error
type OriginGroupsAwsSignatureV4 ¶
type OriginGroupsAwsSignatureV4 struct {
// Origin group ID.
ID int64 `json:"id"`
// Credentials to access the private bucket.
Auth OriginGroupsAwsSignatureV4Auth `json:"auth"`
// Authentication type.
//
// **awsSignatureV4** value is used for S3 storage.
AuthType string `json:"auth_type"`
// Defines whether the origin group has related CDN resources.
//
// Possible values:
//
// - **true** - Origin group has related CDN resources.
// - **false** - Origin group does not have related CDN resources.
HasRelatedResources bool `json:"has_related_resources"`
// Origin group name.
Name string `json:"name"`
// Parameter is **deprecated**.
Path string `json:"path"`
// Defines cases when the request should be passed on to the next origin.
//
// Possible values:
//
// - **error** - an error occurred while establishing a connection with the origin,
// passing a request to it, or reading the response header
// - **timeout** - a timeout has occurred while establishing a connection with the
// origin, passing a request to it, or reading the response header
// - **`invalid_header`** - a origin returned an empty or invalid response
// - **`http_403`** - a origin returned a response with the code 403
// - **`http_404`** - a origin returned a response with the code 404
// - **`http_429`** - a origin returned a response with the code 429
// - **`http_500`** - a origin returned a response with the code 500
// - **`http_502`** - a origin returned a response with the code 502
// - **`http_503`** - a origin returned a response with the code 503
// - **`http_504`** - a origin returned a response with the code 504
ProxyNextUpstream []string `json:"proxy_next_upstream"`
// Defines whether to use the next origin from the origin group if origin responds
// with the cases specified in `proxy_next_upstream`. If you enable it, you must
// specify cases in `proxy_next_upstream`.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
UseNext bool `json:"use_next"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Auth respjson.Field
AuthType respjson.Field
HasRelatedResources respjson.Field
Name respjson.Field
Path respjson.Field
ProxyNextUpstream respjson.Field
UseNext respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (OriginGroupsAwsSignatureV4) RawJSON ¶
func (r OriginGroupsAwsSignatureV4) RawJSON() string
Returns the unmodified JSON received from the API
func (*OriginGroupsAwsSignatureV4) UnmarshalJSON ¶
func (r *OriginGroupsAwsSignatureV4) UnmarshalJSON(data []byte) error
type OriginGroupsAwsSignatureV4Auth ¶
type OriginGroupsAwsSignatureV4Auth struct {
// Access key ID for the S3 account.
//
// Restrictions:
//
// - Latin letters (A-Z, a-z), numbers (0-9), colon, dash, and underscore.
// - From 3 to 512 characters.
S3AccessKeyID string `json:"s3_access_key_id,required"`
// S3 bucket name.
//
// Restrictions:
//
// - Maximum 128 characters.
S3BucketName string `json:"s3_bucket_name,required"`
// Secret access key for the S3 account.
//
// Restrictions:
//
// - Latin letters (A-Z, a-z), numbers (0-9), pluses, slashes, dashes, colons and
// underscores.
// - If "s3_type": amazon, length should be 40 characters.
// - If "s3_type": other, length should be from 16 to 255 characters.
S3SecretAccessKey string `json:"s3_secret_access_key,required"`
// Storage type compatible with S3.
//
// Possible values:
//
// - **amazon** – AWS S3 storage.
// - **other** – Other (not AWS) S3 compatible storage.
S3Type string `json:"s3_type,required"`
// S3 storage region.
//
// The parameter is required, if "s3_type": amazon.
S3Region string `json:"s3_region"`
// S3 storage hostname.
//
// The parameter is required, if "s3_type": other.
S3StorageHostname string `json:"s3_storage_hostname"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
S3AccessKeyID respjson.Field
S3BucketName respjson.Field
S3SecretAccessKey respjson.Field
S3Type respjson.Field
S3Region respjson.Field
S3StorageHostname respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Credentials to access the private bucket.
func (OriginGroupsAwsSignatureV4Auth) RawJSON ¶
func (r OriginGroupsAwsSignatureV4Auth) RawJSON() string
Returns the unmodified JSON received from the API
func (*OriginGroupsAwsSignatureV4Auth) UnmarshalJSON ¶
func (r *OriginGroupsAwsSignatureV4Auth) UnmarshalJSON(data []byte) error
type OriginGroupsList ¶
type OriginGroupsList []OriginGroupsUnion
type OriginGroupsNoneAuth ¶
type OriginGroupsNoneAuth struct {
// Origin group ID.
ID int64 `json:"id"`
// Origin authentication type.
//
// Possible values:
//
// - **none** - Used for public origins.
// - **awsSignatureV4** - Used for S3 storage.
AuthType string `json:"auth_type"`
// Defines whether the origin group has related CDN resources.
//
// Possible values:
//
// - **true** - Origin group has related CDN resources.
// - **false** - Origin group does not have related CDN resources.
HasRelatedResources bool `json:"has_related_resources"`
// Origin group name.
Name string `json:"name"`
// Parameter is **deprecated**.
Path string `json:"path"`
// Defines cases when the request should be passed on to the next origin.
//
// Possible values:
//
// - **error** - an error occurred while establishing a connection with the origin,
// passing a request to it, or reading the response header
// - **timeout** - a timeout has occurred while establishing a connection with the
// origin, passing a request to it, or reading the response header
// - **`invalid_header`** - a origin returned an empty or invalid response
// - **`http_403`** - a origin returned a response with the code 403
// - **`http_404`** - a origin returned a response with the code 404
// - **`http_429`** - a origin returned a response with the code 429
// - **`http_500`** - a origin returned a response with the code 500
// - **`http_502`** - a origin returned a response with the code 502
// - **`http_503`** - a origin returned a response with the code 503
// - **`http_504`** - a origin returned a response with the code 504
ProxyNextUpstream []string `json:"proxy_next_upstream"`
// List of origin sources in the origin group.
Sources []OriginGroupsNoneAuthSource `json:"sources"`
// Defines whether to use the next origin from the origin group if origin responds
// with the cases specified in `proxy_next_upstream`. If you enable it, you must
// specify cases in `proxy_next_upstream`.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
UseNext bool `json:"use_next"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
AuthType respjson.Field
HasRelatedResources respjson.Field
Name respjson.Field
Path respjson.Field
ProxyNextUpstream respjson.Field
Sources respjson.Field
UseNext respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (OriginGroupsNoneAuth) RawJSON ¶
func (r OriginGroupsNoneAuth) RawJSON() string
Returns the unmodified JSON received from the API
func (*OriginGroupsNoneAuth) UnmarshalJSON ¶
func (r *OriginGroupsNoneAuth) UnmarshalJSON(data []byte) error
type OriginGroupsNoneAuthSource ¶
type OriginGroupsNoneAuthSource struct {
// Defines whether the origin is a backup, meaning that it will not be used until
// one of active origins become unavailable.
//
// Possible values:
//
// - **true** - Origin is a backup.
// - **false** - Origin is not a backup.
Backup bool `json:"backup"`
// Enables or disables an origin source in the origin group.
//
// Possible values:
//
// - **true** - Origin is enabled and the CDN uses it to pull content.
// - **false** - Origin is disabled and the CDN does not use it to pull content.
//
// Origin group must contain at least one enabled origin.
Enabled bool `json:"enabled"`
// IP address or domain name of the origin and the port, if custom port is used.
Source string `json:"source"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Backup respjson.Field
Enabled respjson.Field
Source respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (OriginGroupsNoneAuthSource) RawJSON ¶
func (r OriginGroupsNoneAuthSource) RawJSON() string
Returns the unmodified JSON received from the API
func (*OriginGroupsNoneAuthSource) UnmarshalJSON ¶
func (r *OriginGroupsNoneAuthSource) UnmarshalJSON(data []byte) error
type OriginGroupsUnion ¶
type OriginGroupsUnion struct {
ID int64 `json:"id"`
AuthType string `json:"auth_type"`
HasRelatedResources bool `json:"has_related_resources"`
Name string `json:"name"`
Path string `json:"path"`
ProxyNextUpstream []string `json:"proxy_next_upstream"`
// This field is from variant [OriginGroupsNoneAuth].
Sources []OriginGroupsNoneAuthSource `json:"sources"`
UseNext bool `json:"use_next"`
// This field is from variant [OriginGroupsAwsSignatureV4].
Auth OriginGroupsAwsSignatureV4Auth `json:"auth"`
JSON struct {
ID respjson.Field
AuthType respjson.Field
HasRelatedResources respjson.Field
Name respjson.Field
Path respjson.Field
ProxyNextUpstream respjson.Field
Sources respjson.Field
UseNext respjson.Field
Auth respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
OriginGroupsUnion contains all possible properties and values from OriginGroupsNoneAuth, OriginGroupsAwsSignatureV4.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (OriginGroupsUnion) AsAwsSignatureV4 ¶
func (u OriginGroupsUnion) AsAwsSignatureV4() (v OriginGroupsAwsSignatureV4)
func (OriginGroupsUnion) AsNoneAuth ¶
func (u OriginGroupsUnion) AsNoneAuth() (v OriginGroupsNoneAuth)
func (OriginGroupsUnion) RawJSON ¶
func (u OriginGroupsUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*OriginGroupsUnion) UnmarshalJSON ¶
func (r *OriginGroupsUnion) UnmarshalJSON(data []byte) error
type OriginShielding ¶
type OriginShielding struct {
// Shielding location ID.
//
// If origin shielding is disabled, the parameter value is **null**.
ShieldingPop int64 `json:"shielding_pop,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ShieldingPop respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (OriginShielding) RawJSON ¶
func (r OriginShielding) RawJSON() string
Returns the unmodified JSON received from the API
func (OriginShielding) ToParam ¶
func (r OriginShielding) ToParam() OriginShieldingParam
ToParam converts this OriginShielding to a OriginShieldingParam.
Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with OriginShieldingParam.Overrides()
func (*OriginShielding) UnmarshalJSON ¶
func (r *OriginShielding) UnmarshalJSON(data []byte) error
type OriginShieldingParam ¶
type OriginShieldingParam struct {
// Shielding location ID.
//
// If origin shielding is disabled, the parameter value is **null**.
ShieldingPop param.Opt[int64] `json:"shielding_pop,omitzero"`
// contains filtered or unexported fields
}
func (OriginShieldingParam) MarshalJSON ¶
func (r OriginShieldingParam) MarshalJSON() (data []byte, err error)
func (*OriginShieldingParam) UnmarshalJSON ¶
func (r *OriginShieldingParam) UnmarshalJSON(data []byte) error
type OriginShieldingReplaced ¶ added in v0.28.0
type OriginShieldingReplaced = any
type PublicIPList ¶
type PublicIPList struct {
// List of IPv4 addresses.
Addresses []string `json:"addresses"`
// List of IPv6 addresses.
AddressesV6 []string `json:"addresses_v6"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Addresses respjson.Field
AddressesV6 respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PublicIPList) RawJSON ¶
func (r PublicIPList) RawJSON() string
Returns the unmodified JSON received from the API
func (*PublicIPList) UnmarshalJSON ¶
func (r *PublicIPList) UnmarshalJSON(data []byte) error
type PublicNetworkList ¶
type PublicNetworkList struct {
// List of IPv4 networks.
Addresses []string `json:"addresses"`
// List of IPv6 networks.
AddressesV6 []string `json:"addresses_v6"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Addresses respjson.Field
AddressesV6 respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PublicNetworkList) RawJSON ¶
func (r PublicNetworkList) RawJSON() string
Returns the unmodified JSON received from the API
func (*PublicNetworkList) UnmarshalJSON ¶
func (r *PublicNetworkList) UnmarshalJSON(data []byte) error
type PurgeStatus ¶
type PurgeStatus struct {
// Date and time when the purge was created (ISO 8601/RFC 3339 format, UTC).
Created string `json:"created"`
// Purge payload depends on purge type.
//
// Possible values:
//
// - **urls** - Purge by URL.
// - **paths** - Purge by Pattern and purge All.
Payload any `json:"payload"`
// Purge ID.
PurgeID int64 `json:"purge_id"`
// Contains the name of the purge request type.
//
// Possible values:
//
// - **`purge_by_pattern`** - Purge by Pattern.
// - **`purge_by_url`** - Purge by URL.
// - **`purge_all`** - Purge All.
PurgeType string `json:"purge_type"`
Resource PurgeStatusResource `json:"resource"`
// Purge status.
//
// Possible values:
//
// - **In progress** - Purge is in progress.
// - **Successful** - Purge was successful.
// - **Failed** - Purge failed.
//
// Any of "In progress", "Successful", "Failed".
Status PurgeStatusStatus `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Created respjson.Field
Payload respjson.Field
PurgeID respjson.Field
PurgeType respjson.Field
Resource respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PurgeStatus) RawJSON ¶
func (r PurgeStatus) RawJSON() string
Returns the unmodified JSON received from the API
func (*PurgeStatus) UnmarshalJSON ¶
func (r *PurgeStatus) UnmarshalJSON(data []byte) error
type PurgeStatusResource ¶
type PurgeStatusResource struct {
// Resource ID.
ID int64 `json:"id"`
// CNAME of the resource.
Cname string `json:"cname"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Cname respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (PurgeStatusResource) RawJSON ¶
func (r PurgeStatusResource) RawJSON() string
Returns the unmodified JSON received from the API
func (*PurgeStatusResource) UnmarshalJSON ¶
func (r *PurgeStatusResource) UnmarshalJSON(data []byte) error
type PurgeStatusStatus ¶
type PurgeStatusStatus string
Purge status.
Possible values:
- **In progress** - Purge is in progress. - **Successful** - Purge was successful. - **Failed** - Purge failed.
const ( PurgeStatusStatusInProgress PurgeStatusStatus = "In progress" PurgeStatusStatusSuccessful PurgeStatusStatus = "Successful" PurgeStatusStatusFailed PurgeStatusStatus = "Failed" )
type ResourceAggregatedStats ¶
type ResourceAggregatedStats struct {
// CDN resource ID for which statistics data is shown.
Number1Example any `json:"1 (example)"`
// 95 percentile bandwidth value
Number95Percentile int64 `json:"95_percentile"`
// Traffic in bytes from Backblaze origin.
BackblazeBytes int64 `json:"backblaze_bytes"`
// Formula: 1 - `upstream_bytes` / `sent_bytes`. We deduct the non-cached traffic
// from the total traffic amount
CacheHitTrafficRatio int64 `json:"cache_hit_traffic_ratio"`
// Region by which statistics data is grouped.
CisExample any `json:"cis (example)"`
// Maximum bandwidth
MaxBandwidth int64 `json:"max_bandwidth"`
// Statistics parameters.
Metrics any `json:"metrics"`
// Minimum bandwidth
MinBandwidth int64 `json:"min_bandwidth"`
// Regions by which statistics data is grouped.
Region any `json:"region"`
// Number of requests to edge servers.
Requests int64 `json:"requests"`
// Resources IDs by which statistics data is grouped.
Resource any `json:"resource"`
// Statistics by content type. It returns a number of responses for content with
// different MIME types.
ResponseTypes any `json:"response_types"`
// Number of 2xx response codes.
Responses2xx int64 `json:"responses_2xx"`
// Number of 3xx response codes.
Responses3xx int64 `json:"responses_3xx"`
// Number of 4xx response codes.
Responses4xx int64 `json:"responses_4xx"`
// Number of 5xx response codes.
Responses5xx int64 `json:"responses_5xx"`
// Number of responses with the header Cache: HIT.
ResponsesHit int64 `json:"responses_hit"`
// Number of responses with the header Cache: MISS.
ResponsesMiss int64 `json:"responses_miss"`
// Traffic in bytes from CDN servers to clients.
SentBytes int64 `json:"sent_bytes"`
// Upstream bytes and `sent_bytes` combined.
TotalBytes int64 `json:"total_bytes"`
// Traffic in bytes from the upstream to CDN servers.
UpstreamBytes int64 `json:"upstream_bytes"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Number1Example respjson.Field
Number95Percentile respjson.Field
BackblazeBytes respjson.Field
CacheHitTrafficRatio respjson.Field
CisExample respjson.Field
MaxBandwidth respjson.Field
Metrics respjson.Field
MinBandwidth respjson.Field
Region respjson.Field
Requests respjson.Field
Resource respjson.Field
ResponseTypes respjson.Field
Responses2xx respjson.Field
Responses3xx respjson.Field
Responses4xx respjson.Field
Responses5xx respjson.Field
ResponsesHit respjson.Field
ResponsesMiss respjson.Field
SentBytes respjson.Field
TotalBytes respjson.Field
UpstreamBytes respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ResourceAggregatedStats) RawJSON ¶
func (r ResourceAggregatedStats) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResourceAggregatedStats) UnmarshalJSON ¶
func (r *ResourceAggregatedStats) UnmarshalJSON(data []byte) error
type ResourceListParams ¶
type ResourceListParams struct {
// Delivery domain (CNAME) of the CDN resource.
Cname param.Opt[string] `query:"cname,omitzero" json:"-"`
// Defines whether a CDN resource has been deleted.
//
// Possible values:
//
// - **true** - CDN resource has been deleted.
// - **false** - CDN resource has not been deleted.
Deleted param.Opt[bool] `query:"deleted,omitzero" json:"-"`
// Enables or disables a CDN resource change by a user.
//
// Possible values:
//
// - **true** - CDN resource is enabled.
// - **false** - CDN resource is disabled.
Enabled param.Opt[bool] `query:"enabled,omitzero" json:"-"`
// Most recent date of CDN resource creation for which CDN resources should be
// returned (ISO 8601/RFC 3339 format, UTC.)
MaxCreated param.Opt[string] `query:"max_created,omitzero" json:"-"`
// Earliest date of CDN resource creation for which CDN resources should be
// returned (ISO 8601/RFC 3339 format, UTC.)
MinCreated param.Opt[string] `query:"min_created,omitzero" json:"-"`
// Origin group ID.
OriginGroup param.Opt[int64] `query:"originGroup,omitzero" json:"-"`
// Rule name or pattern.
Rules param.Opt[string] `query:"rules,omitzero" json:"-"`
// Additional delivery domains (CNAMEs) of the CDN resource.
SecondaryHostnames param.Opt[string] `query:"secondaryHostnames,omitzero" json:"-"`
// Name of the origin shielding data center location.
ShieldDc param.Opt[string] `query:"shield_dc,omitzero" json:"-"`
// Defines whether origin shielding is enabled for the CDN resource.
//
// Possible values:
//
// - **true** - Origin shielding is enabled for the CDN resource.
// - **false** - Origin shielding is disabled for the CDN resource.
Shielded param.Opt[bool] `query:"shielded,omitzero" json:"-"`
// SSL certificate ID.
SslData param.Opt[int64] `query:"sslData,omitzero" json:"-"`
// SSL certificates IDs.
//
// Example:
//
// - ?`sslData_in`=1643,1644,1652
SslDataIn param.Opt[int64] `query:"sslData_in,omitzero" json:"-"`
// Defines whether the HTTPS protocol is enabled for content delivery.
//
// Possible values:
//
// - **true** - HTTPS protocol is enabled for CDN resource.
// - **false** - HTTPS protocol is disabled for CDN resource.
SslEnabled param.Opt[bool] `query:"sslEnabled,omitzero" json:"-"`
// Defines whether the CDN resource was automatically suspended by the system.
//
// Possible values:
//
// - **true** - CDN resource is selected for automatic suspension in the next 7
// days.
// - **false** - CDN resource is not selected for automatic suspension.
Suspend param.Opt[bool] `query:"suspend,omitzero" json:"-"`
// Defines whether the CDN resource is integrated with the Streaming platform.
//
// Possible values:
//
// - **true** - CDN resource is used for Streaming platform.
// - **false** - CDN resource is not used for Streaming platform.
VpEnabled param.Opt[bool] `query:"vp_enabled,omitzero" json:"-"`
// CDN resource status.
//
// Any of "active", "processed", "suspended", "deleted".
Status ResourceListParamsStatus `query:"status,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (ResourceListParams) URLQuery ¶
func (r ResourceListParams) URLQuery() (v url.Values, err error)
URLQuery serializes ResourceListParams's query parameters as `url.Values`.
type ResourceListParamsStatus ¶
type ResourceListParamsStatus string
CDN resource status.
const ( ResourceListParamsStatusActive ResourceListParamsStatus = "active" ResourceListParamsStatusProcessed ResourceListParamsStatus = "processed" ResourceListParamsStatusSuspended ResourceListParamsStatus = "suspended" ResourceListParamsStatusDeleted ResourceListParamsStatus = "deleted" )
type ResourceNewParams ¶
type ResourceNewParams struct {
// Delivery domains that will be used for content delivery through a CDN.
//
// Delivery domains should be added to your DNS settings.
Cname string `json:"cname,required"`
// IP address or domain name of the origin and the port, if custom port is used.
//
// You can use either the `origin` or `originGroup` parameter in the request.
Origin string `json:"origin,required"`
// Origin group ID with which the CDN resource is associated.
//
// You can use either the `origin` or `originGroup` parameter in the request.
OriginGroup int64 `json:"originGroup,required"`
// CDN resource name.
Name param.Opt[string] `json:"name,omitzero"`
// ID of the main CDN resource which has a shared caching zone with a reserve CDN
// resource.
//
// If the parameter is not empty, then the current CDN resource is the reserve. You
// cannot change some options, create rules, set up origin shielding, or use the
// reserve CDN resource for Streaming.
PrimaryResource param.Opt[int64] `json:"primary_resource,omitzero"`
// ID of the trusted CA certificate used to verify an origin.
//
// It can be used only with `"proxy_ssl_enabled": true`.
ProxySslCa param.Opt[int64] `json:"proxy_ssl_ca,omitzero"`
// ID of the SSL certificate used to verify an origin.
//
// It can be used only with `"proxy_ssl_enabled": true`.
ProxySslData param.Opt[int64] `json:"proxy_ssl_data,omitzero"`
// ID of the SSL certificate linked to the CDN resource.
//
// Can be used only with `"sslEnabled": true`.
SslData param.Opt[int64] `json:"sslData,omitzero"`
// Enables or disables a CDN resource.
//
// Possible values:
//
// - **true** - CDN resource is active. Content is being delivered.
// - **false** - CDN resource is deactivated. Content is not being delivered.
Active param.Opt[bool] `json:"active,omitzero"`
// Optional comment describing the CDN resource.
Description param.Opt[string] `json:"description,omitzero"`
// Enables or disables SSL certificate validation of the origin server before
// completing any connection.
//
// Possible values:
//
// - **true** - Origin SSL certificate validation is enabled.
// - **false** - Origin SSL certificate validation is disabled.
ProxySslEnabled param.Opt[bool] `json:"proxy_ssl_enabled,omitzero"`
// Defines whether the HTTPS protocol enabled for content delivery.
//
// Possible values:
//
// - **true** - HTTPS is enabled.
// - **false** - HTTPS is disabled.
SslEnabled param.Opt[bool] `json:"sslEnabled,omitzero"`
// Defines whether the associated WAAP Domain is identified as an API Domain.
//
// Possible values:
//
// - **true** - The associated WAAP Domain is designated as an API Domain.
// - **false** - The associated WAAP Domain is not designated as an API Domain.
WaapAPIDomainEnabled param.Opt[bool] `json:"waap_api_domain_enabled,omitzero"`
// List of options that can be configured for the CDN resource.
//
// In case of `null` value the option is not added to the CDN resource. Option may
// inherit its value from the global account settings.
Options ResourceNewParamsOptions `json:"options,omitzero"`
// Protocol used by CDN servers to request content from an origin source.
//
// Possible values:
//
// - **HTTPS** - CDN servers will connect to the origin via HTTPS.
// - **HTTP** - CDN servers will connect to the origin via HTTP.
// - **MATCH** - connection protocol will be chosen automatically (content on the
// origin source should be available for the CDN both through HTTP and HTTPS).
//
// If protocol is not specified, HTTP is used to connect to an origin server.
//
// Any of "HTTP", "HTTPS", "MATCH".
OriginProtocol ResourceNewParamsOriginProtocol `json:"originProtocol,omitzero"`
// Additional delivery domains (CNAMEs) that will be used to deliver content via
// the CDN.
//
// Up to ten additional CNAMEs are possible.
SecondaryHostnames []string `json:"secondaryHostnames,omitzero" format:"domain"`
// contains filtered or unexported fields
}
func (ResourceNewParams) MarshalJSON ¶
func (r ResourceNewParams) MarshalJSON() (data []byte, err error)
func (*ResourceNewParams) UnmarshalJSON ¶
func (r *ResourceNewParams) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptions ¶
type ResourceNewParamsOptions struct {
// HTTP methods allowed for content requests from the CDN.
AllowedHTTPMethods ResourceNewParamsOptionsAllowedHTTPMethods `json:"allowedHttpMethods,omitzero"`
// Allows to prevent online services from overloading and ensure your business
// workflow running smoothly.
BotProtection ResourceNewParamsOptionsBotProtection `json:"bot_protection,omitzero"`
// Compresses content with Brotli on the CDN side. CDN servers will request only
// uncompressed content from the origin.
//
// Notes:
//
// 1. CDN only supports "Brotli compression" when the "origin shielding" feature is
// activated.
// 2. If a precache server is not active for a CDN resource, no compression occurs,
// even if the option is enabled.
// 3. `brotli_compression` is not supported with `fetch_compressed` or `slice`
// options enabled.
// 4. `fetch_compressed` option in CDN resource settings overrides
// `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN
// resource and want to enable `brotli_compression` in a rule, you must specify
// `fetch_compressed:false` in the rule.
BrotliCompression ResourceNewParamsOptionsBrotliCompression `json:"brotli_compression,omitzero"`
// Cache expiration time for users browsers in seconds.
//
// Cache expiration time is applied to the following response codes: 200, 201, 204,
// 206, 301, 302, 303, 304, 307, 308.
//
// Responses with other codes will not be cached.
BrowserCacheSettings ResourceNewParamsOptionsBrowserCacheSettings `json:"browser_cache_settings,omitzero"`
// **Legacy option**. Use the `response_headers_hiding_policy` option instead.
//
// HTTP Headers that must be included in the response.
//
// Deprecated: deprecated
CacheHTTPHeaders ResourceNewParamsOptionsCacheHTTPHeaders `json:"cache_http_headers,omitzero"`
// Enables or disables CORS (Cross-Origin Resource Sharing) header support.
//
// CORS header support allows the CDN to add the Access-Control-Allow-Origin header
// to a response to a browser.
Cors ResourceNewParamsOptionsCors `json:"cors,omitzero"`
// Enables control access to content for specified countries.
CountryACL ResourceNewParamsOptionsCountryACL `json:"country_acl,omitzero"`
// **Legacy option**. Use the `edge_cache_settings` option instead.
//
// Allows the complete disabling of content caching.
//
// Deprecated: deprecated
DisableCache ResourceNewParamsOptionsDisableCache `json:"disable_cache,omitzero"`
// Allows 206 responses regardless of the settings of an origin source.
DisableProxyForceRanges ResourceNewParamsOptionsDisableProxyForceRanges `json:"disable_proxy_force_ranges,omitzero"`
// Cache expiration time for CDN servers.
//
// `value` and `default` fields cannot be used simultaneously.
EdgeCacheSettings ResourceNewParamsOptionsEdgeCacheSettings `json:"edge_cache_settings,omitzero"`
// Allows to configure FastEdge app to be called on different request/response
// phases.
//
// Note: At least one of `on_request_headers`, `on_request_body`,
// `on_response_headers`, or `on_response_body` must be specified.
Fastedge ResourceNewParamsOptionsFastedge `json:"fastedge,omitzero"`
// Makes the CDN request compressed content from the origin.
//
// The origin server should support compression. CDN servers will not decompress
// your content even if a user browser does not accept compression.
//
// Notes:
//
// 1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or
// `slice` options enabled.
// 2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If
// you enable it in CDN resource and want to use `gzipON` and
// `brotli_compression` in a rule, you have to specify
// `"fetch_compressed": false` in the rule.
FetchCompressed ResourceNewParamsOptionsFetchCompressed `json:"fetch_compressed,omitzero"`
// Enables redirection from origin. If the origin server returns a redirect, the
// option allows the CDN to pull the requested content from the origin server that
// was returned in the redirect.
FollowOriginRedirect ResourceNewParamsOptionsFollowOriginRedirect `json:"follow_origin_redirect,omitzero"`
// Applies custom HTTP response codes for CDN content.
//
// The following codes are reserved by our system and cannot be specified in this
// option: 408, 444, 477, 494, 495, 496, 497, 499.
ForceReturn ResourceNewParamsOptionsForceReturn `json:"force_return,omitzero"`
// Forwards the Host header from a end-user request to an origin server.
//
// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
ForwardHostHeader ResourceNewParamsOptionsForwardHostHeader `json:"forward_host_header,omitzero"`
// Compresses content with gzip on the CDN end. CDN servers will request only
// uncompressed content from the origin.
//
// Notes:
//
// 1. Compression with gzip is not supported with `fetch_compressed` or `slice`
// options enabled.
// 2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in
// rules. If you enable `fetch_compressed` in CDN resource and want to enable
// `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
GzipOn ResourceNewParamsOptionsGzipOn `json:"gzipOn,omitzero"`
// Sets the Host header that CDN servers use when request content from an origin
// server. Your server must be able to process requests with the chosen header.
//
// If the option is `null`, the Host Header value is equal to first CNAME.
//
// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
HostHeader ResourceNewParamsOptionsHostHeader `json:"hostHeader,omitzero"`
// Enables HTTP/3 protocol for content delivery.
//
// `http3_enabled` option works only with `"sslEnabled": true`.
Http3Enabled ResourceNewParamsOptionsHttp3Enabled `json:"http3_enabled,omitzero"`
// Defines whether the files with the Set-Cookies header are cached as one file or
// as different ones.
IgnoreCookie ResourceNewParamsOptionsIgnoreCookie `json:"ignore_cookie,omitzero"`
// How a file with different query strings is cached: either as one object (option
// is enabled) or as different objects (option is disabled.)
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
IgnoreQueryString ResourceNewParamsOptionsIgnoreQueryString `json:"ignoreQueryString,omitzero"`
// Transforms JPG and PNG images (for example, resize or crop) and automatically
// converts them to WebP or AVIF format.
ImageStack ResourceNewParamsOptionsImageStack `json:"image_stack,omitzero"`
// Controls access to the CDN resource content for specific IP addresses.
//
// If you want to use IPs from our CDN servers IP list for IP ACL configuration,
// you have to independently monitor their relevance. We recommend you use a script
// for automatically update IP ACL.
// [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
IPAddressACL ResourceNewParamsOptionsIPAddressACL `json:"ip_address_acl,omitzero"`
// Allows to control the download speed per connection.
LimitBandwidth ResourceNewParamsOptionsLimitBandwidth `json:"limit_bandwidth,omitzero"`
// Allows you to modify your cache key. If omitted, the default value is
// `$request_uri`.
//
// Combine the specified variables to create a key for caching.
//
// - **$`request_uri`**
// - **$scheme**
// - **$uri**
//
// **Warning**: Enabling and changing this option can invalidate your current cache
// and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will
// not work.
ProxyCacheKey ResourceNewParamsOptionsProxyCacheKey `json:"proxy_cache_key,omitzero"`
// Caching for POST requests along with default GET and HEAD.
ProxyCacheMethodsSet ResourceNewParamsOptionsProxyCacheMethodsSet `json:"proxy_cache_methods_set,omitzero"`
// The time limit for establishing a connection with the origin.
ProxyConnectTimeout ResourceNewParamsOptionsProxyConnectTimeout `json:"proxy_connect_timeout,omitzero"`
// The time limit for receiving a partial response from the origin. If no response
// is received within this time, the connection will be closed.
//
// **Note:** When used with a WebSocket connection, this option supports values
// only in the range 1–20 seconds (instead of the usual 1–30 seconds).
ProxyReadTimeout ResourceNewParamsOptionsProxyReadTimeout `json:"proxy_read_timeout,omitzero"`
// Files with the specified query parameters are cached as one object, files with
// other parameters are cached as different objects.
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
QueryParamsBlacklist ResourceNewParamsOptionsQueryParamsBlacklist `json:"query_params_blacklist,omitzero"`
// Files with the specified query parameters are cached as different objects, files
// with other parameters are cached as one object.
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
QueryParamsWhitelist ResourceNewParamsOptionsQueryParamsWhitelist `json:"query_params_whitelist,omitzero"`
// The Query String Forwarding feature allows for the seamless transfer of
// parameters embedded in playlist files to the corresponding media chunk files.
// This functionality ensures that specific attributes, such as authentication
// tokens or tracking information, are consistently passed along from the playlist
// manifest to the individual media segments. This is particularly useful for
// maintaining continuity in security, analytics, and any other parameter-based
// operations across the entire media delivery workflow.
QueryStringForwarding ResourceNewParamsOptionsQueryStringForwarding `json:"query_string_forwarding,omitzero"`
// Enables redirect from HTTP to HTTPS.
//
// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
// simultaneously.
RedirectHTTPToHTTPS ResourceNewParamsOptionsRedirectHTTPToHTTPS `json:"redirect_http_to_https,omitzero"`
// Enables redirect from HTTPS to HTTP.
//
// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
// simultaneously.
RedirectHTTPSToHTTP ResourceNewParamsOptionsRedirectHTTPSToHTTP `json:"redirect_https_to_http,omitzero"`
// Controls access to the CDN resource content for specified domain names.
ReferrerACL ResourceNewParamsOptionsReferrerACL `json:"referrer_acl,omitzero"`
// Option allows to limit the amount of HTTP requests.
RequestLimiter ResourceNewParamsOptionsRequestLimiter `json:"request_limiter,omitzero"`
// Hides HTTP headers from an origin server in the CDN response.
ResponseHeadersHidingPolicy ResourceNewParamsOptionsResponseHeadersHidingPolicy `json:"response_headers_hiding_policy,omitzero"`
// Changes and redirects requests from the CDN to the origin. It operates according
// to the
// [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite)
// configuration.
Rewrite ResourceNewParamsOptionsRewrite `json:"rewrite,omitzero"`
// Configures access with tokenized URLs. This makes impossible to access content
// without a valid (unexpired) token.
SecureKey ResourceNewParamsOptionsSecureKey `json:"secure_key,omitzero"`
// Requests and caches files larger than 10 MB in parts (no larger than 10 MB per
// part.) This reduces time to first byte.
//
// The option is based on the
// [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
//
// Notes:
//
// 1. Origin must support HTTP Range requests.
// 2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed`
// options enabled.
Slice ResourceNewParamsOptionsSlice `json:"slice,omitzero"`
// The hostname that is added to SNI requests from CDN servers to the origin server
// via HTTPS.
//
// SNI is generally only required if your origin uses shared hosting or does not
// have a dedicated IP address. If the origin server presents multiple
// certificates, SNI allows the origin server to know which certificate to use for
// the connection.
//
// The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
Sni ResourceNewParamsOptionsSni `json:"sni,omitzero"`
// Serves stale cached content in case of origin unavailability.
Stale ResourceNewParamsOptionsStale `json:"stale,omitzero"`
// Custom HTTP Headers that a CDN server adds to a response.
StaticResponseHeaders ResourceNewParamsOptionsStaticResponseHeaders `json:"static_response_headers,omitzero"`
// **Legacy option**. Use the `static_response_headers` option instead.
//
// Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP
// Headers can be specified. May contain a header with multiple values.
//
// Deprecated: deprecated
StaticHeaders ResourceNewParamsOptionsStaticHeaders `json:"staticHeaders,omitzero"`
// Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP
// Headers can be specified.
StaticRequestHeaders ResourceNewParamsOptionsStaticRequestHeaders `json:"staticRequestHeaders,omitzero"`
// List of SSL/TLS protocol versions allowed for HTTPS connections from end users
// to the domain.
//
// When the option is disabled, all protocols versions are allowed.
TlsVersions ResourceNewParamsOptionsTlsVersions `json:"tls_versions,omitzero"`
// Let's Encrypt certificate chain.
//
// The specified chain will be used during the next Let's Encrypt certificate issue
// or renewal.
UseDefaultLeChain ResourceNewParamsOptionsUseDefaultLeChain `json:"use_default_le_chain,omitzero"`
// DNS-01 challenge to issue a Let's Encrypt certificate for the resource.
//
// DNS service should be activated to enable this option.
UseDns01LeChallenge ResourceNewParamsOptionsUseDns01LeChallenge `json:"use_dns01_le_challenge,omitzero"`
// RSA Let's Encrypt certificate type for the CDN resource.
//
// The specified value will be used during the next Let's Encrypt certificate issue
// or renewal.
UseRsaLeCert ResourceNewParamsOptionsUseRsaLeCert `json:"use_rsa_le_cert,omitzero"`
// Controls access to the content for specified User-Agents.
UserAgentACL ResourceNewParamsOptionsUserAgentACL `json:"user_agent_acl,omitzero"`
// Allows to enable WAAP (Web Application and API Protection).
Waap ResourceNewParamsOptionsWaap `json:"waap,omitzero"`
// Enables or disables WebSockets connections to an origin server.
Websockets ResourceNewParamsOptionsWebsockets `json:"websockets,omitzero"`
// contains filtered or unexported fields
}
List of options that can be configured for the CDN resource.
In case of `null` value the option is not added to the CDN resource. Option may inherit its value from the global account settings.
func (ResourceNewParamsOptions) MarshalJSON ¶
func (r ResourceNewParamsOptions) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptions) UnmarshalJSON ¶
func (r *ResourceNewParamsOptions) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsAllowedHTTPMethods ¶
type ResourceNewParamsOptionsAllowedHTTPMethods struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
HTTP methods allowed for content requests from the CDN.
The properties Enabled, Value are required.
func (ResourceNewParamsOptionsAllowedHTTPMethods) MarshalJSON ¶
func (r ResourceNewParamsOptionsAllowedHTTPMethods) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsAllowedHTTPMethods) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsAllowedHTTPMethods) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsBotProtection ¶
type ResourceNewParamsOptionsBotProtection struct {
// Controls the bot challenge module state.
BotChallenge ResourceNewParamsOptionsBotProtectionBotChallenge `json:"bot_challenge,omitzero,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// contains filtered or unexported fields
}
Allows to prevent online services from overloading and ensure your business workflow running smoothly.
The properties BotChallenge, Enabled are required.
func (ResourceNewParamsOptionsBotProtection) MarshalJSON ¶
func (r ResourceNewParamsOptionsBotProtection) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsBotProtection) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsBotProtection) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsBotProtectionBotChallenge ¶
type ResourceNewParamsOptionsBotProtectionBotChallenge struct {
// Possible values:
//
// - **true** - Bot challenge is enabled.
// - **false** - Bot challenge is disabled.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// contains filtered or unexported fields
}
Controls the bot challenge module state.
func (ResourceNewParamsOptionsBotProtectionBotChallenge) MarshalJSON ¶
func (r ResourceNewParamsOptionsBotProtectionBotChallenge) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsBotProtectionBotChallenge) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsBotProtectionBotChallenge) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsBrotliCompression ¶
type ResourceNewParamsOptionsBrotliCompression struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Allows to select the content types you want to compress.
//
// `text/html` is a mandatory content type.
//
// Any of "application/javascript", "application/json",
// "application/vnd.ms-fontobject", "application/wasm", "application/x-font-ttf",
// "application/x-javascript", "application/xml", "application/xml+rss",
// "image/svg+xml", "image/x-icon", "text/css", "text/html", "text/javascript",
// "text/plain", "text/xml".
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Compresses content with Brotli on the CDN side. CDN servers will request only uncompressed content from the origin.
Notes:
- CDN only supports "Brotli compression" when the "origin shielding" feature is activated.
- If a precache server is not active for a CDN resource, no compression occurs, even if the option is enabled.
- `brotli_compression` is not supported with `fetch_compressed` or `slice` options enabled.
- `fetch_compressed` option in CDN resource settings overrides `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN resource and want to enable `brotli_compression` in a rule, you must specify `fetch_compressed:false` in the rule.
The properties Enabled, Value are required.
func (ResourceNewParamsOptionsBrotliCompression) MarshalJSON ¶
func (r ResourceNewParamsOptionsBrotliCompression) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsBrotliCompression) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsBrotliCompression) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsBrowserCacheSettings ¶
type ResourceNewParamsOptionsBrowserCacheSettings struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Set the cache expiration time to '0s' to disable caching.
//
// The maximum duration is any equivalent to `1y`.
Value string `json:"value,required" format:"nginx time"`
// contains filtered or unexported fields
}
Cache expiration time for users browsers in seconds.
Cache expiration time is applied to the following response codes: 200, 201, 204, 206, 301, 302, 303, 304, 307, 308.
Responses with other codes will not be cached.
The properties Enabled, Value are required.
func (ResourceNewParamsOptionsBrowserCacheSettings) MarshalJSON ¶
func (r ResourceNewParamsOptionsBrowserCacheSettings) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsBrowserCacheSettings) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsBrowserCacheSettings) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsCacheHTTPHeaders
deprecated
type ResourceNewParamsOptionsCacheHTTPHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
**Legacy option**. Use the `response_headers_hiding_policy` option instead.
HTTP Headers that must be included in the response.
Deprecated: deprecated
The properties Enabled, Value are required.
func (ResourceNewParamsOptionsCacheHTTPHeaders) MarshalJSON ¶
func (r ResourceNewParamsOptionsCacheHTTPHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsCacheHTTPHeaders) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsCacheHTTPHeaders) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsCors ¶
type ResourceNewParamsOptionsCors struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Value of the Access-Control-Allow-Origin header.
//
// Possible values:
//
// - **Adds \* as the Access-Control-Allow-Origin header value** - Content will be
// uploaded for requests from any domain. `"value": ["*"]`
// - **Adds "$http_origin" as the Access-Control-Allow-Origin header value if the
// origin matches one of the listed domains** - Content will be uploaded only for
// requests from the domains specified in the field.
// `"value": ["domain.com", "second.dom.com"]`
// - **Adds "$http_origin" as the Access-Control-Allow-Origin header value** -
// Content will be uploaded for requests from any domain, and the domain from
// which the request was sent will be added to the "Access-Control-Allow-Origin"
// header in the response. `"value": ["$http_origin"]`
Value []string `json:"value,omitzero,required"`
// Defines whether the Access-Control-Allow-Origin header should be added to a
// response from CDN regardless of response code.
//
// Possible values:
//
// - **true** - Header will be added to a response regardless of response code.
// - **false** - Header will only be added to responses with codes: 200, 201, 204,
// 206, 301, 302, 303, 304, 307, 308.
Always param.Opt[bool] `json:"always,omitzero"`
// contains filtered or unexported fields
}
Enables or disables CORS (Cross-Origin Resource Sharing) header support.
CORS header support allows the CDN to add the Access-Control-Allow-Origin header to a response to a browser.
The properties Enabled, Value are required.
func (ResourceNewParamsOptionsCors) MarshalJSON ¶
func (r ResourceNewParamsOptionsCors) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsCors) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsCors) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsCountryACL ¶
type ResourceNewParamsOptionsCountryACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of countries according to ISO-3166-1.
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of countries for which access is prohibited.
// - **deny** - List of countries for which access is allowed.
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"country-code"`
// Defines the type of CDN resource access policy.
//
// Possible values:
//
// - **allow** - Access is allowed for all the countries except for those specified
// in `excepted_values` field.
// - **deny** - Access is denied for all the countries except for those specified
// in `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Enables control access to content for specified countries.
The properties Enabled, ExceptedValues, PolicyType are required.
func (ResourceNewParamsOptionsCountryACL) MarshalJSON ¶
func (r ResourceNewParamsOptionsCountryACL) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsCountryACL) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsCountryACL) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsDisableCache
deprecated
type ResourceNewParamsOptionsDisableCache struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - content caching is disabled.
// - **false** - content caching is enabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
**Legacy option**. Use the `edge_cache_settings` option instead.
Allows the complete disabling of content caching.
Deprecated: deprecated
The properties Enabled, Value are required.
func (ResourceNewParamsOptionsDisableCache) MarshalJSON ¶
func (r ResourceNewParamsOptionsDisableCache) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsDisableCache) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsDisableCache) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsDisableProxyForceRanges ¶
type ResourceNewParamsOptionsDisableProxyForceRanges struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Allows 206 responses regardless of the settings of an origin source.
The properties Enabled, Value are required.
func (ResourceNewParamsOptionsDisableProxyForceRanges) MarshalJSON ¶
func (r ResourceNewParamsOptionsDisableProxyForceRanges) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsDisableProxyForceRanges) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsDisableProxyForceRanges) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsEdgeCacheSettings ¶
type ResourceNewParamsOptionsEdgeCacheSettings struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Enables content caching according to the origin cache settings.
//
// The value is applied to the following response codes 200, 201, 204, 206, 301,
// 302, 303, 304, 307, 308, if an origin server does not have caching HTTP headers.
//
// Responses with other codes will not be cached.
//
// The maximum duration is any equivalent to `1y`.
Default param.Opt[string] `json:"default,omitzero" format:"nginx time"`
// Caching time.
//
// The value is applied to the following response codes: 200, 206, 301, 302.
// Responses with codes 4xx, 5xx will not be cached.
//
// Use `0s` to disable caching.
//
// The maximum duration is any equivalent to `1y`.
Value param.Opt[string] `json:"value,omitzero" format:"nginx time"`
// A MAP object representing the caching time in seconds for a response with a
// specific response code.
//
// These settings have a higher priority than the `value` field.
//
// - Use `any` key to specify caching time for all response codes.
// - Use `0s` value to disable caching for a specific response code.
CustomValues map[string]string `json:"custom_values,omitzero" format:"nginx time"`
// contains filtered or unexported fields
}
Cache expiration time for CDN servers.
`value` and `default` fields cannot be used simultaneously.
The property Enabled is required.
func (ResourceNewParamsOptionsEdgeCacheSettings) MarshalJSON ¶
func (r ResourceNewParamsOptionsEdgeCacheSettings) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsEdgeCacheSettings) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsEdgeCacheSettings) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsFastedge ¶
type ResourceNewParamsOptionsFastedge struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Allows to configure FastEdge application that will be called to handle request
// body as soon as CDN receives incoming HTTP request.
OnRequestBody ResourceNewParamsOptionsFastedgeOnRequestBody `json:"on_request_body,omitzero"`
// Allows to configure FastEdge application that will be called to handle request
// headers as soon as CDN receives incoming HTTP request.
OnRequestHeaders ResourceNewParamsOptionsFastedgeOnRequestHeaders `json:"on_request_headers,omitzero"`
// Allows to configure FastEdge application that will be called to handle response
// body before CDN sends the HTTP response.
OnResponseBody ResourceNewParamsOptionsFastedgeOnResponseBody `json:"on_response_body,omitzero"`
// Allows to configure FastEdge application that will be called to handle response
// headers before CDN sends the HTTP response.
OnResponseHeaders ResourceNewParamsOptionsFastedgeOnResponseHeaders `json:"on_response_headers,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge app to be called on different request/response phases.
Note: At least one of `on_request_headers`, `on_request_body`, `on_response_headers`, or `on_response_body` must be specified.
The property Enabled is required.
func (ResourceNewParamsOptionsFastedge) MarshalJSON ¶
func (r ResourceNewParamsOptionsFastedge) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsFastedge) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsFastedge) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsFastedgeOnRequestBody ¶
type ResourceNewParamsOptionsFastedgeOnRequestBody struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle request body as soon as CDN receives incoming HTTP request.
The property AppID is required.
func (ResourceNewParamsOptionsFastedgeOnRequestBody) MarshalJSON ¶
func (r ResourceNewParamsOptionsFastedgeOnRequestBody) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsFastedgeOnRequestBody) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsFastedgeOnRequestBody) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsFastedgeOnRequestHeaders ¶
type ResourceNewParamsOptionsFastedgeOnRequestHeaders struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request.
The property AppID is required.
func (ResourceNewParamsOptionsFastedgeOnRequestHeaders) MarshalJSON ¶
func (r ResourceNewParamsOptionsFastedgeOnRequestHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsFastedgeOnResponseBody ¶
type ResourceNewParamsOptionsFastedgeOnResponseBody struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle response body before CDN sends the HTTP response.
The property AppID is required.
func (ResourceNewParamsOptionsFastedgeOnResponseBody) MarshalJSON ¶
func (r ResourceNewParamsOptionsFastedgeOnResponseBody) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsFastedgeOnResponseBody) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsFastedgeOnResponseBody) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsFastedgeOnResponseHeaders ¶
type ResourceNewParamsOptionsFastedgeOnResponseHeaders struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle response headers before CDN sends the HTTP response.
The property AppID is required.
func (ResourceNewParamsOptionsFastedgeOnResponseHeaders) MarshalJSON ¶
func (r ResourceNewParamsOptionsFastedgeOnResponseHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsFastedgeOnResponseHeaders) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsFastedgeOnResponseHeaders) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsFetchCompressed ¶
type ResourceNewParamsOptionsFetchCompressed struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Makes the CDN request compressed content from the origin.
The origin server should support compression. CDN servers will not decompress your content even if a user browser does not accept compression.
Notes:
- `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or `slice` options enabled.
- `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If you enable it in CDN resource and want to use `gzipON` and `brotli_compression` in a rule, you have to specify `"fetch_compressed": false` in the rule.
The properties Enabled, Value are required.
func (ResourceNewParamsOptionsFetchCompressed) MarshalJSON ¶
func (r ResourceNewParamsOptionsFetchCompressed) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsFetchCompressed) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsFetchCompressed) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsFollowOriginRedirect ¶
type ResourceNewParamsOptionsFollowOriginRedirect struct {
// Redirect status code that the origin server returns.
//
// To serve up to date content to end users, you will need to purge the cache after
// managing the option.
//
// Any of 301, 302, 303, 307, 308.
Codes []int64 `json:"codes,omitzero,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// contains filtered or unexported fields
}
Enables redirection from origin. If the origin server returns a redirect, the option allows the CDN to pull the requested content from the origin server that was returned in the redirect.
The properties Codes, Enabled are required.
func (ResourceNewParamsOptionsFollowOriginRedirect) MarshalJSON ¶
func (r ResourceNewParamsOptionsFollowOriginRedirect) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsFollowOriginRedirect) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsFollowOriginRedirect) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsForceReturn ¶
type ResourceNewParamsOptionsForceReturn struct {
// URL for redirection or text.
Body string `json:"body,required"`
// Status code value.
Code int64 `json:"code,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Controls the time at which a custom HTTP response code should be applied. By
// default, a custom HTTP response code is applied at any time.
TimeInterval ResourceNewParamsOptionsForceReturnTimeInterval `json:"time_interval,omitzero"`
// contains filtered or unexported fields
}
Applies custom HTTP response codes for CDN content.
The following codes are reserved by our system and cannot be specified in this option: 408, 444, 477, 494, 495, 496, 497, 499.
The properties Body, Code, Enabled are required.
func (ResourceNewParamsOptionsForceReturn) MarshalJSON ¶
func (r ResourceNewParamsOptionsForceReturn) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsForceReturn) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsForceReturn) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsForceReturnTimeInterval ¶
type ResourceNewParamsOptionsForceReturnTimeInterval struct {
// Time until which a custom HTTP response code should be applied. Indicated in
// 24-hour format.
EndTime string `json:"end_time,required"`
// Time from which a custom HTTP response code should be applied. Indicated in
// 24-hour format.
StartTime string `json:"start_time,required"`
// Time zone used to calculate time.
TimeZone param.Opt[string] `json:"time_zone,omitzero" format:"timezone"`
// contains filtered or unexported fields
}
Controls the time at which a custom HTTP response code should be applied. By default, a custom HTTP response code is applied at any time.
The properties EndTime, StartTime are required.
func (ResourceNewParamsOptionsForceReturnTimeInterval) MarshalJSON ¶
func (r ResourceNewParamsOptionsForceReturnTimeInterval) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsForceReturnTimeInterval) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsForceReturnTimeInterval) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsForwardHostHeader ¶
type ResourceNewParamsOptionsForwardHostHeader struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Forwards the Host header from a end-user request to an origin server.
`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceNewParamsOptionsForwardHostHeader) MarshalJSON ¶
func (r ResourceNewParamsOptionsForwardHostHeader) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsForwardHostHeader) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsForwardHostHeader) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsGzipOn ¶
type ResourceNewParamsOptionsGzipOn struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Compresses content with gzip on the CDN end. CDN servers will request only uncompressed content from the origin.
Notes:
- Compression with gzip is not supported with `fetch_compressed` or `slice` options enabled.
- `fetch_compressed` option in CDN resource settings overrides `gzipON` in rules. If you enable `fetch_compressed` in CDN resource and want to enable `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
The properties Enabled, Value are required.
func (ResourceNewParamsOptionsGzipOn) MarshalJSON ¶
func (r ResourceNewParamsOptionsGzipOn) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsGzipOn) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsGzipOn) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsHostHeader ¶
type ResourceNewParamsOptionsHostHeader struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Host Header value.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
Sets the Host header that CDN servers use when request content from an origin server. Your server must be able to process requests with the chosen header.
If the option is `null`, the Host Header value is equal to first CNAME.
`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceNewParamsOptionsHostHeader) MarshalJSON ¶
func (r ResourceNewParamsOptionsHostHeader) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsHostHeader) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsHostHeader) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsHttp3Enabled ¶
type ResourceNewParamsOptionsHttp3Enabled struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Enables HTTP/3 protocol for content delivery.
`http3_enabled` option works only with `"sslEnabled": true`.
The properties Enabled, Value are required.
func (ResourceNewParamsOptionsHttp3Enabled) MarshalJSON ¶
func (r ResourceNewParamsOptionsHttp3Enabled) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsHttp3Enabled) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsHttp3Enabled) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsIPAddressACL ¶
type ResourceNewParamsOptionsIPAddressACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of IP addresses with a subnet mask.
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of IP addresses for which access is prohibited.
// - **deny** - List of IP addresses for which access is allowed.
//
// Examples:
//
// - `192.168.3.2/32`
// - `2a03:d000:2980:7::8/128`
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"ipv4net or ipv6net"`
// IP access policy type.
//
// Possible values:
//
// - **allow** - Allow access to all IPs except IPs specified in "excepted_values"
// field.
// - **deny** - Deny access to all IPs except IPs specified in "excepted_values"
// field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Controls access to the CDN resource content for specific IP addresses.
If you want to use IPs from our CDN servers IP list for IP ACL configuration, you have to independently monitor their relevance. We recommend you use a script for automatically update IP ACL. [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
The properties Enabled, ExceptedValues, PolicyType are required.
func (ResourceNewParamsOptionsIPAddressACL) MarshalJSON ¶
func (r ResourceNewParamsOptionsIPAddressACL) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsIPAddressACL) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsIPAddressACL) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsIgnoreCookie ¶
type ResourceNewParamsOptionsIgnoreCookie struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled, files with cookies are cached as one file.
// - **false** - Option is disabled, files with cookies are cached as different
// files.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Defines whether the files with the Set-Cookies header are cached as one file or as different ones.
The properties Enabled, Value are required.
func (ResourceNewParamsOptionsIgnoreCookie) MarshalJSON ¶
func (r ResourceNewParamsOptionsIgnoreCookie) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsIgnoreCookie) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsIgnoreCookie) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsIgnoreQueryString ¶
type ResourceNewParamsOptionsIgnoreQueryString struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
How a file with different query strings is cached: either as one object (option is enabled) or as different objects (option is disabled.)
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceNewParamsOptionsIgnoreQueryString) MarshalJSON ¶
func (r ResourceNewParamsOptionsIgnoreQueryString) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsIgnoreQueryString) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsIgnoreQueryString) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsImageStack ¶
type ResourceNewParamsOptionsImageStack struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Enables or disables automatic conversion of JPEG and PNG images to AVI format.
AvifEnabled param.Opt[bool] `json:"avif_enabled,omitzero"`
// Enables or disables compression without quality loss for PNG format.
PngLossless param.Opt[bool] `json:"png_lossless,omitzero"`
// Defines quality settings for JPG and PNG images. The higher the value, the
// better the image quality, and the larger the file size after conversion.
Quality param.Opt[int64] `json:"quality,omitzero"`
// Enables or disables automatic conversion of JPEG and PNG images to WebP format.
WebpEnabled param.Opt[bool] `json:"webp_enabled,omitzero"`
// contains filtered or unexported fields
}
Transforms JPG and PNG images (for example, resize or crop) and automatically converts them to WebP or AVIF format.
The property Enabled is required.
func (ResourceNewParamsOptionsImageStack) MarshalJSON ¶
func (r ResourceNewParamsOptionsImageStack) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsImageStack) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsImageStack) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsLimitBandwidth ¶
type ResourceNewParamsOptionsLimitBandwidth struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Method of controlling the download speed per connection.
//
// Possible values:
//
// - **static** - Use speed and buffer fields to set the download speed limit.
// - **dynamic** - Use query strings **speed** and **buffer** to set the download
// speed limit.
//
// # For example, when requesting content at the link
//
// “`
// http://cdn.example.com/video.mp4?speed=50k&buffer=500k
// “`
//
// the download speed will be limited to 50kB/s after 500 kB.
//
// Any of "static", "dynamic".
LimitType string `json:"limit_type,omitzero,required"`
// Amount of downloaded data after which the user will be rate limited.
Buffer param.Opt[int64] `json:"buffer,omitzero"`
// Maximum download speed per connection.
Speed param.Opt[int64] `json:"speed,omitzero"`
// contains filtered or unexported fields
}
Allows to control the download speed per connection.
The properties Enabled, LimitType are required.
func (ResourceNewParamsOptionsLimitBandwidth) MarshalJSON ¶
func (r ResourceNewParamsOptionsLimitBandwidth) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsLimitBandwidth) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsLimitBandwidth) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsProxyCacheKey ¶
type ResourceNewParamsOptionsProxyCacheKey struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Key for caching.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
Allows you to modify your cache key. If omitted, the default value is `$request_uri`.
Combine the specified variables to create a key for caching.
- **$`request_uri`** - **$scheme** - **$uri**
**Warning**: Enabling and changing this option can invalidate your current cache and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will not work.
The properties Enabled, Value are required.
func (ResourceNewParamsOptionsProxyCacheKey) MarshalJSON ¶
func (r ResourceNewParamsOptionsProxyCacheKey) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsProxyCacheKey) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsProxyCacheKey) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsProxyCacheMethodsSet ¶
type ResourceNewParamsOptionsProxyCacheMethodsSet struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Caching for POST requests along with default GET and HEAD.
The properties Enabled, Value are required.
func (ResourceNewParamsOptionsProxyCacheMethodsSet) MarshalJSON ¶
func (r ResourceNewParamsOptionsProxyCacheMethodsSet) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsProxyCacheMethodsSet) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsProxyCacheMethodsSet) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsProxyConnectTimeout ¶
type ResourceNewParamsOptionsProxyConnectTimeout struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Timeout value in seconds.
//
// Supported range: **1s - 5s**.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
The time limit for establishing a connection with the origin.
The properties Enabled, Value are required.
func (ResourceNewParamsOptionsProxyConnectTimeout) MarshalJSON ¶
func (r ResourceNewParamsOptionsProxyConnectTimeout) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsProxyConnectTimeout) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsProxyConnectTimeout) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsProxyReadTimeout ¶
type ResourceNewParamsOptionsProxyReadTimeout struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Timeout value in seconds.
//
// Supported range: **1s - 30s**.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
The time limit for receiving a partial response from the origin. If no response is received within this time, the connection will be closed.
**Note:** When used with a WebSocket connection, this option supports values only in the range 1–20 seconds (instead of the usual 1–30 seconds).
The properties Enabled, Value are required.
func (ResourceNewParamsOptionsProxyReadTimeout) MarshalJSON ¶
func (r ResourceNewParamsOptionsProxyReadTimeout) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsProxyReadTimeout) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsProxyReadTimeout) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsQueryParamsBlacklist ¶
type ResourceNewParamsOptionsQueryParamsBlacklist struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of query parameters.
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Files with the specified query parameters are cached as one object, files with other parameters are cached as different objects.
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceNewParamsOptionsQueryParamsBlacklist) MarshalJSON ¶
func (r ResourceNewParamsOptionsQueryParamsBlacklist) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsQueryParamsBlacklist) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsQueryParamsBlacklist) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsQueryParamsWhitelist ¶
type ResourceNewParamsOptionsQueryParamsWhitelist struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of query parameters.
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Files with the specified query parameters are cached as different objects, files with other parameters are cached as one object.
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceNewParamsOptionsQueryParamsWhitelist) MarshalJSON ¶
func (r ResourceNewParamsOptionsQueryParamsWhitelist) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsQueryParamsWhitelist) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsQueryParamsWhitelist) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsQueryStringForwarding ¶
type ResourceNewParamsOptionsQueryStringForwarding struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// The `forward_from_files_types` field specifies the types of playlist files from
// which parameters will be extracted and forwarded. This typically includes
// formats that list multiple media chunk references, such as HLS and DASH
// playlists. Parameters associated with these playlist files (like query strings
// or headers) will be propagated to the chunks they reference.
ForwardFromFileTypes []string `json:"forward_from_file_types,omitzero,required"`
// The field specifies the types of media chunk files to which parameters,
// extracted from playlist files, will be forwarded. These refer to the actual
// segments of media content that are delivered to viewers. Ensuring the correct
// parameters are forwarded to these files is crucial for maintaining the integrity
// of the streaming session.
ForwardToFileTypes []string `json:"forward_to_file_types,omitzero,required"`
// The `forward_except_keys` field provides a mechanism to exclude specific
// parameters from being forwarded from playlist files to media chunk files. By
// listing certain keys in this field, you can ensure that these parameters are
// omitted during the forwarding process. This is particularly useful for
// preventing sensitive or irrelevant information from being included in requests
// for media chunks, thereby enhancing security and optimizing performance.
ForwardExceptKeys []string `json:"forward_except_keys,omitzero"`
// The `forward_only_keys` field allows for granular control over which specific
// parameters are forwarded from playlist files to media chunk files. By specifying
// certain keys, only those parameters will be propagated, ensuring that only
// relevant information is passed along. This is particularly useful for security
// and performance optimization, as it prevents unnecessary or sensitive data from
// being included in requests for media chunks.
ForwardOnlyKeys []string `json:"forward_only_keys,omitzero"`
// contains filtered or unexported fields
}
The Query String Forwarding feature allows for the seamless transfer of parameters embedded in playlist files to the corresponding media chunk files. This functionality ensures that specific attributes, such as authentication tokens or tracking information, are consistently passed along from the playlist manifest to the individual media segments. This is particularly useful for maintaining continuity in security, analytics, and any other parameter-based operations across the entire media delivery workflow.
The properties Enabled, ForwardFromFileTypes, ForwardToFileTypes are required.
func (ResourceNewParamsOptionsQueryStringForwarding) MarshalJSON ¶
func (r ResourceNewParamsOptionsQueryStringForwarding) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsQueryStringForwarding) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsQueryStringForwarding) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsRedirectHTTPSToHTTP ¶
type ResourceNewParamsOptionsRedirectHTTPSToHTTP struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Enables redirect from HTTPS to HTTP.
`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceNewParamsOptionsRedirectHTTPSToHTTP) MarshalJSON ¶
func (r ResourceNewParamsOptionsRedirectHTTPSToHTTP) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsRedirectHTTPSToHTTP) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsRedirectHTTPSToHTTP) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsRedirectHTTPToHTTPS ¶
type ResourceNewParamsOptionsRedirectHTTPToHTTPS struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Enables redirect from HTTP to HTTPS.
`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceNewParamsOptionsRedirectHTTPToHTTPS) MarshalJSON ¶
func (r ResourceNewParamsOptionsRedirectHTTPToHTTPS) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsRedirectHTTPToHTTPS) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsRedirectHTTPToHTTPS) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsReferrerACL ¶
type ResourceNewParamsOptionsReferrerACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of domain names or wildcard domains (without protocol: `http://` or
// `https://`.)
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of domain names for which access is prohibited.
// - **deny** - List of IP domain names for which access is allowed.
//
// Examples:
//
// - `example.com`
// - `*.example.com`
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"domain or wildcard"`
// Policy type.
//
// Possible values:
//
// - **allow** - Allow access to all domain names except the domain names specified
// in `excepted_values` field.
// - **deny** - Deny access to all domain names except the domain names specified
// in `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Controls access to the CDN resource content for specified domain names.
The properties Enabled, ExceptedValues, PolicyType are required.
func (ResourceNewParamsOptionsReferrerACL) MarshalJSON ¶
func (r ResourceNewParamsOptionsReferrerACL) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsReferrerACL) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsReferrerACL) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsRequestLimiter ¶
type ResourceNewParamsOptionsRequestLimiter struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Maximum request rate.
Rate int64 `json:"rate,required"`
// Units of measurement for the `rate` field.
//
// Possible values:
//
// - **r/s** - Requests per second.
// - **r/m** - Requests per minute.
//
// If the rate is less than one request per second, it is specified in request per
// minute (r/m.)
//
// Any of "r/s", "r/m".
RateUnit string `json:"rate_unit,omitzero"`
// contains filtered or unexported fields
}
Option allows to limit the amount of HTTP requests.
The properties Enabled, Rate are required.
func (ResourceNewParamsOptionsRequestLimiter) MarshalJSON ¶
func (r ResourceNewParamsOptionsRequestLimiter) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsRequestLimiter) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsRequestLimiter) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsResponseHeadersHidingPolicy ¶
type ResourceNewParamsOptionsResponseHeadersHidingPolicy struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of HTTP headers.
//
// Parameter meaning depends on the value of the `mode` field:
//
// - **show** - List of HTTP headers to hide from response.
// - **hide** - List of HTTP headers to include in response. Other HTTP headers
// will be hidden.
//
// The following headers are required and cannot be hidden from response:
//
// - `Connection`
// - `Content-Length`
// - `Content-Type`
// - `Date`
// - `Server`
Excepted []string `json:"excepted,omitzero,required" format:"http_header"`
// How HTTP headers are hidden from the response.
//
// Possible values:
//
// - **show** - Hide only HTTP headers listed in the `excepted` field.
// - **hide** - Hide all HTTP headers except headers listed in the "excepted"
// field.
//
// Any of "hide", "show".
Mode string `json:"mode,omitzero,required"`
// contains filtered or unexported fields
}
Hides HTTP headers from an origin server in the CDN response.
The properties Enabled, Excepted, Mode are required.
func (ResourceNewParamsOptionsResponseHeadersHidingPolicy) MarshalJSON ¶
func (r ResourceNewParamsOptionsResponseHeadersHidingPolicy) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsResponseHeadersHidingPolicy) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsResponseHeadersHidingPolicy) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsRewrite ¶
type ResourceNewParamsOptionsRewrite struct {
// Path for the Rewrite option.
//
// Example:
//
// - `/(.*) /media/$1`
Body string `json:"body,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Flag for the Rewrite option.
//
// Possible values:
//
// - **last** - Stop processing the current set of `ngx_http_rewrite_module`
// directives and start a search for a new location matching changed URI.
// - **break** - Stop processing the current set of the Rewrite option.
// - **redirect** - Return a temporary redirect with the 302 code; used when a
// replacement string does not start with `http://`, `https://`, or `$scheme`.
// - **permanent** - Return a permanent redirect with the 301 code.
//
// Any of "break", "last", "redirect", "permanent".
Flag string `json:"flag,omitzero"`
// contains filtered or unexported fields
}
Changes and redirects requests from the CDN to the origin. It operates according to the [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite) configuration.
The properties Body, Enabled are required.
func (ResourceNewParamsOptionsRewrite) MarshalJSON ¶
func (r ResourceNewParamsOptionsRewrite) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsRewrite) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsRewrite) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsSecureKey ¶
type ResourceNewParamsOptionsSecureKey struct {
// Key generated on your side that will be used for URL signing.
Key param.Opt[string] `json:"key,omitzero,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Type of URL signing.
//
// Possible types:
//
// - **Type 0** - Includes end user IP to secure token generation.
// - **Type 2** - Excludes end user IP from secure token generation.
//
// Any of 0, 2.
Type int64 `json:"type,omitzero"`
// contains filtered or unexported fields
}
Configures access with tokenized URLs. This makes impossible to access content without a valid (unexpired) token.
The properties Enabled, Key are required.
func (ResourceNewParamsOptionsSecureKey) MarshalJSON ¶
func (r ResourceNewParamsOptionsSecureKey) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsSecureKey) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsSecureKey) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsSlice ¶
type ResourceNewParamsOptionsSlice struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Requests and caches files larger than 10 MB in parts (no larger than 10 MB per part.) This reduces time to first byte.
The option is based on the [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
Notes:
- Origin must support HTTP Range requests.
- Not supported with `gzipON`, `brotli_compression` or `fetch_compressed` options enabled.
The properties Enabled, Value are required.
func (ResourceNewParamsOptionsSlice) MarshalJSON ¶
func (r ResourceNewParamsOptionsSlice) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsSlice) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsSlice) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsSni ¶
type ResourceNewParamsOptionsSni struct {
// Custom SNI hostname.
//
// It is required if `sni_type` is set to custom.
CustomHostname string `json:"custom_hostname,required" format:"domain"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// SNI (Server Name Indication) type.
//
// Possible values:
//
// - **dynamic** - SNI hostname depends on `hostHeader` and `forward_host_header`
// options. It has several possible combinations:
// - If the `hostHeader` option is enabled and specified, SNI hostname matches the
// Host header.
// - If the `forward_host_header` option is enabled and has true value, SNI
// hostname matches the Host header used in the request made to a CDN.
// - If the `hostHeader` and `forward_host_header` options are disabled, SNI
// hostname matches the primary CNAME.
// - **custom** - custom SNI hostname is in use.
//
// Any of "dynamic", "custom".
SniType string `json:"sni_type,omitzero"`
// contains filtered or unexported fields
}
The hostname that is added to SNI requests from CDN servers to the origin server via HTTPS.
SNI is generally only required if your origin uses shared hosting or does not have a dedicated IP address. If the origin server presents multiple certificates, SNI allows the origin server to know which certificate to use for the connection.
The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
The properties CustomHostname, Enabled are required.
func (ResourceNewParamsOptionsSni) MarshalJSON ¶
func (r ResourceNewParamsOptionsSni) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsSni) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsSni) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsStale ¶
type ResourceNewParamsOptionsStale struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Defines list of errors for which "Always online" option is applied.
//
// Any of "error", "http_403", "http_404", "http_429", "http_500", "http_502",
// "http_503", "http_504", "invalid_header", "timeout", "updating".
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Serves stale cached content in case of origin unavailability.
The properties Enabled, Value are required.
func (ResourceNewParamsOptionsStale) MarshalJSON ¶
func (r ResourceNewParamsOptionsStale) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsStale) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsStale) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsStaticHeaders
deprecated
type ResourceNewParamsOptionsStaticHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// A MAP for static headers in a format of `header_name: header_value`.
//
// Restrictions:
//
// - **Header name** - Maximum 128 symbols, may contain Latin letters (A-Z, a-z),
// numbers (0-9), dashes, and underscores.
// - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
// (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
// with a letter, number, asterisk or {.
Value any `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
**Legacy option**. Use the `static_response_headers` option instead.
Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP Headers can be specified. May contain a header with multiple values.
Deprecated: deprecated
The properties Enabled, Value are required.
func (ResourceNewParamsOptionsStaticHeaders) MarshalJSON ¶
func (r ResourceNewParamsOptionsStaticHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsStaticHeaders) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsStaticHeaders) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsStaticRequestHeaders ¶
type ResourceNewParamsOptionsStaticRequestHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// A MAP for static headers in a format of `header_name: header_value`.
//
// Restrictions:
//
// - **Header name** - Maximum 255 symbols, may contain Latin letters (A-Z, a-z),
// numbers (0-9), dashes, and underscores.
// - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
// (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
// with a letter, number, asterisk or {.
Value map[string]string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP Headers can be specified.
The properties Enabled, Value are required.
func (ResourceNewParamsOptionsStaticRequestHeaders) MarshalJSON ¶
func (r ResourceNewParamsOptionsStaticRequestHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsStaticRequestHeaders) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsStaticRequestHeaders) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsStaticResponseHeaders ¶
type ResourceNewParamsOptionsStaticResponseHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
Value []ResourceNewParamsOptionsStaticResponseHeadersValue `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Custom HTTP Headers that a CDN server adds to a response.
The properties Enabled, Value are required.
func (ResourceNewParamsOptionsStaticResponseHeaders) MarshalJSON ¶
func (r ResourceNewParamsOptionsStaticResponseHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsStaticResponseHeaders) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsStaticResponseHeaders) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsStaticResponseHeadersValue ¶
type ResourceNewParamsOptionsStaticResponseHeadersValue struct {
// HTTP Header name.
//
// Restrictions:
//
// - Maximum 128 symbols.
// - Latin letters (A-Z, a-z,) numbers (0-9,) dashes, and underscores only.
Name string `json:"name,required"`
// Header value.
//
// Restrictions:
//
// - Maximum 512 symbols.
// - Letters (a-z), numbers (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+
// /|\";:?.,><{}[]).
// - Must start with a letter, number, asterisk or {.
// - Multiple values can be added.
Value []string `json:"value,omitzero,required"`
// Defines whether the header will be added to a response from CDN regardless of
// response code.
//
// Possible values:
//
// - **true** - Header will be added to a response from CDN regardless of response
// code.
// - **false** - Header will be added only to the following response codes: 200,
// 201, 204, 206, 301, 302, 303, 304, 307, 308.
Always param.Opt[bool] `json:"always,omitzero"`
// contains filtered or unexported fields
}
The properties Name, Value are required.
func (ResourceNewParamsOptionsStaticResponseHeadersValue) MarshalJSON ¶
func (r ResourceNewParamsOptionsStaticResponseHeadersValue) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsStaticResponseHeadersValue) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsStaticResponseHeadersValue) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsTlsVersions ¶
type ResourceNewParamsOptionsTlsVersions struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of SSL/TLS protocol versions (case sensitive).
//
// Any of "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3".
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
List of SSL/TLS protocol versions allowed for HTTPS connections from end users to the domain.
When the option is disabled, all protocols versions are allowed.
The properties Enabled, Value are required.
func (ResourceNewParamsOptionsTlsVersions) MarshalJSON ¶
func (r ResourceNewParamsOptionsTlsVersions) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsTlsVersions) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsTlsVersions) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsUseDefaultLeChain ¶
type ResourceNewParamsOptionsUseDefaultLeChain struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Default Let's Encrypt certificate chain. This is a deprecated
// version, use it only for compatibilities with Android devices 7.1.1 or lower.
// - **false** - Alternative Let's Encrypt certificate chain.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Let's Encrypt certificate chain.
The specified chain will be used during the next Let's Encrypt certificate issue or renewal.
The properties Enabled, Value are required.
func (ResourceNewParamsOptionsUseDefaultLeChain) MarshalJSON ¶
func (r ResourceNewParamsOptionsUseDefaultLeChain) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsUseDefaultLeChain) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsUseDefaultLeChain) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsUseDns01LeChallenge ¶
type ResourceNewParamsOptionsUseDns01LeChallenge struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - DNS-01 challenge is used to issue Let's Encrypt certificate.
// - **false** - HTTP-01 challenge is used to issue Let's Encrypt certificate.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
DNS-01 challenge to issue a Let's Encrypt certificate for the resource.
DNS service should be activated to enable this option.
The properties Enabled, Value are required.
func (ResourceNewParamsOptionsUseDns01LeChallenge) MarshalJSON ¶
func (r ResourceNewParamsOptionsUseDns01LeChallenge) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsUseDns01LeChallenge) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsUseDns01LeChallenge) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsUseRsaLeCert ¶
type ResourceNewParamsOptionsUseRsaLeCert struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - RSA Let's Encrypt certificate.
// - **false** - ECDSA Let's Encrypt certificate.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
RSA Let's Encrypt certificate type for the CDN resource.
The specified value will be used during the next Let's Encrypt certificate issue or renewal.
The properties Enabled, Value are required.
func (ResourceNewParamsOptionsUseRsaLeCert) MarshalJSON ¶
func (r ResourceNewParamsOptionsUseRsaLeCert) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsUseRsaLeCert) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsUseRsaLeCert) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsUserAgentACL ¶
type ResourceNewParamsOptionsUserAgentACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of User-Agents that will be allowed/denied.
//
// The meaning of the parameter depends on `policy_type`:
//
// - **allow** - List of User-Agents for which access is prohibited.
// - **deny** - List of User-Agents for which access is allowed.
//
// Use an empty string `""` to allow/deny access when the User-Agent header is
// empty.
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"user_agent"`
// User-Agents policy type.
//
// Possible values:
//
// - **allow** - Allow access for all User-Agents except specified in
// `excepted_values` field.
// - **deny** - Deny access for all User-Agents except specified in
// `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Controls access to the content for specified User-Agents.
The properties Enabled, ExceptedValues, PolicyType are required.
func (ResourceNewParamsOptionsUserAgentACL) MarshalJSON ¶
func (r ResourceNewParamsOptionsUserAgentACL) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsUserAgentACL) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsUserAgentACL) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsWaap ¶
type ResourceNewParamsOptionsWaap struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Allows to enable WAAP (Web Application and API Protection).
The properties Enabled, Value are required.
func (ResourceNewParamsOptionsWaap) MarshalJSON ¶
func (r ResourceNewParamsOptionsWaap) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsWaap) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsWaap) UnmarshalJSON(data []byte) error
type ResourceNewParamsOptionsWebsockets ¶
type ResourceNewParamsOptionsWebsockets struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Enables or disables WebSockets connections to an origin server.
The properties Enabled, Value are required.
func (ResourceNewParamsOptionsWebsockets) MarshalJSON ¶
func (r ResourceNewParamsOptionsWebsockets) MarshalJSON() (data []byte, err error)
func (*ResourceNewParamsOptionsWebsockets) UnmarshalJSON ¶
func (r *ResourceNewParamsOptionsWebsockets) UnmarshalJSON(data []byte) error
type ResourceNewParamsOriginProtocol ¶
type ResourceNewParamsOriginProtocol string
Protocol used by CDN servers to request content from an origin source.
Possible values:
- **HTTPS** - CDN servers will connect to the origin via HTTPS.
- **HTTP** - CDN servers will connect to the origin via HTTP.
- **MATCH** - connection protocol will be chosen automatically (content on the origin source should be available for the CDN both through HTTP and HTTPS).
If protocol is not specified, HTTP is used to connect to an origin server.
const ( ResourceNewParamsOriginProtocolHTTP ResourceNewParamsOriginProtocol = "HTTP" ResourceNewParamsOriginProtocolHTTPS ResourceNewParamsOriginProtocol = "HTTPS" ResourceNewParamsOriginProtocolMatch ResourceNewParamsOriginProtocol = "MATCH" )
type ResourcePrefetchParams ¶
type ResourcePrefetchParams struct {
// Paths to files that should be pre-populated to the CDN.
//
// Paths to the files should be specified without a domain name.
Paths []string `json:"paths,omitzero,required"`
// contains filtered or unexported fields
}
func (ResourcePrefetchParams) MarshalJSON ¶
func (r ResourcePrefetchParams) MarshalJSON() (data []byte, err error)
func (*ResourcePrefetchParams) UnmarshalJSON ¶
func (r *ResourcePrefetchParams) UnmarshalJSON(data []byte) error
type ResourcePurgeParams ¶
type ResourcePurgeParams struct {
// This field is a request body variant, only one variant field can be set.
OfPurgeByURL *ResourcePurgeParamsBodyPurgeByURL `json:",inline"`
// This field is a request body variant, only one variant field can be set.
OfPurgeByPattern *ResourcePurgeParamsBodyPurgeByPattern `json:",inline"`
// This field is a request body variant, only one variant field can be set.
OfPurgeAllCache *ResourcePurgeParamsBodyPurgeAllCache `json:",inline"`
// contains filtered or unexported fields
}
func (ResourcePurgeParams) MarshalJSON ¶
func (u ResourcePurgeParams) MarshalJSON() ([]byte, error)
func (*ResourcePurgeParams) UnmarshalJSON ¶
func (r *ResourcePurgeParams) UnmarshalJSON(data []byte) error
type ResourcePurgeParamsBodyPurgeAllCache ¶
type ResourcePurgeParamsBodyPurgeAllCache struct {
// **Purge all cache** clears the entire cache for the CDN resource.
//
// Specify an empty array to purge all content for the resource.
//
// When you purge all assets, CDN servers request content from your origin server
// and cause a high load. Therefore, we recommend to use purge by URL for large
// content quantities.
Paths []string `json:"paths,omitzero"`
// contains filtered or unexported fields
}
func (ResourcePurgeParamsBodyPurgeAllCache) MarshalJSON ¶
func (r ResourcePurgeParamsBodyPurgeAllCache) MarshalJSON() (data []byte, err error)
func (*ResourcePurgeParamsBodyPurgeAllCache) UnmarshalJSON ¶
func (r *ResourcePurgeParamsBodyPurgeAllCache) UnmarshalJSON(data []byte) error
type ResourcePurgeParamsBodyPurgeByPattern ¶
type ResourcePurgeParamsBodyPurgeByPattern struct {
// **Purge by pattern** clears the cache that matches the pattern.
//
// Use _ operator, which replaces any number of symbols in your path. It's
// important to note that wildcard usage (_) is permitted only at the end of a
// pattern.
//
// Query string added to any patterns will be ignored, and purge request will be
// processed as if there weren't any parameters.
//
// Purge by pattern is recursive. Both /path and /path* will result in recursive
// purging, meaning all content under the specified path will be affected. As such,
// using the pattern /path* is functionally equivalent to simply using /path.
Paths []string `json:"paths,omitzero"`
// contains filtered or unexported fields
}
func (ResourcePurgeParamsBodyPurgeByPattern) MarshalJSON ¶
func (r ResourcePurgeParamsBodyPurgeByPattern) MarshalJSON() (data []byte, err error)
func (*ResourcePurgeParamsBodyPurgeByPattern) UnmarshalJSON ¶
func (r *ResourcePurgeParamsBodyPurgeByPattern) UnmarshalJSON(data []byte) error
type ResourcePurgeParamsBodyPurgeByURL ¶
type ResourcePurgeParamsBodyPurgeByURL struct {
// **Purge by URL** clears the cache of a specific files. This purge type is
// recommended.
//
// Specify file URLs including query strings. URLs should start with / without a
// domain name.
//
// Purge by URL depends on the following CDN options:
//
// 1. "vary response header" is used. If your origin serves variants of the same
// content depending on the Vary HTTP response header, purge by URL will delete
// only one version of the file.
// 2. "slice" is used. If you update several files in the origin without clearing
// the CDN cache, purge by URL will delete only the first slice (with bytes=0…
// .)
// 3. "ignoreQueryString" is used. Don’t specify parameters in the purge request.
// 4. "query_params_blacklist" is used. Only files with the listed in the option
// parameters will be cached as different objects. Files with other parameters
// will be cached as one object. In this case, specify the listed parameters in
// the Purge request. Don't specify other parameters.
// 5. "query_params_whitelist" is used. Files with listed in the option parameters
// will be cached as one object. Files with other parameters will be cached as
// different objects. In this case, specify other parameters (if any) besides
// the ones listed in the purge request.
URLs []string `json:"urls,omitzero"`
// contains filtered or unexported fields
}
func (ResourcePurgeParamsBodyPurgeByURL) MarshalJSON ¶
func (r ResourcePurgeParamsBodyPurgeByURL) MarshalJSON() (data []byte, err error)
func (*ResourcePurgeParamsBodyPurgeByURL) UnmarshalJSON ¶
func (r *ResourcePurgeParamsBodyPurgeByURL) UnmarshalJSON(data []byte) error
type ResourceReplaceParams ¶
type ResourceReplaceParams struct {
// Origin group ID with which the CDN resource is associated.
//
// You can use either the `origin` or `originGroup` parameter in the request.
OriginGroup int64 `json:"originGroup,required"`
// CDN resource name.
Name param.Opt[string] `json:"name,omitzero"`
// ID of the trusted CA certificate used to verify an origin.
//
// It can be used only with `"proxy_ssl_enabled": true`.
ProxySslCa param.Opt[int64] `json:"proxy_ssl_ca,omitzero"`
// ID of the SSL certificate used to verify an origin.
//
// It can be used only with `"proxy_ssl_enabled": true`.
ProxySslData param.Opt[int64] `json:"proxy_ssl_data,omitzero"`
// ID of the SSL certificate linked to the CDN resource.
//
// Can be used only with `"sslEnabled": true`.
SslData param.Opt[int64] `json:"sslData,omitzero"`
// Enables or disables a CDN resource.
//
// Possible values:
//
// - **true** - CDN resource is active. Content is being delivered.
// - **false** - CDN resource is deactivated. Content is not being delivered.
Active param.Opt[bool] `json:"active,omitzero"`
// Optional comment describing the CDN resource.
Description param.Opt[string] `json:"description,omitzero"`
// Enables or disables SSL certificate validation of the origin server before
// completing any connection.
//
// Possible values:
//
// - **true** - Origin SSL certificate validation is enabled.
// - **false** - Origin SSL certificate validation is disabled.
ProxySslEnabled param.Opt[bool] `json:"proxy_ssl_enabled,omitzero"`
// Defines whether the HTTPS protocol enabled for content delivery.
//
// Possible values:
//
// - **true** - HTTPS is enabled.
// - **false** - HTTPS is disabled.
SslEnabled param.Opt[bool] `json:"sslEnabled,omitzero"`
// Defines whether the associated WAAP Domain is identified as an API Domain.
//
// Possible values:
//
// - **true** - The associated WAAP Domain is designated as an API Domain.
// - **false** - The associated WAAP Domain is not designated as an API Domain.
WaapAPIDomainEnabled param.Opt[bool] `json:"waap_api_domain_enabled,omitzero"`
// List of options that can be configured for the CDN resource.
//
// In case of `null` value the option is not added to the CDN resource. Option may
// inherit its value from the global account settings.
Options ResourceReplaceParamsOptions `json:"options,omitzero"`
// Protocol used by CDN servers to request content from an origin source.
//
// Possible values:
//
// - **HTTPS** - CDN servers will connect to the origin via HTTPS.
// - **HTTP** - CDN servers will connect to the origin via HTTP.
// - **MATCH** - connection protocol will be chosen automatically (content on the
// origin source should be available for the CDN both through HTTP and HTTPS).
//
// If protocol is not specified, HTTP is used to connect to an origin server.
//
// Any of "HTTP", "HTTPS", "MATCH".
OriginProtocol ResourceReplaceParamsOriginProtocol `json:"originProtocol,omitzero"`
// Additional delivery domains (CNAMEs) that will be used to deliver content via
// the CDN.
//
// Up to ten additional CNAMEs are possible.
SecondaryHostnames []string `json:"secondaryHostnames,omitzero" format:"domain"`
// contains filtered or unexported fields
}
func (ResourceReplaceParams) MarshalJSON ¶
func (r ResourceReplaceParams) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParams) UnmarshalJSON ¶
func (r *ResourceReplaceParams) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptions ¶
type ResourceReplaceParamsOptions struct {
// HTTP methods allowed for content requests from the CDN.
AllowedHTTPMethods ResourceReplaceParamsOptionsAllowedHTTPMethods `json:"allowedHttpMethods,omitzero"`
// Allows to prevent online services from overloading and ensure your business
// workflow running smoothly.
BotProtection ResourceReplaceParamsOptionsBotProtection `json:"bot_protection,omitzero"`
// Compresses content with Brotli on the CDN side. CDN servers will request only
// uncompressed content from the origin.
//
// Notes:
//
// 1. CDN only supports "Brotli compression" when the "origin shielding" feature is
// activated.
// 2. If a precache server is not active for a CDN resource, no compression occurs,
// even if the option is enabled.
// 3. `brotli_compression` is not supported with `fetch_compressed` or `slice`
// options enabled.
// 4. `fetch_compressed` option in CDN resource settings overrides
// `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN
// resource and want to enable `brotli_compression` in a rule, you must specify
// `fetch_compressed:false` in the rule.
BrotliCompression ResourceReplaceParamsOptionsBrotliCompression `json:"brotli_compression,omitzero"`
// Cache expiration time for users browsers in seconds.
//
// Cache expiration time is applied to the following response codes: 200, 201, 204,
// 206, 301, 302, 303, 304, 307, 308.
//
// Responses with other codes will not be cached.
BrowserCacheSettings ResourceReplaceParamsOptionsBrowserCacheSettings `json:"browser_cache_settings,omitzero"`
// **Legacy option**. Use the `response_headers_hiding_policy` option instead.
//
// HTTP Headers that must be included in the response.
//
// Deprecated: deprecated
CacheHTTPHeaders ResourceReplaceParamsOptionsCacheHTTPHeaders `json:"cache_http_headers,omitzero"`
// Enables or disables CORS (Cross-Origin Resource Sharing) header support.
//
// CORS header support allows the CDN to add the Access-Control-Allow-Origin header
// to a response to a browser.
Cors ResourceReplaceParamsOptionsCors `json:"cors,omitzero"`
// Enables control access to content for specified countries.
CountryACL ResourceReplaceParamsOptionsCountryACL `json:"country_acl,omitzero"`
// **Legacy option**. Use the `edge_cache_settings` option instead.
//
// Allows the complete disabling of content caching.
//
// Deprecated: deprecated
DisableCache ResourceReplaceParamsOptionsDisableCache `json:"disable_cache,omitzero"`
// Allows 206 responses regardless of the settings of an origin source.
DisableProxyForceRanges ResourceReplaceParamsOptionsDisableProxyForceRanges `json:"disable_proxy_force_ranges,omitzero"`
// Cache expiration time for CDN servers.
//
// `value` and `default` fields cannot be used simultaneously.
EdgeCacheSettings ResourceReplaceParamsOptionsEdgeCacheSettings `json:"edge_cache_settings,omitzero"`
// Allows to configure FastEdge app to be called on different request/response
// phases.
//
// Note: At least one of `on_request_headers`, `on_request_body`,
// `on_response_headers`, or `on_response_body` must be specified.
Fastedge ResourceReplaceParamsOptionsFastedge `json:"fastedge,omitzero"`
// Makes the CDN request compressed content from the origin.
//
// The origin server should support compression. CDN servers will not decompress
// your content even if a user browser does not accept compression.
//
// Notes:
//
// 1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or
// `slice` options enabled.
// 2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If
// you enable it in CDN resource and want to use `gzipON` and
// `brotli_compression` in a rule, you have to specify
// `"fetch_compressed": false` in the rule.
FetchCompressed ResourceReplaceParamsOptionsFetchCompressed `json:"fetch_compressed,omitzero"`
// Enables redirection from origin. If the origin server returns a redirect, the
// option allows the CDN to pull the requested content from the origin server that
// was returned in the redirect.
FollowOriginRedirect ResourceReplaceParamsOptionsFollowOriginRedirect `json:"follow_origin_redirect,omitzero"`
// Applies custom HTTP response codes for CDN content.
//
// The following codes are reserved by our system and cannot be specified in this
// option: 408, 444, 477, 494, 495, 496, 497, 499.
ForceReturn ResourceReplaceParamsOptionsForceReturn `json:"force_return,omitzero"`
// Forwards the Host header from a end-user request to an origin server.
//
// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
ForwardHostHeader ResourceReplaceParamsOptionsForwardHostHeader `json:"forward_host_header,omitzero"`
// Compresses content with gzip on the CDN end. CDN servers will request only
// uncompressed content from the origin.
//
// Notes:
//
// 1. Compression with gzip is not supported with `fetch_compressed` or `slice`
// options enabled.
// 2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in
// rules. If you enable `fetch_compressed` in CDN resource and want to enable
// `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
GzipOn ResourceReplaceParamsOptionsGzipOn `json:"gzipOn,omitzero"`
// Sets the Host header that CDN servers use when request content from an origin
// server. Your server must be able to process requests with the chosen header.
//
// If the option is `null`, the Host Header value is equal to first CNAME.
//
// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
HostHeader ResourceReplaceParamsOptionsHostHeader `json:"hostHeader,omitzero"`
// Enables HTTP/3 protocol for content delivery.
//
// `http3_enabled` option works only with `"sslEnabled": true`.
Http3Enabled ResourceReplaceParamsOptionsHttp3Enabled `json:"http3_enabled,omitzero"`
// Defines whether the files with the Set-Cookies header are cached as one file or
// as different ones.
IgnoreCookie ResourceReplaceParamsOptionsIgnoreCookie `json:"ignore_cookie,omitzero"`
// How a file with different query strings is cached: either as one object (option
// is enabled) or as different objects (option is disabled.)
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
IgnoreQueryString ResourceReplaceParamsOptionsIgnoreQueryString `json:"ignoreQueryString,omitzero"`
// Transforms JPG and PNG images (for example, resize or crop) and automatically
// converts them to WebP or AVIF format.
ImageStack ResourceReplaceParamsOptionsImageStack `json:"image_stack,omitzero"`
// Controls access to the CDN resource content for specific IP addresses.
//
// If you want to use IPs from our CDN servers IP list for IP ACL configuration,
// you have to independently monitor their relevance. We recommend you use a script
// for automatically update IP ACL.
// [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
IPAddressACL ResourceReplaceParamsOptionsIPAddressACL `json:"ip_address_acl,omitzero"`
// Allows to control the download speed per connection.
LimitBandwidth ResourceReplaceParamsOptionsLimitBandwidth `json:"limit_bandwidth,omitzero"`
// Allows you to modify your cache key. If omitted, the default value is
// `$request_uri`.
//
// Combine the specified variables to create a key for caching.
//
// - **$`request_uri`**
// - **$scheme**
// - **$uri**
//
// **Warning**: Enabling and changing this option can invalidate your current cache
// and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will
// not work.
ProxyCacheKey ResourceReplaceParamsOptionsProxyCacheKey `json:"proxy_cache_key,omitzero"`
// Caching for POST requests along with default GET and HEAD.
ProxyCacheMethodsSet ResourceReplaceParamsOptionsProxyCacheMethodsSet `json:"proxy_cache_methods_set,omitzero"`
// The time limit for establishing a connection with the origin.
ProxyConnectTimeout ResourceReplaceParamsOptionsProxyConnectTimeout `json:"proxy_connect_timeout,omitzero"`
// The time limit for receiving a partial response from the origin. If no response
// is received within this time, the connection will be closed.
//
// **Note:** When used with a WebSocket connection, this option supports values
// only in the range 1–20 seconds (instead of the usual 1–30 seconds).
ProxyReadTimeout ResourceReplaceParamsOptionsProxyReadTimeout `json:"proxy_read_timeout,omitzero"`
// Files with the specified query parameters are cached as one object, files with
// other parameters are cached as different objects.
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
QueryParamsBlacklist ResourceReplaceParamsOptionsQueryParamsBlacklist `json:"query_params_blacklist,omitzero"`
// Files with the specified query parameters are cached as different objects, files
// with other parameters are cached as one object.
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
QueryParamsWhitelist ResourceReplaceParamsOptionsQueryParamsWhitelist `json:"query_params_whitelist,omitzero"`
// The Query String Forwarding feature allows for the seamless transfer of
// parameters embedded in playlist files to the corresponding media chunk files.
// This functionality ensures that specific attributes, such as authentication
// tokens or tracking information, are consistently passed along from the playlist
// manifest to the individual media segments. This is particularly useful for
// maintaining continuity in security, analytics, and any other parameter-based
// operations across the entire media delivery workflow.
QueryStringForwarding ResourceReplaceParamsOptionsQueryStringForwarding `json:"query_string_forwarding,omitzero"`
// Enables redirect from HTTP to HTTPS.
//
// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
// simultaneously.
RedirectHTTPToHTTPS ResourceReplaceParamsOptionsRedirectHTTPToHTTPS `json:"redirect_http_to_https,omitzero"`
// Enables redirect from HTTPS to HTTP.
//
// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
// simultaneously.
RedirectHTTPSToHTTP ResourceReplaceParamsOptionsRedirectHTTPSToHTTP `json:"redirect_https_to_http,omitzero"`
// Controls access to the CDN resource content for specified domain names.
ReferrerACL ResourceReplaceParamsOptionsReferrerACL `json:"referrer_acl,omitzero"`
// Option allows to limit the amount of HTTP requests.
RequestLimiter ResourceReplaceParamsOptionsRequestLimiter `json:"request_limiter,omitzero"`
// Hides HTTP headers from an origin server in the CDN response.
ResponseHeadersHidingPolicy ResourceReplaceParamsOptionsResponseHeadersHidingPolicy `json:"response_headers_hiding_policy,omitzero"`
// Changes and redirects requests from the CDN to the origin. It operates according
// to the
// [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite)
// configuration.
Rewrite ResourceReplaceParamsOptionsRewrite `json:"rewrite,omitzero"`
// Configures access with tokenized URLs. This makes impossible to access content
// without a valid (unexpired) token.
SecureKey ResourceReplaceParamsOptionsSecureKey `json:"secure_key,omitzero"`
// Requests and caches files larger than 10 MB in parts (no larger than 10 MB per
// part.) This reduces time to first byte.
//
// The option is based on the
// [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
//
// Notes:
//
// 1. Origin must support HTTP Range requests.
// 2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed`
// options enabled.
Slice ResourceReplaceParamsOptionsSlice `json:"slice,omitzero"`
// The hostname that is added to SNI requests from CDN servers to the origin server
// via HTTPS.
//
// SNI is generally only required if your origin uses shared hosting or does not
// have a dedicated IP address. If the origin server presents multiple
// certificates, SNI allows the origin server to know which certificate to use for
// the connection.
//
// The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
Sni ResourceReplaceParamsOptionsSni `json:"sni,omitzero"`
// Serves stale cached content in case of origin unavailability.
Stale ResourceReplaceParamsOptionsStale `json:"stale,omitzero"`
// Custom HTTP Headers that a CDN server adds to a response.
StaticResponseHeaders ResourceReplaceParamsOptionsStaticResponseHeaders `json:"static_response_headers,omitzero"`
// **Legacy option**. Use the `static_response_headers` option instead.
//
// Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP
// Headers can be specified. May contain a header with multiple values.
//
// Deprecated: deprecated
StaticHeaders ResourceReplaceParamsOptionsStaticHeaders `json:"staticHeaders,omitzero"`
// Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP
// Headers can be specified.
StaticRequestHeaders ResourceReplaceParamsOptionsStaticRequestHeaders `json:"staticRequestHeaders,omitzero"`
// List of SSL/TLS protocol versions allowed for HTTPS connections from end users
// to the domain.
//
// When the option is disabled, all protocols versions are allowed.
TlsVersions ResourceReplaceParamsOptionsTlsVersions `json:"tls_versions,omitzero"`
// Let's Encrypt certificate chain.
//
// The specified chain will be used during the next Let's Encrypt certificate issue
// or renewal.
UseDefaultLeChain ResourceReplaceParamsOptionsUseDefaultLeChain `json:"use_default_le_chain,omitzero"`
// DNS-01 challenge to issue a Let's Encrypt certificate for the resource.
//
// DNS service should be activated to enable this option.
UseDns01LeChallenge ResourceReplaceParamsOptionsUseDns01LeChallenge `json:"use_dns01_le_challenge,omitzero"`
// RSA Let's Encrypt certificate type for the CDN resource.
//
// The specified value will be used during the next Let's Encrypt certificate issue
// or renewal.
UseRsaLeCert ResourceReplaceParamsOptionsUseRsaLeCert `json:"use_rsa_le_cert,omitzero"`
// Controls access to the content for specified User-Agents.
UserAgentACL ResourceReplaceParamsOptionsUserAgentACL `json:"user_agent_acl,omitzero"`
// Allows to enable WAAP (Web Application and API Protection).
Waap ResourceReplaceParamsOptionsWaap `json:"waap,omitzero"`
// Enables or disables WebSockets connections to an origin server.
Websockets ResourceReplaceParamsOptionsWebsockets `json:"websockets,omitzero"`
// contains filtered or unexported fields
}
List of options that can be configured for the CDN resource.
In case of `null` value the option is not added to the CDN resource. Option may inherit its value from the global account settings.
func (ResourceReplaceParamsOptions) MarshalJSON ¶
func (r ResourceReplaceParamsOptions) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptions) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptions) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsAllowedHTTPMethods ¶
type ResourceReplaceParamsOptionsAllowedHTTPMethods struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
HTTP methods allowed for content requests from the CDN.
The properties Enabled, Value are required.
func (ResourceReplaceParamsOptionsAllowedHTTPMethods) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsAllowedHTTPMethods) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsAllowedHTTPMethods) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsAllowedHTTPMethods) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsBotProtection ¶
type ResourceReplaceParamsOptionsBotProtection struct {
// Controls the bot challenge module state.
BotChallenge ResourceReplaceParamsOptionsBotProtectionBotChallenge `json:"bot_challenge,omitzero,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// contains filtered or unexported fields
}
Allows to prevent online services from overloading and ensure your business workflow running smoothly.
The properties BotChallenge, Enabled are required.
func (ResourceReplaceParamsOptionsBotProtection) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsBotProtection) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsBotProtection) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsBotProtection) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsBotProtectionBotChallenge ¶
type ResourceReplaceParamsOptionsBotProtectionBotChallenge struct {
// Possible values:
//
// - **true** - Bot challenge is enabled.
// - **false** - Bot challenge is disabled.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// contains filtered or unexported fields
}
Controls the bot challenge module state.
func (ResourceReplaceParamsOptionsBotProtectionBotChallenge) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsBotProtectionBotChallenge) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsBotProtectionBotChallenge) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsBotProtectionBotChallenge) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsBrotliCompression ¶
type ResourceReplaceParamsOptionsBrotliCompression struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Allows to select the content types you want to compress.
//
// `text/html` is a mandatory content type.
//
// Any of "application/javascript", "application/json",
// "application/vnd.ms-fontobject", "application/wasm", "application/x-font-ttf",
// "application/x-javascript", "application/xml", "application/xml+rss",
// "image/svg+xml", "image/x-icon", "text/css", "text/html", "text/javascript",
// "text/plain", "text/xml".
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Compresses content with Brotli on the CDN side. CDN servers will request only uncompressed content from the origin.
Notes:
- CDN only supports "Brotli compression" when the "origin shielding" feature is activated.
- If a precache server is not active for a CDN resource, no compression occurs, even if the option is enabled.
- `brotli_compression` is not supported with `fetch_compressed` or `slice` options enabled.
- `fetch_compressed` option in CDN resource settings overrides `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN resource and want to enable `brotli_compression` in a rule, you must specify `fetch_compressed:false` in the rule.
The properties Enabled, Value are required.
func (ResourceReplaceParamsOptionsBrotliCompression) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsBrotliCompression) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsBrotliCompression) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsBrotliCompression) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsBrowserCacheSettings ¶
type ResourceReplaceParamsOptionsBrowserCacheSettings struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Set the cache expiration time to '0s' to disable caching.
//
// The maximum duration is any equivalent to `1y`.
Value string `json:"value,required" format:"nginx time"`
// contains filtered or unexported fields
}
Cache expiration time for users browsers in seconds.
Cache expiration time is applied to the following response codes: 200, 201, 204, 206, 301, 302, 303, 304, 307, 308.
Responses with other codes will not be cached.
The properties Enabled, Value are required.
func (ResourceReplaceParamsOptionsBrowserCacheSettings) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsBrowserCacheSettings) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsBrowserCacheSettings) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsBrowserCacheSettings) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsCacheHTTPHeaders
deprecated
type ResourceReplaceParamsOptionsCacheHTTPHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
**Legacy option**. Use the `response_headers_hiding_policy` option instead.
HTTP Headers that must be included in the response.
Deprecated: deprecated
The properties Enabled, Value are required.
func (ResourceReplaceParamsOptionsCacheHTTPHeaders) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsCacheHTTPHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsCacheHTTPHeaders) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsCacheHTTPHeaders) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsCors ¶
type ResourceReplaceParamsOptionsCors struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Value of the Access-Control-Allow-Origin header.
//
// Possible values:
//
// - **Adds \* as the Access-Control-Allow-Origin header value** - Content will be
// uploaded for requests from any domain. `"value": ["*"]`
// - **Adds "$http_origin" as the Access-Control-Allow-Origin header value if the
// origin matches one of the listed domains** - Content will be uploaded only for
// requests from the domains specified in the field.
// `"value": ["domain.com", "second.dom.com"]`
// - **Adds "$http_origin" as the Access-Control-Allow-Origin header value** -
// Content will be uploaded for requests from any domain, and the domain from
// which the request was sent will be added to the "Access-Control-Allow-Origin"
// header in the response. `"value": ["$http_origin"]`
Value []string `json:"value,omitzero,required"`
// Defines whether the Access-Control-Allow-Origin header should be added to a
// response from CDN regardless of response code.
//
// Possible values:
//
// - **true** - Header will be added to a response regardless of response code.
// - **false** - Header will only be added to responses with codes: 200, 201, 204,
// 206, 301, 302, 303, 304, 307, 308.
Always param.Opt[bool] `json:"always,omitzero"`
// contains filtered or unexported fields
}
Enables or disables CORS (Cross-Origin Resource Sharing) header support.
CORS header support allows the CDN to add the Access-Control-Allow-Origin header to a response to a browser.
The properties Enabled, Value are required.
func (ResourceReplaceParamsOptionsCors) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsCors) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsCors) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsCors) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsCountryACL ¶
type ResourceReplaceParamsOptionsCountryACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of countries according to ISO-3166-1.
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of countries for which access is prohibited.
// - **deny** - List of countries for which access is allowed.
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"country-code"`
// Defines the type of CDN resource access policy.
//
// Possible values:
//
// - **allow** - Access is allowed for all the countries except for those specified
// in `excepted_values` field.
// - **deny** - Access is denied for all the countries except for those specified
// in `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Enables control access to content for specified countries.
The properties Enabled, ExceptedValues, PolicyType are required.
func (ResourceReplaceParamsOptionsCountryACL) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsCountryACL) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsCountryACL) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsCountryACL) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsDisableCache
deprecated
type ResourceReplaceParamsOptionsDisableCache struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - content caching is disabled.
// - **false** - content caching is enabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
**Legacy option**. Use the `edge_cache_settings` option instead.
Allows the complete disabling of content caching.
Deprecated: deprecated
The properties Enabled, Value are required.
func (ResourceReplaceParamsOptionsDisableCache) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsDisableCache) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsDisableCache) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsDisableCache) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsDisableProxyForceRanges ¶
type ResourceReplaceParamsOptionsDisableProxyForceRanges struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Allows 206 responses regardless of the settings of an origin source.
The properties Enabled, Value are required.
func (ResourceReplaceParamsOptionsDisableProxyForceRanges) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsDisableProxyForceRanges) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsDisableProxyForceRanges) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsDisableProxyForceRanges) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsEdgeCacheSettings ¶
type ResourceReplaceParamsOptionsEdgeCacheSettings struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Enables content caching according to the origin cache settings.
//
// The value is applied to the following response codes 200, 201, 204, 206, 301,
// 302, 303, 304, 307, 308, if an origin server does not have caching HTTP headers.
//
// Responses with other codes will not be cached.
//
// The maximum duration is any equivalent to `1y`.
Default param.Opt[string] `json:"default,omitzero" format:"nginx time"`
// Caching time.
//
// The value is applied to the following response codes: 200, 206, 301, 302.
// Responses with codes 4xx, 5xx will not be cached.
//
// Use `0s` to disable caching.
//
// The maximum duration is any equivalent to `1y`.
Value param.Opt[string] `json:"value,omitzero" format:"nginx time"`
// A MAP object representing the caching time in seconds for a response with a
// specific response code.
//
// These settings have a higher priority than the `value` field.
//
// - Use `any` key to specify caching time for all response codes.
// - Use `0s` value to disable caching for a specific response code.
CustomValues map[string]string `json:"custom_values,omitzero" format:"nginx time"`
// contains filtered or unexported fields
}
Cache expiration time for CDN servers.
`value` and `default` fields cannot be used simultaneously.
The property Enabled is required.
func (ResourceReplaceParamsOptionsEdgeCacheSettings) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsEdgeCacheSettings) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsEdgeCacheSettings) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsEdgeCacheSettings) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsFastedge ¶
type ResourceReplaceParamsOptionsFastedge struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Allows to configure FastEdge application that will be called to handle request
// body as soon as CDN receives incoming HTTP request.
OnRequestBody ResourceReplaceParamsOptionsFastedgeOnRequestBody `json:"on_request_body,omitzero"`
// Allows to configure FastEdge application that will be called to handle request
// headers as soon as CDN receives incoming HTTP request.
OnRequestHeaders ResourceReplaceParamsOptionsFastedgeOnRequestHeaders `json:"on_request_headers,omitzero"`
// Allows to configure FastEdge application that will be called to handle response
// body before CDN sends the HTTP response.
OnResponseBody ResourceReplaceParamsOptionsFastedgeOnResponseBody `json:"on_response_body,omitzero"`
// Allows to configure FastEdge application that will be called to handle response
// headers before CDN sends the HTTP response.
OnResponseHeaders ResourceReplaceParamsOptionsFastedgeOnResponseHeaders `json:"on_response_headers,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge app to be called on different request/response phases.
Note: At least one of `on_request_headers`, `on_request_body`, `on_response_headers`, or `on_response_body` must be specified.
The property Enabled is required.
func (ResourceReplaceParamsOptionsFastedge) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsFastedge) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsFastedge) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsFastedge) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsFastedgeOnRequestBody ¶
type ResourceReplaceParamsOptionsFastedgeOnRequestBody struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle request body as soon as CDN receives incoming HTTP request.
The property AppID is required.
func (ResourceReplaceParamsOptionsFastedgeOnRequestBody) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsFastedgeOnRequestBody) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsFastedgeOnRequestBody) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsFastedgeOnRequestBody) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsFastedgeOnRequestHeaders ¶
type ResourceReplaceParamsOptionsFastedgeOnRequestHeaders struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request.
The property AppID is required.
func (ResourceReplaceParamsOptionsFastedgeOnRequestHeaders) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsFastedgeOnRequestHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsFastedgeOnResponseBody ¶
type ResourceReplaceParamsOptionsFastedgeOnResponseBody struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle response body before CDN sends the HTTP response.
The property AppID is required.
func (ResourceReplaceParamsOptionsFastedgeOnResponseBody) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsFastedgeOnResponseBody) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsFastedgeOnResponseBody) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsFastedgeOnResponseBody) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsFastedgeOnResponseHeaders ¶
type ResourceReplaceParamsOptionsFastedgeOnResponseHeaders struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle response headers before CDN sends the HTTP response.
The property AppID is required.
func (ResourceReplaceParamsOptionsFastedgeOnResponseHeaders) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsFastedgeOnResponseHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsFastedgeOnResponseHeaders) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsFastedgeOnResponseHeaders) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsFetchCompressed ¶
type ResourceReplaceParamsOptionsFetchCompressed struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Makes the CDN request compressed content from the origin.
The origin server should support compression. CDN servers will not decompress your content even if a user browser does not accept compression.
Notes:
- `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or `slice` options enabled.
- `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If you enable it in CDN resource and want to use `gzipON` and `brotli_compression` in a rule, you have to specify `"fetch_compressed": false` in the rule.
The properties Enabled, Value are required.
func (ResourceReplaceParamsOptionsFetchCompressed) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsFetchCompressed) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsFetchCompressed) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsFetchCompressed) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsFollowOriginRedirect ¶
type ResourceReplaceParamsOptionsFollowOriginRedirect struct {
// Redirect status code that the origin server returns.
//
// To serve up to date content to end users, you will need to purge the cache after
// managing the option.
//
// Any of 301, 302, 303, 307, 308.
Codes []int64 `json:"codes,omitzero,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// contains filtered or unexported fields
}
Enables redirection from origin. If the origin server returns a redirect, the option allows the CDN to pull the requested content from the origin server that was returned in the redirect.
The properties Codes, Enabled are required.
func (ResourceReplaceParamsOptionsFollowOriginRedirect) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsFollowOriginRedirect) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsFollowOriginRedirect) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsFollowOriginRedirect) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsForceReturn ¶
type ResourceReplaceParamsOptionsForceReturn struct {
// URL for redirection or text.
Body string `json:"body,required"`
// Status code value.
Code int64 `json:"code,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Controls the time at which a custom HTTP response code should be applied. By
// default, a custom HTTP response code is applied at any time.
TimeInterval ResourceReplaceParamsOptionsForceReturnTimeInterval `json:"time_interval,omitzero"`
// contains filtered or unexported fields
}
Applies custom HTTP response codes for CDN content.
The following codes are reserved by our system and cannot be specified in this option: 408, 444, 477, 494, 495, 496, 497, 499.
The properties Body, Code, Enabled are required.
func (ResourceReplaceParamsOptionsForceReturn) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsForceReturn) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsForceReturn) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsForceReturn) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsForceReturnTimeInterval ¶
type ResourceReplaceParamsOptionsForceReturnTimeInterval struct {
// Time until which a custom HTTP response code should be applied. Indicated in
// 24-hour format.
EndTime string `json:"end_time,required"`
// Time from which a custom HTTP response code should be applied. Indicated in
// 24-hour format.
StartTime string `json:"start_time,required"`
// Time zone used to calculate time.
TimeZone param.Opt[string] `json:"time_zone,omitzero" format:"timezone"`
// contains filtered or unexported fields
}
Controls the time at which a custom HTTP response code should be applied. By default, a custom HTTP response code is applied at any time.
The properties EndTime, StartTime are required.
func (ResourceReplaceParamsOptionsForceReturnTimeInterval) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsForceReturnTimeInterval) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsForceReturnTimeInterval) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsForceReturnTimeInterval) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsForwardHostHeader ¶
type ResourceReplaceParamsOptionsForwardHostHeader struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Forwards the Host header from a end-user request to an origin server.
`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceReplaceParamsOptionsForwardHostHeader) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsForwardHostHeader) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsForwardHostHeader) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsForwardHostHeader) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsGzipOn ¶
type ResourceReplaceParamsOptionsGzipOn struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Compresses content with gzip on the CDN end. CDN servers will request only uncompressed content from the origin.
Notes:
- Compression with gzip is not supported with `fetch_compressed` or `slice` options enabled.
- `fetch_compressed` option in CDN resource settings overrides `gzipON` in rules. If you enable `fetch_compressed` in CDN resource and want to enable `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
The properties Enabled, Value are required.
func (ResourceReplaceParamsOptionsGzipOn) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsGzipOn) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsGzipOn) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsGzipOn) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsHostHeader ¶
type ResourceReplaceParamsOptionsHostHeader struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Host Header value.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
Sets the Host header that CDN servers use when request content from an origin server. Your server must be able to process requests with the chosen header.
If the option is `null`, the Host Header value is equal to first CNAME.
`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceReplaceParamsOptionsHostHeader) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsHostHeader) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsHostHeader) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsHostHeader) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsHttp3Enabled ¶
type ResourceReplaceParamsOptionsHttp3Enabled struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Enables HTTP/3 protocol for content delivery.
`http3_enabled` option works only with `"sslEnabled": true`.
The properties Enabled, Value are required.
func (ResourceReplaceParamsOptionsHttp3Enabled) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsHttp3Enabled) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsHttp3Enabled) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsHttp3Enabled) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsIPAddressACL ¶
type ResourceReplaceParamsOptionsIPAddressACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of IP addresses with a subnet mask.
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of IP addresses for which access is prohibited.
// - **deny** - List of IP addresses for which access is allowed.
//
// Examples:
//
// - `192.168.3.2/32`
// - `2a03:d000:2980:7::8/128`
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"ipv4net or ipv6net"`
// IP access policy type.
//
// Possible values:
//
// - **allow** - Allow access to all IPs except IPs specified in "excepted_values"
// field.
// - **deny** - Deny access to all IPs except IPs specified in "excepted_values"
// field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Controls access to the CDN resource content for specific IP addresses.
If you want to use IPs from our CDN servers IP list for IP ACL configuration, you have to independently monitor their relevance. We recommend you use a script for automatically update IP ACL. [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
The properties Enabled, ExceptedValues, PolicyType are required.
func (ResourceReplaceParamsOptionsIPAddressACL) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsIPAddressACL) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsIPAddressACL) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsIPAddressACL) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsIgnoreCookie ¶
type ResourceReplaceParamsOptionsIgnoreCookie struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled, files with cookies are cached as one file.
// - **false** - Option is disabled, files with cookies are cached as different
// files.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Defines whether the files with the Set-Cookies header are cached as one file or as different ones.
The properties Enabled, Value are required.
func (ResourceReplaceParamsOptionsIgnoreCookie) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsIgnoreCookie) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsIgnoreCookie) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsIgnoreCookie) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsIgnoreQueryString ¶
type ResourceReplaceParamsOptionsIgnoreQueryString struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
How a file with different query strings is cached: either as one object (option is enabled) or as different objects (option is disabled.)
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceReplaceParamsOptionsIgnoreQueryString) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsIgnoreQueryString) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsIgnoreQueryString) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsIgnoreQueryString) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsImageStack ¶
type ResourceReplaceParamsOptionsImageStack struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Enables or disables automatic conversion of JPEG and PNG images to AVI format.
AvifEnabled param.Opt[bool] `json:"avif_enabled,omitzero"`
// Enables or disables compression without quality loss for PNG format.
PngLossless param.Opt[bool] `json:"png_lossless,omitzero"`
// Defines quality settings for JPG and PNG images. The higher the value, the
// better the image quality, and the larger the file size after conversion.
Quality param.Opt[int64] `json:"quality,omitzero"`
// Enables or disables automatic conversion of JPEG and PNG images to WebP format.
WebpEnabled param.Opt[bool] `json:"webp_enabled,omitzero"`
// contains filtered or unexported fields
}
Transforms JPG and PNG images (for example, resize or crop) and automatically converts them to WebP or AVIF format.
The property Enabled is required.
func (ResourceReplaceParamsOptionsImageStack) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsImageStack) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsImageStack) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsImageStack) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsLimitBandwidth ¶
type ResourceReplaceParamsOptionsLimitBandwidth struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Method of controlling the download speed per connection.
//
// Possible values:
//
// - **static** - Use speed and buffer fields to set the download speed limit.
// - **dynamic** - Use query strings **speed** and **buffer** to set the download
// speed limit.
//
// # For example, when requesting content at the link
//
// “`
// http://cdn.example.com/video.mp4?speed=50k&buffer=500k
// “`
//
// the download speed will be limited to 50kB/s after 500 kB.
//
// Any of "static", "dynamic".
LimitType string `json:"limit_type,omitzero,required"`
// Amount of downloaded data after which the user will be rate limited.
Buffer param.Opt[int64] `json:"buffer,omitzero"`
// Maximum download speed per connection.
Speed param.Opt[int64] `json:"speed,omitzero"`
// contains filtered or unexported fields
}
Allows to control the download speed per connection.
The properties Enabled, LimitType are required.
func (ResourceReplaceParamsOptionsLimitBandwidth) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsLimitBandwidth) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsLimitBandwidth) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsLimitBandwidth) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsProxyCacheKey ¶
type ResourceReplaceParamsOptionsProxyCacheKey struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Key for caching.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
Allows you to modify your cache key. If omitted, the default value is `$request_uri`.
Combine the specified variables to create a key for caching.
- **$`request_uri`** - **$scheme** - **$uri**
**Warning**: Enabling and changing this option can invalidate your current cache and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will not work.
The properties Enabled, Value are required.
func (ResourceReplaceParamsOptionsProxyCacheKey) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsProxyCacheKey) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsProxyCacheKey) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsProxyCacheKey) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsProxyCacheMethodsSet ¶
type ResourceReplaceParamsOptionsProxyCacheMethodsSet struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Caching for POST requests along with default GET and HEAD.
The properties Enabled, Value are required.
func (ResourceReplaceParamsOptionsProxyCacheMethodsSet) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsProxyCacheMethodsSet) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsProxyCacheMethodsSet) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsProxyCacheMethodsSet) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsProxyConnectTimeout ¶
type ResourceReplaceParamsOptionsProxyConnectTimeout struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Timeout value in seconds.
//
// Supported range: **1s - 5s**.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
The time limit for establishing a connection with the origin.
The properties Enabled, Value are required.
func (ResourceReplaceParamsOptionsProxyConnectTimeout) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsProxyConnectTimeout) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsProxyConnectTimeout) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsProxyConnectTimeout) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsProxyReadTimeout ¶
type ResourceReplaceParamsOptionsProxyReadTimeout struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Timeout value in seconds.
//
// Supported range: **1s - 30s**.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
The time limit for receiving a partial response from the origin. If no response is received within this time, the connection will be closed.
**Note:** When used with a WebSocket connection, this option supports values only in the range 1–20 seconds (instead of the usual 1–30 seconds).
The properties Enabled, Value are required.
func (ResourceReplaceParamsOptionsProxyReadTimeout) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsProxyReadTimeout) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsProxyReadTimeout) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsProxyReadTimeout) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsQueryParamsBlacklist ¶
type ResourceReplaceParamsOptionsQueryParamsBlacklist struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of query parameters.
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Files with the specified query parameters are cached as one object, files with other parameters are cached as different objects.
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceReplaceParamsOptionsQueryParamsBlacklist) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsQueryParamsBlacklist) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsQueryParamsBlacklist) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsQueryParamsBlacklist) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsQueryParamsWhitelist ¶
type ResourceReplaceParamsOptionsQueryParamsWhitelist struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of query parameters.
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Files with the specified query parameters are cached as different objects, files with other parameters are cached as one object.
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceReplaceParamsOptionsQueryParamsWhitelist) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsQueryParamsWhitelist) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsQueryParamsWhitelist) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsQueryParamsWhitelist) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsQueryStringForwarding ¶
type ResourceReplaceParamsOptionsQueryStringForwarding struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// The `forward_from_files_types` field specifies the types of playlist files from
// which parameters will be extracted and forwarded. This typically includes
// formats that list multiple media chunk references, such as HLS and DASH
// playlists. Parameters associated with these playlist files (like query strings
// or headers) will be propagated to the chunks they reference.
ForwardFromFileTypes []string `json:"forward_from_file_types,omitzero,required"`
// The field specifies the types of media chunk files to which parameters,
// extracted from playlist files, will be forwarded. These refer to the actual
// segments of media content that are delivered to viewers. Ensuring the correct
// parameters are forwarded to these files is crucial for maintaining the integrity
// of the streaming session.
ForwardToFileTypes []string `json:"forward_to_file_types,omitzero,required"`
// The `forward_except_keys` field provides a mechanism to exclude specific
// parameters from being forwarded from playlist files to media chunk files. By
// listing certain keys in this field, you can ensure that these parameters are
// omitted during the forwarding process. This is particularly useful for
// preventing sensitive or irrelevant information from being included in requests
// for media chunks, thereby enhancing security and optimizing performance.
ForwardExceptKeys []string `json:"forward_except_keys,omitzero"`
// The `forward_only_keys` field allows for granular control over which specific
// parameters are forwarded from playlist files to media chunk files. By specifying
// certain keys, only those parameters will be propagated, ensuring that only
// relevant information is passed along. This is particularly useful for security
// and performance optimization, as it prevents unnecessary or sensitive data from
// being included in requests for media chunks.
ForwardOnlyKeys []string `json:"forward_only_keys,omitzero"`
// contains filtered or unexported fields
}
The Query String Forwarding feature allows for the seamless transfer of parameters embedded in playlist files to the corresponding media chunk files. This functionality ensures that specific attributes, such as authentication tokens or tracking information, are consistently passed along from the playlist manifest to the individual media segments. This is particularly useful for maintaining continuity in security, analytics, and any other parameter-based operations across the entire media delivery workflow.
The properties Enabled, ForwardFromFileTypes, ForwardToFileTypes are required.
func (ResourceReplaceParamsOptionsQueryStringForwarding) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsQueryStringForwarding) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsQueryStringForwarding) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsQueryStringForwarding) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsRedirectHTTPSToHTTP ¶
type ResourceReplaceParamsOptionsRedirectHTTPSToHTTP struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Enables redirect from HTTPS to HTTP.
`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceReplaceParamsOptionsRedirectHTTPSToHTTP) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsRedirectHTTPSToHTTP) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsRedirectHTTPSToHTTP) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsRedirectHTTPSToHTTP) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsRedirectHTTPToHTTPS ¶
type ResourceReplaceParamsOptionsRedirectHTTPToHTTPS struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Enables redirect from HTTP to HTTPS.
`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceReplaceParamsOptionsRedirectHTTPToHTTPS) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsRedirectHTTPToHTTPS) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsRedirectHTTPToHTTPS) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsRedirectHTTPToHTTPS) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsReferrerACL ¶
type ResourceReplaceParamsOptionsReferrerACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of domain names or wildcard domains (without protocol: `http://` or
// `https://`.)
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of domain names for which access is prohibited.
// - **deny** - List of IP domain names for which access is allowed.
//
// Examples:
//
// - `example.com`
// - `*.example.com`
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"domain or wildcard"`
// Policy type.
//
// Possible values:
//
// - **allow** - Allow access to all domain names except the domain names specified
// in `excepted_values` field.
// - **deny** - Deny access to all domain names except the domain names specified
// in `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Controls access to the CDN resource content for specified domain names.
The properties Enabled, ExceptedValues, PolicyType are required.
func (ResourceReplaceParamsOptionsReferrerACL) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsReferrerACL) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsReferrerACL) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsReferrerACL) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsRequestLimiter ¶
type ResourceReplaceParamsOptionsRequestLimiter struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Maximum request rate.
Rate int64 `json:"rate,required"`
// Units of measurement for the `rate` field.
//
// Possible values:
//
// - **r/s** - Requests per second.
// - **r/m** - Requests per minute.
//
// If the rate is less than one request per second, it is specified in request per
// minute (r/m.)
//
// Any of "r/s", "r/m".
RateUnit string `json:"rate_unit,omitzero"`
// contains filtered or unexported fields
}
Option allows to limit the amount of HTTP requests.
The properties Enabled, Rate are required.
func (ResourceReplaceParamsOptionsRequestLimiter) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsRequestLimiter) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsRequestLimiter) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsRequestLimiter) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsResponseHeadersHidingPolicy ¶
type ResourceReplaceParamsOptionsResponseHeadersHidingPolicy struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of HTTP headers.
//
// Parameter meaning depends on the value of the `mode` field:
//
// - **show** - List of HTTP headers to hide from response.
// - **hide** - List of HTTP headers to include in response. Other HTTP headers
// will be hidden.
//
// The following headers are required and cannot be hidden from response:
//
// - `Connection`
// - `Content-Length`
// - `Content-Type`
// - `Date`
// - `Server`
Excepted []string `json:"excepted,omitzero,required" format:"http_header"`
// How HTTP headers are hidden from the response.
//
// Possible values:
//
// - **show** - Hide only HTTP headers listed in the `excepted` field.
// - **hide** - Hide all HTTP headers except headers listed in the "excepted"
// field.
//
// Any of "hide", "show".
Mode string `json:"mode,omitzero,required"`
// contains filtered or unexported fields
}
Hides HTTP headers from an origin server in the CDN response.
The properties Enabled, Excepted, Mode are required.
func (ResourceReplaceParamsOptionsResponseHeadersHidingPolicy) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsResponseHeadersHidingPolicy) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsResponseHeadersHidingPolicy) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsResponseHeadersHidingPolicy) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsRewrite ¶
type ResourceReplaceParamsOptionsRewrite struct {
// Path for the Rewrite option.
//
// Example:
//
// - `/(.*) /media/$1`
Body string `json:"body,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Flag for the Rewrite option.
//
// Possible values:
//
// - **last** - Stop processing the current set of `ngx_http_rewrite_module`
// directives and start a search for a new location matching changed URI.
// - **break** - Stop processing the current set of the Rewrite option.
// - **redirect** - Return a temporary redirect with the 302 code; used when a
// replacement string does not start with `http://`, `https://`, or `$scheme`.
// - **permanent** - Return a permanent redirect with the 301 code.
//
// Any of "break", "last", "redirect", "permanent".
Flag string `json:"flag,omitzero"`
// contains filtered or unexported fields
}
Changes and redirects requests from the CDN to the origin. It operates according to the [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite) configuration.
The properties Body, Enabled are required.
func (ResourceReplaceParamsOptionsRewrite) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsRewrite) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsRewrite) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsRewrite) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsSecureKey ¶
type ResourceReplaceParamsOptionsSecureKey struct {
// Key generated on your side that will be used for URL signing.
Key param.Opt[string] `json:"key,omitzero,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Type of URL signing.
//
// Possible types:
//
// - **Type 0** - Includes end user IP to secure token generation.
// - **Type 2** - Excludes end user IP from secure token generation.
//
// Any of 0, 2.
Type int64 `json:"type,omitzero"`
// contains filtered or unexported fields
}
Configures access with tokenized URLs. This makes impossible to access content without a valid (unexpired) token.
The properties Enabled, Key are required.
func (ResourceReplaceParamsOptionsSecureKey) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsSecureKey) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsSecureKey) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsSecureKey) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsSlice ¶
type ResourceReplaceParamsOptionsSlice struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Requests and caches files larger than 10 MB in parts (no larger than 10 MB per part.) This reduces time to first byte.
The option is based on the [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
Notes:
- Origin must support HTTP Range requests.
- Not supported with `gzipON`, `brotli_compression` or `fetch_compressed` options enabled.
The properties Enabled, Value are required.
func (ResourceReplaceParamsOptionsSlice) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsSlice) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsSlice) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsSlice) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsSni ¶
type ResourceReplaceParamsOptionsSni struct {
// Custom SNI hostname.
//
// It is required if `sni_type` is set to custom.
CustomHostname string `json:"custom_hostname,required" format:"domain"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// SNI (Server Name Indication) type.
//
// Possible values:
//
// - **dynamic** - SNI hostname depends on `hostHeader` and `forward_host_header`
// options. It has several possible combinations:
// - If the `hostHeader` option is enabled and specified, SNI hostname matches the
// Host header.
// - If the `forward_host_header` option is enabled and has true value, SNI
// hostname matches the Host header used in the request made to a CDN.
// - If the `hostHeader` and `forward_host_header` options are disabled, SNI
// hostname matches the primary CNAME.
// - **custom** - custom SNI hostname is in use.
//
// Any of "dynamic", "custom".
SniType string `json:"sni_type,omitzero"`
// contains filtered or unexported fields
}
The hostname that is added to SNI requests from CDN servers to the origin server via HTTPS.
SNI is generally only required if your origin uses shared hosting or does not have a dedicated IP address. If the origin server presents multiple certificates, SNI allows the origin server to know which certificate to use for the connection.
The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
The properties CustomHostname, Enabled are required.
func (ResourceReplaceParamsOptionsSni) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsSni) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsSni) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsSni) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsStale ¶
type ResourceReplaceParamsOptionsStale struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Defines list of errors for which "Always online" option is applied.
//
// Any of "error", "http_403", "http_404", "http_429", "http_500", "http_502",
// "http_503", "http_504", "invalid_header", "timeout", "updating".
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Serves stale cached content in case of origin unavailability.
The properties Enabled, Value are required.
func (ResourceReplaceParamsOptionsStale) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsStale) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsStale) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsStale) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsStaticHeaders
deprecated
type ResourceReplaceParamsOptionsStaticHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// A MAP for static headers in a format of `header_name: header_value`.
//
// Restrictions:
//
// - **Header name** - Maximum 128 symbols, may contain Latin letters (A-Z, a-z),
// numbers (0-9), dashes, and underscores.
// - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
// (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
// with a letter, number, asterisk or {.
Value any `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
**Legacy option**. Use the `static_response_headers` option instead.
Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP Headers can be specified. May contain a header with multiple values.
Deprecated: deprecated
The properties Enabled, Value are required.
func (ResourceReplaceParamsOptionsStaticHeaders) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsStaticHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsStaticHeaders) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsStaticHeaders) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsStaticRequestHeaders ¶
type ResourceReplaceParamsOptionsStaticRequestHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// A MAP for static headers in a format of `header_name: header_value`.
//
// Restrictions:
//
// - **Header name** - Maximum 255 symbols, may contain Latin letters (A-Z, a-z),
// numbers (0-9), dashes, and underscores.
// - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
// (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
// with a letter, number, asterisk or {.
Value map[string]string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP Headers can be specified.
The properties Enabled, Value are required.
func (ResourceReplaceParamsOptionsStaticRequestHeaders) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsStaticRequestHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsStaticRequestHeaders) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsStaticRequestHeaders) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsStaticResponseHeaders ¶
type ResourceReplaceParamsOptionsStaticResponseHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
Value []ResourceReplaceParamsOptionsStaticResponseHeadersValue `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Custom HTTP Headers that a CDN server adds to a response.
The properties Enabled, Value are required.
func (ResourceReplaceParamsOptionsStaticResponseHeaders) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsStaticResponseHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsStaticResponseHeaders) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsStaticResponseHeaders) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsStaticResponseHeadersValue ¶
type ResourceReplaceParamsOptionsStaticResponseHeadersValue struct {
// HTTP Header name.
//
// Restrictions:
//
// - Maximum 128 symbols.
// - Latin letters (A-Z, a-z,) numbers (0-9,) dashes, and underscores only.
Name string `json:"name,required"`
// Header value.
//
// Restrictions:
//
// - Maximum 512 symbols.
// - Letters (a-z), numbers (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+
// /|\";:?.,><{}[]).
// - Must start with a letter, number, asterisk or {.
// - Multiple values can be added.
Value []string `json:"value,omitzero,required"`
// Defines whether the header will be added to a response from CDN regardless of
// response code.
//
// Possible values:
//
// - **true** - Header will be added to a response from CDN regardless of response
// code.
// - **false** - Header will be added only to the following response codes: 200,
// 201, 204, 206, 301, 302, 303, 304, 307, 308.
Always param.Opt[bool] `json:"always,omitzero"`
// contains filtered or unexported fields
}
The properties Name, Value are required.
func (ResourceReplaceParamsOptionsStaticResponseHeadersValue) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsStaticResponseHeadersValue) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsStaticResponseHeadersValue) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsStaticResponseHeadersValue) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsTlsVersions ¶
type ResourceReplaceParamsOptionsTlsVersions struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of SSL/TLS protocol versions (case sensitive).
//
// Any of "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3".
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
List of SSL/TLS protocol versions allowed for HTTPS connections from end users to the domain.
When the option is disabled, all protocols versions are allowed.
The properties Enabled, Value are required.
func (ResourceReplaceParamsOptionsTlsVersions) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsTlsVersions) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsTlsVersions) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsTlsVersions) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsUseDefaultLeChain ¶
type ResourceReplaceParamsOptionsUseDefaultLeChain struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Default Let's Encrypt certificate chain. This is a deprecated
// version, use it only for compatibilities with Android devices 7.1.1 or lower.
// - **false** - Alternative Let's Encrypt certificate chain.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Let's Encrypt certificate chain.
The specified chain will be used during the next Let's Encrypt certificate issue or renewal.
The properties Enabled, Value are required.
func (ResourceReplaceParamsOptionsUseDefaultLeChain) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsUseDefaultLeChain) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsUseDefaultLeChain) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsUseDefaultLeChain) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsUseDns01LeChallenge ¶
type ResourceReplaceParamsOptionsUseDns01LeChallenge struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - DNS-01 challenge is used to issue Let's Encrypt certificate.
// - **false** - HTTP-01 challenge is used to issue Let's Encrypt certificate.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
DNS-01 challenge to issue a Let's Encrypt certificate for the resource.
DNS service should be activated to enable this option.
The properties Enabled, Value are required.
func (ResourceReplaceParamsOptionsUseDns01LeChallenge) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsUseDns01LeChallenge) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsUseDns01LeChallenge) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsUseDns01LeChallenge) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsUseRsaLeCert ¶
type ResourceReplaceParamsOptionsUseRsaLeCert struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - RSA Let's Encrypt certificate.
// - **false** - ECDSA Let's Encrypt certificate.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
RSA Let's Encrypt certificate type for the CDN resource.
The specified value will be used during the next Let's Encrypt certificate issue or renewal.
The properties Enabled, Value are required.
func (ResourceReplaceParamsOptionsUseRsaLeCert) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsUseRsaLeCert) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsUseRsaLeCert) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsUseRsaLeCert) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsUserAgentACL ¶
type ResourceReplaceParamsOptionsUserAgentACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of User-Agents that will be allowed/denied.
//
// The meaning of the parameter depends on `policy_type`:
//
// - **allow** - List of User-Agents for which access is prohibited.
// - **deny** - List of User-Agents for which access is allowed.
//
// Use an empty string `""` to allow/deny access when the User-Agent header is
// empty.
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"user_agent"`
// User-Agents policy type.
//
// Possible values:
//
// - **allow** - Allow access for all User-Agents except specified in
// `excepted_values` field.
// - **deny** - Deny access for all User-Agents except specified in
// `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Controls access to the content for specified User-Agents.
The properties Enabled, ExceptedValues, PolicyType are required.
func (ResourceReplaceParamsOptionsUserAgentACL) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsUserAgentACL) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsUserAgentACL) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsUserAgentACL) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsWaap ¶
type ResourceReplaceParamsOptionsWaap struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Allows to enable WAAP (Web Application and API Protection).
The properties Enabled, Value are required.
func (ResourceReplaceParamsOptionsWaap) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsWaap) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsWaap) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsWaap) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOptionsWebsockets ¶
type ResourceReplaceParamsOptionsWebsockets struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Enables or disables WebSockets connections to an origin server.
The properties Enabled, Value are required.
func (ResourceReplaceParamsOptionsWebsockets) MarshalJSON ¶
func (r ResourceReplaceParamsOptionsWebsockets) MarshalJSON() (data []byte, err error)
func (*ResourceReplaceParamsOptionsWebsockets) UnmarshalJSON ¶
func (r *ResourceReplaceParamsOptionsWebsockets) UnmarshalJSON(data []byte) error
type ResourceReplaceParamsOriginProtocol ¶
type ResourceReplaceParamsOriginProtocol string
Protocol used by CDN servers to request content from an origin source.
Possible values:
- **HTTPS** - CDN servers will connect to the origin via HTTPS.
- **HTTP** - CDN servers will connect to the origin via HTTP.
- **MATCH** - connection protocol will be chosen automatically (content on the origin source should be available for the CDN both through HTTP and HTTPS).
If protocol is not specified, HTTP is used to connect to an origin server.
const ( ResourceReplaceParamsOriginProtocolHTTP ResourceReplaceParamsOriginProtocol = "HTTP" ResourceReplaceParamsOriginProtocolHTTPS ResourceReplaceParamsOriginProtocol = "HTTPS" ResourceReplaceParamsOriginProtocolMatch ResourceReplaceParamsOriginProtocol = "MATCH" )
type ResourceRuleDeleteParams ¶
type ResourceRuleDeleteParams struct {
ResourceID int64 `path:"resource_id,required" json:"-"`
// contains filtered or unexported fields
}
type ResourceRuleGetParams ¶
type ResourceRuleGetParams struct {
ResourceID int64 `path:"resource_id,required" json:"-"`
// contains filtered or unexported fields
}
type ResourceRuleNewParams ¶
type ResourceRuleNewParams struct {
// Rule name.
Name string `json:"name,required"`
// Path to the file or folder for which the rule will be applied.
//
// The rule is applied if the requested URI matches the rule path.
//
// We add a leading forward slash to any rule path. Specify a path without a
// forward slash.
Rule string `json:"rule,required"`
// Rule type.
//
// Possible values:
//
// - **Type 0** - Regular expression. Must start with '^/' or '/'.
// - **Type 1** - Regular expression. Note that for this rule type we automatically
// add / to each rule pattern before your regular expression. This type is
// **legacy**, please use Type 0.
RuleType int64 `json:"ruleType,required"`
// ID of the origin group to which the rule is applied.
//
// If the origin group is not specified, the rule is applied to the origin group
// that the CDN resource is associated with.
OriginGroup param.Opt[int64] `json:"originGroup,omitzero"`
// Enables or disables a rule.
//
// Possible values:
//
// - **true** - Rule is active, rule settings are applied.
// - **false** - Rule is inactive, rule settings are not applied.
Active param.Opt[bool] `json:"active,omitzero"`
// Rule execution order: from lowest (1) to highest.
//
// If requested URI matches multiple rules, the one higher in the order of the
// rules will be applied.
Weight param.Opt[int64] `json:"weight,omitzero"`
// Sets a protocol other than the one specified in the CDN resource settings to
// connect to the origin.
//
// Possible values:
//
// - **HTTPS** - CDN servers connect to origin via HTTPS protocol.
// - **HTTP** - CDN servers connect to origin via HTTP protocol.
// - **MATCH** - Connection protocol is chosen automatically; in this case, content
// on origin source should be available for the CDN both through HTTP and HTTPS
// protocols.
// - **null** - `originProtocol` setting is inherited from the CDN resource
// settings.
//
// Any of "HTTPS", "HTTP", "MATCH".
OverrideOriginProtocol ResourceRuleNewParamsOverrideOriginProtocol `json:"overrideOriginProtocol,omitzero"`
// List of options that can be configured for the rule.
//
// In case of `null` value the option is not added to the rule. Option inherits its
// value from the CDN resource settings.
Options ResourceRuleNewParamsOptions `json:"options,omitzero"`
// contains filtered or unexported fields
}
func (ResourceRuleNewParams) MarshalJSON ¶
func (r ResourceRuleNewParams) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParams) UnmarshalJSON ¶
func (r *ResourceRuleNewParams) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptions ¶
type ResourceRuleNewParamsOptions struct {
// HTTP methods allowed for content requests from the CDN.
AllowedHTTPMethods ResourceRuleNewParamsOptionsAllowedHTTPMethods `json:"allowedHttpMethods,omitzero"`
// Allows to prevent online services from overloading and ensure your business
// workflow running smoothly.
BotProtection ResourceRuleNewParamsOptionsBotProtection `json:"bot_protection,omitzero"`
// Compresses content with Brotli on the CDN side. CDN servers will request only
// uncompressed content from the origin.
//
// Notes:
//
// 1. CDN only supports "Brotli compression" when the "origin shielding" feature is
// activated.
// 2. If a precache server is not active for a CDN resource, no compression occurs,
// even if the option is enabled.
// 3. `brotli_compression` is not supported with `fetch_compressed` or `slice`
// options enabled.
// 4. `fetch_compressed` option in CDN resource settings overrides
// `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN
// resource and want to enable `brotli_compression` in a rule, you must specify
// `fetch_compressed:false` in the rule.
BrotliCompression ResourceRuleNewParamsOptionsBrotliCompression `json:"brotli_compression,omitzero"`
// Cache expiration time for users browsers in seconds.
//
// Cache expiration time is applied to the following response codes: 200, 201, 204,
// 206, 301, 302, 303, 304, 307, 308.
//
// Responses with other codes will not be cached.
BrowserCacheSettings ResourceRuleNewParamsOptionsBrowserCacheSettings `json:"browser_cache_settings,omitzero"`
// **Legacy option**. Use the `response_headers_hiding_policy` option instead.
//
// HTTP Headers that must be included in the response.
//
// Deprecated: deprecated
CacheHTTPHeaders ResourceRuleNewParamsOptionsCacheHTTPHeaders `json:"cache_http_headers,omitzero"`
// Enables or disables CORS (Cross-Origin Resource Sharing) header support.
//
// CORS header support allows the CDN to add the Access-Control-Allow-Origin header
// to a response to a browser.
Cors ResourceRuleNewParamsOptionsCors `json:"cors,omitzero"`
// Enables control access to content for specified countries.
CountryACL ResourceRuleNewParamsOptionsCountryACL `json:"country_acl,omitzero"`
// **Legacy option**. Use the `edge_cache_settings` option instead.
//
// Allows the complete disabling of content caching.
//
// Deprecated: deprecated
DisableCache ResourceRuleNewParamsOptionsDisableCache `json:"disable_cache,omitzero"`
// Allows 206 responses regardless of the settings of an origin source.
DisableProxyForceRanges ResourceRuleNewParamsOptionsDisableProxyForceRanges `json:"disable_proxy_force_ranges,omitzero"`
// Cache expiration time for CDN servers.
//
// `value` and `default` fields cannot be used simultaneously.
EdgeCacheSettings ResourceRuleNewParamsOptionsEdgeCacheSettings `json:"edge_cache_settings,omitzero"`
// Allows to configure FastEdge app to be called on different request/response
// phases.
//
// Note: At least one of `on_request_headers`, `on_request_body`,
// `on_response_headers`, or `on_response_body` must be specified.
Fastedge ResourceRuleNewParamsOptionsFastedge `json:"fastedge,omitzero"`
// Makes the CDN request compressed content from the origin.
//
// The origin server should support compression. CDN servers will not decompress
// your content even if a user browser does not accept compression.
//
// Notes:
//
// 1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or
// `slice` options enabled.
// 2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If
// you enable it in CDN resource and want to use `gzipON` and
// `brotli_compression` in a rule, you have to specify
// `"fetch_compressed": false` in the rule.
FetchCompressed ResourceRuleNewParamsOptionsFetchCompressed `json:"fetch_compressed,omitzero"`
// Enables redirection from origin. If the origin server returns a redirect, the
// option allows the CDN to pull the requested content from the origin server that
// was returned in the redirect.
FollowOriginRedirect ResourceRuleNewParamsOptionsFollowOriginRedirect `json:"follow_origin_redirect,omitzero"`
// Applies custom HTTP response codes for CDN content.
//
// The following codes are reserved by our system and cannot be specified in this
// option: 408, 444, 477, 494, 495, 496, 497, 499.
ForceReturn ResourceRuleNewParamsOptionsForceReturn `json:"force_return,omitzero"`
// Forwards the Host header from a end-user request to an origin server.
//
// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
ForwardHostHeader ResourceRuleNewParamsOptionsForwardHostHeader `json:"forward_host_header,omitzero"`
// Compresses content with gzip on the CDN end. CDN servers will request only
// uncompressed content from the origin.
//
// Notes:
//
// 1. Compression with gzip is not supported with `fetch_compressed` or `slice`
// options enabled.
// 2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in
// rules. If you enable `fetch_compressed` in CDN resource and want to enable
// `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
GzipOn ResourceRuleNewParamsOptionsGzipOn `json:"gzipOn,omitzero"`
// Sets the Host header that CDN servers use when request content from an origin
// server. Your server must be able to process requests with the chosen header.
//
// If the option is `null`, the Host Header value is equal to first CNAME.
//
// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
HostHeader ResourceRuleNewParamsOptionsHostHeader `json:"hostHeader,omitzero"`
// Defines whether the files with the Set-Cookies header are cached as one file or
// as different ones.
IgnoreCookie ResourceRuleNewParamsOptionsIgnoreCookie `json:"ignore_cookie,omitzero"`
// How a file with different query strings is cached: either as one object (option
// is enabled) or as different objects (option is disabled.)
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
IgnoreQueryString ResourceRuleNewParamsOptionsIgnoreQueryString `json:"ignoreQueryString,omitzero"`
// Transforms JPG and PNG images (for example, resize or crop) and automatically
// converts them to WebP or AVIF format.
ImageStack ResourceRuleNewParamsOptionsImageStack `json:"image_stack,omitzero"`
// Controls access to the CDN resource content for specific IP addresses.
//
// If you want to use IPs from our CDN servers IP list for IP ACL configuration,
// you have to independently monitor their relevance. We recommend you use a script
// for automatically update IP ACL.
// [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
IPAddressACL ResourceRuleNewParamsOptionsIPAddressACL `json:"ip_address_acl,omitzero"`
// Allows to control the download speed per connection.
LimitBandwidth ResourceRuleNewParamsOptionsLimitBandwidth `json:"limit_bandwidth,omitzero"`
// Allows you to modify your cache key. If omitted, the default value is
// `$request_uri`.
//
// Combine the specified variables to create a key for caching.
//
// - **$`request_uri`**
// - **$scheme**
// - **$uri**
//
// **Warning**: Enabling and changing this option can invalidate your current cache
// and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will
// not work.
ProxyCacheKey ResourceRuleNewParamsOptionsProxyCacheKey `json:"proxy_cache_key,omitzero"`
// Caching for POST requests along with default GET and HEAD.
ProxyCacheMethodsSet ResourceRuleNewParamsOptionsProxyCacheMethodsSet `json:"proxy_cache_methods_set,omitzero"`
// The time limit for establishing a connection with the origin.
ProxyConnectTimeout ResourceRuleNewParamsOptionsProxyConnectTimeout `json:"proxy_connect_timeout,omitzero"`
// The time limit for receiving a partial response from the origin. If no response
// is received within this time, the connection will be closed.
//
// **Note:** When used with a WebSocket connection, this option supports values
// only in the range 1–20 seconds (instead of the usual 1–30 seconds).
ProxyReadTimeout ResourceRuleNewParamsOptionsProxyReadTimeout `json:"proxy_read_timeout,omitzero"`
// Files with the specified query parameters are cached as one object, files with
// other parameters are cached as different objects.
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
QueryParamsBlacklist ResourceRuleNewParamsOptionsQueryParamsBlacklist `json:"query_params_blacklist,omitzero"`
// Files with the specified query parameters are cached as different objects, files
// with other parameters are cached as one object.
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
QueryParamsWhitelist ResourceRuleNewParamsOptionsQueryParamsWhitelist `json:"query_params_whitelist,omitzero"`
// The Query String Forwarding feature allows for the seamless transfer of
// parameters embedded in playlist files to the corresponding media chunk files.
// This functionality ensures that specific attributes, such as authentication
// tokens or tracking information, are consistently passed along from the playlist
// manifest to the individual media segments. This is particularly useful for
// maintaining continuity in security, analytics, and any other parameter-based
// operations across the entire media delivery workflow.
QueryStringForwarding ResourceRuleNewParamsOptionsQueryStringForwarding `json:"query_string_forwarding,omitzero"`
// Enables redirect from HTTP to HTTPS.
//
// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
// simultaneously.
RedirectHTTPToHTTPS ResourceRuleNewParamsOptionsRedirectHTTPToHTTPS `json:"redirect_http_to_https,omitzero"`
// Enables redirect from HTTPS to HTTP.
//
// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
// simultaneously.
RedirectHTTPSToHTTP ResourceRuleNewParamsOptionsRedirectHTTPSToHTTP `json:"redirect_https_to_http,omitzero"`
// Controls access to the CDN resource content for specified domain names.
ReferrerACL ResourceRuleNewParamsOptionsReferrerACL `json:"referrer_acl,omitzero"`
// Option allows to limit the amount of HTTP requests.
RequestLimiter ResourceRuleNewParamsOptionsRequestLimiter `json:"request_limiter,omitzero"`
// Hides HTTP headers from an origin server in the CDN response.
ResponseHeadersHidingPolicy ResourceRuleNewParamsOptionsResponseHeadersHidingPolicy `json:"response_headers_hiding_policy,omitzero"`
// Changes and redirects requests from the CDN to the origin. It operates according
// to the
// [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite)
// configuration.
Rewrite ResourceRuleNewParamsOptionsRewrite `json:"rewrite,omitzero"`
// Configures access with tokenized URLs. This makes impossible to access content
// without a valid (unexpired) token.
SecureKey ResourceRuleNewParamsOptionsSecureKey `json:"secure_key,omitzero"`
// Requests and caches files larger than 10 MB in parts (no larger than 10 MB per
// part.) This reduces time to first byte.
//
// The option is based on the
// [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
//
// Notes:
//
// 1. Origin must support HTTP Range requests.
// 2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed`
// options enabled.
Slice ResourceRuleNewParamsOptionsSlice `json:"slice,omitzero"`
// The hostname that is added to SNI requests from CDN servers to the origin server
// via HTTPS.
//
// SNI is generally only required if your origin uses shared hosting or does not
// have a dedicated IP address. If the origin server presents multiple
// certificates, SNI allows the origin server to know which certificate to use for
// the connection.
//
// The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
Sni ResourceRuleNewParamsOptionsSni `json:"sni,omitzero"`
// Serves stale cached content in case of origin unavailability.
Stale ResourceRuleNewParamsOptionsStale `json:"stale,omitzero"`
// Custom HTTP Headers that a CDN server adds to a response.
StaticResponseHeaders ResourceRuleNewParamsOptionsStaticResponseHeaders `json:"static_response_headers,omitzero"`
// **Legacy option**. Use the `static_response_headers` option instead.
//
// Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP
// Headers can be specified. May contain a header with multiple values.
//
// Deprecated: deprecated
StaticHeaders ResourceRuleNewParamsOptionsStaticHeaders `json:"staticHeaders,omitzero"`
// Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP
// Headers can be specified.
StaticRequestHeaders ResourceRuleNewParamsOptionsStaticRequestHeaders `json:"staticRequestHeaders,omitzero"`
// Controls access to the content for specified User-Agents.
UserAgentACL ResourceRuleNewParamsOptionsUserAgentACL `json:"user_agent_acl,omitzero"`
// Allows to enable WAAP (Web Application and API Protection).
Waap ResourceRuleNewParamsOptionsWaap `json:"waap,omitzero"`
// Enables or disables WebSockets connections to an origin server.
Websockets ResourceRuleNewParamsOptionsWebsockets `json:"websockets,omitzero"`
// contains filtered or unexported fields
}
List of options that can be configured for the rule.
In case of `null` value the option is not added to the rule. Option inherits its value from the CDN resource settings.
func (ResourceRuleNewParamsOptions) MarshalJSON ¶
func (r ResourceRuleNewParamsOptions) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptions) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptions) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsAllowedHTTPMethods ¶
type ResourceRuleNewParamsOptionsAllowedHTTPMethods struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
HTTP methods allowed for content requests from the CDN.
The properties Enabled, Value are required.
func (ResourceRuleNewParamsOptionsAllowedHTTPMethods) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsAllowedHTTPMethods) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsAllowedHTTPMethods) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsAllowedHTTPMethods) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsBotProtection ¶
type ResourceRuleNewParamsOptionsBotProtection struct {
// Controls the bot challenge module state.
BotChallenge ResourceRuleNewParamsOptionsBotProtectionBotChallenge `json:"bot_challenge,omitzero,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// contains filtered or unexported fields
}
Allows to prevent online services from overloading and ensure your business workflow running smoothly.
The properties BotChallenge, Enabled are required.
func (ResourceRuleNewParamsOptionsBotProtection) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsBotProtection) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsBotProtection) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsBotProtection) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsBotProtectionBotChallenge ¶
type ResourceRuleNewParamsOptionsBotProtectionBotChallenge struct {
// Possible values:
//
// - **true** - Bot challenge is enabled.
// - **false** - Bot challenge is disabled.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// contains filtered or unexported fields
}
Controls the bot challenge module state.
func (ResourceRuleNewParamsOptionsBotProtectionBotChallenge) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsBotProtectionBotChallenge) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsBotProtectionBotChallenge) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsBotProtectionBotChallenge) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsBrotliCompression ¶
type ResourceRuleNewParamsOptionsBrotliCompression struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Allows to select the content types you want to compress.
//
// `text/html` is a mandatory content type.
//
// Any of "application/javascript", "application/json",
// "application/vnd.ms-fontobject", "application/wasm", "application/x-font-ttf",
// "application/x-javascript", "application/xml", "application/xml+rss",
// "image/svg+xml", "image/x-icon", "text/css", "text/html", "text/javascript",
// "text/plain", "text/xml".
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Compresses content with Brotli on the CDN side. CDN servers will request only uncompressed content from the origin.
Notes:
- CDN only supports "Brotli compression" when the "origin shielding" feature is activated.
- If a precache server is not active for a CDN resource, no compression occurs, even if the option is enabled.
- `brotli_compression` is not supported with `fetch_compressed` or `slice` options enabled.
- `fetch_compressed` option in CDN resource settings overrides `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN resource and want to enable `brotli_compression` in a rule, you must specify `fetch_compressed:false` in the rule.
The properties Enabled, Value are required.
func (ResourceRuleNewParamsOptionsBrotliCompression) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsBrotliCompression) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsBrotliCompression) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsBrotliCompression) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsBrowserCacheSettings ¶
type ResourceRuleNewParamsOptionsBrowserCacheSettings struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Set the cache expiration time to '0s' to disable caching.
//
// The maximum duration is any equivalent to `1y`.
Value string `json:"value,required" format:"nginx time"`
// contains filtered or unexported fields
}
Cache expiration time for users browsers in seconds.
Cache expiration time is applied to the following response codes: 200, 201, 204, 206, 301, 302, 303, 304, 307, 308.
Responses with other codes will not be cached.
The properties Enabled, Value are required.
func (ResourceRuleNewParamsOptionsBrowserCacheSettings) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsBrowserCacheSettings) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsBrowserCacheSettings) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsBrowserCacheSettings) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsCacheHTTPHeaders
deprecated
type ResourceRuleNewParamsOptionsCacheHTTPHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
**Legacy option**. Use the `response_headers_hiding_policy` option instead.
HTTP Headers that must be included in the response.
Deprecated: deprecated
The properties Enabled, Value are required.
func (ResourceRuleNewParamsOptionsCacheHTTPHeaders) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsCacheHTTPHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsCacheHTTPHeaders) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsCacheHTTPHeaders) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsCors ¶
type ResourceRuleNewParamsOptionsCors struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Value of the Access-Control-Allow-Origin header.
//
// Possible values:
//
// - **Adds \* as the Access-Control-Allow-Origin header value** - Content will be
// uploaded for requests from any domain. `"value": ["*"]`
// - **Adds "$http_origin" as the Access-Control-Allow-Origin header value if the
// origin matches one of the listed domains** - Content will be uploaded only for
// requests from the domains specified in the field.
// `"value": ["domain.com", "second.dom.com"]`
// - **Adds "$http_origin" as the Access-Control-Allow-Origin header value** -
// Content will be uploaded for requests from any domain, and the domain from
// which the request was sent will be added to the "Access-Control-Allow-Origin"
// header in the response. `"value": ["$http_origin"]`
Value []string `json:"value,omitzero,required"`
// Defines whether the Access-Control-Allow-Origin header should be added to a
// response from CDN regardless of response code.
//
// Possible values:
//
// - **true** - Header will be added to a response regardless of response code.
// - **false** - Header will only be added to responses with codes: 200, 201, 204,
// 206, 301, 302, 303, 304, 307, 308.
Always param.Opt[bool] `json:"always,omitzero"`
// contains filtered or unexported fields
}
Enables or disables CORS (Cross-Origin Resource Sharing) header support.
CORS header support allows the CDN to add the Access-Control-Allow-Origin header to a response to a browser.
The properties Enabled, Value are required.
func (ResourceRuleNewParamsOptionsCors) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsCors) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsCors) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsCors) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsCountryACL ¶
type ResourceRuleNewParamsOptionsCountryACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of countries according to ISO-3166-1.
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of countries for which access is prohibited.
// - **deny** - List of countries for which access is allowed.
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"country-code"`
// Defines the type of CDN resource access policy.
//
// Possible values:
//
// - **allow** - Access is allowed for all the countries except for those specified
// in `excepted_values` field.
// - **deny** - Access is denied for all the countries except for those specified
// in `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Enables control access to content for specified countries.
The properties Enabled, ExceptedValues, PolicyType are required.
func (ResourceRuleNewParamsOptionsCountryACL) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsCountryACL) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsCountryACL) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsCountryACL) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsDisableCache
deprecated
type ResourceRuleNewParamsOptionsDisableCache struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - content caching is disabled.
// - **false** - content caching is enabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
**Legacy option**. Use the `edge_cache_settings` option instead.
Allows the complete disabling of content caching.
Deprecated: deprecated
The properties Enabled, Value are required.
func (ResourceRuleNewParamsOptionsDisableCache) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsDisableCache) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsDisableCache) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsDisableCache) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsDisableProxyForceRanges ¶
type ResourceRuleNewParamsOptionsDisableProxyForceRanges struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Allows 206 responses regardless of the settings of an origin source.
The properties Enabled, Value are required.
func (ResourceRuleNewParamsOptionsDisableProxyForceRanges) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsDisableProxyForceRanges) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsDisableProxyForceRanges) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsDisableProxyForceRanges) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsEdgeCacheSettings ¶
type ResourceRuleNewParamsOptionsEdgeCacheSettings struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Enables content caching according to the origin cache settings.
//
// The value is applied to the following response codes 200, 201, 204, 206, 301,
// 302, 303, 304, 307, 308, if an origin server does not have caching HTTP headers.
//
// Responses with other codes will not be cached.
//
// The maximum duration is any equivalent to `1y`.
Default param.Opt[string] `json:"default,omitzero" format:"nginx time"`
// Caching time.
//
// The value is applied to the following response codes: 200, 206, 301, 302.
// Responses with codes 4xx, 5xx will not be cached.
//
// Use `0s` to disable caching.
//
// The maximum duration is any equivalent to `1y`.
Value param.Opt[string] `json:"value,omitzero" format:"nginx time"`
// A MAP object representing the caching time in seconds for a response with a
// specific response code.
//
// These settings have a higher priority than the `value` field.
//
// - Use `any` key to specify caching time for all response codes.
// - Use `0s` value to disable caching for a specific response code.
CustomValues map[string]string `json:"custom_values,omitzero" format:"nginx time"`
// contains filtered or unexported fields
}
Cache expiration time for CDN servers.
`value` and `default` fields cannot be used simultaneously.
The property Enabled is required.
func (ResourceRuleNewParamsOptionsEdgeCacheSettings) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsEdgeCacheSettings) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsEdgeCacheSettings) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsEdgeCacheSettings) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsFastedge ¶
type ResourceRuleNewParamsOptionsFastedge struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Allows to configure FastEdge application that will be called to handle request
// body as soon as CDN receives incoming HTTP request.
OnRequestBody ResourceRuleNewParamsOptionsFastedgeOnRequestBody `json:"on_request_body,omitzero"`
// Allows to configure FastEdge application that will be called to handle request
// headers as soon as CDN receives incoming HTTP request.
OnRequestHeaders ResourceRuleNewParamsOptionsFastedgeOnRequestHeaders `json:"on_request_headers,omitzero"`
// Allows to configure FastEdge application that will be called to handle response
// body before CDN sends the HTTP response.
OnResponseBody ResourceRuleNewParamsOptionsFastedgeOnResponseBody `json:"on_response_body,omitzero"`
// Allows to configure FastEdge application that will be called to handle response
// headers before CDN sends the HTTP response.
OnResponseHeaders ResourceRuleNewParamsOptionsFastedgeOnResponseHeaders `json:"on_response_headers,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge app to be called on different request/response phases.
Note: At least one of `on_request_headers`, `on_request_body`, `on_response_headers`, or `on_response_body` must be specified.
The property Enabled is required.
func (ResourceRuleNewParamsOptionsFastedge) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsFastedge) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsFastedge) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsFastedge) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsFastedgeOnRequestBody ¶
type ResourceRuleNewParamsOptionsFastedgeOnRequestBody struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle request body as soon as CDN receives incoming HTTP request.
The property AppID is required.
func (ResourceRuleNewParamsOptionsFastedgeOnRequestBody) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsFastedgeOnRequestBody) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsFastedgeOnRequestBody) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsFastedgeOnRequestBody) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsFastedgeOnRequestHeaders ¶
type ResourceRuleNewParamsOptionsFastedgeOnRequestHeaders struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request.
The property AppID is required.
func (ResourceRuleNewParamsOptionsFastedgeOnRequestHeaders) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsFastedgeOnRequestHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsFastedgeOnResponseBody ¶
type ResourceRuleNewParamsOptionsFastedgeOnResponseBody struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle response body before CDN sends the HTTP response.
The property AppID is required.
func (ResourceRuleNewParamsOptionsFastedgeOnResponseBody) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsFastedgeOnResponseBody) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsFastedgeOnResponseBody) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsFastedgeOnResponseBody) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsFastedgeOnResponseHeaders ¶
type ResourceRuleNewParamsOptionsFastedgeOnResponseHeaders struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle response headers before CDN sends the HTTP response.
The property AppID is required.
func (ResourceRuleNewParamsOptionsFastedgeOnResponseHeaders) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsFastedgeOnResponseHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsFastedgeOnResponseHeaders) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsFastedgeOnResponseHeaders) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsFetchCompressed ¶
type ResourceRuleNewParamsOptionsFetchCompressed struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Makes the CDN request compressed content from the origin.
The origin server should support compression. CDN servers will not decompress your content even if a user browser does not accept compression.
Notes:
- `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or `slice` options enabled.
- `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If you enable it in CDN resource and want to use `gzipON` and `brotli_compression` in a rule, you have to specify `"fetch_compressed": false` in the rule.
The properties Enabled, Value are required.
func (ResourceRuleNewParamsOptionsFetchCompressed) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsFetchCompressed) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsFetchCompressed) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsFetchCompressed) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsFollowOriginRedirect ¶
type ResourceRuleNewParamsOptionsFollowOriginRedirect struct {
// Redirect status code that the origin server returns.
//
// To serve up to date content to end users, you will need to purge the cache after
// managing the option.
//
// Any of 301, 302, 303, 307, 308.
Codes []int64 `json:"codes,omitzero,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// contains filtered or unexported fields
}
Enables redirection from origin. If the origin server returns a redirect, the option allows the CDN to pull the requested content from the origin server that was returned in the redirect.
The properties Codes, Enabled are required.
func (ResourceRuleNewParamsOptionsFollowOriginRedirect) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsFollowOriginRedirect) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsFollowOriginRedirect) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsFollowOriginRedirect) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsForceReturn ¶
type ResourceRuleNewParamsOptionsForceReturn struct {
// URL for redirection or text.
Body string `json:"body,required"`
// Status code value.
Code int64 `json:"code,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Controls the time at which a custom HTTP response code should be applied. By
// default, a custom HTTP response code is applied at any time.
TimeInterval ResourceRuleNewParamsOptionsForceReturnTimeInterval `json:"time_interval,omitzero"`
// contains filtered or unexported fields
}
Applies custom HTTP response codes for CDN content.
The following codes are reserved by our system and cannot be specified in this option: 408, 444, 477, 494, 495, 496, 497, 499.
The properties Body, Code, Enabled are required.
func (ResourceRuleNewParamsOptionsForceReturn) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsForceReturn) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsForceReturn) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsForceReturn) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsForceReturnTimeInterval ¶
type ResourceRuleNewParamsOptionsForceReturnTimeInterval struct {
// Time until which a custom HTTP response code should be applied. Indicated in
// 24-hour format.
EndTime string `json:"end_time,required"`
// Time from which a custom HTTP response code should be applied. Indicated in
// 24-hour format.
StartTime string `json:"start_time,required"`
// Time zone used to calculate time.
TimeZone param.Opt[string] `json:"time_zone,omitzero" format:"timezone"`
// contains filtered or unexported fields
}
Controls the time at which a custom HTTP response code should be applied. By default, a custom HTTP response code is applied at any time.
The properties EndTime, StartTime are required.
func (ResourceRuleNewParamsOptionsForceReturnTimeInterval) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsForceReturnTimeInterval) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsForceReturnTimeInterval) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsForceReturnTimeInterval) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsForwardHostHeader ¶
type ResourceRuleNewParamsOptionsForwardHostHeader struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Forwards the Host header from a end-user request to an origin server.
`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceRuleNewParamsOptionsForwardHostHeader) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsForwardHostHeader) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsForwardHostHeader) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsForwardHostHeader) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsGzipOn ¶
type ResourceRuleNewParamsOptionsGzipOn struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Compresses content with gzip on the CDN end. CDN servers will request only uncompressed content from the origin.
Notes:
- Compression with gzip is not supported with `fetch_compressed` or `slice` options enabled.
- `fetch_compressed` option in CDN resource settings overrides `gzipON` in rules. If you enable `fetch_compressed` in CDN resource and want to enable `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
The properties Enabled, Value are required.
func (ResourceRuleNewParamsOptionsGzipOn) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsGzipOn) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsGzipOn) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsGzipOn) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsHostHeader ¶
type ResourceRuleNewParamsOptionsHostHeader struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Host Header value.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
Sets the Host header that CDN servers use when request content from an origin server. Your server must be able to process requests with the chosen header.
If the option is `null`, the Host Header value is equal to first CNAME.
`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceRuleNewParamsOptionsHostHeader) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsHostHeader) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsHostHeader) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsHostHeader) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsIPAddressACL ¶
type ResourceRuleNewParamsOptionsIPAddressACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of IP addresses with a subnet mask.
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of IP addresses for which access is prohibited.
// - **deny** - List of IP addresses for which access is allowed.
//
// Examples:
//
// - `192.168.3.2/32`
// - `2a03:d000:2980:7::8/128`
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"ipv4net or ipv6net"`
// IP access policy type.
//
// Possible values:
//
// - **allow** - Allow access to all IPs except IPs specified in "excepted_values"
// field.
// - **deny** - Deny access to all IPs except IPs specified in "excepted_values"
// field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Controls access to the CDN resource content for specific IP addresses.
If you want to use IPs from our CDN servers IP list for IP ACL configuration, you have to independently monitor their relevance. We recommend you use a script for automatically update IP ACL. [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
The properties Enabled, ExceptedValues, PolicyType are required.
func (ResourceRuleNewParamsOptionsIPAddressACL) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsIPAddressACL) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsIPAddressACL) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsIPAddressACL) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsIgnoreCookie ¶
type ResourceRuleNewParamsOptionsIgnoreCookie struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled, files with cookies are cached as one file.
// - **false** - Option is disabled, files with cookies are cached as different
// files.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Defines whether the files with the Set-Cookies header are cached as one file or as different ones.
The properties Enabled, Value are required.
func (ResourceRuleNewParamsOptionsIgnoreCookie) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsIgnoreCookie) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsIgnoreCookie) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsIgnoreCookie) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsIgnoreQueryString ¶
type ResourceRuleNewParamsOptionsIgnoreQueryString struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
How a file with different query strings is cached: either as one object (option is enabled) or as different objects (option is disabled.)
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceRuleNewParamsOptionsIgnoreQueryString) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsIgnoreQueryString) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsIgnoreQueryString) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsIgnoreQueryString) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsImageStack ¶
type ResourceRuleNewParamsOptionsImageStack struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Enables or disables automatic conversion of JPEG and PNG images to AVI format.
AvifEnabled param.Opt[bool] `json:"avif_enabled,omitzero"`
// Enables or disables compression without quality loss for PNG format.
PngLossless param.Opt[bool] `json:"png_lossless,omitzero"`
// Defines quality settings for JPG and PNG images. The higher the value, the
// better the image quality, and the larger the file size after conversion.
Quality param.Opt[int64] `json:"quality,omitzero"`
// Enables or disables automatic conversion of JPEG and PNG images to WebP format.
WebpEnabled param.Opt[bool] `json:"webp_enabled,omitzero"`
// contains filtered or unexported fields
}
Transforms JPG and PNG images (for example, resize or crop) and automatically converts them to WebP or AVIF format.
The property Enabled is required.
func (ResourceRuleNewParamsOptionsImageStack) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsImageStack) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsImageStack) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsImageStack) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsLimitBandwidth ¶
type ResourceRuleNewParamsOptionsLimitBandwidth struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Method of controlling the download speed per connection.
//
// Possible values:
//
// - **static** - Use speed and buffer fields to set the download speed limit.
// - **dynamic** - Use query strings **speed** and **buffer** to set the download
// speed limit.
//
// # For example, when requesting content at the link
//
// “`
// http://cdn.example.com/video.mp4?speed=50k&buffer=500k
// “`
//
// the download speed will be limited to 50kB/s after 500 kB.
//
// Any of "static", "dynamic".
LimitType string `json:"limit_type,omitzero,required"`
// Amount of downloaded data after which the user will be rate limited.
Buffer param.Opt[int64] `json:"buffer,omitzero"`
// Maximum download speed per connection.
Speed param.Opt[int64] `json:"speed,omitzero"`
// contains filtered or unexported fields
}
Allows to control the download speed per connection.
The properties Enabled, LimitType are required.
func (ResourceRuleNewParamsOptionsLimitBandwidth) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsLimitBandwidth) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsLimitBandwidth) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsLimitBandwidth) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsProxyCacheKey ¶
type ResourceRuleNewParamsOptionsProxyCacheKey struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Key for caching.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
Allows you to modify your cache key. If omitted, the default value is `$request_uri`.
Combine the specified variables to create a key for caching.
- **$`request_uri`** - **$scheme** - **$uri**
**Warning**: Enabling and changing this option can invalidate your current cache and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will not work.
The properties Enabled, Value are required.
func (ResourceRuleNewParamsOptionsProxyCacheKey) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsProxyCacheKey) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsProxyCacheKey) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsProxyCacheKey) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsProxyCacheMethodsSet ¶
type ResourceRuleNewParamsOptionsProxyCacheMethodsSet struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Caching for POST requests along with default GET and HEAD.
The properties Enabled, Value are required.
func (ResourceRuleNewParamsOptionsProxyCacheMethodsSet) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsProxyCacheMethodsSet) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsProxyCacheMethodsSet) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsProxyCacheMethodsSet) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsProxyConnectTimeout ¶
type ResourceRuleNewParamsOptionsProxyConnectTimeout struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Timeout value in seconds.
//
// Supported range: **1s - 5s**.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
The time limit for establishing a connection with the origin.
The properties Enabled, Value are required.
func (ResourceRuleNewParamsOptionsProxyConnectTimeout) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsProxyConnectTimeout) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsProxyConnectTimeout) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsProxyConnectTimeout) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsProxyReadTimeout ¶
type ResourceRuleNewParamsOptionsProxyReadTimeout struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Timeout value in seconds.
//
// Supported range: **1s - 30s**.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
The time limit for receiving a partial response from the origin. If no response is received within this time, the connection will be closed.
**Note:** When used with a WebSocket connection, this option supports values only in the range 1–20 seconds (instead of the usual 1–30 seconds).
The properties Enabled, Value are required.
func (ResourceRuleNewParamsOptionsProxyReadTimeout) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsProxyReadTimeout) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsProxyReadTimeout) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsProxyReadTimeout) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsQueryParamsBlacklist ¶
type ResourceRuleNewParamsOptionsQueryParamsBlacklist struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of query parameters.
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Files with the specified query parameters are cached as one object, files with other parameters are cached as different objects.
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceRuleNewParamsOptionsQueryParamsBlacklist) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsQueryParamsBlacklist) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsQueryParamsBlacklist) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsQueryParamsBlacklist) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsQueryParamsWhitelist ¶
type ResourceRuleNewParamsOptionsQueryParamsWhitelist struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of query parameters.
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Files with the specified query parameters are cached as different objects, files with other parameters are cached as one object.
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceRuleNewParamsOptionsQueryParamsWhitelist) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsQueryParamsWhitelist) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsQueryParamsWhitelist) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsQueryParamsWhitelist) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsQueryStringForwarding ¶
type ResourceRuleNewParamsOptionsQueryStringForwarding struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// The `forward_from_files_types` field specifies the types of playlist files from
// which parameters will be extracted and forwarded. This typically includes
// formats that list multiple media chunk references, such as HLS and DASH
// playlists. Parameters associated with these playlist files (like query strings
// or headers) will be propagated to the chunks they reference.
ForwardFromFileTypes []string `json:"forward_from_file_types,omitzero,required"`
// The field specifies the types of media chunk files to which parameters,
// extracted from playlist files, will be forwarded. These refer to the actual
// segments of media content that are delivered to viewers. Ensuring the correct
// parameters are forwarded to these files is crucial for maintaining the integrity
// of the streaming session.
ForwardToFileTypes []string `json:"forward_to_file_types,omitzero,required"`
// The `forward_except_keys` field provides a mechanism to exclude specific
// parameters from being forwarded from playlist files to media chunk files. By
// listing certain keys in this field, you can ensure that these parameters are
// omitted during the forwarding process. This is particularly useful for
// preventing sensitive or irrelevant information from being included in requests
// for media chunks, thereby enhancing security and optimizing performance.
ForwardExceptKeys []string `json:"forward_except_keys,omitzero"`
// The `forward_only_keys` field allows for granular control over which specific
// parameters are forwarded from playlist files to media chunk files. By specifying
// certain keys, only those parameters will be propagated, ensuring that only
// relevant information is passed along. This is particularly useful for security
// and performance optimization, as it prevents unnecessary or sensitive data from
// being included in requests for media chunks.
ForwardOnlyKeys []string `json:"forward_only_keys,omitzero"`
// contains filtered or unexported fields
}
The Query String Forwarding feature allows for the seamless transfer of parameters embedded in playlist files to the corresponding media chunk files. This functionality ensures that specific attributes, such as authentication tokens or tracking information, are consistently passed along from the playlist manifest to the individual media segments. This is particularly useful for maintaining continuity in security, analytics, and any other parameter-based operations across the entire media delivery workflow.
The properties Enabled, ForwardFromFileTypes, ForwardToFileTypes are required.
func (ResourceRuleNewParamsOptionsQueryStringForwarding) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsQueryStringForwarding) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsQueryStringForwarding) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsQueryStringForwarding) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsRedirectHTTPSToHTTP ¶
type ResourceRuleNewParamsOptionsRedirectHTTPSToHTTP struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Enables redirect from HTTPS to HTTP.
`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceRuleNewParamsOptionsRedirectHTTPSToHTTP) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsRedirectHTTPSToHTTP) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsRedirectHTTPSToHTTP) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsRedirectHTTPSToHTTP) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsRedirectHTTPToHTTPS ¶
type ResourceRuleNewParamsOptionsRedirectHTTPToHTTPS struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Enables redirect from HTTP to HTTPS.
`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceRuleNewParamsOptionsRedirectHTTPToHTTPS) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsRedirectHTTPToHTTPS) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsRedirectHTTPToHTTPS) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsRedirectHTTPToHTTPS) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsReferrerACL ¶
type ResourceRuleNewParamsOptionsReferrerACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of domain names or wildcard domains (without protocol: `http://` or
// `https://`.)
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of domain names for which access is prohibited.
// - **deny** - List of IP domain names for which access is allowed.
//
// Examples:
//
// - `example.com`
// - `*.example.com`
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"domain or wildcard"`
// Policy type.
//
// Possible values:
//
// - **allow** - Allow access to all domain names except the domain names specified
// in `excepted_values` field.
// - **deny** - Deny access to all domain names except the domain names specified
// in `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Controls access to the CDN resource content for specified domain names.
The properties Enabled, ExceptedValues, PolicyType are required.
func (ResourceRuleNewParamsOptionsReferrerACL) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsReferrerACL) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsReferrerACL) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsReferrerACL) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsRequestLimiter ¶
type ResourceRuleNewParamsOptionsRequestLimiter struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Maximum request rate.
Rate int64 `json:"rate,required"`
// Units of measurement for the `rate` field.
//
// Possible values:
//
// - **r/s** - Requests per second.
// - **r/m** - Requests per minute.
//
// If the rate is less than one request per second, it is specified in request per
// minute (r/m.)
//
// Any of "r/s", "r/m".
RateUnit string `json:"rate_unit,omitzero"`
// contains filtered or unexported fields
}
Option allows to limit the amount of HTTP requests.
The properties Enabled, Rate are required.
func (ResourceRuleNewParamsOptionsRequestLimiter) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsRequestLimiter) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsRequestLimiter) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsRequestLimiter) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsResponseHeadersHidingPolicy ¶
type ResourceRuleNewParamsOptionsResponseHeadersHidingPolicy struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of HTTP headers.
//
// Parameter meaning depends on the value of the `mode` field:
//
// - **show** - List of HTTP headers to hide from response.
// - **hide** - List of HTTP headers to include in response. Other HTTP headers
// will be hidden.
//
// The following headers are required and cannot be hidden from response:
//
// - `Connection`
// - `Content-Length`
// - `Content-Type`
// - `Date`
// - `Server`
Excepted []string `json:"excepted,omitzero,required" format:"http_header"`
// How HTTP headers are hidden from the response.
//
// Possible values:
//
// - **show** - Hide only HTTP headers listed in the `excepted` field.
// - **hide** - Hide all HTTP headers except headers listed in the "excepted"
// field.
//
// Any of "hide", "show".
Mode string `json:"mode,omitzero,required"`
// contains filtered or unexported fields
}
Hides HTTP headers from an origin server in the CDN response.
The properties Enabled, Excepted, Mode are required.
func (ResourceRuleNewParamsOptionsResponseHeadersHidingPolicy) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsResponseHeadersHidingPolicy) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsResponseHeadersHidingPolicy) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsResponseHeadersHidingPolicy) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsRewrite ¶
type ResourceRuleNewParamsOptionsRewrite struct {
// Path for the Rewrite option.
//
// Example:
//
// - `/(.*) /media/$1`
Body string `json:"body,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Flag for the Rewrite option.
//
// Possible values:
//
// - **last** - Stop processing the current set of `ngx_http_rewrite_module`
// directives and start a search for a new location matching changed URI.
// - **break** - Stop processing the current set of the Rewrite option.
// - **redirect** - Return a temporary redirect with the 302 code; used when a
// replacement string does not start with `http://`, `https://`, or `$scheme`.
// - **permanent** - Return a permanent redirect with the 301 code.
//
// Any of "break", "last", "redirect", "permanent".
Flag string `json:"flag,omitzero"`
// contains filtered or unexported fields
}
Changes and redirects requests from the CDN to the origin. It operates according to the [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite) configuration.
The properties Body, Enabled are required.
func (ResourceRuleNewParamsOptionsRewrite) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsRewrite) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsRewrite) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsRewrite) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsSecureKey ¶
type ResourceRuleNewParamsOptionsSecureKey struct {
// Key generated on your side that will be used for URL signing.
Key param.Opt[string] `json:"key,omitzero,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Type of URL signing.
//
// Possible types:
//
// - **Type 0** - Includes end user IP to secure token generation.
// - **Type 2** - Excludes end user IP from secure token generation.
//
// Any of 0, 2.
Type int64 `json:"type,omitzero"`
// contains filtered or unexported fields
}
Configures access with tokenized URLs. This makes impossible to access content without a valid (unexpired) token.
The properties Enabled, Key are required.
func (ResourceRuleNewParamsOptionsSecureKey) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsSecureKey) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsSecureKey) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsSecureKey) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsSlice ¶
type ResourceRuleNewParamsOptionsSlice struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Requests and caches files larger than 10 MB in parts (no larger than 10 MB per part.) This reduces time to first byte.
The option is based on the [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
Notes:
- Origin must support HTTP Range requests.
- Not supported with `gzipON`, `brotli_compression` or `fetch_compressed` options enabled.
The properties Enabled, Value are required.
func (ResourceRuleNewParamsOptionsSlice) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsSlice) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsSlice) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsSlice) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsSni ¶
type ResourceRuleNewParamsOptionsSni struct {
// Custom SNI hostname.
//
// It is required if `sni_type` is set to custom.
CustomHostname string `json:"custom_hostname,required" format:"domain"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// SNI (Server Name Indication) type.
//
// Possible values:
//
// - **dynamic** - SNI hostname depends on `hostHeader` and `forward_host_header`
// options. It has several possible combinations:
// - If the `hostHeader` option is enabled and specified, SNI hostname matches the
// Host header.
// - If the `forward_host_header` option is enabled and has true value, SNI
// hostname matches the Host header used in the request made to a CDN.
// - If the `hostHeader` and `forward_host_header` options are disabled, SNI
// hostname matches the primary CNAME.
// - **custom** - custom SNI hostname is in use.
//
// Any of "dynamic", "custom".
SniType string `json:"sni_type,omitzero"`
// contains filtered or unexported fields
}
The hostname that is added to SNI requests from CDN servers to the origin server via HTTPS.
SNI is generally only required if your origin uses shared hosting or does not have a dedicated IP address. If the origin server presents multiple certificates, SNI allows the origin server to know which certificate to use for the connection.
The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
The properties CustomHostname, Enabled are required.
func (ResourceRuleNewParamsOptionsSni) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsSni) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsSni) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsSni) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsStale ¶
type ResourceRuleNewParamsOptionsStale struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Defines list of errors for which "Always online" option is applied.
//
// Any of "error", "http_403", "http_404", "http_429", "http_500", "http_502",
// "http_503", "http_504", "invalid_header", "timeout", "updating".
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Serves stale cached content in case of origin unavailability.
The properties Enabled, Value are required.
func (ResourceRuleNewParamsOptionsStale) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsStale) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsStale) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsStale) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsStaticHeaders
deprecated
type ResourceRuleNewParamsOptionsStaticHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// A MAP for static headers in a format of `header_name: header_value`.
//
// Restrictions:
//
// - **Header name** - Maximum 128 symbols, may contain Latin letters (A-Z, a-z),
// numbers (0-9), dashes, and underscores.
// - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
// (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
// with a letter, number, asterisk or {.
Value any `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
**Legacy option**. Use the `static_response_headers` option instead.
Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP Headers can be specified. May contain a header with multiple values.
Deprecated: deprecated
The properties Enabled, Value are required.
func (ResourceRuleNewParamsOptionsStaticHeaders) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsStaticHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsStaticHeaders) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsStaticHeaders) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsStaticRequestHeaders ¶
type ResourceRuleNewParamsOptionsStaticRequestHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// A MAP for static headers in a format of `header_name: header_value`.
//
// Restrictions:
//
// - **Header name** - Maximum 255 symbols, may contain Latin letters (A-Z, a-z),
// numbers (0-9), dashes, and underscores.
// - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
// (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
// with a letter, number, asterisk or {.
Value map[string]string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP Headers can be specified.
The properties Enabled, Value are required.
func (ResourceRuleNewParamsOptionsStaticRequestHeaders) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsStaticRequestHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsStaticRequestHeaders) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsStaticRequestHeaders) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsStaticResponseHeaders ¶
type ResourceRuleNewParamsOptionsStaticResponseHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
Value []ResourceRuleNewParamsOptionsStaticResponseHeadersValue `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Custom HTTP Headers that a CDN server adds to a response.
The properties Enabled, Value are required.
func (ResourceRuleNewParamsOptionsStaticResponseHeaders) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsStaticResponseHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsStaticResponseHeaders) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsStaticResponseHeaders) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsStaticResponseHeadersValue ¶
type ResourceRuleNewParamsOptionsStaticResponseHeadersValue struct {
// HTTP Header name.
//
// Restrictions:
//
// - Maximum 128 symbols.
// - Latin letters (A-Z, a-z,) numbers (0-9,) dashes, and underscores only.
Name string `json:"name,required"`
// Header value.
//
// Restrictions:
//
// - Maximum 512 symbols.
// - Letters (a-z), numbers (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+
// /|\";:?.,><{}[]).
// - Must start with a letter, number, asterisk or {.
// - Multiple values can be added.
Value []string `json:"value,omitzero,required"`
// Defines whether the header will be added to a response from CDN regardless of
// response code.
//
// Possible values:
//
// - **true** - Header will be added to a response from CDN regardless of response
// code.
// - **false** - Header will be added only to the following response codes: 200,
// 201, 204, 206, 301, 302, 303, 304, 307, 308.
Always param.Opt[bool] `json:"always,omitzero"`
// contains filtered or unexported fields
}
The properties Name, Value are required.
func (ResourceRuleNewParamsOptionsStaticResponseHeadersValue) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsStaticResponseHeadersValue) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsStaticResponseHeadersValue) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsStaticResponseHeadersValue) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsUserAgentACL ¶
type ResourceRuleNewParamsOptionsUserAgentACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of User-Agents that will be allowed/denied.
//
// The meaning of the parameter depends on `policy_type`:
//
// - **allow** - List of User-Agents for which access is prohibited.
// - **deny** - List of User-Agents for which access is allowed.
//
// Use an empty string `""` to allow/deny access when the User-Agent header is
// empty.
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"user_agent"`
// User-Agents policy type.
//
// Possible values:
//
// - **allow** - Allow access for all User-Agents except specified in
// `excepted_values` field.
// - **deny** - Deny access for all User-Agents except specified in
// `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Controls access to the content for specified User-Agents.
The properties Enabled, ExceptedValues, PolicyType are required.
func (ResourceRuleNewParamsOptionsUserAgentACL) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsUserAgentACL) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsUserAgentACL) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsUserAgentACL) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsWaap ¶
type ResourceRuleNewParamsOptionsWaap struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Allows to enable WAAP (Web Application and API Protection).
The properties Enabled, Value are required.
func (ResourceRuleNewParamsOptionsWaap) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsWaap) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsWaap) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsWaap) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOptionsWebsockets ¶
type ResourceRuleNewParamsOptionsWebsockets struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Enables or disables WebSockets connections to an origin server.
The properties Enabled, Value are required.
func (ResourceRuleNewParamsOptionsWebsockets) MarshalJSON ¶
func (r ResourceRuleNewParamsOptionsWebsockets) MarshalJSON() (data []byte, err error)
func (*ResourceRuleNewParamsOptionsWebsockets) UnmarshalJSON ¶
func (r *ResourceRuleNewParamsOptionsWebsockets) UnmarshalJSON(data []byte) error
type ResourceRuleNewParamsOverrideOriginProtocol ¶
type ResourceRuleNewParamsOverrideOriginProtocol string
Sets a protocol other than the one specified in the CDN resource settings to connect to the origin.
Possible values:
- **HTTPS** - CDN servers connect to origin via HTTPS protocol.
- **HTTP** - CDN servers connect to origin via HTTP protocol.
- **MATCH** - Connection protocol is chosen automatically; in this case, content on origin source should be available for the CDN both through HTTP and HTTPS protocols.
- **null** - `originProtocol` setting is inherited from the CDN resource settings.
const ( ResourceRuleNewParamsOverrideOriginProtocolHTTPS ResourceRuleNewParamsOverrideOriginProtocol = "HTTPS" ResourceRuleNewParamsOverrideOriginProtocolHTTP ResourceRuleNewParamsOverrideOriginProtocol = "HTTP" ResourceRuleNewParamsOverrideOriginProtocolMatch ResourceRuleNewParamsOverrideOriginProtocol = "MATCH" )
type ResourceRuleReplaceParams ¶
type ResourceRuleReplaceParams struct {
ResourceID int64 `path:"resource_id,required" json:"-"`
// Path to the file or folder for which the rule will be applied.
//
// The rule is applied if the requested URI matches the rule path.
//
// We add a leading forward slash to any rule path. Specify a path without a
// forward slash.
Rule string `json:"rule,required"`
// Rule type.
//
// Possible values:
//
// - **Type 0** - Regular expression. Must start with '^/' or '/'.
// - **Type 1** - Regular expression. Note that for this rule type we automatically
// add / to each rule pattern before your regular expression. This type is
// **legacy**, please use Type 0.
RuleType int64 `json:"ruleType,required"`
// ID of the origin group to which the rule is applied.
//
// If the origin group is not specified, the rule is applied to the origin group
// that the CDN resource is associated with.
OriginGroup param.Opt[int64] `json:"originGroup,omitzero"`
// Enables or disables a rule.
//
// Possible values:
//
// - **true** - Rule is active, rule settings are applied.
// - **false** - Rule is inactive, rule settings are not applied.
Active param.Opt[bool] `json:"active,omitzero"`
// Rule name.
Name param.Opt[string] `json:"name,omitzero"`
// Rule execution order: from lowest (1) to highest.
//
// If requested URI matches multiple rules, the one higher in the order of the
// rules will be applied.
Weight param.Opt[int64] `json:"weight,omitzero"`
// Sets a protocol other than the one specified in the CDN resource settings to
// connect to the origin.
//
// Possible values:
//
// - **HTTPS** - CDN servers connect to origin via HTTPS protocol.
// - **HTTP** - CDN servers connect to origin via HTTP protocol.
// - **MATCH** - Connection protocol is chosen automatically; in this case, content
// on origin source should be available for the CDN both through HTTP and HTTPS
// protocols.
// - **null** - `originProtocol` setting is inherited from the CDN resource
// settings.
//
// Any of "HTTPS", "HTTP", "MATCH".
OverrideOriginProtocol ResourceRuleReplaceParamsOverrideOriginProtocol `json:"overrideOriginProtocol,omitzero"`
// List of options that can be configured for the rule.
//
// In case of `null` value the option is not added to the rule. Option inherits its
// value from the CDN resource settings.
Options ResourceRuleReplaceParamsOptions `json:"options,omitzero"`
// contains filtered or unexported fields
}
func (ResourceRuleReplaceParams) MarshalJSON ¶
func (r ResourceRuleReplaceParams) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParams) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParams) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptions ¶
type ResourceRuleReplaceParamsOptions struct {
// HTTP methods allowed for content requests from the CDN.
AllowedHTTPMethods ResourceRuleReplaceParamsOptionsAllowedHTTPMethods `json:"allowedHttpMethods,omitzero"`
// Allows to prevent online services from overloading and ensure your business
// workflow running smoothly.
BotProtection ResourceRuleReplaceParamsOptionsBotProtection `json:"bot_protection,omitzero"`
// Compresses content with Brotli on the CDN side. CDN servers will request only
// uncompressed content from the origin.
//
// Notes:
//
// 1. CDN only supports "Brotli compression" when the "origin shielding" feature is
// activated.
// 2. If a precache server is not active for a CDN resource, no compression occurs,
// even if the option is enabled.
// 3. `brotli_compression` is not supported with `fetch_compressed` or `slice`
// options enabled.
// 4. `fetch_compressed` option in CDN resource settings overrides
// `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN
// resource and want to enable `brotli_compression` in a rule, you must specify
// `fetch_compressed:false` in the rule.
BrotliCompression ResourceRuleReplaceParamsOptionsBrotliCompression `json:"brotli_compression,omitzero"`
// Cache expiration time for users browsers in seconds.
//
// Cache expiration time is applied to the following response codes: 200, 201, 204,
// 206, 301, 302, 303, 304, 307, 308.
//
// Responses with other codes will not be cached.
BrowserCacheSettings ResourceRuleReplaceParamsOptionsBrowserCacheSettings `json:"browser_cache_settings,omitzero"`
// **Legacy option**. Use the `response_headers_hiding_policy` option instead.
//
// HTTP Headers that must be included in the response.
//
// Deprecated: deprecated
CacheHTTPHeaders ResourceRuleReplaceParamsOptionsCacheHTTPHeaders `json:"cache_http_headers,omitzero"`
// Enables or disables CORS (Cross-Origin Resource Sharing) header support.
//
// CORS header support allows the CDN to add the Access-Control-Allow-Origin header
// to a response to a browser.
Cors ResourceRuleReplaceParamsOptionsCors `json:"cors,omitzero"`
// Enables control access to content for specified countries.
CountryACL ResourceRuleReplaceParamsOptionsCountryACL `json:"country_acl,omitzero"`
// **Legacy option**. Use the `edge_cache_settings` option instead.
//
// Allows the complete disabling of content caching.
//
// Deprecated: deprecated
DisableCache ResourceRuleReplaceParamsOptionsDisableCache `json:"disable_cache,omitzero"`
// Allows 206 responses regardless of the settings of an origin source.
DisableProxyForceRanges ResourceRuleReplaceParamsOptionsDisableProxyForceRanges `json:"disable_proxy_force_ranges,omitzero"`
// Cache expiration time for CDN servers.
//
// `value` and `default` fields cannot be used simultaneously.
EdgeCacheSettings ResourceRuleReplaceParamsOptionsEdgeCacheSettings `json:"edge_cache_settings,omitzero"`
// Allows to configure FastEdge app to be called on different request/response
// phases.
//
// Note: At least one of `on_request_headers`, `on_request_body`,
// `on_response_headers`, or `on_response_body` must be specified.
Fastedge ResourceRuleReplaceParamsOptionsFastedge `json:"fastedge,omitzero"`
// Makes the CDN request compressed content from the origin.
//
// The origin server should support compression. CDN servers will not decompress
// your content even if a user browser does not accept compression.
//
// Notes:
//
// 1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or
// `slice` options enabled.
// 2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If
// you enable it in CDN resource and want to use `gzipON` and
// `brotli_compression` in a rule, you have to specify
// `"fetch_compressed": false` in the rule.
FetchCompressed ResourceRuleReplaceParamsOptionsFetchCompressed `json:"fetch_compressed,omitzero"`
// Enables redirection from origin. If the origin server returns a redirect, the
// option allows the CDN to pull the requested content from the origin server that
// was returned in the redirect.
FollowOriginRedirect ResourceRuleReplaceParamsOptionsFollowOriginRedirect `json:"follow_origin_redirect,omitzero"`
// Applies custom HTTP response codes for CDN content.
//
// The following codes are reserved by our system and cannot be specified in this
// option: 408, 444, 477, 494, 495, 496, 497, 499.
ForceReturn ResourceRuleReplaceParamsOptionsForceReturn `json:"force_return,omitzero"`
// Forwards the Host header from a end-user request to an origin server.
//
// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
ForwardHostHeader ResourceRuleReplaceParamsOptionsForwardHostHeader `json:"forward_host_header,omitzero"`
// Compresses content with gzip on the CDN end. CDN servers will request only
// uncompressed content from the origin.
//
// Notes:
//
// 1. Compression with gzip is not supported with `fetch_compressed` or `slice`
// options enabled.
// 2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in
// rules. If you enable `fetch_compressed` in CDN resource and want to enable
// `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
GzipOn ResourceRuleReplaceParamsOptionsGzipOn `json:"gzipOn,omitzero"`
// Sets the Host header that CDN servers use when request content from an origin
// server. Your server must be able to process requests with the chosen header.
//
// If the option is `null`, the Host Header value is equal to first CNAME.
//
// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
HostHeader ResourceRuleReplaceParamsOptionsHostHeader `json:"hostHeader,omitzero"`
// Defines whether the files with the Set-Cookies header are cached as one file or
// as different ones.
IgnoreCookie ResourceRuleReplaceParamsOptionsIgnoreCookie `json:"ignore_cookie,omitzero"`
// How a file with different query strings is cached: either as one object (option
// is enabled) or as different objects (option is disabled.)
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
IgnoreQueryString ResourceRuleReplaceParamsOptionsIgnoreQueryString `json:"ignoreQueryString,omitzero"`
// Transforms JPG and PNG images (for example, resize or crop) and automatically
// converts them to WebP or AVIF format.
ImageStack ResourceRuleReplaceParamsOptionsImageStack `json:"image_stack,omitzero"`
// Controls access to the CDN resource content for specific IP addresses.
//
// If you want to use IPs from our CDN servers IP list for IP ACL configuration,
// you have to independently monitor their relevance. We recommend you use a script
// for automatically update IP ACL.
// [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
IPAddressACL ResourceRuleReplaceParamsOptionsIPAddressACL `json:"ip_address_acl,omitzero"`
// Allows to control the download speed per connection.
LimitBandwidth ResourceRuleReplaceParamsOptionsLimitBandwidth `json:"limit_bandwidth,omitzero"`
// Allows you to modify your cache key. If omitted, the default value is
// `$request_uri`.
//
// Combine the specified variables to create a key for caching.
//
// - **$`request_uri`**
// - **$scheme**
// - **$uri**
//
// **Warning**: Enabling and changing this option can invalidate your current cache
// and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will
// not work.
ProxyCacheKey ResourceRuleReplaceParamsOptionsProxyCacheKey `json:"proxy_cache_key,omitzero"`
// Caching for POST requests along with default GET and HEAD.
ProxyCacheMethodsSet ResourceRuleReplaceParamsOptionsProxyCacheMethodsSet `json:"proxy_cache_methods_set,omitzero"`
// The time limit for establishing a connection with the origin.
ProxyConnectTimeout ResourceRuleReplaceParamsOptionsProxyConnectTimeout `json:"proxy_connect_timeout,omitzero"`
// The time limit for receiving a partial response from the origin. If no response
// is received within this time, the connection will be closed.
//
// **Note:** When used with a WebSocket connection, this option supports values
// only in the range 1–20 seconds (instead of the usual 1–30 seconds).
ProxyReadTimeout ResourceRuleReplaceParamsOptionsProxyReadTimeout `json:"proxy_read_timeout,omitzero"`
// Files with the specified query parameters are cached as one object, files with
// other parameters are cached as different objects.
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
QueryParamsBlacklist ResourceRuleReplaceParamsOptionsQueryParamsBlacklist `json:"query_params_blacklist,omitzero"`
// Files with the specified query parameters are cached as different objects, files
// with other parameters are cached as one object.
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
QueryParamsWhitelist ResourceRuleReplaceParamsOptionsQueryParamsWhitelist `json:"query_params_whitelist,omitzero"`
// The Query String Forwarding feature allows for the seamless transfer of
// parameters embedded in playlist files to the corresponding media chunk files.
// This functionality ensures that specific attributes, such as authentication
// tokens or tracking information, are consistently passed along from the playlist
// manifest to the individual media segments. This is particularly useful for
// maintaining continuity in security, analytics, and any other parameter-based
// operations across the entire media delivery workflow.
QueryStringForwarding ResourceRuleReplaceParamsOptionsQueryStringForwarding `json:"query_string_forwarding,omitzero"`
// Enables redirect from HTTP to HTTPS.
//
// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
// simultaneously.
RedirectHTTPToHTTPS ResourceRuleReplaceParamsOptionsRedirectHTTPToHTTPS `json:"redirect_http_to_https,omitzero"`
// Enables redirect from HTTPS to HTTP.
//
// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
// simultaneously.
RedirectHTTPSToHTTP ResourceRuleReplaceParamsOptionsRedirectHTTPSToHTTP `json:"redirect_https_to_http,omitzero"`
// Controls access to the CDN resource content for specified domain names.
ReferrerACL ResourceRuleReplaceParamsOptionsReferrerACL `json:"referrer_acl,omitzero"`
// Option allows to limit the amount of HTTP requests.
RequestLimiter ResourceRuleReplaceParamsOptionsRequestLimiter `json:"request_limiter,omitzero"`
// Hides HTTP headers from an origin server in the CDN response.
ResponseHeadersHidingPolicy ResourceRuleReplaceParamsOptionsResponseHeadersHidingPolicy `json:"response_headers_hiding_policy,omitzero"`
// Changes and redirects requests from the CDN to the origin. It operates according
// to the
// [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite)
// configuration.
Rewrite ResourceRuleReplaceParamsOptionsRewrite `json:"rewrite,omitzero"`
// Configures access with tokenized URLs. This makes impossible to access content
// without a valid (unexpired) token.
SecureKey ResourceRuleReplaceParamsOptionsSecureKey `json:"secure_key,omitzero"`
// Requests and caches files larger than 10 MB in parts (no larger than 10 MB per
// part.) This reduces time to first byte.
//
// The option is based on the
// [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
//
// Notes:
//
// 1. Origin must support HTTP Range requests.
// 2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed`
// options enabled.
Slice ResourceRuleReplaceParamsOptionsSlice `json:"slice,omitzero"`
// The hostname that is added to SNI requests from CDN servers to the origin server
// via HTTPS.
//
// SNI is generally only required if your origin uses shared hosting or does not
// have a dedicated IP address. If the origin server presents multiple
// certificates, SNI allows the origin server to know which certificate to use for
// the connection.
//
// The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
Sni ResourceRuleReplaceParamsOptionsSni `json:"sni,omitzero"`
// Serves stale cached content in case of origin unavailability.
Stale ResourceRuleReplaceParamsOptionsStale `json:"stale,omitzero"`
// Custom HTTP Headers that a CDN server adds to a response.
StaticResponseHeaders ResourceRuleReplaceParamsOptionsStaticResponseHeaders `json:"static_response_headers,omitzero"`
// **Legacy option**. Use the `static_response_headers` option instead.
//
// Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP
// Headers can be specified. May contain a header with multiple values.
//
// Deprecated: deprecated
StaticHeaders ResourceRuleReplaceParamsOptionsStaticHeaders `json:"staticHeaders,omitzero"`
// Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP
// Headers can be specified.
StaticRequestHeaders ResourceRuleReplaceParamsOptionsStaticRequestHeaders `json:"staticRequestHeaders,omitzero"`
// Controls access to the content for specified User-Agents.
UserAgentACL ResourceRuleReplaceParamsOptionsUserAgentACL `json:"user_agent_acl,omitzero"`
// Allows to enable WAAP (Web Application and API Protection).
Waap ResourceRuleReplaceParamsOptionsWaap `json:"waap,omitzero"`
// Enables or disables WebSockets connections to an origin server.
Websockets ResourceRuleReplaceParamsOptionsWebsockets `json:"websockets,omitzero"`
// contains filtered or unexported fields
}
List of options that can be configured for the rule.
In case of `null` value the option is not added to the rule. Option inherits its value from the CDN resource settings.
func (ResourceRuleReplaceParamsOptions) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptions) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptions) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptions) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsAllowedHTTPMethods ¶
type ResourceRuleReplaceParamsOptionsAllowedHTTPMethods struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
HTTP methods allowed for content requests from the CDN.
The properties Enabled, Value are required.
func (ResourceRuleReplaceParamsOptionsAllowedHTTPMethods) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsAllowedHTTPMethods) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsAllowedHTTPMethods) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsAllowedHTTPMethods) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsBotProtection ¶
type ResourceRuleReplaceParamsOptionsBotProtection struct {
// Controls the bot challenge module state.
BotChallenge ResourceRuleReplaceParamsOptionsBotProtectionBotChallenge `json:"bot_challenge,omitzero,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// contains filtered or unexported fields
}
Allows to prevent online services from overloading and ensure your business workflow running smoothly.
The properties BotChallenge, Enabled are required.
func (ResourceRuleReplaceParamsOptionsBotProtection) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsBotProtection) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsBotProtection) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsBotProtection) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsBotProtectionBotChallenge ¶
type ResourceRuleReplaceParamsOptionsBotProtectionBotChallenge struct {
// Possible values:
//
// - **true** - Bot challenge is enabled.
// - **false** - Bot challenge is disabled.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// contains filtered or unexported fields
}
Controls the bot challenge module state.
func (ResourceRuleReplaceParamsOptionsBotProtectionBotChallenge) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsBotProtectionBotChallenge) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsBotProtectionBotChallenge) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsBotProtectionBotChallenge) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsBrotliCompression ¶
type ResourceRuleReplaceParamsOptionsBrotliCompression struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Allows to select the content types you want to compress.
//
// `text/html` is a mandatory content type.
//
// Any of "application/javascript", "application/json",
// "application/vnd.ms-fontobject", "application/wasm", "application/x-font-ttf",
// "application/x-javascript", "application/xml", "application/xml+rss",
// "image/svg+xml", "image/x-icon", "text/css", "text/html", "text/javascript",
// "text/plain", "text/xml".
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Compresses content with Brotli on the CDN side. CDN servers will request only uncompressed content from the origin.
Notes:
- CDN only supports "Brotli compression" when the "origin shielding" feature is activated.
- If a precache server is not active for a CDN resource, no compression occurs, even if the option is enabled.
- `brotli_compression` is not supported with `fetch_compressed` or `slice` options enabled.
- `fetch_compressed` option in CDN resource settings overrides `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN resource and want to enable `brotli_compression` in a rule, you must specify `fetch_compressed:false` in the rule.
The properties Enabled, Value are required.
func (ResourceRuleReplaceParamsOptionsBrotliCompression) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsBrotliCompression) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsBrotliCompression) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsBrotliCompression) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsBrowserCacheSettings ¶
type ResourceRuleReplaceParamsOptionsBrowserCacheSettings struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Set the cache expiration time to '0s' to disable caching.
//
// The maximum duration is any equivalent to `1y`.
Value string `json:"value,required" format:"nginx time"`
// contains filtered or unexported fields
}
Cache expiration time for users browsers in seconds.
Cache expiration time is applied to the following response codes: 200, 201, 204, 206, 301, 302, 303, 304, 307, 308.
Responses with other codes will not be cached.
The properties Enabled, Value are required.
func (ResourceRuleReplaceParamsOptionsBrowserCacheSettings) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsBrowserCacheSettings) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsBrowserCacheSettings) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsBrowserCacheSettings) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsCacheHTTPHeaders
deprecated
type ResourceRuleReplaceParamsOptionsCacheHTTPHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
**Legacy option**. Use the `response_headers_hiding_policy` option instead.
HTTP Headers that must be included in the response.
Deprecated: deprecated
The properties Enabled, Value are required.
func (ResourceRuleReplaceParamsOptionsCacheHTTPHeaders) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsCacheHTTPHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsCacheHTTPHeaders) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsCacheHTTPHeaders) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsCors ¶
type ResourceRuleReplaceParamsOptionsCors struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Value of the Access-Control-Allow-Origin header.
//
// Possible values:
//
// - **Adds \* as the Access-Control-Allow-Origin header value** - Content will be
// uploaded for requests from any domain. `"value": ["*"]`
// - **Adds "$http_origin" as the Access-Control-Allow-Origin header value if the
// origin matches one of the listed domains** - Content will be uploaded only for
// requests from the domains specified in the field.
// `"value": ["domain.com", "second.dom.com"]`
// - **Adds "$http_origin" as the Access-Control-Allow-Origin header value** -
// Content will be uploaded for requests from any domain, and the domain from
// which the request was sent will be added to the "Access-Control-Allow-Origin"
// header in the response. `"value": ["$http_origin"]`
Value []string `json:"value,omitzero,required"`
// Defines whether the Access-Control-Allow-Origin header should be added to a
// response from CDN regardless of response code.
//
// Possible values:
//
// - **true** - Header will be added to a response regardless of response code.
// - **false** - Header will only be added to responses with codes: 200, 201, 204,
// 206, 301, 302, 303, 304, 307, 308.
Always param.Opt[bool] `json:"always,omitzero"`
// contains filtered or unexported fields
}
Enables or disables CORS (Cross-Origin Resource Sharing) header support.
CORS header support allows the CDN to add the Access-Control-Allow-Origin header to a response to a browser.
The properties Enabled, Value are required.
func (ResourceRuleReplaceParamsOptionsCors) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsCors) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsCors) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsCors) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsCountryACL ¶
type ResourceRuleReplaceParamsOptionsCountryACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of countries according to ISO-3166-1.
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of countries for which access is prohibited.
// - **deny** - List of countries for which access is allowed.
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"country-code"`
// Defines the type of CDN resource access policy.
//
// Possible values:
//
// - **allow** - Access is allowed for all the countries except for those specified
// in `excepted_values` field.
// - **deny** - Access is denied for all the countries except for those specified
// in `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Enables control access to content for specified countries.
The properties Enabled, ExceptedValues, PolicyType are required.
func (ResourceRuleReplaceParamsOptionsCountryACL) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsCountryACL) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsCountryACL) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsCountryACL) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsDisableCache
deprecated
type ResourceRuleReplaceParamsOptionsDisableCache struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - content caching is disabled.
// - **false** - content caching is enabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
**Legacy option**. Use the `edge_cache_settings` option instead.
Allows the complete disabling of content caching.
Deprecated: deprecated
The properties Enabled, Value are required.
func (ResourceRuleReplaceParamsOptionsDisableCache) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsDisableCache) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsDisableCache) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsDisableCache) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsDisableProxyForceRanges ¶
type ResourceRuleReplaceParamsOptionsDisableProxyForceRanges struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Allows 206 responses regardless of the settings of an origin source.
The properties Enabled, Value are required.
func (ResourceRuleReplaceParamsOptionsDisableProxyForceRanges) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsDisableProxyForceRanges) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsDisableProxyForceRanges) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsDisableProxyForceRanges) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsEdgeCacheSettings ¶
type ResourceRuleReplaceParamsOptionsEdgeCacheSettings struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Enables content caching according to the origin cache settings.
//
// The value is applied to the following response codes 200, 201, 204, 206, 301,
// 302, 303, 304, 307, 308, if an origin server does not have caching HTTP headers.
//
// Responses with other codes will not be cached.
//
// The maximum duration is any equivalent to `1y`.
Default param.Opt[string] `json:"default,omitzero" format:"nginx time"`
// Caching time.
//
// The value is applied to the following response codes: 200, 206, 301, 302.
// Responses with codes 4xx, 5xx will not be cached.
//
// Use `0s` to disable caching.
//
// The maximum duration is any equivalent to `1y`.
Value param.Opt[string] `json:"value,omitzero" format:"nginx time"`
// A MAP object representing the caching time in seconds for a response with a
// specific response code.
//
// These settings have a higher priority than the `value` field.
//
// - Use `any` key to specify caching time for all response codes.
// - Use `0s` value to disable caching for a specific response code.
CustomValues map[string]string `json:"custom_values,omitzero" format:"nginx time"`
// contains filtered or unexported fields
}
Cache expiration time for CDN servers.
`value` and `default` fields cannot be used simultaneously.
The property Enabled is required.
func (ResourceRuleReplaceParamsOptionsEdgeCacheSettings) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsEdgeCacheSettings) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsEdgeCacheSettings) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsEdgeCacheSettings) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsFastedge ¶
type ResourceRuleReplaceParamsOptionsFastedge struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Allows to configure FastEdge application that will be called to handle request
// body as soon as CDN receives incoming HTTP request.
OnRequestBody ResourceRuleReplaceParamsOptionsFastedgeOnRequestBody `json:"on_request_body,omitzero"`
// Allows to configure FastEdge application that will be called to handle request
// headers as soon as CDN receives incoming HTTP request.
OnRequestHeaders ResourceRuleReplaceParamsOptionsFastedgeOnRequestHeaders `json:"on_request_headers,omitzero"`
// Allows to configure FastEdge application that will be called to handle response
// body before CDN sends the HTTP response.
OnResponseBody ResourceRuleReplaceParamsOptionsFastedgeOnResponseBody `json:"on_response_body,omitzero"`
// Allows to configure FastEdge application that will be called to handle response
// headers before CDN sends the HTTP response.
OnResponseHeaders ResourceRuleReplaceParamsOptionsFastedgeOnResponseHeaders `json:"on_response_headers,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge app to be called on different request/response phases.
Note: At least one of `on_request_headers`, `on_request_body`, `on_response_headers`, or `on_response_body` must be specified.
The property Enabled is required.
func (ResourceRuleReplaceParamsOptionsFastedge) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsFastedge) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsFastedge) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsFastedge) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsFastedgeOnRequestBody ¶
type ResourceRuleReplaceParamsOptionsFastedgeOnRequestBody struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle request body as soon as CDN receives incoming HTTP request.
The property AppID is required.
func (ResourceRuleReplaceParamsOptionsFastedgeOnRequestBody) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsFastedgeOnRequestBody) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsFastedgeOnRequestBody) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsFastedgeOnRequestBody) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsFastedgeOnRequestHeaders ¶
type ResourceRuleReplaceParamsOptionsFastedgeOnRequestHeaders struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request.
The property AppID is required.
func (ResourceRuleReplaceParamsOptionsFastedgeOnRequestHeaders) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsFastedgeOnRequestHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsFastedgeOnResponseBody ¶
type ResourceRuleReplaceParamsOptionsFastedgeOnResponseBody struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle response body before CDN sends the HTTP response.
The property AppID is required.
func (ResourceRuleReplaceParamsOptionsFastedgeOnResponseBody) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsFastedgeOnResponseBody) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsFastedgeOnResponseBody) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsFastedgeOnResponseBody) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsFastedgeOnResponseHeaders ¶
type ResourceRuleReplaceParamsOptionsFastedgeOnResponseHeaders struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle response headers before CDN sends the HTTP response.
The property AppID is required.
func (ResourceRuleReplaceParamsOptionsFastedgeOnResponseHeaders) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsFastedgeOnResponseHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsFastedgeOnResponseHeaders) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsFastedgeOnResponseHeaders) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsFetchCompressed ¶
type ResourceRuleReplaceParamsOptionsFetchCompressed struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Makes the CDN request compressed content from the origin.
The origin server should support compression. CDN servers will not decompress your content even if a user browser does not accept compression.
Notes:
- `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or `slice` options enabled.
- `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If you enable it in CDN resource and want to use `gzipON` and `brotli_compression` in a rule, you have to specify `"fetch_compressed": false` in the rule.
The properties Enabled, Value are required.
func (ResourceRuleReplaceParamsOptionsFetchCompressed) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsFetchCompressed) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsFetchCompressed) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsFetchCompressed) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsFollowOriginRedirect ¶
type ResourceRuleReplaceParamsOptionsFollowOriginRedirect struct {
// Redirect status code that the origin server returns.
//
// To serve up to date content to end users, you will need to purge the cache after
// managing the option.
//
// Any of 301, 302, 303, 307, 308.
Codes []int64 `json:"codes,omitzero,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// contains filtered or unexported fields
}
Enables redirection from origin. If the origin server returns a redirect, the option allows the CDN to pull the requested content from the origin server that was returned in the redirect.
The properties Codes, Enabled are required.
func (ResourceRuleReplaceParamsOptionsFollowOriginRedirect) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsFollowOriginRedirect) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsFollowOriginRedirect) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsFollowOriginRedirect) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsForceReturn ¶
type ResourceRuleReplaceParamsOptionsForceReturn struct {
// URL for redirection or text.
Body string `json:"body,required"`
// Status code value.
Code int64 `json:"code,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Controls the time at which a custom HTTP response code should be applied. By
// default, a custom HTTP response code is applied at any time.
TimeInterval ResourceRuleReplaceParamsOptionsForceReturnTimeInterval `json:"time_interval,omitzero"`
// contains filtered or unexported fields
}
Applies custom HTTP response codes for CDN content.
The following codes are reserved by our system and cannot be specified in this option: 408, 444, 477, 494, 495, 496, 497, 499.
The properties Body, Code, Enabled are required.
func (ResourceRuleReplaceParamsOptionsForceReturn) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsForceReturn) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsForceReturn) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsForceReturn) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsForceReturnTimeInterval ¶
type ResourceRuleReplaceParamsOptionsForceReturnTimeInterval struct {
// Time until which a custom HTTP response code should be applied. Indicated in
// 24-hour format.
EndTime string `json:"end_time,required"`
// Time from which a custom HTTP response code should be applied. Indicated in
// 24-hour format.
StartTime string `json:"start_time,required"`
// Time zone used to calculate time.
TimeZone param.Opt[string] `json:"time_zone,omitzero" format:"timezone"`
// contains filtered or unexported fields
}
Controls the time at which a custom HTTP response code should be applied. By default, a custom HTTP response code is applied at any time.
The properties EndTime, StartTime are required.
func (ResourceRuleReplaceParamsOptionsForceReturnTimeInterval) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsForceReturnTimeInterval) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsForceReturnTimeInterval) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsForceReturnTimeInterval) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsForwardHostHeader ¶
type ResourceRuleReplaceParamsOptionsForwardHostHeader struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Forwards the Host header from a end-user request to an origin server.
`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceRuleReplaceParamsOptionsForwardHostHeader) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsForwardHostHeader) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsForwardHostHeader) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsForwardHostHeader) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsGzipOn ¶
type ResourceRuleReplaceParamsOptionsGzipOn struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Compresses content with gzip on the CDN end. CDN servers will request only uncompressed content from the origin.
Notes:
- Compression with gzip is not supported with `fetch_compressed` or `slice` options enabled.
- `fetch_compressed` option in CDN resource settings overrides `gzipON` in rules. If you enable `fetch_compressed` in CDN resource and want to enable `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
The properties Enabled, Value are required.
func (ResourceRuleReplaceParamsOptionsGzipOn) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsGzipOn) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsGzipOn) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsGzipOn) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsHostHeader ¶
type ResourceRuleReplaceParamsOptionsHostHeader struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Host Header value.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
Sets the Host header that CDN servers use when request content from an origin server. Your server must be able to process requests with the chosen header.
If the option is `null`, the Host Header value is equal to first CNAME.
`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceRuleReplaceParamsOptionsHostHeader) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsHostHeader) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsHostHeader) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsHostHeader) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsIPAddressACL ¶
type ResourceRuleReplaceParamsOptionsIPAddressACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of IP addresses with a subnet mask.
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of IP addresses for which access is prohibited.
// - **deny** - List of IP addresses for which access is allowed.
//
// Examples:
//
// - `192.168.3.2/32`
// - `2a03:d000:2980:7::8/128`
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"ipv4net or ipv6net"`
// IP access policy type.
//
// Possible values:
//
// - **allow** - Allow access to all IPs except IPs specified in "excepted_values"
// field.
// - **deny** - Deny access to all IPs except IPs specified in "excepted_values"
// field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Controls access to the CDN resource content for specific IP addresses.
If you want to use IPs from our CDN servers IP list for IP ACL configuration, you have to independently monitor their relevance. We recommend you use a script for automatically update IP ACL. [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
The properties Enabled, ExceptedValues, PolicyType are required.
func (ResourceRuleReplaceParamsOptionsIPAddressACL) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsIPAddressACL) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsIPAddressACL) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsIPAddressACL) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsIgnoreCookie ¶
type ResourceRuleReplaceParamsOptionsIgnoreCookie struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled, files with cookies are cached as one file.
// - **false** - Option is disabled, files with cookies are cached as different
// files.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Defines whether the files with the Set-Cookies header are cached as one file or as different ones.
The properties Enabled, Value are required.
func (ResourceRuleReplaceParamsOptionsIgnoreCookie) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsIgnoreCookie) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsIgnoreCookie) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsIgnoreCookie) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsIgnoreQueryString ¶
type ResourceRuleReplaceParamsOptionsIgnoreQueryString struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
How a file with different query strings is cached: either as one object (option is enabled) or as different objects (option is disabled.)
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceRuleReplaceParamsOptionsIgnoreQueryString) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsIgnoreQueryString) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsIgnoreQueryString) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsIgnoreQueryString) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsImageStack ¶
type ResourceRuleReplaceParamsOptionsImageStack struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Enables or disables automatic conversion of JPEG and PNG images to AVI format.
AvifEnabled param.Opt[bool] `json:"avif_enabled,omitzero"`
// Enables or disables compression without quality loss for PNG format.
PngLossless param.Opt[bool] `json:"png_lossless,omitzero"`
// Defines quality settings for JPG and PNG images. The higher the value, the
// better the image quality, and the larger the file size after conversion.
Quality param.Opt[int64] `json:"quality,omitzero"`
// Enables or disables automatic conversion of JPEG and PNG images to WebP format.
WebpEnabled param.Opt[bool] `json:"webp_enabled,omitzero"`
// contains filtered or unexported fields
}
Transforms JPG and PNG images (for example, resize or crop) and automatically converts them to WebP or AVIF format.
The property Enabled is required.
func (ResourceRuleReplaceParamsOptionsImageStack) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsImageStack) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsImageStack) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsImageStack) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsLimitBandwidth ¶
type ResourceRuleReplaceParamsOptionsLimitBandwidth struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Method of controlling the download speed per connection.
//
// Possible values:
//
// - **static** - Use speed and buffer fields to set the download speed limit.
// - **dynamic** - Use query strings **speed** and **buffer** to set the download
// speed limit.
//
// # For example, when requesting content at the link
//
// “`
// http://cdn.example.com/video.mp4?speed=50k&buffer=500k
// “`
//
// the download speed will be limited to 50kB/s after 500 kB.
//
// Any of "static", "dynamic".
LimitType string `json:"limit_type,omitzero,required"`
// Amount of downloaded data after which the user will be rate limited.
Buffer param.Opt[int64] `json:"buffer,omitzero"`
// Maximum download speed per connection.
Speed param.Opt[int64] `json:"speed,omitzero"`
// contains filtered or unexported fields
}
Allows to control the download speed per connection.
The properties Enabled, LimitType are required.
func (ResourceRuleReplaceParamsOptionsLimitBandwidth) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsLimitBandwidth) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsLimitBandwidth) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsLimitBandwidth) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsProxyCacheKey ¶
type ResourceRuleReplaceParamsOptionsProxyCacheKey struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Key for caching.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
Allows you to modify your cache key. If omitted, the default value is `$request_uri`.
Combine the specified variables to create a key for caching.
- **$`request_uri`** - **$scheme** - **$uri**
**Warning**: Enabling and changing this option can invalidate your current cache and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will not work.
The properties Enabled, Value are required.
func (ResourceRuleReplaceParamsOptionsProxyCacheKey) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsProxyCacheKey) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsProxyCacheKey) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsProxyCacheKey) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsProxyCacheMethodsSet ¶
type ResourceRuleReplaceParamsOptionsProxyCacheMethodsSet struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Caching for POST requests along with default GET and HEAD.
The properties Enabled, Value are required.
func (ResourceRuleReplaceParamsOptionsProxyCacheMethodsSet) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsProxyCacheMethodsSet) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsProxyCacheMethodsSet) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsProxyCacheMethodsSet) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsProxyConnectTimeout ¶
type ResourceRuleReplaceParamsOptionsProxyConnectTimeout struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Timeout value in seconds.
//
// Supported range: **1s - 5s**.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
The time limit for establishing a connection with the origin.
The properties Enabled, Value are required.
func (ResourceRuleReplaceParamsOptionsProxyConnectTimeout) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsProxyConnectTimeout) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsProxyConnectTimeout) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsProxyConnectTimeout) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsProxyReadTimeout ¶
type ResourceRuleReplaceParamsOptionsProxyReadTimeout struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Timeout value in seconds.
//
// Supported range: **1s - 30s**.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
The time limit for receiving a partial response from the origin. If no response is received within this time, the connection will be closed.
**Note:** When used with a WebSocket connection, this option supports values only in the range 1–20 seconds (instead of the usual 1–30 seconds).
The properties Enabled, Value are required.
func (ResourceRuleReplaceParamsOptionsProxyReadTimeout) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsProxyReadTimeout) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsProxyReadTimeout) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsProxyReadTimeout) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsQueryParamsBlacklist ¶
type ResourceRuleReplaceParamsOptionsQueryParamsBlacklist struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of query parameters.
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Files with the specified query parameters are cached as one object, files with other parameters are cached as different objects.
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceRuleReplaceParamsOptionsQueryParamsBlacklist) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsQueryParamsBlacklist) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsQueryParamsBlacklist) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsQueryParamsBlacklist) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsQueryParamsWhitelist ¶
type ResourceRuleReplaceParamsOptionsQueryParamsWhitelist struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of query parameters.
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Files with the specified query parameters are cached as different objects, files with other parameters are cached as one object.
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceRuleReplaceParamsOptionsQueryParamsWhitelist) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsQueryParamsWhitelist) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsQueryParamsWhitelist) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsQueryParamsWhitelist) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsQueryStringForwarding ¶
type ResourceRuleReplaceParamsOptionsQueryStringForwarding struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// The `forward_from_files_types` field specifies the types of playlist files from
// which parameters will be extracted and forwarded. This typically includes
// formats that list multiple media chunk references, such as HLS and DASH
// playlists. Parameters associated with these playlist files (like query strings
// or headers) will be propagated to the chunks they reference.
ForwardFromFileTypes []string `json:"forward_from_file_types,omitzero,required"`
// The field specifies the types of media chunk files to which parameters,
// extracted from playlist files, will be forwarded. These refer to the actual
// segments of media content that are delivered to viewers. Ensuring the correct
// parameters are forwarded to these files is crucial for maintaining the integrity
// of the streaming session.
ForwardToFileTypes []string `json:"forward_to_file_types,omitzero,required"`
// The `forward_except_keys` field provides a mechanism to exclude specific
// parameters from being forwarded from playlist files to media chunk files. By
// listing certain keys in this field, you can ensure that these parameters are
// omitted during the forwarding process. This is particularly useful for
// preventing sensitive or irrelevant information from being included in requests
// for media chunks, thereby enhancing security and optimizing performance.
ForwardExceptKeys []string `json:"forward_except_keys,omitzero"`
// The `forward_only_keys` field allows for granular control over which specific
// parameters are forwarded from playlist files to media chunk files. By specifying
// certain keys, only those parameters will be propagated, ensuring that only
// relevant information is passed along. This is particularly useful for security
// and performance optimization, as it prevents unnecessary or sensitive data from
// being included in requests for media chunks.
ForwardOnlyKeys []string `json:"forward_only_keys,omitzero"`
// contains filtered or unexported fields
}
The Query String Forwarding feature allows for the seamless transfer of parameters embedded in playlist files to the corresponding media chunk files. This functionality ensures that specific attributes, such as authentication tokens or tracking information, are consistently passed along from the playlist manifest to the individual media segments. This is particularly useful for maintaining continuity in security, analytics, and any other parameter-based operations across the entire media delivery workflow.
The properties Enabled, ForwardFromFileTypes, ForwardToFileTypes are required.
func (ResourceRuleReplaceParamsOptionsQueryStringForwarding) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsQueryStringForwarding) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsQueryStringForwarding) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsQueryStringForwarding) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsRedirectHTTPSToHTTP ¶
type ResourceRuleReplaceParamsOptionsRedirectHTTPSToHTTP struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Enables redirect from HTTPS to HTTP.
`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceRuleReplaceParamsOptionsRedirectHTTPSToHTTP) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsRedirectHTTPSToHTTP) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsRedirectHTTPSToHTTP) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsRedirectHTTPSToHTTP) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsRedirectHTTPToHTTPS ¶
type ResourceRuleReplaceParamsOptionsRedirectHTTPToHTTPS struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Enables redirect from HTTP to HTTPS.
`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceRuleReplaceParamsOptionsRedirectHTTPToHTTPS) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsRedirectHTTPToHTTPS) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsRedirectHTTPToHTTPS) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsRedirectHTTPToHTTPS) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsReferrerACL ¶
type ResourceRuleReplaceParamsOptionsReferrerACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of domain names or wildcard domains (without protocol: `http://` or
// `https://`.)
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of domain names for which access is prohibited.
// - **deny** - List of IP domain names for which access is allowed.
//
// Examples:
//
// - `example.com`
// - `*.example.com`
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"domain or wildcard"`
// Policy type.
//
// Possible values:
//
// - **allow** - Allow access to all domain names except the domain names specified
// in `excepted_values` field.
// - **deny** - Deny access to all domain names except the domain names specified
// in `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Controls access to the CDN resource content for specified domain names.
The properties Enabled, ExceptedValues, PolicyType are required.
func (ResourceRuleReplaceParamsOptionsReferrerACL) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsReferrerACL) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsReferrerACL) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsReferrerACL) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsRequestLimiter ¶
type ResourceRuleReplaceParamsOptionsRequestLimiter struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Maximum request rate.
Rate int64 `json:"rate,required"`
// Units of measurement for the `rate` field.
//
// Possible values:
//
// - **r/s** - Requests per second.
// - **r/m** - Requests per minute.
//
// If the rate is less than one request per second, it is specified in request per
// minute (r/m.)
//
// Any of "r/s", "r/m".
RateUnit string `json:"rate_unit,omitzero"`
// contains filtered or unexported fields
}
Option allows to limit the amount of HTTP requests.
The properties Enabled, Rate are required.
func (ResourceRuleReplaceParamsOptionsRequestLimiter) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsRequestLimiter) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsRequestLimiter) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsRequestLimiter) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsResponseHeadersHidingPolicy ¶
type ResourceRuleReplaceParamsOptionsResponseHeadersHidingPolicy struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of HTTP headers.
//
// Parameter meaning depends on the value of the `mode` field:
//
// - **show** - List of HTTP headers to hide from response.
// - **hide** - List of HTTP headers to include in response. Other HTTP headers
// will be hidden.
//
// The following headers are required and cannot be hidden from response:
//
// - `Connection`
// - `Content-Length`
// - `Content-Type`
// - `Date`
// - `Server`
Excepted []string `json:"excepted,omitzero,required" format:"http_header"`
// How HTTP headers are hidden from the response.
//
// Possible values:
//
// - **show** - Hide only HTTP headers listed in the `excepted` field.
// - **hide** - Hide all HTTP headers except headers listed in the "excepted"
// field.
//
// Any of "hide", "show".
Mode string `json:"mode,omitzero,required"`
// contains filtered or unexported fields
}
Hides HTTP headers from an origin server in the CDN response.
The properties Enabled, Excepted, Mode are required.
func (ResourceRuleReplaceParamsOptionsResponseHeadersHidingPolicy) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsResponseHeadersHidingPolicy) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsResponseHeadersHidingPolicy) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsResponseHeadersHidingPolicy) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsRewrite ¶
type ResourceRuleReplaceParamsOptionsRewrite struct {
// Path for the Rewrite option.
//
// Example:
//
// - `/(.*) /media/$1`
Body string `json:"body,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Flag for the Rewrite option.
//
// Possible values:
//
// - **last** - Stop processing the current set of `ngx_http_rewrite_module`
// directives and start a search for a new location matching changed URI.
// - **break** - Stop processing the current set of the Rewrite option.
// - **redirect** - Return a temporary redirect with the 302 code; used when a
// replacement string does not start with `http://`, `https://`, or `$scheme`.
// - **permanent** - Return a permanent redirect with the 301 code.
//
// Any of "break", "last", "redirect", "permanent".
Flag string `json:"flag,omitzero"`
// contains filtered or unexported fields
}
Changes and redirects requests from the CDN to the origin. It operates according to the [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite) configuration.
The properties Body, Enabled are required.
func (ResourceRuleReplaceParamsOptionsRewrite) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsRewrite) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsRewrite) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsRewrite) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsSecureKey ¶
type ResourceRuleReplaceParamsOptionsSecureKey struct {
// Key generated on your side that will be used for URL signing.
Key param.Opt[string] `json:"key,omitzero,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Type of URL signing.
//
// Possible types:
//
// - **Type 0** - Includes end user IP to secure token generation.
// - **Type 2** - Excludes end user IP from secure token generation.
//
// Any of 0, 2.
Type int64 `json:"type,omitzero"`
// contains filtered or unexported fields
}
Configures access with tokenized URLs. This makes impossible to access content without a valid (unexpired) token.
The properties Enabled, Key are required.
func (ResourceRuleReplaceParamsOptionsSecureKey) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsSecureKey) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsSecureKey) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsSecureKey) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsSlice ¶
type ResourceRuleReplaceParamsOptionsSlice struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Requests and caches files larger than 10 MB in parts (no larger than 10 MB per part.) This reduces time to first byte.
The option is based on the [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
Notes:
- Origin must support HTTP Range requests.
- Not supported with `gzipON`, `brotli_compression` or `fetch_compressed` options enabled.
The properties Enabled, Value are required.
func (ResourceRuleReplaceParamsOptionsSlice) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsSlice) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsSlice) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsSlice) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsSni ¶
type ResourceRuleReplaceParamsOptionsSni struct {
// Custom SNI hostname.
//
// It is required if `sni_type` is set to custom.
CustomHostname string `json:"custom_hostname,required" format:"domain"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// SNI (Server Name Indication) type.
//
// Possible values:
//
// - **dynamic** - SNI hostname depends on `hostHeader` and `forward_host_header`
// options. It has several possible combinations:
// - If the `hostHeader` option is enabled and specified, SNI hostname matches the
// Host header.
// - If the `forward_host_header` option is enabled and has true value, SNI
// hostname matches the Host header used in the request made to a CDN.
// - If the `hostHeader` and `forward_host_header` options are disabled, SNI
// hostname matches the primary CNAME.
// - **custom** - custom SNI hostname is in use.
//
// Any of "dynamic", "custom".
SniType string `json:"sni_type,omitzero"`
// contains filtered or unexported fields
}
The hostname that is added to SNI requests from CDN servers to the origin server via HTTPS.
SNI is generally only required if your origin uses shared hosting or does not have a dedicated IP address. If the origin server presents multiple certificates, SNI allows the origin server to know which certificate to use for the connection.
The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
The properties CustomHostname, Enabled are required.
func (ResourceRuleReplaceParamsOptionsSni) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsSni) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsSni) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsSni) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsStale ¶
type ResourceRuleReplaceParamsOptionsStale struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Defines list of errors for which "Always online" option is applied.
//
// Any of "error", "http_403", "http_404", "http_429", "http_500", "http_502",
// "http_503", "http_504", "invalid_header", "timeout", "updating".
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Serves stale cached content in case of origin unavailability.
The properties Enabled, Value are required.
func (ResourceRuleReplaceParamsOptionsStale) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsStale) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsStale) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsStale) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsStaticHeaders
deprecated
type ResourceRuleReplaceParamsOptionsStaticHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// A MAP for static headers in a format of `header_name: header_value`.
//
// Restrictions:
//
// - **Header name** - Maximum 128 symbols, may contain Latin letters (A-Z, a-z),
// numbers (0-9), dashes, and underscores.
// - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
// (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
// with a letter, number, asterisk or {.
Value any `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
**Legacy option**. Use the `static_response_headers` option instead.
Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP Headers can be specified. May contain a header with multiple values.
Deprecated: deprecated
The properties Enabled, Value are required.
func (ResourceRuleReplaceParamsOptionsStaticHeaders) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsStaticHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsStaticHeaders) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsStaticHeaders) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsStaticRequestHeaders ¶
type ResourceRuleReplaceParamsOptionsStaticRequestHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// A MAP for static headers in a format of `header_name: header_value`.
//
// Restrictions:
//
// - **Header name** - Maximum 255 symbols, may contain Latin letters (A-Z, a-z),
// numbers (0-9), dashes, and underscores.
// - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
// (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
// with a letter, number, asterisk or {.
Value map[string]string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP Headers can be specified.
The properties Enabled, Value are required.
func (ResourceRuleReplaceParamsOptionsStaticRequestHeaders) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsStaticRequestHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsStaticRequestHeaders) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsStaticRequestHeaders) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsStaticResponseHeaders ¶
type ResourceRuleReplaceParamsOptionsStaticResponseHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
Value []ResourceRuleReplaceParamsOptionsStaticResponseHeadersValue `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Custom HTTP Headers that a CDN server adds to a response.
The properties Enabled, Value are required.
func (ResourceRuleReplaceParamsOptionsStaticResponseHeaders) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsStaticResponseHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsStaticResponseHeaders) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsStaticResponseHeaders) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsStaticResponseHeadersValue ¶
type ResourceRuleReplaceParamsOptionsStaticResponseHeadersValue struct {
// HTTP Header name.
//
// Restrictions:
//
// - Maximum 128 symbols.
// - Latin letters (A-Z, a-z,) numbers (0-9,) dashes, and underscores only.
Name string `json:"name,required"`
// Header value.
//
// Restrictions:
//
// - Maximum 512 symbols.
// - Letters (a-z), numbers (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+
// /|\";:?.,><{}[]).
// - Must start with a letter, number, asterisk or {.
// - Multiple values can be added.
Value []string `json:"value,omitzero,required"`
// Defines whether the header will be added to a response from CDN regardless of
// response code.
//
// Possible values:
//
// - **true** - Header will be added to a response from CDN regardless of response
// code.
// - **false** - Header will be added only to the following response codes: 200,
// 201, 204, 206, 301, 302, 303, 304, 307, 308.
Always param.Opt[bool] `json:"always,omitzero"`
// contains filtered or unexported fields
}
The properties Name, Value are required.
func (ResourceRuleReplaceParamsOptionsStaticResponseHeadersValue) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsStaticResponseHeadersValue) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsStaticResponseHeadersValue) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsStaticResponseHeadersValue) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsUserAgentACL ¶
type ResourceRuleReplaceParamsOptionsUserAgentACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of User-Agents that will be allowed/denied.
//
// The meaning of the parameter depends on `policy_type`:
//
// - **allow** - List of User-Agents for which access is prohibited.
// - **deny** - List of User-Agents for which access is allowed.
//
// Use an empty string `""` to allow/deny access when the User-Agent header is
// empty.
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"user_agent"`
// User-Agents policy type.
//
// Possible values:
//
// - **allow** - Allow access for all User-Agents except specified in
// `excepted_values` field.
// - **deny** - Deny access for all User-Agents except specified in
// `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Controls access to the content for specified User-Agents.
The properties Enabled, ExceptedValues, PolicyType are required.
func (ResourceRuleReplaceParamsOptionsUserAgentACL) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsUserAgentACL) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsUserAgentACL) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsUserAgentACL) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsWaap ¶
type ResourceRuleReplaceParamsOptionsWaap struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Allows to enable WAAP (Web Application and API Protection).
The properties Enabled, Value are required.
func (ResourceRuleReplaceParamsOptionsWaap) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsWaap) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsWaap) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsWaap) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOptionsWebsockets ¶
type ResourceRuleReplaceParamsOptionsWebsockets struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Enables or disables WebSockets connections to an origin server.
The properties Enabled, Value are required.
func (ResourceRuleReplaceParamsOptionsWebsockets) MarshalJSON ¶
func (r ResourceRuleReplaceParamsOptionsWebsockets) MarshalJSON() (data []byte, err error)
func (*ResourceRuleReplaceParamsOptionsWebsockets) UnmarshalJSON ¶
func (r *ResourceRuleReplaceParamsOptionsWebsockets) UnmarshalJSON(data []byte) error
type ResourceRuleReplaceParamsOverrideOriginProtocol ¶
type ResourceRuleReplaceParamsOverrideOriginProtocol string
Sets a protocol other than the one specified in the CDN resource settings to connect to the origin.
Possible values:
- **HTTPS** - CDN servers connect to origin via HTTPS protocol.
- **HTTP** - CDN servers connect to origin via HTTP protocol.
- **MATCH** - Connection protocol is chosen automatically; in this case, content on origin source should be available for the CDN both through HTTP and HTTPS protocols.
- **null** - `originProtocol` setting is inherited from the CDN resource settings.
const ( ResourceRuleReplaceParamsOverrideOriginProtocolHTTPS ResourceRuleReplaceParamsOverrideOriginProtocol = "HTTPS" ResourceRuleReplaceParamsOverrideOriginProtocolHTTP ResourceRuleReplaceParamsOverrideOriginProtocol = "HTTP" ResourceRuleReplaceParamsOverrideOriginProtocolMatch ResourceRuleReplaceParamsOverrideOriginProtocol = "MATCH" )
type ResourceRuleService ¶
type ResourceRuleService struct {
Options []option.RequestOption
}
ResourceRuleService 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 NewResourceRuleService method instead.
func NewResourceRuleService ¶
func NewResourceRuleService(opts ...option.RequestOption) (r ResourceRuleService)
NewResourceRuleService 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 (*ResourceRuleService) Delete ¶
func (r *ResourceRuleService) Delete(ctx context.Context, ruleID int64, body ResourceRuleDeleteParams, opts ...option.RequestOption) (err error)
Delete the rule from the system permanently.
Notes:
- **Deactivation Requirement**: Set the `active` attribute to `false` before deletion.
- **Irreversibility**: This action is irreversible. Once deleted, the rule cannot be recovered.
func (*ResourceRuleService) Get ¶
func (r *ResourceRuleService) Get(ctx context.Context, ruleID int64, query ResourceRuleGetParams, opts ...option.RequestOption) (res *CdnResourceRule, err error)
Get rule details
func (*ResourceRuleService) List ¶
func (r *ResourceRuleService) List(ctx context.Context, resourceID int64, opts ...option.RequestOption) (res *[]CdnResourceRule, err error)
Get rules list
func (*ResourceRuleService) New ¶
func (r *ResourceRuleService) New(ctx context.Context, resourceID int64, body ResourceRuleNewParams, opts ...option.RequestOption) (res *CdnResourceRule, err error)
Create rule
func (*ResourceRuleService) Replace ¶
func (r *ResourceRuleService) Replace(ctx context.Context, ruleID int64, params ResourceRuleReplaceParams, opts ...option.RequestOption) (res *CdnResourceRule, err error)
Change rule
func (*ResourceRuleService) Update ¶
func (r *ResourceRuleService) Update(ctx context.Context, ruleID int64, params ResourceRuleUpdateParams, opts ...option.RequestOption) (res *CdnResourceRule, err error)
Change rule
type ResourceRuleUpdateParams ¶
type ResourceRuleUpdateParams struct {
ResourceID int64 `path:"resource_id,required" json:"-"`
// ID of the origin group to which the rule is applied.
//
// If the origin group is not specified, the rule is applied to the origin group
// that the CDN resource is associated with.
OriginGroup param.Opt[int64] `json:"originGroup,omitzero"`
// Enables or disables a rule.
//
// Possible values:
//
// - **true** - Rule is active, rule settings are applied.
// - **false** - Rule is inactive, rule settings are not applied.
Active param.Opt[bool] `json:"active,omitzero"`
// Rule name.
Name param.Opt[string] `json:"name,omitzero"`
// Path to the file or folder for which the rule will be applied.
//
// The rule is applied if the requested URI matches the rule path.
//
// We add a leading forward slash to any rule path. Specify a path without a
// forward slash.
Rule param.Opt[string] `json:"rule,omitzero"`
// Rule type.
//
// Possible values:
//
// - **Type 0** - Regular expression. Must start with '^/' or '/'.
// - **Type 1** - Regular expression. Note that for this rule type we automatically
// add / to each rule pattern before your regular expression. This type is
// **legacy**, please use Type 0.
RuleType param.Opt[int64] `json:"ruleType,omitzero"`
// Rule execution order: from lowest (1) to highest.
//
// If requested URI matches multiple rules, the one higher in the order of the
// rules will be applied.
Weight param.Opt[int64] `json:"weight,omitzero"`
// Sets a protocol other than the one specified in the CDN resource settings to
// connect to the origin.
//
// Possible values:
//
// - **HTTPS** - CDN servers connect to origin via HTTPS protocol.
// - **HTTP** - CDN servers connect to origin via HTTP protocol.
// - **MATCH** - Connection protocol is chosen automatically; in this case, content
// on origin source should be available for the CDN both through HTTP and HTTPS
// protocols.
// - **null** - `originProtocol` setting is inherited from the CDN resource
// settings.
//
// Any of "HTTPS", "HTTP", "MATCH".
OverrideOriginProtocol ResourceRuleUpdateParamsOverrideOriginProtocol `json:"overrideOriginProtocol,omitzero"`
// List of options that can be configured for the rule.
//
// In case of `null` value the option is not added to the rule. Option inherits its
// value from the CDN resource settings.
Options ResourceRuleUpdateParamsOptions `json:"options,omitzero"`
// contains filtered or unexported fields
}
func (ResourceRuleUpdateParams) MarshalJSON ¶
func (r ResourceRuleUpdateParams) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParams) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParams) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptions ¶
type ResourceRuleUpdateParamsOptions struct {
// HTTP methods allowed for content requests from the CDN.
AllowedHTTPMethods ResourceRuleUpdateParamsOptionsAllowedHTTPMethods `json:"allowedHttpMethods,omitzero"`
// Allows to prevent online services from overloading and ensure your business
// workflow running smoothly.
BotProtection ResourceRuleUpdateParamsOptionsBotProtection `json:"bot_protection,omitzero"`
// Compresses content with Brotli on the CDN side. CDN servers will request only
// uncompressed content from the origin.
//
// Notes:
//
// 1. CDN only supports "Brotli compression" when the "origin shielding" feature is
// activated.
// 2. If a precache server is not active for a CDN resource, no compression occurs,
// even if the option is enabled.
// 3. `brotli_compression` is not supported with `fetch_compressed` or `slice`
// options enabled.
// 4. `fetch_compressed` option in CDN resource settings overrides
// `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN
// resource and want to enable `brotli_compression` in a rule, you must specify
// `fetch_compressed:false` in the rule.
BrotliCompression ResourceRuleUpdateParamsOptionsBrotliCompression `json:"brotli_compression,omitzero"`
// Cache expiration time for users browsers in seconds.
//
// Cache expiration time is applied to the following response codes: 200, 201, 204,
// 206, 301, 302, 303, 304, 307, 308.
//
// Responses with other codes will not be cached.
BrowserCacheSettings ResourceRuleUpdateParamsOptionsBrowserCacheSettings `json:"browser_cache_settings,omitzero"`
// **Legacy option**. Use the `response_headers_hiding_policy` option instead.
//
// HTTP Headers that must be included in the response.
//
// Deprecated: deprecated
CacheHTTPHeaders ResourceRuleUpdateParamsOptionsCacheHTTPHeaders `json:"cache_http_headers,omitzero"`
// Enables or disables CORS (Cross-Origin Resource Sharing) header support.
//
// CORS header support allows the CDN to add the Access-Control-Allow-Origin header
// to a response to a browser.
Cors ResourceRuleUpdateParamsOptionsCors `json:"cors,omitzero"`
// Enables control access to content for specified countries.
CountryACL ResourceRuleUpdateParamsOptionsCountryACL `json:"country_acl,omitzero"`
// **Legacy option**. Use the `edge_cache_settings` option instead.
//
// Allows the complete disabling of content caching.
//
// Deprecated: deprecated
DisableCache ResourceRuleUpdateParamsOptionsDisableCache `json:"disable_cache,omitzero"`
// Allows 206 responses regardless of the settings of an origin source.
DisableProxyForceRanges ResourceRuleUpdateParamsOptionsDisableProxyForceRanges `json:"disable_proxy_force_ranges,omitzero"`
// Cache expiration time for CDN servers.
//
// `value` and `default` fields cannot be used simultaneously.
EdgeCacheSettings ResourceRuleUpdateParamsOptionsEdgeCacheSettings `json:"edge_cache_settings,omitzero"`
// Allows to configure FastEdge app to be called on different request/response
// phases.
//
// Note: At least one of `on_request_headers`, `on_request_body`,
// `on_response_headers`, or `on_response_body` must be specified.
Fastedge ResourceRuleUpdateParamsOptionsFastedge `json:"fastedge,omitzero"`
// Makes the CDN request compressed content from the origin.
//
// The origin server should support compression. CDN servers will not decompress
// your content even if a user browser does not accept compression.
//
// Notes:
//
// 1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or
// `slice` options enabled.
// 2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If
// you enable it in CDN resource and want to use `gzipON` and
// `brotli_compression` in a rule, you have to specify
// `"fetch_compressed": false` in the rule.
FetchCompressed ResourceRuleUpdateParamsOptionsFetchCompressed `json:"fetch_compressed,omitzero"`
// Enables redirection from origin. If the origin server returns a redirect, the
// option allows the CDN to pull the requested content from the origin server that
// was returned in the redirect.
FollowOriginRedirect ResourceRuleUpdateParamsOptionsFollowOriginRedirect `json:"follow_origin_redirect,omitzero"`
// Applies custom HTTP response codes for CDN content.
//
// The following codes are reserved by our system and cannot be specified in this
// option: 408, 444, 477, 494, 495, 496, 497, 499.
ForceReturn ResourceRuleUpdateParamsOptionsForceReturn `json:"force_return,omitzero"`
// Forwards the Host header from a end-user request to an origin server.
//
// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
ForwardHostHeader ResourceRuleUpdateParamsOptionsForwardHostHeader `json:"forward_host_header,omitzero"`
// Compresses content with gzip on the CDN end. CDN servers will request only
// uncompressed content from the origin.
//
// Notes:
//
// 1. Compression with gzip is not supported with `fetch_compressed` or `slice`
// options enabled.
// 2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in
// rules. If you enable `fetch_compressed` in CDN resource and want to enable
// `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
GzipOn ResourceRuleUpdateParamsOptionsGzipOn `json:"gzipOn,omitzero"`
// Sets the Host header that CDN servers use when request content from an origin
// server. Your server must be able to process requests with the chosen header.
//
// If the option is `null`, the Host Header value is equal to first CNAME.
//
// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
HostHeader ResourceRuleUpdateParamsOptionsHostHeader `json:"hostHeader,omitzero"`
// Defines whether the files with the Set-Cookies header are cached as one file or
// as different ones.
IgnoreCookie ResourceRuleUpdateParamsOptionsIgnoreCookie `json:"ignore_cookie,omitzero"`
// How a file with different query strings is cached: either as one object (option
// is enabled) or as different objects (option is disabled.)
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
IgnoreQueryString ResourceRuleUpdateParamsOptionsIgnoreQueryString `json:"ignoreQueryString,omitzero"`
// Transforms JPG and PNG images (for example, resize or crop) and automatically
// converts them to WebP or AVIF format.
ImageStack ResourceRuleUpdateParamsOptionsImageStack `json:"image_stack,omitzero"`
// Controls access to the CDN resource content for specific IP addresses.
//
// If you want to use IPs from our CDN servers IP list for IP ACL configuration,
// you have to independently monitor their relevance. We recommend you use a script
// for automatically update IP ACL.
// [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
IPAddressACL ResourceRuleUpdateParamsOptionsIPAddressACL `json:"ip_address_acl,omitzero"`
// Allows to control the download speed per connection.
LimitBandwidth ResourceRuleUpdateParamsOptionsLimitBandwidth `json:"limit_bandwidth,omitzero"`
// Allows you to modify your cache key. If omitted, the default value is
// `$request_uri`.
//
// Combine the specified variables to create a key for caching.
//
// - **$`request_uri`**
// - **$scheme**
// - **$uri**
//
// **Warning**: Enabling and changing this option can invalidate your current cache
// and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will
// not work.
ProxyCacheKey ResourceRuleUpdateParamsOptionsProxyCacheKey `json:"proxy_cache_key,omitzero"`
// Caching for POST requests along with default GET and HEAD.
ProxyCacheMethodsSet ResourceRuleUpdateParamsOptionsProxyCacheMethodsSet `json:"proxy_cache_methods_set,omitzero"`
// The time limit for establishing a connection with the origin.
ProxyConnectTimeout ResourceRuleUpdateParamsOptionsProxyConnectTimeout `json:"proxy_connect_timeout,omitzero"`
// The time limit for receiving a partial response from the origin. If no response
// is received within this time, the connection will be closed.
//
// **Note:** When used with a WebSocket connection, this option supports values
// only in the range 1–20 seconds (instead of the usual 1–30 seconds).
ProxyReadTimeout ResourceRuleUpdateParamsOptionsProxyReadTimeout `json:"proxy_read_timeout,omitzero"`
// Files with the specified query parameters are cached as one object, files with
// other parameters are cached as different objects.
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
QueryParamsBlacklist ResourceRuleUpdateParamsOptionsQueryParamsBlacklist `json:"query_params_blacklist,omitzero"`
// Files with the specified query parameters are cached as different objects, files
// with other parameters are cached as one object.
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
QueryParamsWhitelist ResourceRuleUpdateParamsOptionsQueryParamsWhitelist `json:"query_params_whitelist,omitzero"`
// The Query String Forwarding feature allows for the seamless transfer of
// parameters embedded in playlist files to the corresponding media chunk files.
// This functionality ensures that specific attributes, such as authentication
// tokens or tracking information, are consistently passed along from the playlist
// manifest to the individual media segments. This is particularly useful for
// maintaining continuity in security, analytics, and any other parameter-based
// operations across the entire media delivery workflow.
QueryStringForwarding ResourceRuleUpdateParamsOptionsQueryStringForwarding `json:"query_string_forwarding,omitzero"`
// Enables redirect from HTTP to HTTPS.
//
// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
// simultaneously.
RedirectHTTPToHTTPS ResourceRuleUpdateParamsOptionsRedirectHTTPToHTTPS `json:"redirect_http_to_https,omitzero"`
// Enables redirect from HTTPS to HTTP.
//
// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
// simultaneously.
RedirectHTTPSToHTTP ResourceRuleUpdateParamsOptionsRedirectHTTPSToHTTP `json:"redirect_https_to_http,omitzero"`
// Controls access to the CDN resource content for specified domain names.
ReferrerACL ResourceRuleUpdateParamsOptionsReferrerACL `json:"referrer_acl,omitzero"`
// Option allows to limit the amount of HTTP requests.
RequestLimiter ResourceRuleUpdateParamsOptionsRequestLimiter `json:"request_limiter,omitzero"`
// Hides HTTP headers from an origin server in the CDN response.
ResponseHeadersHidingPolicy ResourceRuleUpdateParamsOptionsResponseHeadersHidingPolicy `json:"response_headers_hiding_policy,omitzero"`
// Changes and redirects requests from the CDN to the origin. It operates according
// to the
// [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite)
// configuration.
Rewrite ResourceRuleUpdateParamsOptionsRewrite `json:"rewrite,omitzero"`
// Configures access with tokenized URLs. This makes impossible to access content
// without a valid (unexpired) token.
SecureKey ResourceRuleUpdateParamsOptionsSecureKey `json:"secure_key,omitzero"`
// Requests and caches files larger than 10 MB in parts (no larger than 10 MB per
// part.) This reduces time to first byte.
//
// The option is based on the
// [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
//
// Notes:
//
// 1. Origin must support HTTP Range requests.
// 2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed`
// options enabled.
Slice ResourceRuleUpdateParamsOptionsSlice `json:"slice,omitzero"`
// The hostname that is added to SNI requests from CDN servers to the origin server
// via HTTPS.
//
// SNI is generally only required if your origin uses shared hosting or does not
// have a dedicated IP address. If the origin server presents multiple
// certificates, SNI allows the origin server to know which certificate to use for
// the connection.
//
// The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
Sni ResourceRuleUpdateParamsOptionsSni `json:"sni,omitzero"`
// Serves stale cached content in case of origin unavailability.
Stale ResourceRuleUpdateParamsOptionsStale `json:"stale,omitzero"`
// Custom HTTP Headers that a CDN server adds to a response.
StaticResponseHeaders ResourceRuleUpdateParamsOptionsStaticResponseHeaders `json:"static_response_headers,omitzero"`
// **Legacy option**. Use the `static_response_headers` option instead.
//
// Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP
// Headers can be specified. May contain a header with multiple values.
//
// Deprecated: deprecated
StaticHeaders ResourceRuleUpdateParamsOptionsStaticHeaders `json:"staticHeaders,omitzero"`
// Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP
// Headers can be specified.
StaticRequestHeaders ResourceRuleUpdateParamsOptionsStaticRequestHeaders `json:"staticRequestHeaders,omitzero"`
// Controls access to the content for specified User-Agents.
UserAgentACL ResourceRuleUpdateParamsOptionsUserAgentACL `json:"user_agent_acl,omitzero"`
// Allows to enable WAAP (Web Application and API Protection).
Waap ResourceRuleUpdateParamsOptionsWaap `json:"waap,omitzero"`
// Enables or disables WebSockets connections to an origin server.
Websockets ResourceRuleUpdateParamsOptionsWebsockets `json:"websockets,omitzero"`
// contains filtered or unexported fields
}
List of options that can be configured for the rule.
In case of `null` value the option is not added to the rule. Option inherits its value from the CDN resource settings.
func (ResourceRuleUpdateParamsOptions) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptions) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptions) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptions) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsAllowedHTTPMethods ¶
type ResourceRuleUpdateParamsOptionsAllowedHTTPMethods struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
HTTP methods allowed for content requests from the CDN.
The properties Enabled, Value are required.
func (ResourceRuleUpdateParamsOptionsAllowedHTTPMethods) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsAllowedHTTPMethods) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsAllowedHTTPMethods) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsAllowedHTTPMethods) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsBotProtection ¶
type ResourceRuleUpdateParamsOptionsBotProtection struct {
// Controls the bot challenge module state.
BotChallenge ResourceRuleUpdateParamsOptionsBotProtectionBotChallenge `json:"bot_challenge,omitzero,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// contains filtered or unexported fields
}
Allows to prevent online services from overloading and ensure your business workflow running smoothly.
The properties BotChallenge, Enabled are required.
func (ResourceRuleUpdateParamsOptionsBotProtection) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsBotProtection) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsBotProtection) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsBotProtection) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsBotProtectionBotChallenge ¶
type ResourceRuleUpdateParamsOptionsBotProtectionBotChallenge struct {
// Possible values:
//
// - **true** - Bot challenge is enabled.
// - **false** - Bot challenge is disabled.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// contains filtered or unexported fields
}
Controls the bot challenge module state.
func (ResourceRuleUpdateParamsOptionsBotProtectionBotChallenge) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsBotProtectionBotChallenge) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsBotProtectionBotChallenge) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsBotProtectionBotChallenge) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsBrotliCompression ¶
type ResourceRuleUpdateParamsOptionsBrotliCompression struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Allows to select the content types you want to compress.
//
// `text/html` is a mandatory content type.
//
// Any of "application/javascript", "application/json",
// "application/vnd.ms-fontobject", "application/wasm", "application/x-font-ttf",
// "application/x-javascript", "application/xml", "application/xml+rss",
// "image/svg+xml", "image/x-icon", "text/css", "text/html", "text/javascript",
// "text/plain", "text/xml".
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Compresses content with Brotli on the CDN side. CDN servers will request only uncompressed content from the origin.
Notes:
- CDN only supports "Brotli compression" when the "origin shielding" feature is activated.
- If a precache server is not active for a CDN resource, no compression occurs, even if the option is enabled.
- `brotli_compression` is not supported with `fetch_compressed` or `slice` options enabled.
- `fetch_compressed` option in CDN resource settings overrides `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN resource and want to enable `brotli_compression` in a rule, you must specify `fetch_compressed:false` in the rule.
The properties Enabled, Value are required.
func (ResourceRuleUpdateParamsOptionsBrotliCompression) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsBrotliCompression) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsBrotliCompression) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsBrotliCompression) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsBrowserCacheSettings ¶
type ResourceRuleUpdateParamsOptionsBrowserCacheSettings struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Set the cache expiration time to '0s' to disable caching.
//
// The maximum duration is any equivalent to `1y`.
Value string `json:"value,required" format:"nginx time"`
// contains filtered or unexported fields
}
Cache expiration time for users browsers in seconds.
Cache expiration time is applied to the following response codes: 200, 201, 204, 206, 301, 302, 303, 304, 307, 308.
Responses with other codes will not be cached.
The properties Enabled, Value are required.
func (ResourceRuleUpdateParamsOptionsBrowserCacheSettings) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsBrowserCacheSettings) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsBrowserCacheSettings) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsBrowserCacheSettings) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsCacheHTTPHeaders
deprecated
type ResourceRuleUpdateParamsOptionsCacheHTTPHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
**Legacy option**. Use the `response_headers_hiding_policy` option instead.
HTTP Headers that must be included in the response.
Deprecated: deprecated
The properties Enabled, Value are required.
func (ResourceRuleUpdateParamsOptionsCacheHTTPHeaders) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsCacheHTTPHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsCacheHTTPHeaders) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsCacheHTTPHeaders) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsCors ¶
type ResourceRuleUpdateParamsOptionsCors struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Value of the Access-Control-Allow-Origin header.
//
// Possible values:
//
// - **Adds \* as the Access-Control-Allow-Origin header value** - Content will be
// uploaded for requests from any domain. `"value": ["*"]`
// - **Adds "$http_origin" as the Access-Control-Allow-Origin header value if the
// origin matches one of the listed domains** - Content will be uploaded only for
// requests from the domains specified in the field.
// `"value": ["domain.com", "second.dom.com"]`
// - **Adds "$http_origin" as the Access-Control-Allow-Origin header value** -
// Content will be uploaded for requests from any domain, and the domain from
// which the request was sent will be added to the "Access-Control-Allow-Origin"
// header in the response. `"value": ["$http_origin"]`
Value []string `json:"value,omitzero,required"`
// Defines whether the Access-Control-Allow-Origin header should be added to a
// response from CDN regardless of response code.
//
// Possible values:
//
// - **true** - Header will be added to a response regardless of response code.
// - **false** - Header will only be added to responses with codes: 200, 201, 204,
// 206, 301, 302, 303, 304, 307, 308.
Always param.Opt[bool] `json:"always,omitzero"`
// contains filtered or unexported fields
}
Enables or disables CORS (Cross-Origin Resource Sharing) header support.
CORS header support allows the CDN to add the Access-Control-Allow-Origin header to a response to a browser.
The properties Enabled, Value are required.
func (ResourceRuleUpdateParamsOptionsCors) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsCors) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsCors) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsCors) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsCountryACL ¶
type ResourceRuleUpdateParamsOptionsCountryACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of countries according to ISO-3166-1.
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of countries for which access is prohibited.
// - **deny** - List of countries for which access is allowed.
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"country-code"`
// Defines the type of CDN resource access policy.
//
// Possible values:
//
// - **allow** - Access is allowed for all the countries except for those specified
// in `excepted_values` field.
// - **deny** - Access is denied for all the countries except for those specified
// in `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Enables control access to content for specified countries.
The properties Enabled, ExceptedValues, PolicyType are required.
func (ResourceRuleUpdateParamsOptionsCountryACL) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsCountryACL) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsCountryACL) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsCountryACL) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsDisableCache
deprecated
type ResourceRuleUpdateParamsOptionsDisableCache struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - content caching is disabled.
// - **false** - content caching is enabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
**Legacy option**. Use the `edge_cache_settings` option instead.
Allows the complete disabling of content caching.
Deprecated: deprecated
The properties Enabled, Value are required.
func (ResourceRuleUpdateParamsOptionsDisableCache) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsDisableCache) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsDisableCache) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsDisableCache) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsDisableProxyForceRanges ¶
type ResourceRuleUpdateParamsOptionsDisableProxyForceRanges struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Allows 206 responses regardless of the settings of an origin source.
The properties Enabled, Value are required.
func (ResourceRuleUpdateParamsOptionsDisableProxyForceRanges) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsDisableProxyForceRanges) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsDisableProxyForceRanges) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsDisableProxyForceRanges) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsEdgeCacheSettings ¶
type ResourceRuleUpdateParamsOptionsEdgeCacheSettings struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Enables content caching according to the origin cache settings.
//
// The value is applied to the following response codes 200, 201, 204, 206, 301,
// 302, 303, 304, 307, 308, if an origin server does not have caching HTTP headers.
//
// Responses with other codes will not be cached.
//
// The maximum duration is any equivalent to `1y`.
Default param.Opt[string] `json:"default,omitzero" format:"nginx time"`
// Caching time.
//
// The value is applied to the following response codes: 200, 206, 301, 302.
// Responses with codes 4xx, 5xx will not be cached.
//
// Use `0s` to disable caching.
//
// The maximum duration is any equivalent to `1y`.
Value param.Opt[string] `json:"value,omitzero" format:"nginx time"`
// A MAP object representing the caching time in seconds for a response with a
// specific response code.
//
// These settings have a higher priority than the `value` field.
//
// - Use `any` key to specify caching time for all response codes.
// - Use `0s` value to disable caching for a specific response code.
CustomValues map[string]string `json:"custom_values,omitzero" format:"nginx time"`
// contains filtered or unexported fields
}
Cache expiration time for CDN servers.
`value` and `default` fields cannot be used simultaneously.
The property Enabled is required.
func (ResourceRuleUpdateParamsOptionsEdgeCacheSettings) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsEdgeCacheSettings) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsEdgeCacheSettings) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsEdgeCacheSettings) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsFastedge ¶
type ResourceRuleUpdateParamsOptionsFastedge struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Allows to configure FastEdge application that will be called to handle request
// body as soon as CDN receives incoming HTTP request.
OnRequestBody ResourceRuleUpdateParamsOptionsFastedgeOnRequestBody `json:"on_request_body,omitzero"`
// Allows to configure FastEdge application that will be called to handle request
// headers as soon as CDN receives incoming HTTP request.
OnRequestHeaders ResourceRuleUpdateParamsOptionsFastedgeOnRequestHeaders `json:"on_request_headers,omitzero"`
// Allows to configure FastEdge application that will be called to handle response
// body before CDN sends the HTTP response.
OnResponseBody ResourceRuleUpdateParamsOptionsFastedgeOnResponseBody `json:"on_response_body,omitzero"`
// Allows to configure FastEdge application that will be called to handle response
// headers before CDN sends the HTTP response.
OnResponseHeaders ResourceRuleUpdateParamsOptionsFastedgeOnResponseHeaders `json:"on_response_headers,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge app to be called on different request/response phases.
Note: At least one of `on_request_headers`, `on_request_body`, `on_response_headers`, or `on_response_body` must be specified.
The property Enabled is required.
func (ResourceRuleUpdateParamsOptionsFastedge) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsFastedge) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsFastedge) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsFastedge) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsFastedgeOnRequestBody ¶
type ResourceRuleUpdateParamsOptionsFastedgeOnRequestBody struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle request body as soon as CDN receives incoming HTTP request.
The property AppID is required.
func (ResourceRuleUpdateParamsOptionsFastedgeOnRequestBody) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsFastedgeOnRequestBody) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsFastedgeOnRequestBody) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsFastedgeOnRequestBody) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsFastedgeOnRequestHeaders ¶
type ResourceRuleUpdateParamsOptionsFastedgeOnRequestHeaders struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request.
The property AppID is required.
func (ResourceRuleUpdateParamsOptionsFastedgeOnRequestHeaders) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsFastedgeOnRequestHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsFastedgeOnResponseBody ¶
type ResourceRuleUpdateParamsOptionsFastedgeOnResponseBody struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle response body before CDN sends the HTTP response.
The property AppID is required.
func (ResourceRuleUpdateParamsOptionsFastedgeOnResponseBody) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsFastedgeOnResponseBody) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsFastedgeOnResponseBody) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsFastedgeOnResponseBody) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsFastedgeOnResponseHeaders ¶
type ResourceRuleUpdateParamsOptionsFastedgeOnResponseHeaders struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle response headers before CDN sends the HTTP response.
The property AppID is required.
func (ResourceRuleUpdateParamsOptionsFastedgeOnResponseHeaders) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsFastedgeOnResponseHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsFastedgeOnResponseHeaders) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsFastedgeOnResponseHeaders) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsFetchCompressed ¶
type ResourceRuleUpdateParamsOptionsFetchCompressed struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Makes the CDN request compressed content from the origin.
The origin server should support compression. CDN servers will not decompress your content even if a user browser does not accept compression.
Notes:
- `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or `slice` options enabled.
- `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If you enable it in CDN resource and want to use `gzipON` and `brotli_compression` in a rule, you have to specify `"fetch_compressed": false` in the rule.
The properties Enabled, Value are required.
func (ResourceRuleUpdateParamsOptionsFetchCompressed) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsFetchCompressed) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsFetchCompressed) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsFetchCompressed) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsFollowOriginRedirect ¶
type ResourceRuleUpdateParamsOptionsFollowOriginRedirect struct {
// Redirect status code that the origin server returns.
//
// To serve up to date content to end users, you will need to purge the cache after
// managing the option.
//
// Any of 301, 302, 303, 307, 308.
Codes []int64 `json:"codes,omitzero,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// contains filtered or unexported fields
}
Enables redirection from origin. If the origin server returns a redirect, the option allows the CDN to pull the requested content from the origin server that was returned in the redirect.
The properties Codes, Enabled are required.
func (ResourceRuleUpdateParamsOptionsFollowOriginRedirect) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsFollowOriginRedirect) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsFollowOriginRedirect) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsFollowOriginRedirect) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsForceReturn ¶
type ResourceRuleUpdateParamsOptionsForceReturn struct {
// URL for redirection or text.
Body string `json:"body,required"`
// Status code value.
Code int64 `json:"code,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Controls the time at which a custom HTTP response code should be applied. By
// default, a custom HTTP response code is applied at any time.
TimeInterval ResourceRuleUpdateParamsOptionsForceReturnTimeInterval `json:"time_interval,omitzero"`
// contains filtered or unexported fields
}
Applies custom HTTP response codes for CDN content.
The following codes are reserved by our system and cannot be specified in this option: 408, 444, 477, 494, 495, 496, 497, 499.
The properties Body, Code, Enabled are required.
func (ResourceRuleUpdateParamsOptionsForceReturn) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsForceReturn) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsForceReturn) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsForceReturn) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsForceReturnTimeInterval ¶
type ResourceRuleUpdateParamsOptionsForceReturnTimeInterval struct {
// Time until which a custom HTTP response code should be applied. Indicated in
// 24-hour format.
EndTime string `json:"end_time,required"`
// Time from which a custom HTTP response code should be applied. Indicated in
// 24-hour format.
StartTime string `json:"start_time,required"`
// Time zone used to calculate time.
TimeZone param.Opt[string] `json:"time_zone,omitzero" format:"timezone"`
// contains filtered or unexported fields
}
Controls the time at which a custom HTTP response code should be applied. By default, a custom HTTP response code is applied at any time.
The properties EndTime, StartTime are required.
func (ResourceRuleUpdateParamsOptionsForceReturnTimeInterval) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsForceReturnTimeInterval) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsForceReturnTimeInterval) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsForceReturnTimeInterval) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsForwardHostHeader ¶
type ResourceRuleUpdateParamsOptionsForwardHostHeader struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Forwards the Host header from a end-user request to an origin server.
`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceRuleUpdateParamsOptionsForwardHostHeader) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsForwardHostHeader) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsForwardHostHeader) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsForwardHostHeader) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsGzipOn ¶
type ResourceRuleUpdateParamsOptionsGzipOn struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Compresses content with gzip on the CDN end. CDN servers will request only uncompressed content from the origin.
Notes:
- Compression with gzip is not supported with `fetch_compressed` or `slice` options enabled.
- `fetch_compressed` option in CDN resource settings overrides `gzipON` in rules. If you enable `fetch_compressed` in CDN resource and want to enable `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
The properties Enabled, Value are required.
func (ResourceRuleUpdateParamsOptionsGzipOn) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsGzipOn) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsGzipOn) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsGzipOn) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsHostHeader ¶
type ResourceRuleUpdateParamsOptionsHostHeader struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Host Header value.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
Sets the Host header that CDN servers use when request content from an origin server. Your server must be able to process requests with the chosen header.
If the option is `null`, the Host Header value is equal to first CNAME.
`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceRuleUpdateParamsOptionsHostHeader) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsHostHeader) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsHostHeader) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsHostHeader) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsIPAddressACL ¶
type ResourceRuleUpdateParamsOptionsIPAddressACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of IP addresses with a subnet mask.
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of IP addresses for which access is prohibited.
// - **deny** - List of IP addresses for which access is allowed.
//
// Examples:
//
// - `192.168.3.2/32`
// - `2a03:d000:2980:7::8/128`
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"ipv4net or ipv6net"`
// IP access policy type.
//
// Possible values:
//
// - **allow** - Allow access to all IPs except IPs specified in "excepted_values"
// field.
// - **deny** - Deny access to all IPs except IPs specified in "excepted_values"
// field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Controls access to the CDN resource content for specific IP addresses.
If you want to use IPs from our CDN servers IP list for IP ACL configuration, you have to independently monitor their relevance. We recommend you use a script for automatically update IP ACL. [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
The properties Enabled, ExceptedValues, PolicyType are required.
func (ResourceRuleUpdateParamsOptionsIPAddressACL) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsIPAddressACL) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsIPAddressACL) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsIPAddressACL) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsIgnoreCookie ¶
type ResourceRuleUpdateParamsOptionsIgnoreCookie struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled, files with cookies are cached as one file.
// - **false** - Option is disabled, files with cookies are cached as different
// files.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Defines whether the files with the Set-Cookies header are cached as one file or as different ones.
The properties Enabled, Value are required.
func (ResourceRuleUpdateParamsOptionsIgnoreCookie) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsIgnoreCookie) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsIgnoreCookie) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsIgnoreCookie) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsIgnoreQueryString ¶
type ResourceRuleUpdateParamsOptionsIgnoreQueryString struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
How a file with different query strings is cached: either as one object (option is enabled) or as different objects (option is disabled.)
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceRuleUpdateParamsOptionsIgnoreQueryString) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsIgnoreQueryString) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsIgnoreQueryString) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsIgnoreQueryString) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsImageStack ¶
type ResourceRuleUpdateParamsOptionsImageStack struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Enables or disables automatic conversion of JPEG and PNG images to AVI format.
AvifEnabled param.Opt[bool] `json:"avif_enabled,omitzero"`
// Enables or disables compression without quality loss for PNG format.
PngLossless param.Opt[bool] `json:"png_lossless,omitzero"`
// Defines quality settings for JPG and PNG images. The higher the value, the
// better the image quality, and the larger the file size after conversion.
Quality param.Opt[int64] `json:"quality,omitzero"`
// Enables or disables automatic conversion of JPEG and PNG images to WebP format.
WebpEnabled param.Opt[bool] `json:"webp_enabled,omitzero"`
// contains filtered or unexported fields
}
Transforms JPG and PNG images (for example, resize or crop) and automatically converts them to WebP or AVIF format.
The property Enabled is required.
func (ResourceRuleUpdateParamsOptionsImageStack) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsImageStack) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsImageStack) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsImageStack) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsLimitBandwidth ¶
type ResourceRuleUpdateParamsOptionsLimitBandwidth struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Method of controlling the download speed per connection.
//
// Possible values:
//
// - **static** - Use speed and buffer fields to set the download speed limit.
// - **dynamic** - Use query strings **speed** and **buffer** to set the download
// speed limit.
//
// # For example, when requesting content at the link
//
// “`
// http://cdn.example.com/video.mp4?speed=50k&buffer=500k
// “`
//
// the download speed will be limited to 50kB/s after 500 kB.
//
// Any of "static", "dynamic".
LimitType string `json:"limit_type,omitzero,required"`
// Amount of downloaded data after which the user will be rate limited.
Buffer param.Opt[int64] `json:"buffer,omitzero"`
// Maximum download speed per connection.
Speed param.Opt[int64] `json:"speed,omitzero"`
// contains filtered or unexported fields
}
Allows to control the download speed per connection.
The properties Enabled, LimitType are required.
func (ResourceRuleUpdateParamsOptionsLimitBandwidth) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsLimitBandwidth) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsLimitBandwidth) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsLimitBandwidth) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsProxyCacheKey ¶
type ResourceRuleUpdateParamsOptionsProxyCacheKey struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Key for caching.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
Allows you to modify your cache key. If omitted, the default value is `$request_uri`.
Combine the specified variables to create a key for caching.
- **$`request_uri`** - **$scheme** - **$uri**
**Warning**: Enabling and changing this option can invalidate your current cache and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will not work.
The properties Enabled, Value are required.
func (ResourceRuleUpdateParamsOptionsProxyCacheKey) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsProxyCacheKey) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsProxyCacheKey) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsProxyCacheKey) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsProxyCacheMethodsSet ¶
type ResourceRuleUpdateParamsOptionsProxyCacheMethodsSet struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Caching for POST requests along with default GET and HEAD.
The properties Enabled, Value are required.
func (ResourceRuleUpdateParamsOptionsProxyCacheMethodsSet) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsProxyCacheMethodsSet) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsProxyCacheMethodsSet) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsProxyCacheMethodsSet) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsProxyConnectTimeout ¶
type ResourceRuleUpdateParamsOptionsProxyConnectTimeout struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Timeout value in seconds.
//
// Supported range: **1s - 5s**.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
The time limit for establishing a connection with the origin.
The properties Enabled, Value are required.
func (ResourceRuleUpdateParamsOptionsProxyConnectTimeout) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsProxyConnectTimeout) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsProxyConnectTimeout) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsProxyConnectTimeout) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsProxyReadTimeout ¶
type ResourceRuleUpdateParamsOptionsProxyReadTimeout struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Timeout value in seconds.
//
// Supported range: **1s - 30s**.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
The time limit for receiving a partial response from the origin. If no response is received within this time, the connection will be closed.
**Note:** When used with a WebSocket connection, this option supports values only in the range 1–20 seconds (instead of the usual 1–30 seconds).
The properties Enabled, Value are required.
func (ResourceRuleUpdateParamsOptionsProxyReadTimeout) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsProxyReadTimeout) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsProxyReadTimeout) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsProxyReadTimeout) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsQueryParamsBlacklist ¶
type ResourceRuleUpdateParamsOptionsQueryParamsBlacklist struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of query parameters.
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Files with the specified query parameters are cached as one object, files with other parameters are cached as different objects.
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceRuleUpdateParamsOptionsQueryParamsBlacklist) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsQueryParamsBlacklist) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsQueryParamsBlacklist) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsQueryParamsBlacklist) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsQueryParamsWhitelist ¶
type ResourceRuleUpdateParamsOptionsQueryParamsWhitelist struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of query parameters.
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Files with the specified query parameters are cached as different objects, files with other parameters are cached as one object.
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceRuleUpdateParamsOptionsQueryParamsWhitelist) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsQueryParamsWhitelist) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsQueryParamsWhitelist) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsQueryParamsWhitelist) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsQueryStringForwarding ¶
type ResourceRuleUpdateParamsOptionsQueryStringForwarding struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// The `forward_from_files_types` field specifies the types of playlist files from
// which parameters will be extracted and forwarded. This typically includes
// formats that list multiple media chunk references, such as HLS and DASH
// playlists. Parameters associated with these playlist files (like query strings
// or headers) will be propagated to the chunks they reference.
ForwardFromFileTypes []string `json:"forward_from_file_types,omitzero,required"`
// The field specifies the types of media chunk files to which parameters,
// extracted from playlist files, will be forwarded. These refer to the actual
// segments of media content that are delivered to viewers. Ensuring the correct
// parameters are forwarded to these files is crucial for maintaining the integrity
// of the streaming session.
ForwardToFileTypes []string `json:"forward_to_file_types,omitzero,required"`
// The `forward_except_keys` field provides a mechanism to exclude specific
// parameters from being forwarded from playlist files to media chunk files. By
// listing certain keys in this field, you can ensure that these parameters are
// omitted during the forwarding process. This is particularly useful for
// preventing sensitive or irrelevant information from being included in requests
// for media chunks, thereby enhancing security and optimizing performance.
ForwardExceptKeys []string `json:"forward_except_keys,omitzero"`
// The `forward_only_keys` field allows for granular control over which specific
// parameters are forwarded from playlist files to media chunk files. By specifying
// certain keys, only those parameters will be propagated, ensuring that only
// relevant information is passed along. This is particularly useful for security
// and performance optimization, as it prevents unnecessary or sensitive data from
// being included in requests for media chunks.
ForwardOnlyKeys []string `json:"forward_only_keys,omitzero"`
// contains filtered or unexported fields
}
The Query String Forwarding feature allows for the seamless transfer of parameters embedded in playlist files to the corresponding media chunk files. This functionality ensures that specific attributes, such as authentication tokens or tracking information, are consistently passed along from the playlist manifest to the individual media segments. This is particularly useful for maintaining continuity in security, analytics, and any other parameter-based operations across the entire media delivery workflow.
The properties Enabled, ForwardFromFileTypes, ForwardToFileTypes are required.
func (ResourceRuleUpdateParamsOptionsQueryStringForwarding) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsQueryStringForwarding) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsQueryStringForwarding) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsQueryStringForwarding) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsRedirectHTTPSToHTTP ¶
type ResourceRuleUpdateParamsOptionsRedirectHTTPSToHTTP struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Enables redirect from HTTPS to HTTP.
`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceRuleUpdateParamsOptionsRedirectHTTPSToHTTP) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsRedirectHTTPSToHTTP) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsRedirectHTTPSToHTTP) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsRedirectHTTPSToHTTP) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsRedirectHTTPToHTTPS ¶
type ResourceRuleUpdateParamsOptionsRedirectHTTPToHTTPS struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Enables redirect from HTTP to HTTPS.
`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceRuleUpdateParamsOptionsRedirectHTTPToHTTPS) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsRedirectHTTPToHTTPS) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsRedirectHTTPToHTTPS) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsRedirectHTTPToHTTPS) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsReferrerACL ¶
type ResourceRuleUpdateParamsOptionsReferrerACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of domain names or wildcard domains (without protocol: `http://` or
// `https://`.)
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of domain names for which access is prohibited.
// - **deny** - List of IP domain names for which access is allowed.
//
// Examples:
//
// - `example.com`
// - `*.example.com`
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"domain or wildcard"`
// Policy type.
//
// Possible values:
//
// - **allow** - Allow access to all domain names except the domain names specified
// in `excepted_values` field.
// - **deny** - Deny access to all domain names except the domain names specified
// in `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Controls access to the CDN resource content for specified domain names.
The properties Enabled, ExceptedValues, PolicyType are required.
func (ResourceRuleUpdateParamsOptionsReferrerACL) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsReferrerACL) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsReferrerACL) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsReferrerACL) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsRequestLimiter ¶
type ResourceRuleUpdateParamsOptionsRequestLimiter struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Maximum request rate.
Rate int64 `json:"rate,required"`
// Units of measurement for the `rate` field.
//
// Possible values:
//
// - **r/s** - Requests per second.
// - **r/m** - Requests per minute.
//
// If the rate is less than one request per second, it is specified in request per
// minute (r/m.)
//
// Any of "r/s", "r/m".
RateUnit string `json:"rate_unit,omitzero"`
// contains filtered or unexported fields
}
Option allows to limit the amount of HTTP requests.
The properties Enabled, Rate are required.
func (ResourceRuleUpdateParamsOptionsRequestLimiter) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsRequestLimiter) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsRequestLimiter) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsRequestLimiter) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsResponseHeadersHidingPolicy ¶
type ResourceRuleUpdateParamsOptionsResponseHeadersHidingPolicy struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of HTTP headers.
//
// Parameter meaning depends on the value of the `mode` field:
//
// - **show** - List of HTTP headers to hide from response.
// - **hide** - List of HTTP headers to include in response. Other HTTP headers
// will be hidden.
//
// The following headers are required and cannot be hidden from response:
//
// - `Connection`
// - `Content-Length`
// - `Content-Type`
// - `Date`
// - `Server`
Excepted []string `json:"excepted,omitzero,required" format:"http_header"`
// How HTTP headers are hidden from the response.
//
// Possible values:
//
// - **show** - Hide only HTTP headers listed in the `excepted` field.
// - **hide** - Hide all HTTP headers except headers listed in the "excepted"
// field.
//
// Any of "hide", "show".
Mode string `json:"mode,omitzero,required"`
// contains filtered or unexported fields
}
Hides HTTP headers from an origin server in the CDN response.
The properties Enabled, Excepted, Mode are required.
func (ResourceRuleUpdateParamsOptionsResponseHeadersHidingPolicy) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsResponseHeadersHidingPolicy) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsResponseHeadersHidingPolicy) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsResponseHeadersHidingPolicy) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsRewrite ¶
type ResourceRuleUpdateParamsOptionsRewrite struct {
// Path for the Rewrite option.
//
// Example:
//
// - `/(.*) /media/$1`
Body string `json:"body,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Flag for the Rewrite option.
//
// Possible values:
//
// - **last** - Stop processing the current set of `ngx_http_rewrite_module`
// directives and start a search for a new location matching changed URI.
// - **break** - Stop processing the current set of the Rewrite option.
// - **redirect** - Return a temporary redirect with the 302 code; used when a
// replacement string does not start with `http://`, `https://`, or `$scheme`.
// - **permanent** - Return a permanent redirect with the 301 code.
//
// Any of "break", "last", "redirect", "permanent".
Flag string `json:"flag,omitzero"`
// contains filtered or unexported fields
}
Changes and redirects requests from the CDN to the origin. It operates according to the [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite) configuration.
The properties Body, Enabled are required.
func (ResourceRuleUpdateParamsOptionsRewrite) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsRewrite) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsRewrite) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsRewrite) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsSecureKey ¶
type ResourceRuleUpdateParamsOptionsSecureKey struct {
// Key generated on your side that will be used for URL signing.
Key param.Opt[string] `json:"key,omitzero,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Type of URL signing.
//
// Possible types:
//
// - **Type 0** - Includes end user IP to secure token generation.
// - **Type 2** - Excludes end user IP from secure token generation.
//
// Any of 0, 2.
Type int64 `json:"type,omitzero"`
// contains filtered or unexported fields
}
Configures access with tokenized URLs. This makes impossible to access content without a valid (unexpired) token.
The properties Enabled, Key are required.
func (ResourceRuleUpdateParamsOptionsSecureKey) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsSecureKey) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsSecureKey) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsSecureKey) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsSlice ¶
type ResourceRuleUpdateParamsOptionsSlice struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Requests and caches files larger than 10 MB in parts (no larger than 10 MB per part.) This reduces time to first byte.
The option is based on the [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
Notes:
- Origin must support HTTP Range requests.
- Not supported with `gzipON`, `brotli_compression` or `fetch_compressed` options enabled.
The properties Enabled, Value are required.
func (ResourceRuleUpdateParamsOptionsSlice) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsSlice) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsSlice) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsSlice) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsSni ¶
type ResourceRuleUpdateParamsOptionsSni struct {
// Custom SNI hostname.
//
// It is required if `sni_type` is set to custom.
CustomHostname string `json:"custom_hostname,required" format:"domain"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// SNI (Server Name Indication) type.
//
// Possible values:
//
// - **dynamic** - SNI hostname depends on `hostHeader` and `forward_host_header`
// options. It has several possible combinations:
// - If the `hostHeader` option is enabled and specified, SNI hostname matches the
// Host header.
// - If the `forward_host_header` option is enabled and has true value, SNI
// hostname matches the Host header used in the request made to a CDN.
// - If the `hostHeader` and `forward_host_header` options are disabled, SNI
// hostname matches the primary CNAME.
// - **custom** - custom SNI hostname is in use.
//
// Any of "dynamic", "custom".
SniType string `json:"sni_type,omitzero"`
// contains filtered or unexported fields
}
The hostname that is added to SNI requests from CDN servers to the origin server via HTTPS.
SNI is generally only required if your origin uses shared hosting or does not have a dedicated IP address. If the origin server presents multiple certificates, SNI allows the origin server to know which certificate to use for the connection.
The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
The properties CustomHostname, Enabled are required.
func (ResourceRuleUpdateParamsOptionsSni) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsSni) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsSni) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsSni) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsStale ¶
type ResourceRuleUpdateParamsOptionsStale struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Defines list of errors for which "Always online" option is applied.
//
// Any of "error", "http_403", "http_404", "http_429", "http_500", "http_502",
// "http_503", "http_504", "invalid_header", "timeout", "updating".
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Serves stale cached content in case of origin unavailability.
The properties Enabled, Value are required.
func (ResourceRuleUpdateParamsOptionsStale) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsStale) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsStale) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsStale) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsStaticHeaders
deprecated
type ResourceRuleUpdateParamsOptionsStaticHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// A MAP for static headers in a format of `header_name: header_value`.
//
// Restrictions:
//
// - **Header name** - Maximum 128 symbols, may contain Latin letters (A-Z, a-z),
// numbers (0-9), dashes, and underscores.
// - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
// (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
// with a letter, number, asterisk or {.
Value any `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
**Legacy option**. Use the `static_response_headers` option instead.
Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP Headers can be specified. May contain a header with multiple values.
Deprecated: deprecated
The properties Enabled, Value are required.
func (ResourceRuleUpdateParamsOptionsStaticHeaders) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsStaticHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsStaticHeaders) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsStaticHeaders) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsStaticRequestHeaders ¶
type ResourceRuleUpdateParamsOptionsStaticRequestHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// A MAP for static headers in a format of `header_name: header_value`.
//
// Restrictions:
//
// - **Header name** - Maximum 255 symbols, may contain Latin letters (A-Z, a-z),
// numbers (0-9), dashes, and underscores.
// - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
// (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
// with a letter, number, asterisk or {.
Value map[string]string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP Headers can be specified.
The properties Enabled, Value are required.
func (ResourceRuleUpdateParamsOptionsStaticRequestHeaders) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsStaticRequestHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsStaticRequestHeaders) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsStaticRequestHeaders) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsStaticResponseHeaders ¶
type ResourceRuleUpdateParamsOptionsStaticResponseHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
Value []ResourceRuleUpdateParamsOptionsStaticResponseHeadersValue `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Custom HTTP Headers that a CDN server adds to a response.
The properties Enabled, Value are required.
func (ResourceRuleUpdateParamsOptionsStaticResponseHeaders) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsStaticResponseHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsStaticResponseHeaders) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsStaticResponseHeaders) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsStaticResponseHeadersValue ¶
type ResourceRuleUpdateParamsOptionsStaticResponseHeadersValue struct {
// HTTP Header name.
//
// Restrictions:
//
// - Maximum 128 symbols.
// - Latin letters (A-Z, a-z,) numbers (0-9,) dashes, and underscores only.
Name string `json:"name,required"`
// Header value.
//
// Restrictions:
//
// - Maximum 512 symbols.
// - Letters (a-z), numbers (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+
// /|\";:?.,><{}[]).
// - Must start with a letter, number, asterisk or {.
// - Multiple values can be added.
Value []string `json:"value,omitzero,required"`
// Defines whether the header will be added to a response from CDN regardless of
// response code.
//
// Possible values:
//
// - **true** - Header will be added to a response from CDN regardless of response
// code.
// - **false** - Header will be added only to the following response codes: 200,
// 201, 204, 206, 301, 302, 303, 304, 307, 308.
Always param.Opt[bool] `json:"always,omitzero"`
// contains filtered or unexported fields
}
The properties Name, Value are required.
func (ResourceRuleUpdateParamsOptionsStaticResponseHeadersValue) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsStaticResponseHeadersValue) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsStaticResponseHeadersValue) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsStaticResponseHeadersValue) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsUserAgentACL ¶
type ResourceRuleUpdateParamsOptionsUserAgentACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of User-Agents that will be allowed/denied.
//
// The meaning of the parameter depends on `policy_type`:
//
// - **allow** - List of User-Agents for which access is prohibited.
// - **deny** - List of User-Agents for which access is allowed.
//
// Use an empty string `""` to allow/deny access when the User-Agent header is
// empty.
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"user_agent"`
// User-Agents policy type.
//
// Possible values:
//
// - **allow** - Allow access for all User-Agents except specified in
// `excepted_values` field.
// - **deny** - Deny access for all User-Agents except specified in
// `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Controls access to the content for specified User-Agents.
The properties Enabled, ExceptedValues, PolicyType are required.
func (ResourceRuleUpdateParamsOptionsUserAgentACL) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsUserAgentACL) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsUserAgentACL) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsUserAgentACL) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsWaap ¶
type ResourceRuleUpdateParamsOptionsWaap struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Allows to enable WAAP (Web Application and API Protection).
The properties Enabled, Value are required.
func (ResourceRuleUpdateParamsOptionsWaap) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsWaap) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsWaap) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsWaap) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOptionsWebsockets ¶
type ResourceRuleUpdateParamsOptionsWebsockets struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Enables or disables WebSockets connections to an origin server.
The properties Enabled, Value are required.
func (ResourceRuleUpdateParamsOptionsWebsockets) MarshalJSON ¶
func (r ResourceRuleUpdateParamsOptionsWebsockets) MarshalJSON() (data []byte, err error)
func (*ResourceRuleUpdateParamsOptionsWebsockets) UnmarshalJSON ¶
func (r *ResourceRuleUpdateParamsOptionsWebsockets) UnmarshalJSON(data []byte) error
type ResourceRuleUpdateParamsOverrideOriginProtocol ¶
type ResourceRuleUpdateParamsOverrideOriginProtocol string
Sets a protocol other than the one specified in the CDN resource settings to connect to the origin.
Possible values:
- **HTTPS** - CDN servers connect to origin via HTTPS protocol.
- **HTTP** - CDN servers connect to origin via HTTP protocol.
- **MATCH** - Connection protocol is chosen automatically; in this case, content on origin source should be available for the CDN both through HTTP and HTTPS protocols.
- **null** - `originProtocol` setting is inherited from the CDN resource settings.
const ( ResourceRuleUpdateParamsOverrideOriginProtocolHTTPS ResourceRuleUpdateParamsOverrideOriginProtocol = "HTTPS" ResourceRuleUpdateParamsOverrideOriginProtocolHTTP ResourceRuleUpdateParamsOverrideOriginProtocol = "HTTP" ResourceRuleUpdateParamsOverrideOriginProtocolMatch ResourceRuleUpdateParamsOverrideOriginProtocol = "MATCH" )
type ResourceService ¶
type ResourceService struct {
Options []option.RequestOption
Shield ResourceShieldService
Rules ResourceRuleService
}
ResourceService 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 NewResourceService method instead.
func NewResourceService ¶
func NewResourceService(opts ...option.RequestOption) (r ResourceService)
NewResourceService 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 (*ResourceService) Delete ¶
func (r *ResourceService) Delete(ctx context.Context, resourceID int64, opts ...option.RequestOption) (err error)
Delete the CDN resource from the system permanently.
Notes:
- **Deactivation Requirement**: Set the `active` attribute to `false` before deletion.
- **Statistics Availability**: Statistics will be available for **365 days** after deletion through the [statistics endpoints](/docs/api-reference/cdn/cdn-statistics/cdn-resource-statistics).
- **Irreversibility**: This action is irreversible. Once deleted, the CDN resource cannot be recovered.
func (*ResourceService) Get ¶
func (r *ResourceService) Get(ctx context.Context, resourceID int64, opts ...option.RequestOption) (res *CdnResource, err error)
Get CDN resource details
func (*ResourceService) List ¶
func (r *ResourceService) List(ctx context.Context, query ResourceListParams, opts ...option.RequestOption) (res *CdnResourceList, err error)
Get information about all CDN resources in your account.
func (*ResourceService) New ¶
func (r *ResourceService) New(ctx context.Context, body ResourceNewParams, opts ...option.RequestOption) (res *CdnResource, err error)
Create CDN resource
func (*ResourceService) Prefetch ¶
func (r *ResourceService) Prefetch(ctx context.Context, resourceID int64, body ResourcePrefetchParams, opts ...option.RequestOption) (err error)
Pre-populate files to a CDN cache before users requests. Prefetch is recommended only for files that **more than 200 MB** and **less than 5 GB**.
You can make one prefetch request for a CDN resource per minute. One request for prefetch may content only up to 100 paths to files.
The time of procedure depends on the number and size of the files.
If you need to update files stored in the CDN, first purge these files and then prefetch.
func (*ResourceService) PrevalidateSslLeCertificate ¶
func (r *ResourceService) PrevalidateSslLeCertificate(ctx context.Context, resourceID int64, opts ...option.RequestOption) (err error)
Check whether a Let's Encrypt certificate can be issued for the CDN resource.
func (*ResourceService) Purge ¶
func (r *ResourceService) Purge(ctx context.Context, resourceID int64, body ResourcePurgeParams, opts ...option.RequestOption) (err error)
Delete cache from CDN servers. This is necessary to update CDN content.
We have different limits for different purge types:
- **Purge all cache** - One purge request for a CDN resource per minute.
- **Purge by URL** - Two purge requests for a CDN resource per minute. One purge request is limited to 100 URLs.
- **Purge by pattern** - One purge request for a CDN resource per minute. One purge request is limited to 10 patterns.
func (*ResourceService) Replace ¶
func (r *ResourceService) Replace(ctx context.Context, resourceID int64, body ResourceReplaceParams, opts ...option.RequestOption) (res *CdnResource, err error)
Change CDN resource
func (*ResourceService) Update ¶
func (r *ResourceService) Update(ctx context.Context, resourceID int64, body ResourceUpdateParams, opts ...option.RequestOption) (res *CdnResource, err error)
Change CDN resource
type ResourceShieldReplaceParams ¶
type ResourceShieldReplaceParams struct {
OriginShielding OriginShieldingParam
// contains filtered or unexported fields
}
func (ResourceShieldReplaceParams) MarshalJSON ¶
func (r ResourceShieldReplaceParams) MarshalJSON() (data []byte, err error)
func (*ResourceShieldReplaceParams) UnmarshalJSON ¶
func (r *ResourceShieldReplaceParams) UnmarshalJSON(data []byte) error
type ResourceShieldService ¶
type ResourceShieldService struct {
Options []option.RequestOption
}
ResourceShieldService 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 NewResourceShieldService method instead.
func NewResourceShieldService ¶
func NewResourceShieldService(opts ...option.RequestOption) (r ResourceShieldService)
NewResourceShieldService 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 (*ResourceShieldService) Get ¶
func (r *ResourceShieldService) Get(ctx context.Context, resourceID int64, opts ...option.RequestOption) (res *OriginShielding, err error)
Get information about origin shielding.
func (*ResourceShieldService) Replace ¶
func (r *ResourceShieldService) Replace(ctx context.Context, resourceID int64, body ResourceShieldReplaceParams, opts ...option.RequestOption) (res *OriginShieldingReplaced, err error)
Change origin shielding settings or disabled origin shielding.
type ResourceUpdateParams ¶
type ResourceUpdateParams struct {
// CDN resource name.
Name param.Opt[string] `json:"name,omitzero"`
// ID of the trusted CA certificate used to verify an origin.
//
// It can be used only with `"proxy_ssl_enabled": true`.
ProxySslCa param.Opt[int64] `json:"proxy_ssl_ca,omitzero"`
// ID of the SSL certificate used to verify an origin.
//
// It can be used only with `"proxy_ssl_enabled": true`.
ProxySslData param.Opt[int64] `json:"proxy_ssl_data,omitzero"`
// ID of the SSL certificate linked to the CDN resource.
//
// Can be used only with `"sslEnabled": true`.
SslData param.Opt[int64] `json:"sslData,omitzero"`
// Enables or disables a CDN resource.
//
// Possible values:
//
// - **true** - CDN resource is active. Content is being delivered.
// - **false** - CDN resource is deactivated. Content is not being delivered.
Active param.Opt[bool] `json:"active,omitzero"`
// Optional comment describing the CDN resource.
Description param.Opt[string] `json:"description,omitzero"`
// Origin group ID with which the CDN resource is associated.
//
// You can use either the `origin` or `originGroup` parameter in the request.
OriginGroup param.Opt[int64] `json:"originGroup,omitzero"`
// Enables or disables SSL certificate validation of the origin server before
// completing any connection.
//
// Possible values:
//
// - **true** - Origin SSL certificate validation is enabled.
// - **false** - Origin SSL certificate validation is disabled.
ProxySslEnabled param.Opt[bool] `json:"proxy_ssl_enabled,omitzero"`
// Defines whether the HTTPS protocol enabled for content delivery.
//
// Possible values:
//
// - **true** - HTTPS is enabled.
// - **false** - HTTPS is disabled.
SslEnabled param.Opt[bool] `json:"sslEnabled,omitzero"`
// List of options that can be configured for the CDN resource.
//
// In case of `null` value the option is not added to the CDN resource. Option may
// inherit its value from the global account settings.
Options ResourceUpdateParamsOptions `json:"options,omitzero"`
// Protocol used by CDN servers to request content from an origin source.
//
// Possible values:
//
// - **HTTPS** - CDN servers will connect to the origin via HTTPS.
// - **HTTP** - CDN servers will connect to the origin via HTTP.
// - **MATCH** - connection protocol will be chosen automatically (content on the
// origin source should be available for the CDN both through HTTP and HTTPS).
//
// If protocol is not specified, HTTP is used to connect to an origin server.
//
// Any of "HTTP", "HTTPS", "MATCH".
OriginProtocol ResourceUpdateParamsOriginProtocol `json:"originProtocol,omitzero"`
// Additional delivery domains (CNAMEs) that will be used to deliver content via
// the CDN.
//
// Up to ten additional CNAMEs are possible.
SecondaryHostnames []string `json:"secondaryHostnames,omitzero" format:"domain"`
// contains filtered or unexported fields
}
func (ResourceUpdateParams) MarshalJSON ¶
func (r ResourceUpdateParams) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParams) UnmarshalJSON ¶
func (r *ResourceUpdateParams) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptions ¶
type ResourceUpdateParamsOptions struct {
// HTTP methods allowed for content requests from the CDN.
AllowedHTTPMethods ResourceUpdateParamsOptionsAllowedHTTPMethods `json:"allowedHttpMethods,omitzero"`
// Allows to prevent online services from overloading and ensure your business
// workflow running smoothly.
BotProtection ResourceUpdateParamsOptionsBotProtection `json:"bot_protection,omitzero"`
// Compresses content with Brotli on the CDN side. CDN servers will request only
// uncompressed content from the origin.
//
// Notes:
//
// 1. CDN only supports "Brotli compression" when the "origin shielding" feature is
// activated.
// 2. If a precache server is not active for a CDN resource, no compression occurs,
// even if the option is enabled.
// 3. `brotli_compression` is not supported with `fetch_compressed` or `slice`
// options enabled.
// 4. `fetch_compressed` option in CDN resource settings overrides
// `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN
// resource and want to enable `brotli_compression` in a rule, you must specify
// `fetch_compressed:false` in the rule.
BrotliCompression ResourceUpdateParamsOptionsBrotliCompression `json:"brotli_compression,omitzero"`
// Cache expiration time for users browsers in seconds.
//
// Cache expiration time is applied to the following response codes: 200, 201, 204,
// 206, 301, 302, 303, 304, 307, 308.
//
// Responses with other codes will not be cached.
BrowserCacheSettings ResourceUpdateParamsOptionsBrowserCacheSettings `json:"browser_cache_settings,omitzero"`
// **Legacy option**. Use the `response_headers_hiding_policy` option instead.
//
// HTTP Headers that must be included in the response.
//
// Deprecated: deprecated
CacheHTTPHeaders ResourceUpdateParamsOptionsCacheHTTPHeaders `json:"cache_http_headers,omitzero"`
// Enables or disables CORS (Cross-Origin Resource Sharing) header support.
//
// CORS header support allows the CDN to add the Access-Control-Allow-Origin header
// to a response to a browser.
Cors ResourceUpdateParamsOptionsCors `json:"cors,omitzero"`
// Enables control access to content for specified countries.
CountryACL ResourceUpdateParamsOptionsCountryACL `json:"country_acl,omitzero"`
// **Legacy option**. Use the `edge_cache_settings` option instead.
//
// Allows the complete disabling of content caching.
//
// Deprecated: deprecated
DisableCache ResourceUpdateParamsOptionsDisableCache `json:"disable_cache,omitzero"`
// Allows 206 responses regardless of the settings of an origin source.
DisableProxyForceRanges ResourceUpdateParamsOptionsDisableProxyForceRanges `json:"disable_proxy_force_ranges,omitzero"`
// Cache expiration time for CDN servers.
//
// `value` and `default` fields cannot be used simultaneously.
EdgeCacheSettings ResourceUpdateParamsOptionsEdgeCacheSettings `json:"edge_cache_settings,omitzero"`
// Allows to configure FastEdge app to be called on different request/response
// phases.
//
// Note: At least one of `on_request_headers`, `on_request_body`,
// `on_response_headers`, or `on_response_body` must be specified.
Fastedge ResourceUpdateParamsOptionsFastedge `json:"fastedge,omitzero"`
// Makes the CDN request compressed content from the origin.
//
// The origin server should support compression. CDN servers will not decompress
// your content even if a user browser does not accept compression.
//
// Notes:
//
// 1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or
// `slice` options enabled.
// 2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If
// you enable it in CDN resource and want to use `gzipON` and
// `brotli_compression` in a rule, you have to specify
// `"fetch_compressed": false` in the rule.
FetchCompressed ResourceUpdateParamsOptionsFetchCompressed `json:"fetch_compressed,omitzero"`
// Enables redirection from origin. If the origin server returns a redirect, the
// option allows the CDN to pull the requested content from the origin server that
// was returned in the redirect.
FollowOriginRedirect ResourceUpdateParamsOptionsFollowOriginRedirect `json:"follow_origin_redirect,omitzero"`
// Applies custom HTTP response codes for CDN content.
//
// The following codes are reserved by our system and cannot be specified in this
// option: 408, 444, 477, 494, 495, 496, 497, 499.
ForceReturn ResourceUpdateParamsOptionsForceReturn `json:"force_return,omitzero"`
// Forwards the Host header from a end-user request to an origin server.
//
// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
ForwardHostHeader ResourceUpdateParamsOptionsForwardHostHeader `json:"forward_host_header,omitzero"`
// Compresses content with gzip on the CDN end. CDN servers will request only
// uncompressed content from the origin.
//
// Notes:
//
// 1. Compression with gzip is not supported with `fetch_compressed` or `slice`
// options enabled.
// 2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in
// rules. If you enable `fetch_compressed` in CDN resource and want to enable
// `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
GzipOn ResourceUpdateParamsOptionsGzipOn `json:"gzipOn,omitzero"`
// Sets the Host header that CDN servers use when request content from an origin
// server. Your server must be able to process requests with the chosen header.
//
// If the option is `null`, the Host Header value is equal to first CNAME.
//
// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
HostHeader ResourceUpdateParamsOptionsHostHeader `json:"hostHeader,omitzero"`
// Enables HTTP/3 protocol for content delivery.
//
// `http3_enabled` option works only with `"sslEnabled": true`.
Http3Enabled ResourceUpdateParamsOptionsHttp3Enabled `json:"http3_enabled,omitzero"`
// Defines whether the files with the Set-Cookies header are cached as one file or
// as different ones.
IgnoreCookie ResourceUpdateParamsOptionsIgnoreCookie `json:"ignore_cookie,omitzero"`
// How a file with different query strings is cached: either as one object (option
// is enabled) or as different objects (option is disabled.)
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
IgnoreQueryString ResourceUpdateParamsOptionsIgnoreQueryString `json:"ignoreQueryString,omitzero"`
// Transforms JPG and PNG images (for example, resize or crop) and automatically
// converts them to WebP or AVIF format.
ImageStack ResourceUpdateParamsOptionsImageStack `json:"image_stack,omitzero"`
// Controls access to the CDN resource content for specific IP addresses.
//
// If you want to use IPs from our CDN servers IP list for IP ACL configuration,
// you have to independently monitor their relevance. We recommend you use a script
// for automatically update IP ACL.
// [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
IPAddressACL ResourceUpdateParamsOptionsIPAddressACL `json:"ip_address_acl,omitzero"`
// Allows to control the download speed per connection.
LimitBandwidth ResourceUpdateParamsOptionsLimitBandwidth `json:"limit_bandwidth,omitzero"`
// Allows you to modify your cache key. If omitted, the default value is
// `$request_uri`.
//
// Combine the specified variables to create a key for caching.
//
// - **$`request_uri`**
// - **$scheme**
// - **$uri**
//
// **Warning**: Enabling and changing this option can invalidate your current cache
// and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will
// not work.
ProxyCacheKey ResourceUpdateParamsOptionsProxyCacheKey `json:"proxy_cache_key,omitzero"`
// Caching for POST requests along with default GET and HEAD.
ProxyCacheMethodsSet ResourceUpdateParamsOptionsProxyCacheMethodsSet `json:"proxy_cache_methods_set,omitzero"`
// The time limit for establishing a connection with the origin.
ProxyConnectTimeout ResourceUpdateParamsOptionsProxyConnectTimeout `json:"proxy_connect_timeout,omitzero"`
// The time limit for receiving a partial response from the origin. If no response
// is received within this time, the connection will be closed.
//
// **Note:** When used with a WebSocket connection, this option supports values
// only in the range 1–20 seconds (instead of the usual 1–30 seconds).
ProxyReadTimeout ResourceUpdateParamsOptionsProxyReadTimeout `json:"proxy_read_timeout,omitzero"`
// Files with the specified query parameters are cached as one object, files with
// other parameters are cached as different objects.
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
QueryParamsBlacklist ResourceUpdateParamsOptionsQueryParamsBlacklist `json:"query_params_blacklist,omitzero"`
// Files with the specified query parameters are cached as different objects, files
// with other parameters are cached as one object.
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
QueryParamsWhitelist ResourceUpdateParamsOptionsQueryParamsWhitelist `json:"query_params_whitelist,omitzero"`
// The Query String Forwarding feature allows for the seamless transfer of
// parameters embedded in playlist files to the corresponding media chunk files.
// This functionality ensures that specific attributes, such as authentication
// tokens or tracking information, are consistently passed along from the playlist
// manifest to the individual media segments. This is particularly useful for
// maintaining continuity in security, analytics, and any other parameter-based
// operations across the entire media delivery workflow.
QueryStringForwarding ResourceUpdateParamsOptionsQueryStringForwarding `json:"query_string_forwarding,omitzero"`
// Enables redirect from HTTP to HTTPS.
//
// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
// simultaneously.
RedirectHTTPToHTTPS ResourceUpdateParamsOptionsRedirectHTTPToHTTPS `json:"redirect_http_to_https,omitzero"`
// Enables redirect from HTTPS to HTTP.
//
// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
// simultaneously.
RedirectHTTPSToHTTP ResourceUpdateParamsOptionsRedirectHTTPSToHTTP `json:"redirect_https_to_http,omitzero"`
// Controls access to the CDN resource content for specified domain names.
ReferrerACL ResourceUpdateParamsOptionsReferrerACL `json:"referrer_acl,omitzero"`
// Option allows to limit the amount of HTTP requests.
RequestLimiter ResourceUpdateParamsOptionsRequestLimiter `json:"request_limiter,omitzero"`
// Hides HTTP headers from an origin server in the CDN response.
ResponseHeadersHidingPolicy ResourceUpdateParamsOptionsResponseHeadersHidingPolicy `json:"response_headers_hiding_policy,omitzero"`
// Changes and redirects requests from the CDN to the origin. It operates according
// to the
// [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite)
// configuration.
Rewrite ResourceUpdateParamsOptionsRewrite `json:"rewrite,omitzero"`
// Configures access with tokenized URLs. This makes impossible to access content
// without a valid (unexpired) token.
SecureKey ResourceUpdateParamsOptionsSecureKey `json:"secure_key,omitzero"`
// Requests and caches files larger than 10 MB in parts (no larger than 10 MB per
// part.) This reduces time to first byte.
//
// The option is based on the
// [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
//
// Notes:
//
// 1. Origin must support HTTP Range requests.
// 2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed`
// options enabled.
Slice ResourceUpdateParamsOptionsSlice `json:"slice,omitzero"`
// The hostname that is added to SNI requests from CDN servers to the origin server
// via HTTPS.
//
// SNI is generally only required if your origin uses shared hosting or does not
// have a dedicated IP address. If the origin server presents multiple
// certificates, SNI allows the origin server to know which certificate to use for
// the connection.
//
// The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
Sni ResourceUpdateParamsOptionsSni `json:"sni,omitzero"`
// Serves stale cached content in case of origin unavailability.
Stale ResourceUpdateParamsOptionsStale `json:"stale,omitzero"`
// Custom HTTP Headers that a CDN server adds to a response.
StaticResponseHeaders ResourceUpdateParamsOptionsStaticResponseHeaders `json:"static_response_headers,omitzero"`
// **Legacy option**. Use the `static_response_headers` option instead.
//
// Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP
// Headers can be specified. May contain a header with multiple values.
//
// Deprecated: deprecated
StaticHeaders ResourceUpdateParamsOptionsStaticHeaders `json:"staticHeaders,omitzero"`
// Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP
// Headers can be specified.
StaticRequestHeaders ResourceUpdateParamsOptionsStaticRequestHeaders `json:"staticRequestHeaders,omitzero"`
// List of SSL/TLS protocol versions allowed for HTTPS connections from end users
// to the domain.
//
// When the option is disabled, all protocols versions are allowed.
TlsVersions ResourceUpdateParamsOptionsTlsVersions `json:"tls_versions,omitzero"`
// Let's Encrypt certificate chain.
//
// The specified chain will be used during the next Let's Encrypt certificate issue
// or renewal.
UseDefaultLeChain ResourceUpdateParamsOptionsUseDefaultLeChain `json:"use_default_le_chain,omitzero"`
// DNS-01 challenge to issue a Let's Encrypt certificate for the resource.
//
// DNS service should be activated to enable this option.
UseDns01LeChallenge ResourceUpdateParamsOptionsUseDns01LeChallenge `json:"use_dns01_le_challenge,omitzero"`
// RSA Let's Encrypt certificate type for the CDN resource.
//
// The specified value will be used during the next Let's Encrypt certificate issue
// or renewal.
UseRsaLeCert ResourceUpdateParamsOptionsUseRsaLeCert `json:"use_rsa_le_cert,omitzero"`
// Controls access to the content for specified User-Agents.
UserAgentACL ResourceUpdateParamsOptionsUserAgentACL `json:"user_agent_acl,omitzero"`
// Allows to enable WAAP (Web Application and API Protection).
Waap ResourceUpdateParamsOptionsWaap `json:"waap,omitzero"`
// Enables or disables WebSockets connections to an origin server.
Websockets ResourceUpdateParamsOptionsWebsockets `json:"websockets,omitzero"`
// contains filtered or unexported fields
}
List of options that can be configured for the CDN resource.
In case of `null` value the option is not added to the CDN resource. Option may inherit its value from the global account settings.
func (ResourceUpdateParamsOptions) MarshalJSON ¶
func (r ResourceUpdateParamsOptions) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptions) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptions) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsAllowedHTTPMethods ¶
type ResourceUpdateParamsOptionsAllowedHTTPMethods struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
HTTP methods allowed for content requests from the CDN.
The properties Enabled, Value are required.
func (ResourceUpdateParamsOptionsAllowedHTTPMethods) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsAllowedHTTPMethods) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsAllowedHTTPMethods) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsAllowedHTTPMethods) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsBotProtection ¶
type ResourceUpdateParamsOptionsBotProtection struct {
// Controls the bot challenge module state.
BotChallenge ResourceUpdateParamsOptionsBotProtectionBotChallenge `json:"bot_challenge,omitzero,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// contains filtered or unexported fields
}
Allows to prevent online services from overloading and ensure your business workflow running smoothly.
The properties BotChallenge, Enabled are required.
func (ResourceUpdateParamsOptionsBotProtection) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsBotProtection) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsBotProtection) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsBotProtection) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsBotProtectionBotChallenge ¶
type ResourceUpdateParamsOptionsBotProtectionBotChallenge struct {
// Possible values:
//
// - **true** - Bot challenge is enabled.
// - **false** - Bot challenge is disabled.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// contains filtered or unexported fields
}
Controls the bot challenge module state.
func (ResourceUpdateParamsOptionsBotProtectionBotChallenge) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsBotProtectionBotChallenge) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsBotProtectionBotChallenge) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsBotProtectionBotChallenge) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsBrotliCompression ¶
type ResourceUpdateParamsOptionsBrotliCompression struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Allows to select the content types you want to compress.
//
// `text/html` is a mandatory content type.
//
// Any of "application/javascript", "application/json",
// "application/vnd.ms-fontobject", "application/wasm", "application/x-font-ttf",
// "application/x-javascript", "application/xml", "application/xml+rss",
// "image/svg+xml", "image/x-icon", "text/css", "text/html", "text/javascript",
// "text/plain", "text/xml".
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Compresses content with Brotli on the CDN side. CDN servers will request only uncompressed content from the origin.
Notes:
- CDN only supports "Brotli compression" when the "origin shielding" feature is activated.
- If a precache server is not active for a CDN resource, no compression occurs, even if the option is enabled.
- `brotli_compression` is not supported with `fetch_compressed` or `slice` options enabled.
- `fetch_compressed` option in CDN resource settings overrides `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN resource and want to enable `brotli_compression` in a rule, you must specify `fetch_compressed:false` in the rule.
The properties Enabled, Value are required.
func (ResourceUpdateParamsOptionsBrotliCompression) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsBrotliCompression) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsBrotliCompression) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsBrotliCompression) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsBrowserCacheSettings ¶
type ResourceUpdateParamsOptionsBrowserCacheSettings struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Set the cache expiration time to '0s' to disable caching.
//
// The maximum duration is any equivalent to `1y`.
Value string `json:"value,required" format:"nginx time"`
// contains filtered or unexported fields
}
Cache expiration time for users browsers in seconds.
Cache expiration time is applied to the following response codes: 200, 201, 204, 206, 301, 302, 303, 304, 307, 308.
Responses with other codes will not be cached.
The properties Enabled, Value are required.
func (ResourceUpdateParamsOptionsBrowserCacheSettings) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsBrowserCacheSettings) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsBrowserCacheSettings) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsBrowserCacheSettings) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsCacheHTTPHeaders
deprecated
type ResourceUpdateParamsOptionsCacheHTTPHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
**Legacy option**. Use the `response_headers_hiding_policy` option instead.
HTTP Headers that must be included in the response.
Deprecated: deprecated
The properties Enabled, Value are required.
func (ResourceUpdateParamsOptionsCacheHTTPHeaders) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsCacheHTTPHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsCacheHTTPHeaders) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsCacheHTTPHeaders) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsCors ¶
type ResourceUpdateParamsOptionsCors struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Value of the Access-Control-Allow-Origin header.
//
// Possible values:
//
// - **Adds \* as the Access-Control-Allow-Origin header value** - Content will be
// uploaded for requests from any domain. `"value": ["*"]`
// - **Adds "$http_origin" as the Access-Control-Allow-Origin header value if the
// origin matches one of the listed domains** - Content will be uploaded only for
// requests from the domains specified in the field.
// `"value": ["domain.com", "second.dom.com"]`
// - **Adds "$http_origin" as the Access-Control-Allow-Origin header value** -
// Content will be uploaded for requests from any domain, and the domain from
// which the request was sent will be added to the "Access-Control-Allow-Origin"
// header in the response. `"value": ["$http_origin"]`
Value []string `json:"value,omitzero,required"`
// Defines whether the Access-Control-Allow-Origin header should be added to a
// response from CDN regardless of response code.
//
// Possible values:
//
// - **true** - Header will be added to a response regardless of response code.
// - **false** - Header will only be added to responses with codes: 200, 201, 204,
// 206, 301, 302, 303, 304, 307, 308.
Always param.Opt[bool] `json:"always,omitzero"`
// contains filtered or unexported fields
}
Enables or disables CORS (Cross-Origin Resource Sharing) header support.
CORS header support allows the CDN to add the Access-Control-Allow-Origin header to a response to a browser.
The properties Enabled, Value are required.
func (ResourceUpdateParamsOptionsCors) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsCors) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsCors) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsCors) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsCountryACL ¶
type ResourceUpdateParamsOptionsCountryACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of countries according to ISO-3166-1.
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of countries for which access is prohibited.
// - **deny** - List of countries for which access is allowed.
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"country-code"`
// Defines the type of CDN resource access policy.
//
// Possible values:
//
// - **allow** - Access is allowed for all the countries except for those specified
// in `excepted_values` field.
// - **deny** - Access is denied for all the countries except for those specified
// in `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Enables control access to content for specified countries.
The properties Enabled, ExceptedValues, PolicyType are required.
func (ResourceUpdateParamsOptionsCountryACL) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsCountryACL) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsCountryACL) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsCountryACL) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsDisableCache
deprecated
type ResourceUpdateParamsOptionsDisableCache struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - content caching is disabled.
// - **false** - content caching is enabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
**Legacy option**. Use the `edge_cache_settings` option instead.
Allows the complete disabling of content caching.
Deprecated: deprecated
The properties Enabled, Value are required.
func (ResourceUpdateParamsOptionsDisableCache) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsDisableCache) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsDisableCache) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsDisableCache) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsDisableProxyForceRanges ¶
type ResourceUpdateParamsOptionsDisableProxyForceRanges struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Allows 206 responses regardless of the settings of an origin source.
The properties Enabled, Value are required.
func (ResourceUpdateParamsOptionsDisableProxyForceRanges) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsDisableProxyForceRanges) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsDisableProxyForceRanges) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsDisableProxyForceRanges) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsEdgeCacheSettings ¶
type ResourceUpdateParamsOptionsEdgeCacheSettings struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Enables content caching according to the origin cache settings.
//
// The value is applied to the following response codes 200, 201, 204, 206, 301,
// 302, 303, 304, 307, 308, if an origin server does not have caching HTTP headers.
//
// Responses with other codes will not be cached.
//
// The maximum duration is any equivalent to `1y`.
Default param.Opt[string] `json:"default,omitzero" format:"nginx time"`
// Caching time.
//
// The value is applied to the following response codes: 200, 206, 301, 302.
// Responses with codes 4xx, 5xx will not be cached.
//
// Use `0s` to disable caching.
//
// The maximum duration is any equivalent to `1y`.
Value param.Opt[string] `json:"value,omitzero" format:"nginx time"`
// A MAP object representing the caching time in seconds for a response with a
// specific response code.
//
// These settings have a higher priority than the `value` field.
//
// - Use `any` key to specify caching time for all response codes.
// - Use `0s` value to disable caching for a specific response code.
CustomValues map[string]string `json:"custom_values,omitzero" format:"nginx time"`
// contains filtered or unexported fields
}
Cache expiration time for CDN servers.
`value` and `default` fields cannot be used simultaneously.
The property Enabled is required.
func (ResourceUpdateParamsOptionsEdgeCacheSettings) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsEdgeCacheSettings) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsEdgeCacheSettings) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsEdgeCacheSettings) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsFastedge ¶
type ResourceUpdateParamsOptionsFastedge struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Allows to configure FastEdge application that will be called to handle request
// body as soon as CDN receives incoming HTTP request.
OnRequestBody ResourceUpdateParamsOptionsFastedgeOnRequestBody `json:"on_request_body,omitzero"`
// Allows to configure FastEdge application that will be called to handle request
// headers as soon as CDN receives incoming HTTP request.
OnRequestHeaders ResourceUpdateParamsOptionsFastedgeOnRequestHeaders `json:"on_request_headers,omitzero"`
// Allows to configure FastEdge application that will be called to handle response
// body before CDN sends the HTTP response.
OnResponseBody ResourceUpdateParamsOptionsFastedgeOnResponseBody `json:"on_response_body,omitzero"`
// Allows to configure FastEdge application that will be called to handle response
// headers before CDN sends the HTTP response.
OnResponseHeaders ResourceUpdateParamsOptionsFastedgeOnResponseHeaders `json:"on_response_headers,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge app to be called on different request/response phases.
Note: At least one of `on_request_headers`, `on_request_body`, `on_response_headers`, or `on_response_body` must be specified.
The property Enabled is required.
func (ResourceUpdateParamsOptionsFastedge) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsFastedge) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsFastedge) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsFastedge) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsFastedgeOnRequestBody ¶
type ResourceUpdateParamsOptionsFastedgeOnRequestBody struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle request body as soon as CDN receives incoming HTTP request.
The property AppID is required.
func (ResourceUpdateParamsOptionsFastedgeOnRequestBody) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsFastedgeOnRequestBody) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsFastedgeOnRequestBody) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsFastedgeOnRequestBody) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsFastedgeOnRequestHeaders ¶
type ResourceUpdateParamsOptionsFastedgeOnRequestHeaders struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request.
The property AppID is required.
func (ResourceUpdateParamsOptionsFastedgeOnRequestHeaders) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsFastedgeOnRequestHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsFastedgeOnResponseBody ¶
type ResourceUpdateParamsOptionsFastedgeOnResponseBody struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle response body before CDN sends the HTTP response.
The property AppID is required.
func (ResourceUpdateParamsOptionsFastedgeOnResponseBody) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsFastedgeOnResponseBody) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsFastedgeOnResponseBody) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsFastedgeOnResponseBody) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsFastedgeOnResponseHeaders ¶
type ResourceUpdateParamsOptionsFastedgeOnResponseHeaders struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle response headers before CDN sends the HTTP response.
The property AppID is required.
func (ResourceUpdateParamsOptionsFastedgeOnResponseHeaders) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsFastedgeOnResponseHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsFastedgeOnResponseHeaders) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsFastedgeOnResponseHeaders) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsFetchCompressed ¶
type ResourceUpdateParamsOptionsFetchCompressed struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Makes the CDN request compressed content from the origin.
The origin server should support compression. CDN servers will not decompress your content even if a user browser does not accept compression.
Notes:
- `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or `slice` options enabled.
- `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If you enable it in CDN resource and want to use `gzipON` and `brotli_compression` in a rule, you have to specify `"fetch_compressed": false` in the rule.
The properties Enabled, Value are required.
func (ResourceUpdateParamsOptionsFetchCompressed) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsFetchCompressed) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsFetchCompressed) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsFetchCompressed) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsFollowOriginRedirect ¶
type ResourceUpdateParamsOptionsFollowOriginRedirect struct {
// Redirect status code that the origin server returns.
//
// To serve up to date content to end users, you will need to purge the cache after
// managing the option.
//
// Any of 301, 302, 303, 307, 308.
Codes []int64 `json:"codes,omitzero,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// contains filtered or unexported fields
}
Enables redirection from origin. If the origin server returns a redirect, the option allows the CDN to pull the requested content from the origin server that was returned in the redirect.
The properties Codes, Enabled are required.
func (ResourceUpdateParamsOptionsFollowOriginRedirect) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsFollowOriginRedirect) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsFollowOriginRedirect) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsFollowOriginRedirect) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsForceReturn ¶
type ResourceUpdateParamsOptionsForceReturn struct {
// URL for redirection or text.
Body string `json:"body,required"`
// Status code value.
Code int64 `json:"code,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Controls the time at which a custom HTTP response code should be applied. By
// default, a custom HTTP response code is applied at any time.
TimeInterval ResourceUpdateParamsOptionsForceReturnTimeInterval `json:"time_interval,omitzero"`
// contains filtered or unexported fields
}
Applies custom HTTP response codes for CDN content.
The following codes are reserved by our system and cannot be specified in this option: 408, 444, 477, 494, 495, 496, 497, 499.
The properties Body, Code, Enabled are required.
func (ResourceUpdateParamsOptionsForceReturn) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsForceReturn) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsForceReturn) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsForceReturn) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsForceReturnTimeInterval ¶
type ResourceUpdateParamsOptionsForceReturnTimeInterval struct {
// Time until which a custom HTTP response code should be applied. Indicated in
// 24-hour format.
EndTime string `json:"end_time,required"`
// Time from which a custom HTTP response code should be applied. Indicated in
// 24-hour format.
StartTime string `json:"start_time,required"`
// Time zone used to calculate time.
TimeZone param.Opt[string] `json:"time_zone,omitzero" format:"timezone"`
// contains filtered or unexported fields
}
Controls the time at which a custom HTTP response code should be applied. By default, a custom HTTP response code is applied at any time.
The properties EndTime, StartTime are required.
func (ResourceUpdateParamsOptionsForceReturnTimeInterval) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsForceReturnTimeInterval) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsForceReturnTimeInterval) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsForceReturnTimeInterval) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsForwardHostHeader ¶
type ResourceUpdateParamsOptionsForwardHostHeader struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Forwards the Host header from a end-user request to an origin server.
`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceUpdateParamsOptionsForwardHostHeader) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsForwardHostHeader) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsForwardHostHeader) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsForwardHostHeader) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsGzipOn ¶
type ResourceUpdateParamsOptionsGzipOn struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Compresses content with gzip on the CDN end. CDN servers will request only uncompressed content from the origin.
Notes:
- Compression with gzip is not supported with `fetch_compressed` or `slice` options enabled.
- `fetch_compressed` option in CDN resource settings overrides `gzipON` in rules. If you enable `fetch_compressed` in CDN resource and want to enable `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
The properties Enabled, Value are required.
func (ResourceUpdateParamsOptionsGzipOn) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsGzipOn) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsGzipOn) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsGzipOn) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsHostHeader ¶
type ResourceUpdateParamsOptionsHostHeader struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Host Header value.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
Sets the Host header that CDN servers use when request content from an origin server. Your server must be able to process requests with the chosen header.
If the option is `null`, the Host Header value is equal to first CNAME.
`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceUpdateParamsOptionsHostHeader) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsHostHeader) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsHostHeader) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsHostHeader) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsHttp3Enabled ¶
type ResourceUpdateParamsOptionsHttp3Enabled struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Enables HTTP/3 protocol for content delivery.
`http3_enabled` option works only with `"sslEnabled": true`.
The properties Enabled, Value are required.
func (ResourceUpdateParamsOptionsHttp3Enabled) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsHttp3Enabled) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsHttp3Enabled) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsHttp3Enabled) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsIPAddressACL ¶
type ResourceUpdateParamsOptionsIPAddressACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of IP addresses with a subnet mask.
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of IP addresses for which access is prohibited.
// - **deny** - List of IP addresses for which access is allowed.
//
// Examples:
//
// - `192.168.3.2/32`
// - `2a03:d000:2980:7::8/128`
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"ipv4net or ipv6net"`
// IP access policy type.
//
// Possible values:
//
// - **allow** - Allow access to all IPs except IPs specified in "excepted_values"
// field.
// - **deny** - Deny access to all IPs except IPs specified in "excepted_values"
// field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Controls access to the CDN resource content for specific IP addresses.
If you want to use IPs from our CDN servers IP list for IP ACL configuration, you have to independently monitor their relevance. We recommend you use a script for automatically update IP ACL. [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
The properties Enabled, ExceptedValues, PolicyType are required.
func (ResourceUpdateParamsOptionsIPAddressACL) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsIPAddressACL) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsIPAddressACL) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsIPAddressACL) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsIgnoreCookie ¶
type ResourceUpdateParamsOptionsIgnoreCookie struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled, files with cookies are cached as one file.
// - **false** - Option is disabled, files with cookies are cached as different
// files.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Defines whether the files with the Set-Cookies header are cached as one file or as different ones.
The properties Enabled, Value are required.
func (ResourceUpdateParamsOptionsIgnoreCookie) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsIgnoreCookie) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsIgnoreCookie) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsIgnoreCookie) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsIgnoreQueryString ¶
type ResourceUpdateParamsOptionsIgnoreQueryString struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
How a file with different query strings is cached: either as one object (option is enabled) or as different objects (option is disabled.)
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceUpdateParamsOptionsIgnoreQueryString) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsIgnoreQueryString) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsIgnoreQueryString) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsIgnoreQueryString) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsImageStack ¶
type ResourceUpdateParamsOptionsImageStack struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Enables or disables automatic conversion of JPEG and PNG images to AVI format.
AvifEnabled param.Opt[bool] `json:"avif_enabled,omitzero"`
// Enables or disables compression without quality loss for PNG format.
PngLossless param.Opt[bool] `json:"png_lossless,omitzero"`
// Defines quality settings for JPG and PNG images. The higher the value, the
// better the image quality, and the larger the file size after conversion.
Quality param.Opt[int64] `json:"quality,omitzero"`
// Enables or disables automatic conversion of JPEG and PNG images to WebP format.
WebpEnabled param.Opt[bool] `json:"webp_enabled,omitzero"`
// contains filtered or unexported fields
}
Transforms JPG and PNG images (for example, resize or crop) and automatically converts them to WebP or AVIF format.
The property Enabled is required.
func (ResourceUpdateParamsOptionsImageStack) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsImageStack) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsImageStack) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsImageStack) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsLimitBandwidth ¶
type ResourceUpdateParamsOptionsLimitBandwidth struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Method of controlling the download speed per connection.
//
// Possible values:
//
// - **static** - Use speed and buffer fields to set the download speed limit.
// - **dynamic** - Use query strings **speed** and **buffer** to set the download
// speed limit.
//
// # For example, when requesting content at the link
//
// “`
// http://cdn.example.com/video.mp4?speed=50k&buffer=500k
// “`
//
// the download speed will be limited to 50kB/s after 500 kB.
//
// Any of "static", "dynamic".
LimitType string `json:"limit_type,omitzero,required"`
// Amount of downloaded data after which the user will be rate limited.
Buffer param.Opt[int64] `json:"buffer,omitzero"`
// Maximum download speed per connection.
Speed param.Opt[int64] `json:"speed,omitzero"`
// contains filtered or unexported fields
}
Allows to control the download speed per connection.
The properties Enabled, LimitType are required.
func (ResourceUpdateParamsOptionsLimitBandwidth) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsLimitBandwidth) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsLimitBandwidth) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsLimitBandwidth) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsProxyCacheKey ¶
type ResourceUpdateParamsOptionsProxyCacheKey struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Key for caching.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
Allows you to modify your cache key. If omitted, the default value is `$request_uri`.
Combine the specified variables to create a key for caching.
- **$`request_uri`** - **$scheme** - **$uri**
**Warning**: Enabling and changing this option can invalidate your current cache and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will not work.
The properties Enabled, Value are required.
func (ResourceUpdateParamsOptionsProxyCacheKey) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsProxyCacheKey) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsProxyCacheKey) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsProxyCacheKey) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsProxyCacheMethodsSet ¶
type ResourceUpdateParamsOptionsProxyCacheMethodsSet struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Caching for POST requests along with default GET and HEAD.
The properties Enabled, Value are required.
func (ResourceUpdateParamsOptionsProxyCacheMethodsSet) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsProxyCacheMethodsSet) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsProxyCacheMethodsSet) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsProxyCacheMethodsSet) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsProxyConnectTimeout ¶
type ResourceUpdateParamsOptionsProxyConnectTimeout struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Timeout value in seconds.
//
// Supported range: **1s - 5s**.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
The time limit for establishing a connection with the origin.
The properties Enabled, Value are required.
func (ResourceUpdateParamsOptionsProxyConnectTimeout) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsProxyConnectTimeout) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsProxyConnectTimeout) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsProxyConnectTimeout) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsProxyReadTimeout ¶
type ResourceUpdateParamsOptionsProxyReadTimeout struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Timeout value in seconds.
//
// Supported range: **1s - 30s**.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
The time limit for receiving a partial response from the origin. If no response is received within this time, the connection will be closed.
**Note:** When used with a WebSocket connection, this option supports values only in the range 1–20 seconds (instead of the usual 1–30 seconds).
The properties Enabled, Value are required.
func (ResourceUpdateParamsOptionsProxyReadTimeout) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsProxyReadTimeout) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsProxyReadTimeout) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsProxyReadTimeout) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsQueryParamsBlacklist ¶
type ResourceUpdateParamsOptionsQueryParamsBlacklist struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of query parameters.
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Files with the specified query parameters are cached as one object, files with other parameters are cached as different objects.
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceUpdateParamsOptionsQueryParamsBlacklist) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsQueryParamsBlacklist) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsQueryParamsBlacklist) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsQueryParamsBlacklist) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsQueryParamsWhitelist ¶
type ResourceUpdateParamsOptionsQueryParamsWhitelist struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of query parameters.
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Files with the specified query parameters are cached as different objects, files with other parameters are cached as one object.
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceUpdateParamsOptionsQueryParamsWhitelist) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsQueryParamsWhitelist) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsQueryParamsWhitelist) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsQueryParamsWhitelist) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsQueryStringForwarding ¶
type ResourceUpdateParamsOptionsQueryStringForwarding struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// The `forward_from_files_types` field specifies the types of playlist files from
// which parameters will be extracted and forwarded. This typically includes
// formats that list multiple media chunk references, such as HLS and DASH
// playlists. Parameters associated with these playlist files (like query strings
// or headers) will be propagated to the chunks they reference.
ForwardFromFileTypes []string `json:"forward_from_file_types,omitzero,required"`
// The field specifies the types of media chunk files to which parameters,
// extracted from playlist files, will be forwarded. These refer to the actual
// segments of media content that are delivered to viewers. Ensuring the correct
// parameters are forwarded to these files is crucial for maintaining the integrity
// of the streaming session.
ForwardToFileTypes []string `json:"forward_to_file_types,omitzero,required"`
// The `forward_except_keys` field provides a mechanism to exclude specific
// parameters from being forwarded from playlist files to media chunk files. By
// listing certain keys in this field, you can ensure that these parameters are
// omitted during the forwarding process. This is particularly useful for
// preventing sensitive or irrelevant information from being included in requests
// for media chunks, thereby enhancing security and optimizing performance.
ForwardExceptKeys []string `json:"forward_except_keys,omitzero"`
// The `forward_only_keys` field allows for granular control over which specific
// parameters are forwarded from playlist files to media chunk files. By specifying
// certain keys, only those parameters will be propagated, ensuring that only
// relevant information is passed along. This is particularly useful for security
// and performance optimization, as it prevents unnecessary or sensitive data from
// being included in requests for media chunks.
ForwardOnlyKeys []string `json:"forward_only_keys,omitzero"`
// contains filtered or unexported fields
}
The Query String Forwarding feature allows for the seamless transfer of parameters embedded in playlist files to the corresponding media chunk files. This functionality ensures that specific attributes, such as authentication tokens or tracking information, are consistently passed along from the playlist manifest to the individual media segments. This is particularly useful for maintaining continuity in security, analytics, and any other parameter-based operations across the entire media delivery workflow.
The properties Enabled, ForwardFromFileTypes, ForwardToFileTypes are required.
func (ResourceUpdateParamsOptionsQueryStringForwarding) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsQueryStringForwarding) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsQueryStringForwarding) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsQueryStringForwarding) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsRedirectHTTPSToHTTP ¶
type ResourceUpdateParamsOptionsRedirectHTTPSToHTTP struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Enables redirect from HTTPS to HTTP.
`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceUpdateParamsOptionsRedirectHTTPSToHTTP) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsRedirectHTTPSToHTTP) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsRedirectHTTPSToHTTP) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsRedirectHTTPSToHTTP) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsRedirectHTTPToHTTPS ¶
type ResourceUpdateParamsOptionsRedirectHTTPToHTTPS struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Enables redirect from HTTP to HTTPS.
`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (ResourceUpdateParamsOptionsRedirectHTTPToHTTPS) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsRedirectHTTPToHTTPS) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsRedirectHTTPToHTTPS) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsRedirectHTTPToHTTPS) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsReferrerACL ¶
type ResourceUpdateParamsOptionsReferrerACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of domain names or wildcard domains (without protocol: `http://` or
// `https://`.)
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of domain names for which access is prohibited.
// - **deny** - List of IP domain names for which access is allowed.
//
// Examples:
//
// - `example.com`
// - `*.example.com`
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"domain or wildcard"`
// Policy type.
//
// Possible values:
//
// - **allow** - Allow access to all domain names except the domain names specified
// in `excepted_values` field.
// - **deny** - Deny access to all domain names except the domain names specified
// in `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Controls access to the CDN resource content for specified domain names.
The properties Enabled, ExceptedValues, PolicyType are required.
func (ResourceUpdateParamsOptionsReferrerACL) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsReferrerACL) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsReferrerACL) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsReferrerACL) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsRequestLimiter ¶
type ResourceUpdateParamsOptionsRequestLimiter struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Maximum request rate.
Rate int64 `json:"rate,required"`
// Units of measurement for the `rate` field.
//
// Possible values:
//
// - **r/s** - Requests per second.
// - **r/m** - Requests per minute.
//
// If the rate is less than one request per second, it is specified in request per
// minute (r/m.)
//
// Any of "r/s", "r/m".
RateUnit string `json:"rate_unit,omitzero"`
// contains filtered or unexported fields
}
Option allows to limit the amount of HTTP requests.
The properties Enabled, Rate are required.
func (ResourceUpdateParamsOptionsRequestLimiter) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsRequestLimiter) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsRequestLimiter) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsRequestLimiter) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsResponseHeadersHidingPolicy ¶
type ResourceUpdateParamsOptionsResponseHeadersHidingPolicy struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of HTTP headers.
//
// Parameter meaning depends on the value of the `mode` field:
//
// - **show** - List of HTTP headers to hide from response.
// - **hide** - List of HTTP headers to include in response. Other HTTP headers
// will be hidden.
//
// The following headers are required and cannot be hidden from response:
//
// - `Connection`
// - `Content-Length`
// - `Content-Type`
// - `Date`
// - `Server`
Excepted []string `json:"excepted,omitzero,required" format:"http_header"`
// How HTTP headers are hidden from the response.
//
// Possible values:
//
// - **show** - Hide only HTTP headers listed in the `excepted` field.
// - **hide** - Hide all HTTP headers except headers listed in the "excepted"
// field.
//
// Any of "hide", "show".
Mode string `json:"mode,omitzero,required"`
// contains filtered or unexported fields
}
Hides HTTP headers from an origin server in the CDN response.
The properties Enabled, Excepted, Mode are required.
func (ResourceUpdateParamsOptionsResponseHeadersHidingPolicy) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsResponseHeadersHidingPolicy) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsResponseHeadersHidingPolicy) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsResponseHeadersHidingPolicy) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsRewrite ¶
type ResourceUpdateParamsOptionsRewrite struct {
// Path for the Rewrite option.
//
// Example:
//
// - `/(.*) /media/$1`
Body string `json:"body,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Flag for the Rewrite option.
//
// Possible values:
//
// - **last** - Stop processing the current set of `ngx_http_rewrite_module`
// directives and start a search for a new location matching changed URI.
// - **break** - Stop processing the current set of the Rewrite option.
// - **redirect** - Return a temporary redirect with the 302 code; used when a
// replacement string does not start with `http://`, `https://`, or `$scheme`.
// - **permanent** - Return a permanent redirect with the 301 code.
//
// Any of "break", "last", "redirect", "permanent".
Flag string `json:"flag,omitzero"`
// contains filtered or unexported fields
}
Changes and redirects requests from the CDN to the origin. It operates according to the [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite) configuration.
The properties Body, Enabled are required.
func (ResourceUpdateParamsOptionsRewrite) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsRewrite) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsRewrite) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsRewrite) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsSecureKey ¶
type ResourceUpdateParamsOptionsSecureKey struct {
// Key generated on your side that will be used for URL signing.
Key param.Opt[string] `json:"key,omitzero,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Type of URL signing.
//
// Possible types:
//
// - **Type 0** - Includes end user IP to secure token generation.
// - **Type 2** - Excludes end user IP from secure token generation.
//
// Any of 0, 2.
Type int64 `json:"type,omitzero"`
// contains filtered or unexported fields
}
Configures access with tokenized URLs. This makes impossible to access content without a valid (unexpired) token.
The properties Enabled, Key are required.
func (ResourceUpdateParamsOptionsSecureKey) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsSecureKey) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsSecureKey) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsSecureKey) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsSlice ¶
type ResourceUpdateParamsOptionsSlice struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Requests and caches files larger than 10 MB in parts (no larger than 10 MB per part.) This reduces time to first byte.
The option is based on the [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
Notes:
- Origin must support HTTP Range requests.
- Not supported with `gzipON`, `brotli_compression` or `fetch_compressed` options enabled.
The properties Enabled, Value are required.
func (ResourceUpdateParamsOptionsSlice) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsSlice) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsSlice) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsSlice) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsSni ¶
type ResourceUpdateParamsOptionsSni struct {
// Custom SNI hostname.
//
// It is required if `sni_type` is set to custom.
CustomHostname string `json:"custom_hostname,required" format:"domain"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// SNI (Server Name Indication) type.
//
// Possible values:
//
// - **dynamic** - SNI hostname depends on `hostHeader` and `forward_host_header`
// options. It has several possible combinations:
// - If the `hostHeader` option is enabled and specified, SNI hostname matches the
// Host header.
// - If the `forward_host_header` option is enabled and has true value, SNI
// hostname matches the Host header used in the request made to a CDN.
// - If the `hostHeader` and `forward_host_header` options are disabled, SNI
// hostname matches the primary CNAME.
// - **custom** - custom SNI hostname is in use.
//
// Any of "dynamic", "custom".
SniType string `json:"sni_type,omitzero"`
// contains filtered or unexported fields
}
The hostname that is added to SNI requests from CDN servers to the origin server via HTTPS.
SNI is generally only required if your origin uses shared hosting or does not have a dedicated IP address. If the origin server presents multiple certificates, SNI allows the origin server to know which certificate to use for the connection.
The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
The properties CustomHostname, Enabled are required.
func (ResourceUpdateParamsOptionsSni) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsSni) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsSni) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsSni) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsStale ¶
type ResourceUpdateParamsOptionsStale struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Defines list of errors for which "Always online" option is applied.
//
// Any of "error", "http_403", "http_404", "http_429", "http_500", "http_502",
// "http_503", "http_504", "invalid_header", "timeout", "updating".
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Serves stale cached content in case of origin unavailability.
The properties Enabled, Value are required.
func (ResourceUpdateParamsOptionsStale) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsStale) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsStale) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsStale) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsStaticHeaders
deprecated
type ResourceUpdateParamsOptionsStaticHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// A MAP for static headers in a format of `header_name: header_value`.
//
// Restrictions:
//
// - **Header name** - Maximum 128 symbols, may contain Latin letters (A-Z, a-z),
// numbers (0-9), dashes, and underscores.
// - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
// (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
// with a letter, number, asterisk or {.
Value any `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
**Legacy option**. Use the `static_response_headers` option instead.
Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP Headers can be specified. May contain a header with multiple values.
Deprecated: deprecated
The properties Enabled, Value are required.
func (ResourceUpdateParamsOptionsStaticHeaders) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsStaticHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsStaticHeaders) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsStaticHeaders) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsStaticRequestHeaders ¶
type ResourceUpdateParamsOptionsStaticRequestHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// A MAP for static headers in a format of `header_name: header_value`.
//
// Restrictions:
//
// - **Header name** - Maximum 255 symbols, may contain Latin letters (A-Z, a-z),
// numbers (0-9), dashes, and underscores.
// - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
// (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
// with a letter, number, asterisk or {.
Value map[string]string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP Headers can be specified.
The properties Enabled, Value are required.
func (ResourceUpdateParamsOptionsStaticRequestHeaders) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsStaticRequestHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsStaticRequestHeaders) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsStaticRequestHeaders) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsStaticResponseHeaders ¶
type ResourceUpdateParamsOptionsStaticResponseHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
Value []ResourceUpdateParamsOptionsStaticResponseHeadersValue `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Custom HTTP Headers that a CDN server adds to a response.
The properties Enabled, Value are required.
func (ResourceUpdateParamsOptionsStaticResponseHeaders) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsStaticResponseHeaders) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsStaticResponseHeaders) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsStaticResponseHeaders) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsStaticResponseHeadersValue ¶
type ResourceUpdateParamsOptionsStaticResponseHeadersValue struct {
// HTTP Header name.
//
// Restrictions:
//
// - Maximum 128 symbols.
// - Latin letters (A-Z, a-z,) numbers (0-9,) dashes, and underscores only.
Name string `json:"name,required"`
// Header value.
//
// Restrictions:
//
// - Maximum 512 symbols.
// - Letters (a-z), numbers (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+
// /|\";:?.,><{}[]).
// - Must start with a letter, number, asterisk or {.
// - Multiple values can be added.
Value []string `json:"value,omitzero,required"`
// Defines whether the header will be added to a response from CDN regardless of
// response code.
//
// Possible values:
//
// - **true** - Header will be added to a response from CDN regardless of response
// code.
// - **false** - Header will be added only to the following response codes: 200,
// 201, 204, 206, 301, 302, 303, 304, 307, 308.
Always param.Opt[bool] `json:"always,omitzero"`
// contains filtered or unexported fields
}
The properties Name, Value are required.
func (ResourceUpdateParamsOptionsStaticResponseHeadersValue) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsStaticResponseHeadersValue) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsStaticResponseHeadersValue) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsStaticResponseHeadersValue) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsTlsVersions ¶
type ResourceUpdateParamsOptionsTlsVersions struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of SSL/TLS protocol versions (case sensitive).
//
// Any of "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3".
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
List of SSL/TLS protocol versions allowed for HTTPS connections from end users to the domain.
When the option is disabled, all protocols versions are allowed.
The properties Enabled, Value are required.
func (ResourceUpdateParamsOptionsTlsVersions) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsTlsVersions) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsTlsVersions) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsTlsVersions) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsUseDefaultLeChain ¶
type ResourceUpdateParamsOptionsUseDefaultLeChain struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Default Let's Encrypt certificate chain. This is a deprecated
// version, use it only for compatibilities with Android devices 7.1.1 or lower.
// - **false** - Alternative Let's Encrypt certificate chain.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Let's Encrypt certificate chain.
The specified chain will be used during the next Let's Encrypt certificate issue or renewal.
The properties Enabled, Value are required.
func (ResourceUpdateParamsOptionsUseDefaultLeChain) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsUseDefaultLeChain) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsUseDefaultLeChain) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsUseDefaultLeChain) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsUseDns01LeChallenge ¶
type ResourceUpdateParamsOptionsUseDns01LeChallenge struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - DNS-01 challenge is used to issue Let's Encrypt certificate.
// - **false** - HTTP-01 challenge is used to issue Let's Encrypt certificate.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
DNS-01 challenge to issue a Let's Encrypt certificate for the resource.
DNS service should be activated to enable this option.
The properties Enabled, Value are required.
func (ResourceUpdateParamsOptionsUseDns01LeChallenge) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsUseDns01LeChallenge) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsUseDns01LeChallenge) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsUseDns01LeChallenge) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsUseRsaLeCert ¶
type ResourceUpdateParamsOptionsUseRsaLeCert struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - RSA Let's Encrypt certificate.
// - **false** - ECDSA Let's Encrypt certificate.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
RSA Let's Encrypt certificate type for the CDN resource.
The specified value will be used during the next Let's Encrypt certificate issue or renewal.
The properties Enabled, Value are required.
func (ResourceUpdateParamsOptionsUseRsaLeCert) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsUseRsaLeCert) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsUseRsaLeCert) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsUseRsaLeCert) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsUserAgentACL ¶
type ResourceUpdateParamsOptionsUserAgentACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of User-Agents that will be allowed/denied.
//
// The meaning of the parameter depends on `policy_type`:
//
// - **allow** - List of User-Agents for which access is prohibited.
// - **deny** - List of User-Agents for which access is allowed.
//
// Use an empty string `""` to allow/deny access when the User-Agent header is
// empty.
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"user_agent"`
// User-Agents policy type.
//
// Possible values:
//
// - **allow** - Allow access for all User-Agents except specified in
// `excepted_values` field.
// - **deny** - Deny access for all User-Agents except specified in
// `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Controls access to the content for specified User-Agents.
The properties Enabled, ExceptedValues, PolicyType are required.
func (ResourceUpdateParamsOptionsUserAgentACL) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsUserAgentACL) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsUserAgentACL) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsUserAgentACL) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsWaap ¶
type ResourceUpdateParamsOptionsWaap struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Allows to enable WAAP (Web Application and API Protection).
The properties Enabled, Value are required.
func (ResourceUpdateParamsOptionsWaap) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsWaap) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsWaap) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsWaap) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOptionsWebsockets ¶
type ResourceUpdateParamsOptionsWebsockets struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Enables or disables WebSockets connections to an origin server.
The properties Enabled, Value are required.
func (ResourceUpdateParamsOptionsWebsockets) MarshalJSON ¶
func (r ResourceUpdateParamsOptionsWebsockets) MarshalJSON() (data []byte, err error)
func (*ResourceUpdateParamsOptionsWebsockets) UnmarshalJSON ¶
func (r *ResourceUpdateParamsOptionsWebsockets) UnmarshalJSON(data []byte) error
type ResourceUpdateParamsOriginProtocol ¶
type ResourceUpdateParamsOriginProtocol string
Protocol used by CDN servers to request content from an origin source.
Possible values:
- **HTTPS** - CDN servers will connect to the origin via HTTPS.
- **HTTP** - CDN servers will connect to the origin via HTTP.
- **MATCH** - connection protocol will be chosen automatically (content on the origin source should be available for the CDN both through HTTP and HTTPS).
If protocol is not specified, HTTP is used to connect to an origin server.
const ( ResourceUpdateParamsOriginProtocolHTTP ResourceUpdateParamsOriginProtocol = "HTTP" ResourceUpdateParamsOriginProtocolHTTPS ResourceUpdateParamsOriginProtocol = "HTTPS" ResourceUpdateParamsOriginProtocolMatch ResourceUpdateParamsOriginProtocol = "MATCH" )
type ResourceUsageStats ¶
type ResourceUsageStats struct {
// ID of CDN resource for which statistics data is shown.
Number1Example any `json:"1 (example)"`
// BackBlaze bytes from Backblaze origin.
//
// Represented by two values:
//
// - 1543622400 — Time in the UNIX timestamp when statistics were received.
// - 17329220573 — Bytes.
BackblazeBytes []int64 `json:"backblaze_bytes"`
// Types of statistics data.
//
// Possible values:
//
// - **`upstream_bytes`** – Traffic in bytes from an origin server to CDN servers
// or to origin shielding when used.
// - **`sent_bytes`** – Traffic in bytes from CDN servers to clients.
// - **`shield_bytes`** – Traffic in bytes from origin shielding to CDN servers.
// - **`backblaze_bytes`** - Traffic in bytes from Backblaze origin.
// - **`total_bytes`** – `shield_bytes`, `upstream_bytes` and `sent_bytes`
// combined.
// - **`cdn_bytes`** – `sent_bytes` and `shield_bytes` combined.
// - **requests** – Number of requests to edge servers.
// - **`responses_2xx`** – Number of 2xx response codes.
// - **`responses_3xx`** – Number of 3xx response codes.
// - **`responses_4xx`** – Number of 4xx response codes.
// - **`responses_5xx`** – Number of 5xx response codes.
// - **`responses_hit`** – Number of responses with the header Cache: HIT.
// - **`responses_miss`** – Number of responses with the header Cache: MISS.
// - **`response_types`** – Statistics by content type. It returns a number of
// responses for content with different MIME types.
// - **`cache_hit_traffic_ratio`** – Formula: 1 - `upstream_bytes` / `sent_bytes`.
// We deduct the non-cached traffic from the total traffic amount.
// - **`cache_hit_requests_ratio`** – Formula: `responses_hit` / requests. The
// share of sending cached content.
// - **`shield_traffic_ratio`** – Formula: (`shield_bytes` - `upstream_bytes`) /
// `shield_bytes`. The efficiency of the Origin Shielding: how much more traffic
// is sent from the Origin Shielding than from the origin.
// - **`image_processed`** - Number of images transformed on the Image optimization
// service.
// - **`request_time`** - Time elapsed between the first bytes of a request were
// processed and logging after the last bytes were sent to a user.
// - **`upstream_response_time`** - Number of milliseconds it took to receive a
// response from an origin. If upstream `response_time_` contains several
// indications for one request (in case of more than 1 origin), we summarize
// them. In case of aggregating several queries, the average of this amount is
// calculated.
//
// Metrics **`upstream_response_time`** and **`request_time`** should be requested
// separately from other metrics
Metrics any `json:"metrics"`
// Regions for which data is displayed.
//
// Possible values:
//
// - **na** – North America
// - **eu** – Europe
// - **cis** – Commonwealth of Independent States
// - **asia** – Asia
// - **au** – Australia
// - **latam** – Latin America
// - **me** – Middle East
// - **africa** - Africa
// - **sa** - South America
Region any `json:"region"`
// Resources IDs by which statistics data is grouped.
Resource any `json:"resource"`
// Bytes from CDN servers to the end-users.
//
// Represented by two values:
//
// - 1543622400 — Time in the UNIX timestamp when statistics were received.
// - 17329220573 — Bytes.
SentBytes []int64 `json:"sent_bytes"`
// Upstream bytes and `sent_bytes` combined.
//
// Represented by two values:
//
// - 1543622400 — Time in the UNIX timestamp when statistics were received.
// - 17329220573 — Bytes.
TotalBytes []int64 `json:"total_bytes"`
// Bytes from the upstream to the CDN servers.
//
// Represented by two values:
//
// - 1543622400 — Time in the UNIX timestamp when statistics were received.
// - 17329220573 — Bytes.
UpstreamBytes []int64 `json:"upstream_bytes"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Number1Example respjson.Field
BackblazeBytes respjson.Field
Metrics respjson.Field
Region respjson.Field
Resource respjson.Field
SentBytes respjson.Field
TotalBytes respjson.Field
UpstreamBytes respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ResourceUsageStats) RawJSON ¶
func (r ResourceUsageStats) RawJSON() string
Returns the unmodified JSON received from the API
func (*ResourceUsageStats) UnmarshalJSON ¶
func (r *ResourceUsageStats) UnmarshalJSON(data []byte) error
type RuleTemplate ¶
type RuleTemplate struct {
// Rule template ID.
ID int64 `json:"id"`
// Client ID
Client int64 `json:"client"`
// Defines whether the template is a system template developed for common cases.
// System templates are available to all customers.
//
// Possible values:
//
// - **true** - Template is a system template and cannot be changed by a user.
// - **false** - Template is a custom template and can be changed by a user.
Default bool `json:"default"`
// Defines whether the template has been deleted.
//
// Possible values:
//
// - **true** - Template has been deleted.
// - **false** - Template has not been deleted.
Deleted bool `json:"deleted"`
// Rule template name.
Name string `json:"name"`
// List of options that can be configured for the rule.
//
// In case of `null` value the option is not added to the rule. Option inherits its
// value from the CDN resource settings.
Options RuleTemplateOptions `json:"options"`
// Sets a protocol other than the one specified in the CDN resource settings to
// connect to the origin.
//
// Possible values:
//
// - **HTTPS** - CDN servers connect to origin via HTTPS protocol.
// - **HTTP** - CDN servers connect to origin via HTTP protocol.
// - **MATCH** - Connection protocol is chosen automatically; in this case, content
// on origin source should be available for the CDN both through HTTP and HTTPS
// protocols.
// - **null** - `originProtocol` setting is inherited from the CDN resource
// settings.
//
// Any of "HTTPS", "HTTP", "MATCH".
OverrideOriginProtocol RuleTemplateOverrideOriginProtocol `json:"overrideOriginProtocol,nullable"`
// Path to the file or folder for which the rule will be applied.
//
// The rule is applied if the requested URI matches the rule path.
//
// We add a leading forward slash to any rule path. Specify a path without a
// forward slash.
Rule string `json:"rule"`
// Rule type.
//
// Possible values:
//
// - **Type 0** - Regular expression. Must start with '^/' or '/'.
// - **Type 1** - Regular expression. Note that for this rule type we automatically
// add / to each rule pattern before your regular expression. This type is
// **legacy**, please use Type 0.
RuleType int64 `json:"ruleType"`
// Determines whether the rule is a template.
Template bool `json:"template"`
// Rule execution order: from lowest (1) to highest.
//
// If requested URI matches multiple rules, the one higher in the order of the
// rules will be applied.
Weight int64 `json:"weight"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Client respjson.Field
Default respjson.Field
Deleted respjson.Field
Name respjson.Field
Options respjson.Field
OverrideOriginProtocol respjson.Field
Rule respjson.Field
RuleType respjson.Field
Template respjson.Field
Weight respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (RuleTemplate) RawJSON ¶
func (r RuleTemplate) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplate) UnmarshalJSON ¶
func (r *RuleTemplate) UnmarshalJSON(data []byte) error
type RuleTemplateList ¶
type RuleTemplateList []RuleTemplate
type RuleTemplateNewParams ¶
type RuleTemplateNewParams struct {
// Path to the file or folder for which the rule will be applied.
//
// The rule is applied if the requested URI matches the rule path.
//
// We add a leading forward slash to any rule path. Specify a path without a
// forward slash.
Rule string `json:"rule,required"`
// Rule type.
//
// Possible values:
//
// - **Type 0** - Regular expression. Must start with '^/' or '/'.
// - **Type 1** - Regular expression. Note that for this rule type we automatically
// add / to each rule pattern before your regular expression. This type is
// **legacy**, please use Type 0.
RuleType int64 `json:"ruleType,required"`
// Rule template name.
Name param.Opt[string] `json:"name,omitzero"`
// Rule execution order: from lowest (1) to highest.
//
// If requested URI matches multiple rules, the one higher in the order of the
// rules will be applied.
Weight param.Opt[int64] `json:"weight,omitzero"`
// Sets a protocol other than the one specified in the CDN resource settings to
// connect to the origin.
//
// Possible values:
//
// - **HTTPS** - CDN servers connect to origin via HTTPS protocol.
// - **HTTP** - CDN servers connect to origin via HTTP protocol.
// - **MATCH** - Connection protocol is chosen automatically; in this case, content
// on origin source should be available for the CDN both through HTTP and HTTPS
// protocols.
// - **null** - `originProtocol` setting is inherited from the CDN resource
// settings.
//
// Any of "HTTPS", "HTTP", "MATCH".
OverrideOriginProtocol RuleTemplateNewParamsOverrideOriginProtocol `json:"overrideOriginProtocol,omitzero"`
// List of options that can be configured for the rule.
//
// In case of `null` value the option is not added to the rule. Option inherits its
// value from the CDN resource settings.
Options RuleTemplateNewParamsOptions `json:"options,omitzero"`
// contains filtered or unexported fields
}
func (RuleTemplateNewParams) MarshalJSON ¶
func (r RuleTemplateNewParams) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParams) UnmarshalJSON ¶
func (r *RuleTemplateNewParams) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptions ¶
type RuleTemplateNewParamsOptions struct {
// HTTP methods allowed for content requests from the CDN.
AllowedHTTPMethods RuleTemplateNewParamsOptionsAllowedHTTPMethods `json:"allowedHttpMethods,omitzero"`
// Allows to prevent online services from overloading and ensure your business
// workflow running smoothly.
BotProtection RuleTemplateNewParamsOptionsBotProtection `json:"bot_protection,omitzero"`
// Compresses content with Brotli on the CDN side. CDN servers will request only
// uncompressed content from the origin.
//
// Notes:
//
// 1. CDN only supports "Brotli compression" when the "origin shielding" feature is
// activated.
// 2. If a precache server is not active for a CDN resource, no compression occurs,
// even if the option is enabled.
// 3. `brotli_compression` is not supported with `fetch_compressed` or `slice`
// options enabled.
// 4. `fetch_compressed` option in CDN resource settings overrides
// `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN
// resource and want to enable `brotli_compression` in a rule, you must specify
// `fetch_compressed:false` in the rule.
BrotliCompression RuleTemplateNewParamsOptionsBrotliCompression `json:"brotli_compression,omitzero"`
// Cache expiration time for users browsers in seconds.
//
// Cache expiration time is applied to the following response codes: 200, 201, 204,
// 206, 301, 302, 303, 304, 307, 308.
//
// Responses with other codes will not be cached.
BrowserCacheSettings RuleTemplateNewParamsOptionsBrowserCacheSettings `json:"browser_cache_settings,omitzero"`
// **Legacy option**. Use the `response_headers_hiding_policy` option instead.
//
// HTTP Headers that must be included in the response.
//
// Deprecated: deprecated
CacheHTTPHeaders RuleTemplateNewParamsOptionsCacheHTTPHeaders `json:"cache_http_headers,omitzero"`
// Enables or disables CORS (Cross-Origin Resource Sharing) header support.
//
// CORS header support allows the CDN to add the Access-Control-Allow-Origin header
// to a response to a browser.
Cors RuleTemplateNewParamsOptionsCors `json:"cors,omitzero"`
// Enables control access to content for specified countries.
CountryACL RuleTemplateNewParamsOptionsCountryACL `json:"country_acl,omitzero"`
// **Legacy option**. Use the `edge_cache_settings` option instead.
//
// Allows the complete disabling of content caching.
//
// Deprecated: deprecated
DisableCache RuleTemplateNewParamsOptionsDisableCache `json:"disable_cache,omitzero"`
// Allows 206 responses regardless of the settings of an origin source.
DisableProxyForceRanges RuleTemplateNewParamsOptionsDisableProxyForceRanges `json:"disable_proxy_force_ranges,omitzero"`
// Cache expiration time for CDN servers.
//
// `value` and `default` fields cannot be used simultaneously.
EdgeCacheSettings RuleTemplateNewParamsOptionsEdgeCacheSettings `json:"edge_cache_settings,omitzero"`
// Allows to configure FastEdge app to be called on different request/response
// phases.
//
// Note: At least one of `on_request_headers`, `on_request_body`,
// `on_response_headers`, or `on_response_body` must be specified.
Fastedge RuleTemplateNewParamsOptionsFastedge `json:"fastedge,omitzero"`
// Makes the CDN request compressed content from the origin.
//
// The origin server should support compression. CDN servers will not decompress
// your content even if a user browser does not accept compression.
//
// Notes:
//
// 1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or
// `slice` options enabled.
// 2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If
// you enable it in CDN resource and want to use `gzipON` and
// `brotli_compression` in a rule, you have to specify
// `"fetch_compressed": false` in the rule.
FetchCompressed RuleTemplateNewParamsOptionsFetchCompressed `json:"fetch_compressed,omitzero"`
// Enables redirection from origin. If the origin server returns a redirect, the
// option allows the CDN to pull the requested content from the origin server that
// was returned in the redirect.
FollowOriginRedirect RuleTemplateNewParamsOptionsFollowOriginRedirect `json:"follow_origin_redirect,omitzero"`
// Applies custom HTTP response codes for CDN content.
//
// The following codes are reserved by our system and cannot be specified in this
// option: 408, 444, 477, 494, 495, 496, 497, 499.
ForceReturn RuleTemplateNewParamsOptionsForceReturn `json:"force_return,omitzero"`
// Forwards the Host header from a end-user request to an origin server.
//
// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
ForwardHostHeader RuleTemplateNewParamsOptionsForwardHostHeader `json:"forward_host_header,omitzero"`
// Compresses content with gzip on the CDN end. CDN servers will request only
// uncompressed content from the origin.
//
// Notes:
//
// 1. Compression with gzip is not supported with `fetch_compressed` or `slice`
// options enabled.
// 2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in
// rules. If you enable `fetch_compressed` in CDN resource and want to enable
// `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
GzipOn RuleTemplateNewParamsOptionsGzipOn `json:"gzipOn,omitzero"`
// Sets the Host header that CDN servers use when request content from an origin
// server. Your server must be able to process requests with the chosen header.
//
// If the option is `null`, the Host Header value is equal to first CNAME.
//
// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
HostHeader RuleTemplateNewParamsOptionsHostHeader `json:"hostHeader,omitzero"`
// Defines whether the files with the Set-Cookies header are cached as one file or
// as different ones.
IgnoreCookie RuleTemplateNewParamsOptionsIgnoreCookie `json:"ignore_cookie,omitzero"`
// How a file with different query strings is cached: either as one object (option
// is enabled) or as different objects (option is disabled.)
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
IgnoreQueryString RuleTemplateNewParamsOptionsIgnoreQueryString `json:"ignoreQueryString,omitzero"`
// Transforms JPG and PNG images (for example, resize or crop) and automatically
// converts them to WebP or AVIF format.
ImageStack RuleTemplateNewParamsOptionsImageStack `json:"image_stack,omitzero"`
// Controls access to the CDN resource content for specific IP addresses.
//
// If you want to use IPs from our CDN servers IP list for IP ACL configuration,
// you have to independently monitor their relevance. We recommend you use a script
// for automatically update IP ACL.
// [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
IPAddressACL RuleTemplateNewParamsOptionsIPAddressACL `json:"ip_address_acl,omitzero"`
// Allows to control the download speed per connection.
LimitBandwidth RuleTemplateNewParamsOptionsLimitBandwidth `json:"limit_bandwidth,omitzero"`
// Allows you to modify your cache key. If omitted, the default value is
// `$request_uri`.
//
// Combine the specified variables to create a key for caching.
//
// - **$`request_uri`**
// - **$scheme**
// - **$uri**
//
// **Warning**: Enabling and changing this option can invalidate your current cache
// and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will
// not work.
ProxyCacheKey RuleTemplateNewParamsOptionsProxyCacheKey `json:"proxy_cache_key,omitzero"`
// Caching for POST requests along with default GET and HEAD.
ProxyCacheMethodsSet RuleTemplateNewParamsOptionsProxyCacheMethodsSet `json:"proxy_cache_methods_set,omitzero"`
// The time limit for establishing a connection with the origin.
ProxyConnectTimeout RuleTemplateNewParamsOptionsProxyConnectTimeout `json:"proxy_connect_timeout,omitzero"`
// The time limit for receiving a partial response from the origin. If no response
// is received within this time, the connection will be closed.
//
// **Note:** When used with a WebSocket connection, this option supports values
// only in the range 1–20 seconds (instead of the usual 1–30 seconds).
ProxyReadTimeout RuleTemplateNewParamsOptionsProxyReadTimeout `json:"proxy_read_timeout,omitzero"`
// Files with the specified query parameters are cached as one object, files with
// other parameters are cached as different objects.
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
QueryParamsBlacklist RuleTemplateNewParamsOptionsQueryParamsBlacklist `json:"query_params_blacklist,omitzero"`
// Files with the specified query parameters are cached as different objects, files
// with other parameters are cached as one object.
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
QueryParamsWhitelist RuleTemplateNewParamsOptionsQueryParamsWhitelist `json:"query_params_whitelist,omitzero"`
// The Query String Forwarding feature allows for the seamless transfer of
// parameters embedded in playlist files to the corresponding media chunk files.
// This functionality ensures that specific attributes, such as authentication
// tokens or tracking information, are consistently passed along from the playlist
// manifest to the individual media segments. This is particularly useful for
// maintaining continuity in security, analytics, and any other parameter-based
// operations across the entire media delivery workflow.
QueryStringForwarding RuleTemplateNewParamsOptionsQueryStringForwarding `json:"query_string_forwarding,omitzero"`
// Enables redirect from HTTP to HTTPS.
//
// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
// simultaneously.
RedirectHTTPToHTTPS RuleTemplateNewParamsOptionsRedirectHTTPToHTTPS `json:"redirect_http_to_https,omitzero"`
// Enables redirect from HTTPS to HTTP.
//
// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
// simultaneously.
RedirectHTTPSToHTTP RuleTemplateNewParamsOptionsRedirectHTTPSToHTTP `json:"redirect_https_to_http,omitzero"`
// Controls access to the CDN resource content for specified domain names.
ReferrerACL RuleTemplateNewParamsOptionsReferrerACL `json:"referrer_acl,omitzero"`
// Option allows to limit the amount of HTTP requests.
RequestLimiter RuleTemplateNewParamsOptionsRequestLimiter `json:"request_limiter,omitzero"`
// Hides HTTP headers from an origin server in the CDN response.
ResponseHeadersHidingPolicy RuleTemplateNewParamsOptionsResponseHeadersHidingPolicy `json:"response_headers_hiding_policy,omitzero"`
// Changes and redirects requests from the CDN to the origin. It operates according
// to the
// [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite)
// configuration.
Rewrite RuleTemplateNewParamsOptionsRewrite `json:"rewrite,omitzero"`
// Configures access with tokenized URLs. This makes impossible to access content
// without a valid (unexpired) token.
SecureKey RuleTemplateNewParamsOptionsSecureKey `json:"secure_key,omitzero"`
// Requests and caches files larger than 10 MB in parts (no larger than 10 MB per
// part.) This reduces time to first byte.
//
// The option is based on the
// [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
//
// Notes:
//
// 1. Origin must support HTTP Range requests.
// 2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed`
// options enabled.
Slice RuleTemplateNewParamsOptionsSlice `json:"slice,omitzero"`
// The hostname that is added to SNI requests from CDN servers to the origin server
// via HTTPS.
//
// SNI is generally only required if your origin uses shared hosting or does not
// have a dedicated IP address. If the origin server presents multiple
// certificates, SNI allows the origin server to know which certificate to use for
// the connection.
//
// The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
Sni RuleTemplateNewParamsOptionsSni `json:"sni,omitzero"`
// Serves stale cached content in case of origin unavailability.
Stale RuleTemplateNewParamsOptionsStale `json:"stale,omitzero"`
// Custom HTTP Headers that a CDN server adds to a response.
StaticResponseHeaders RuleTemplateNewParamsOptionsStaticResponseHeaders `json:"static_response_headers,omitzero"`
// **Legacy option**. Use the `static_response_headers` option instead.
//
// Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP
// Headers can be specified. May contain a header with multiple values.
//
// Deprecated: deprecated
StaticHeaders RuleTemplateNewParamsOptionsStaticHeaders `json:"staticHeaders,omitzero"`
// Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP
// Headers can be specified.
StaticRequestHeaders RuleTemplateNewParamsOptionsStaticRequestHeaders `json:"staticRequestHeaders,omitzero"`
// Controls access to the content for specified User-Agents.
UserAgentACL RuleTemplateNewParamsOptionsUserAgentACL `json:"user_agent_acl,omitzero"`
// Allows to enable WAAP (Web Application and API Protection).
Waap RuleTemplateNewParamsOptionsWaap `json:"waap,omitzero"`
// Enables or disables WebSockets connections to an origin server.
Websockets RuleTemplateNewParamsOptionsWebsockets `json:"websockets,omitzero"`
// contains filtered or unexported fields
}
List of options that can be configured for the rule.
In case of `null` value the option is not added to the rule. Option inherits its value from the CDN resource settings.
func (RuleTemplateNewParamsOptions) MarshalJSON ¶
func (r RuleTemplateNewParamsOptions) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptions) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptions) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsAllowedHTTPMethods ¶
type RuleTemplateNewParamsOptionsAllowedHTTPMethods struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
HTTP methods allowed for content requests from the CDN.
The properties Enabled, Value are required.
func (RuleTemplateNewParamsOptionsAllowedHTTPMethods) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsAllowedHTTPMethods) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsAllowedHTTPMethods) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsAllowedHTTPMethods) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsBotProtection ¶
type RuleTemplateNewParamsOptionsBotProtection struct {
// Controls the bot challenge module state.
BotChallenge RuleTemplateNewParamsOptionsBotProtectionBotChallenge `json:"bot_challenge,omitzero,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// contains filtered or unexported fields
}
Allows to prevent online services from overloading and ensure your business workflow running smoothly.
The properties BotChallenge, Enabled are required.
func (RuleTemplateNewParamsOptionsBotProtection) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsBotProtection) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsBotProtection) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsBotProtection) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsBotProtectionBotChallenge ¶
type RuleTemplateNewParamsOptionsBotProtectionBotChallenge struct {
// Possible values:
//
// - **true** - Bot challenge is enabled.
// - **false** - Bot challenge is disabled.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// contains filtered or unexported fields
}
Controls the bot challenge module state.
func (RuleTemplateNewParamsOptionsBotProtectionBotChallenge) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsBotProtectionBotChallenge) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsBotProtectionBotChallenge) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsBotProtectionBotChallenge) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsBrotliCompression ¶
type RuleTemplateNewParamsOptionsBrotliCompression struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Allows to select the content types you want to compress.
//
// `text/html` is a mandatory content type.
//
// Any of "application/javascript", "application/json",
// "application/vnd.ms-fontobject", "application/wasm", "application/x-font-ttf",
// "application/x-javascript", "application/xml", "application/xml+rss",
// "image/svg+xml", "image/x-icon", "text/css", "text/html", "text/javascript",
// "text/plain", "text/xml".
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Compresses content with Brotli on the CDN side. CDN servers will request only uncompressed content from the origin.
Notes:
- CDN only supports "Brotli compression" when the "origin shielding" feature is activated.
- If a precache server is not active for a CDN resource, no compression occurs, even if the option is enabled.
- `brotli_compression` is not supported with `fetch_compressed` or `slice` options enabled.
- `fetch_compressed` option in CDN resource settings overrides `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN resource and want to enable `brotli_compression` in a rule, you must specify `fetch_compressed:false` in the rule.
The properties Enabled, Value are required.
func (RuleTemplateNewParamsOptionsBrotliCompression) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsBrotliCompression) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsBrotliCompression) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsBrotliCompression) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsBrowserCacheSettings ¶
type RuleTemplateNewParamsOptionsBrowserCacheSettings struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Set the cache expiration time to '0s' to disable caching.
//
// The maximum duration is any equivalent to `1y`.
Value string `json:"value,required" format:"nginx time"`
// contains filtered or unexported fields
}
Cache expiration time for users browsers in seconds.
Cache expiration time is applied to the following response codes: 200, 201, 204, 206, 301, 302, 303, 304, 307, 308.
Responses with other codes will not be cached.
The properties Enabled, Value are required.
func (RuleTemplateNewParamsOptionsBrowserCacheSettings) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsBrowserCacheSettings) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsBrowserCacheSettings) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsBrowserCacheSettings) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsCacheHTTPHeaders
deprecated
type RuleTemplateNewParamsOptionsCacheHTTPHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
**Legacy option**. Use the `response_headers_hiding_policy` option instead.
HTTP Headers that must be included in the response.
Deprecated: deprecated
The properties Enabled, Value are required.
func (RuleTemplateNewParamsOptionsCacheHTTPHeaders) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsCacheHTTPHeaders) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsCacheHTTPHeaders) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsCacheHTTPHeaders) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsCors ¶
type RuleTemplateNewParamsOptionsCors struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Value of the Access-Control-Allow-Origin header.
//
// Possible values:
//
// - **Adds \* as the Access-Control-Allow-Origin header value** - Content will be
// uploaded for requests from any domain. `"value": ["*"]`
// - **Adds "$http_origin" as the Access-Control-Allow-Origin header value if the
// origin matches one of the listed domains** - Content will be uploaded only for
// requests from the domains specified in the field.
// `"value": ["domain.com", "second.dom.com"]`
// - **Adds "$http_origin" as the Access-Control-Allow-Origin header value** -
// Content will be uploaded for requests from any domain, and the domain from
// which the request was sent will be added to the "Access-Control-Allow-Origin"
// header in the response. `"value": ["$http_origin"]`
Value []string `json:"value,omitzero,required"`
// Defines whether the Access-Control-Allow-Origin header should be added to a
// response from CDN regardless of response code.
//
// Possible values:
//
// - **true** - Header will be added to a response regardless of response code.
// - **false** - Header will only be added to responses with codes: 200, 201, 204,
// 206, 301, 302, 303, 304, 307, 308.
Always param.Opt[bool] `json:"always,omitzero"`
// contains filtered or unexported fields
}
Enables or disables CORS (Cross-Origin Resource Sharing) header support.
CORS header support allows the CDN to add the Access-Control-Allow-Origin header to a response to a browser.
The properties Enabled, Value are required.
func (RuleTemplateNewParamsOptionsCors) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsCors) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsCors) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsCors) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsCountryACL ¶
type RuleTemplateNewParamsOptionsCountryACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of countries according to ISO-3166-1.
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of countries for which access is prohibited.
// - **deny** - List of countries for which access is allowed.
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"country-code"`
// Defines the type of CDN resource access policy.
//
// Possible values:
//
// - **allow** - Access is allowed for all the countries except for those specified
// in `excepted_values` field.
// - **deny** - Access is denied for all the countries except for those specified
// in `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Enables control access to content for specified countries.
The properties Enabled, ExceptedValues, PolicyType are required.
func (RuleTemplateNewParamsOptionsCountryACL) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsCountryACL) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsCountryACL) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsCountryACL) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsDisableCache
deprecated
type RuleTemplateNewParamsOptionsDisableCache struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - content caching is disabled.
// - **false** - content caching is enabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
**Legacy option**. Use the `edge_cache_settings` option instead.
Allows the complete disabling of content caching.
Deprecated: deprecated
The properties Enabled, Value are required.
func (RuleTemplateNewParamsOptionsDisableCache) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsDisableCache) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsDisableCache) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsDisableCache) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsDisableProxyForceRanges ¶
type RuleTemplateNewParamsOptionsDisableProxyForceRanges struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Allows 206 responses regardless of the settings of an origin source.
The properties Enabled, Value are required.
func (RuleTemplateNewParamsOptionsDisableProxyForceRanges) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsDisableProxyForceRanges) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsDisableProxyForceRanges) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsDisableProxyForceRanges) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsEdgeCacheSettings ¶
type RuleTemplateNewParamsOptionsEdgeCacheSettings struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Enables content caching according to the origin cache settings.
//
// The value is applied to the following response codes 200, 201, 204, 206, 301,
// 302, 303, 304, 307, 308, if an origin server does not have caching HTTP headers.
//
// Responses with other codes will not be cached.
//
// The maximum duration is any equivalent to `1y`.
Default param.Opt[string] `json:"default,omitzero" format:"nginx time"`
// Caching time.
//
// The value is applied to the following response codes: 200, 206, 301, 302.
// Responses with codes 4xx, 5xx will not be cached.
//
// Use `0s` to disable caching.
//
// The maximum duration is any equivalent to `1y`.
Value param.Opt[string] `json:"value,omitzero" format:"nginx time"`
// A MAP object representing the caching time in seconds for a response with a
// specific response code.
//
// These settings have a higher priority than the `value` field.
//
// - Use `any` key to specify caching time for all response codes.
// - Use `0s` value to disable caching for a specific response code.
CustomValues map[string]string `json:"custom_values,omitzero" format:"nginx time"`
// contains filtered or unexported fields
}
Cache expiration time for CDN servers.
`value` and `default` fields cannot be used simultaneously.
The property Enabled is required.
func (RuleTemplateNewParamsOptionsEdgeCacheSettings) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsEdgeCacheSettings) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsEdgeCacheSettings) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsEdgeCacheSettings) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsFastedge ¶
type RuleTemplateNewParamsOptionsFastedge struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Allows to configure FastEdge application that will be called to handle request
// body as soon as CDN receives incoming HTTP request.
OnRequestBody RuleTemplateNewParamsOptionsFastedgeOnRequestBody `json:"on_request_body,omitzero"`
// Allows to configure FastEdge application that will be called to handle request
// headers as soon as CDN receives incoming HTTP request.
OnRequestHeaders RuleTemplateNewParamsOptionsFastedgeOnRequestHeaders `json:"on_request_headers,omitzero"`
// Allows to configure FastEdge application that will be called to handle response
// body before CDN sends the HTTP response.
OnResponseBody RuleTemplateNewParamsOptionsFastedgeOnResponseBody `json:"on_response_body,omitzero"`
// Allows to configure FastEdge application that will be called to handle response
// headers before CDN sends the HTTP response.
OnResponseHeaders RuleTemplateNewParamsOptionsFastedgeOnResponseHeaders `json:"on_response_headers,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge app to be called on different request/response phases.
Note: At least one of `on_request_headers`, `on_request_body`, `on_response_headers`, or `on_response_body` must be specified.
The property Enabled is required.
func (RuleTemplateNewParamsOptionsFastedge) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsFastedge) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsFastedge) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsFastedge) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsFastedgeOnRequestBody ¶
type RuleTemplateNewParamsOptionsFastedgeOnRequestBody struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle request body as soon as CDN receives incoming HTTP request.
The property AppID is required.
func (RuleTemplateNewParamsOptionsFastedgeOnRequestBody) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsFastedgeOnRequestBody) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsFastedgeOnRequestBody) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsFastedgeOnRequestBody) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsFastedgeOnRequestHeaders ¶
type RuleTemplateNewParamsOptionsFastedgeOnRequestHeaders struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request.
The property AppID is required.
func (RuleTemplateNewParamsOptionsFastedgeOnRequestHeaders) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsFastedgeOnRequestHeaders) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsFastedgeOnResponseBody ¶
type RuleTemplateNewParamsOptionsFastedgeOnResponseBody struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle response body before CDN sends the HTTP response.
The property AppID is required.
func (RuleTemplateNewParamsOptionsFastedgeOnResponseBody) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsFastedgeOnResponseBody) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsFastedgeOnResponseBody) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsFastedgeOnResponseBody) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsFastedgeOnResponseHeaders ¶
type RuleTemplateNewParamsOptionsFastedgeOnResponseHeaders struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle response headers before CDN sends the HTTP response.
The property AppID is required.
func (RuleTemplateNewParamsOptionsFastedgeOnResponseHeaders) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsFastedgeOnResponseHeaders) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsFastedgeOnResponseHeaders) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsFastedgeOnResponseHeaders) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsFetchCompressed ¶
type RuleTemplateNewParamsOptionsFetchCompressed struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Makes the CDN request compressed content from the origin.
The origin server should support compression. CDN servers will not decompress your content even if a user browser does not accept compression.
Notes:
- `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or `slice` options enabled.
- `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If you enable it in CDN resource and want to use `gzipON` and `brotli_compression` in a rule, you have to specify `"fetch_compressed": false` in the rule.
The properties Enabled, Value are required.
func (RuleTemplateNewParamsOptionsFetchCompressed) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsFetchCompressed) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsFetchCompressed) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsFetchCompressed) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsFollowOriginRedirect ¶
type RuleTemplateNewParamsOptionsFollowOriginRedirect struct {
// Redirect status code that the origin server returns.
//
// To serve up to date content to end users, you will need to purge the cache after
// managing the option.
//
// Any of 301, 302, 303, 307, 308.
Codes []int64 `json:"codes,omitzero,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// contains filtered or unexported fields
}
Enables redirection from origin. If the origin server returns a redirect, the option allows the CDN to pull the requested content from the origin server that was returned in the redirect.
The properties Codes, Enabled are required.
func (RuleTemplateNewParamsOptionsFollowOriginRedirect) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsFollowOriginRedirect) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsFollowOriginRedirect) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsFollowOriginRedirect) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsForceReturn ¶
type RuleTemplateNewParamsOptionsForceReturn struct {
// URL for redirection or text.
Body string `json:"body,required"`
// Status code value.
Code int64 `json:"code,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Controls the time at which a custom HTTP response code should be applied. By
// default, a custom HTTP response code is applied at any time.
TimeInterval RuleTemplateNewParamsOptionsForceReturnTimeInterval `json:"time_interval,omitzero"`
// contains filtered or unexported fields
}
Applies custom HTTP response codes for CDN content.
The following codes are reserved by our system and cannot be specified in this option: 408, 444, 477, 494, 495, 496, 497, 499.
The properties Body, Code, Enabled are required.
func (RuleTemplateNewParamsOptionsForceReturn) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsForceReturn) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsForceReturn) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsForceReturn) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsForceReturnTimeInterval ¶
type RuleTemplateNewParamsOptionsForceReturnTimeInterval struct {
// Time until which a custom HTTP response code should be applied. Indicated in
// 24-hour format.
EndTime string `json:"end_time,required"`
// Time from which a custom HTTP response code should be applied. Indicated in
// 24-hour format.
StartTime string `json:"start_time,required"`
// Time zone used to calculate time.
TimeZone param.Opt[string] `json:"time_zone,omitzero" format:"timezone"`
// contains filtered or unexported fields
}
Controls the time at which a custom HTTP response code should be applied. By default, a custom HTTP response code is applied at any time.
The properties EndTime, StartTime are required.
func (RuleTemplateNewParamsOptionsForceReturnTimeInterval) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsForceReturnTimeInterval) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsForceReturnTimeInterval) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsForceReturnTimeInterval) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsForwardHostHeader ¶
type RuleTemplateNewParamsOptionsForwardHostHeader struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Forwards the Host header from a end-user request to an origin server.
`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (RuleTemplateNewParamsOptionsForwardHostHeader) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsForwardHostHeader) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsForwardHostHeader) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsForwardHostHeader) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsGzipOn ¶
type RuleTemplateNewParamsOptionsGzipOn struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Compresses content with gzip on the CDN end. CDN servers will request only uncompressed content from the origin.
Notes:
- Compression with gzip is not supported with `fetch_compressed` or `slice` options enabled.
- `fetch_compressed` option in CDN resource settings overrides `gzipON` in rules. If you enable `fetch_compressed` in CDN resource and want to enable `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
The properties Enabled, Value are required.
func (RuleTemplateNewParamsOptionsGzipOn) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsGzipOn) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsGzipOn) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsGzipOn) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsHostHeader ¶
type RuleTemplateNewParamsOptionsHostHeader struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Host Header value.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
Sets the Host header that CDN servers use when request content from an origin server. Your server must be able to process requests with the chosen header.
If the option is `null`, the Host Header value is equal to first CNAME.
`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (RuleTemplateNewParamsOptionsHostHeader) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsHostHeader) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsHostHeader) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsHostHeader) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsIPAddressACL ¶
type RuleTemplateNewParamsOptionsIPAddressACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of IP addresses with a subnet mask.
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of IP addresses for which access is prohibited.
// - **deny** - List of IP addresses for which access is allowed.
//
// Examples:
//
// - `192.168.3.2/32`
// - `2a03:d000:2980:7::8/128`
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"ipv4net or ipv6net"`
// IP access policy type.
//
// Possible values:
//
// - **allow** - Allow access to all IPs except IPs specified in "excepted_values"
// field.
// - **deny** - Deny access to all IPs except IPs specified in "excepted_values"
// field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Controls access to the CDN resource content for specific IP addresses.
If you want to use IPs from our CDN servers IP list for IP ACL configuration, you have to independently monitor their relevance. We recommend you use a script for automatically update IP ACL. [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
The properties Enabled, ExceptedValues, PolicyType are required.
func (RuleTemplateNewParamsOptionsIPAddressACL) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsIPAddressACL) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsIPAddressACL) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsIPAddressACL) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsIgnoreCookie ¶
type RuleTemplateNewParamsOptionsIgnoreCookie struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled, files with cookies are cached as one file.
// - **false** - Option is disabled, files with cookies are cached as different
// files.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Defines whether the files with the Set-Cookies header are cached as one file or as different ones.
The properties Enabled, Value are required.
func (RuleTemplateNewParamsOptionsIgnoreCookie) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsIgnoreCookie) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsIgnoreCookie) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsIgnoreCookie) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsIgnoreQueryString ¶
type RuleTemplateNewParamsOptionsIgnoreQueryString struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
How a file with different query strings is cached: either as one object (option is enabled) or as different objects (option is disabled.)
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (RuleTemplateNewParamsOptionsIgnoreQueryString) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsIgnoreQueryString) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsIgnoreQueryString) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsIgnoreQueryString) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsImageStack ¶
type RuleTemplateNewParamsOptionsImageStack struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Enables or disables automatic conversion of JPEG and PNG images to AVI format.
AvifEnabled param.Opt[bool] `json:"avif_enabled,omitzero"`
// Enables or disables compression without quality loss for PNG format.
PngLossless param.Opt[bool] `json:"png_lossless,omitzero"`
// Defines quality settings for JPG and PNG images. The higher the value, the
// better the image quality, and the larger the file size after conversion.
Quality param.Opt[int64] `json:"quality,omitzero"`
// Enables or disables automatic conversion of JPEG and PNG images to WebP format.
WebpEnabled param.Opt[bool] `json:"webp_enabled,omitzero"`
// contains filtered or unexported fields
}
Transforms JPG and PNG images (for example, resize or crop) and automatically converts them to WebP or AVIF format.
The property Enabled is required.
func (RuleTemplateNewParamsOptionsImageStack) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsImageStack) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsImageStack) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsImageStack) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsLimitBandwidth ¶
type RuleTemplateNewParamsOptionsLimitBandwidth struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Method of controlling the download speed per connection.
//
// Possible values:
//
// - **static** - Use speed and buffer fields to set the download speed limit.
// - **dynamic** - Use query strings **speed** and **buffer** to set the download
// speed limit.
//
// # For example, when requesting content at the link
//
// “`
// http://cdn.example.com/video.mp4?speed=50k&buffer=500k
// “`
//
// the download speed will be limited to 50kB/s after 500 kB.
//
// Any of "static", "dynamic".
LimitType string `json:"limit_type,omitzero,required"`
// Amount of downloaded data after which the user will be rate limited.
Buffer param.Opt[int64] `json:"buffer,omitzero"`
// Maximum download speed per connection.
Speed param.Opt[int64] `json:"speed,omitzero"`
// contains filtered or unexported fields
}
Allows to control the download speed per connection.
The properties Enabled, LimitType are required.
func (RuleTemplateNewParamsOptionsLimitBandwidth) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsLimitBandwidth) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsLimitBandwidth) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsLimitBandwidth) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsProxyCacheKey ¶
type RuleTemplateNewParamsOptionsProxyCacheKey struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Key for caching.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
Allows you to modify your cache key. If omitted, the default value is `$request_uri`.
Combine the specified variables to create a key for caching.
- **$`request_uri`** - **$scheme** - **$uri**
**Warning**: Enabling and changing this option can invalidate your current cache and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will not work.
The properties Enabled, Value are required.
func (RuleTemplateNewParamsOptionsProxyCacheKey) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsProxyCacheKey) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsProxyCacheKey) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsProxyCacheKey) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsProxyCacheMethodsSet ¶
type RuleTemplateNewParamsOptionsProxyCacheMethodsSet struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Caching for POST requests along with default GET and HEAD.
The properties Enabled, Value are required.
func (RuleTemplateNewParamsOptionsProxyCacheMethodsSet) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsProxyCacheMethodsSet) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsProxyCacheMethodsSet) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsProxyCacheMethodsSet) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsProxyConnectTimeout ¶
type RuleTemplateNewParamsOptionsProxyConnectTimeout struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Timeout value in seconds.
//
// Supported range: **1s - 5s**.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
The time limit for establishing a connection with the origin.
The properties Enabled, Value are required.
func (RuleTemplateNewParamsOptionsProxyConnectTimeout) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsProxyConnectTimeout) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsProxyConnectTimeout) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsProxyConnectTimeout) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsProxyReadTimeout ¶
type RuleTemplateNewParamsOptionsProxyReadTimeout struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Timeout value in seconds.
//
// Supported range: **1s - 30s**.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
The time limit for receiving a partial response from the origin. If no response is received within this time, the connection will be closed.
**Note:** When used with a WebSocket connection, this option supports values only in the range 1–20 seconds (instead of the usual 1–30 seconds).
The properties Enabled, Value are required.
func (RuleTemplateNewParamsOptionsProxyReadTimeout) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsProxyReadTimeout) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsProxyReadTimeout) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsProxyReadTimeout) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsQueryParamsBlacklist ¶
type RuleTemplateNewParamsOptionsQueryParamsBlacklist struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of query parameters.
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Files with the specified query parameters are cached as one object, files with other parameters are cached as different objects.
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (RuleTemplateNewParamsOptionsQueryParamsBlacklist) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsQueryParamsBlacklist) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsQueryParamsBlacklist) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsQueryParamsBlacklist) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsQueryParamsWhitelist ¶
type RuleTemplateNewParamsOptionsQueryParamsWhitelist struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of query parameters.
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Files with the specified query parameters are cached as different objects, files with other parameters are cached as one object.
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (RuleTemplateNewParamsOptionsQueryParamsWhitelist) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsQueryParamsWhitelist) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsQueryParamsWhitelist) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsQueryParamsWhitelist) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsQueryStringForwarding ¶
type RuleTemplateNewParamsOptionsQueryStringForwarding struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// The `forward_from_files_types` field specifies the types of playlist files from
// which parameters will be extracted and forwarded. This typically includes
// formats that list multiple media chunk references, such as HLS and DASH
// playlists. Parameters associated with these playlist files (like query strings
// or headers) will be propagated to the chunks they reference.
ForwardFromFileTypes []string `json:"forward_from_file_types,omitzero,required"`
// The field specifies the types of media chunk files to which parameters,
// extracted from playlist files, will be forwarded. These refer to the actual
// segments of media content that are delivered to viewers. Ensuring the correct
// parameters are forwarded to these files is crucial for maintaining the integrity
// of the streaming session.
ForwardToFileTypes []string `json:"forward_to_file_types,omitzero,required"`
// The `forward_except_keys` field provides a mechanism to exclude specific
// parameters from being forwarded from playlist files to media chunk files. By
// listing certain keys in this field, you can ensure that these parameters are
// omitted during the forwarding process. This is particularly useful for
// preventing sensitive or irrelevant information from being included in requests
// for media chunks, thereby enhancing security and optimizing performance.
ForwardExceptKeys []string `json:"forward_except_keys,omitzero"`
// The `forward_only_keys` field allows for granular control over which specific
// parameters are forwarded from playlist files to media chunk files. By specifying
// certain keys, only those parameters will be propagated, ensuring that only
// relevant information is passed along. This is particularly useful for security
// and performance optimization, as it prevents unnecessary or sensitive data from
// being included in requests for media chunks.
ForwardOnlyKeys []string `json:"forward_only_keys,omitzero"`
// contains filtered or unexported fields
}
The Query String Forwarding feature allows for the seamless transfer of parameters embedded in playlist files to the corresponding media chunk files. This functionality ensures that specific attributes, such as authentication tokens or tracking information, are consistently passed along from the playlist manifest to the individual media segments. This is particularly useful for maintaining continuity in security, analytics, and any other parameter-based operations across the entire media delivery workflow.
The properties Enabled, ForwardFromFileTypes, ForwardToFileTypes are required.
func (RuleTemplateNewParamsOptionsQueryStringForwarding) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsQueryStringForwarding) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsQueryStringForwarding) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsQueryStringForwarding) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsRedirectHTTPSToHTTP ¶
type RuleTemplateNewParamsOptionsRedirectHTTPSToHTTP struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Enables redirect from HTTPS to HTTP.
`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (RuleTemplateNewParamsOptionsRedirectHTTPSToHTTP) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsRedirectHTTPSToHTTP) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsRedirectHTTPSToHTTP) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsRedirectHTTPSToHTTP) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsRedirectHTTPToHTTPS ¶
type RuleTemplateNewParamsOptionsRedirectHTTPToHTTPS struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Enables redirect from HTTP to HTTPS.
`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (RuleTemplateNewParamsOptionsRedirectHTTPToHTTPS) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsRedirectHTTPToHTTPS) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsRedirectHTTPToHTTPS) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsRedirectHTTPToHTTPS) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsReferrerACL ¶
type RuleTemplateNewParamsOptionsReferrerACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of domain names or wildcard domains (without protocol: `http://` or
// `https://`.)
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of domain names for which access is prohibited.
// - **deny** - List of IP domain names for which access is allowed.
//
// Examples:
//
// - `example.com`
// - `*.example.com`
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"domain or wildcard"`
// Policy type.
//
// Possible values:
//
// - **allow** - Allow access to all domain names except the domain names specified
// in `excepted_values` field.
// - **deny** - Deny access to all domain names except the domain names specified
// in `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Controls access to the CDN resource content for specified domain names.
The properties Enabled, ExceptedValues, PolicyType are required.
func (RuleTemplateNewParamsOptionsReferrerACL) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsReferrerACL) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsReferrerACL) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsReferrerACL) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsRequestLimiter ¶
type RuleTemplateNewParamsOptionsRequestLimiter struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Maximum request rate.
Rate int64 `json:"rate,required"`
// Units of measurement for the `rate` field.
//
// Possible values:
//
// - **r/s** - Requests per second.
// - **r/m** - Requests per minute.
//
// If the rate is less than one request per second, it is specified in request per
// minute (r/m.)
//
// Any of "r/s", "r/m".
RateUnit string `json:"rate_unit,omitzero"`
// contains filtered or unexported fields
}
Option allows to limit the amount of HTTP requests.
The properties Enabled, Rate are required.
func (RuleTemplateNewParamsOptionsRequestLimiter) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsRequestLimiter) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsRequestLimiter) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsRequestLimiter) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsResponseHeadersHidingPolicy ¶
type RuleTemplateNewParamsOptionsResponseHeadersHidingPolicy struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of HTTP headers.
//
// Parameter meaning depends on the value of the `mode` field:
//
// - **show** - List of HTTP headers to hide from response.
// - **hide** - List of HTTP headers to include in response. Other HTTP headers
// will be hidden.
//
// The following headers are required and cannot be hidden from response:
//
// - `Connection`
// - `Content-Length`
// - `Content-Type`
// - `Date`
// - `Server`
Excepted []string `json:"excepted,omitzero,required" format:"http_header"`
// How HTTP headers are hidden from the response.
//
// Possible values:
//
// - **show** - Hide only HTTP headers listed in the `excepted` field.
// - **hide** - Hide all HTTP headers except headers listed in the "excepted"
// field.
//
// Any of "hide", "show".
Mode string `json:"mode,omitzero,required"`
// contains filtered or unexported fields
}
Hides HTTP headers from an origin server in the CDN response.
The properties Enabled, Excepted, Mode are required.
func (RuleTemplateNewParamsOptionsResponseHeadersHidingPolicy) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsResponseHeadersHidingPolicy) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsResponseHeadersHidingPolicy) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsResponseHeadersHidingPolicy) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsRewrite ¶
type RuleTemplateNewParamsOptionsRewrite struct {
// Path for the Rewrite option.
//
// Example:
//
// - `/(.*) /media/$1`
Body string `json:"body,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Flag for the Rewrite option.
//
// Possible values:
//
// - **last** - Stop processing the current set of `ngx_http_rewrite_module`
// directives and start a search for a new location matching changed URI.
// - **break** - Stop processing the current set of the Rewrite option.
// - **redirect** - Return a temporary redirect with the 302 code; used when a
// replacement string does not start with `http://`, `https://`, or `$scheme`.
// - **permanent** - Return a permanent redirect with the 301 code.
//
// Any of "break", "last", "redirect", "permanent".
Flag string `json:"flag,omitzero"`
// contains filtered or unexported fields
}
Changes and redirects requests from the CDN to the origin. It operates according to the [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite) configuration.
The properties Body, Enabled are required.
func (RuleTemplateNewParamsOptionsRewrite) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsRewrite) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsRewrite) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsRewrite) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsSecureKey ¶
type RuleTemplateNewParamsOptionsSecureKey struct {
// Key generated on your side that will be used for URL signing.
Key param.Opt[string] `json:"key,omitzero,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Type of URL signing.
//
// Possible types:
//
// - **Type 0** - Includes end user IP to secure token generation.
// - **Type 2** - Excludes end user IP from secure token generation.
//
// Any of 0, 2.
Type int64 `json:"type,omitzero"`
// contains filtered or unexported fields
}
Configures access with tokenized URLs. This makes impossible to access content without a valid (unexpired) token.
The properties Enabled, Key are required.
func (RuleTemplateNewParamsOptionsSecureKey) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsSecureKey) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsSecureKey) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsSecureKey) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsSlice ¶
type RuleTemplateNewParamsOptionsSlice struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Requests and caches files larger than 10 MB in parts (no larger than 10 MB per part.) This reduces time to first byte.
The option is based on the [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
Notes:
- Origin must support HTTP Range requests.
- Not supported with `gzipON`, `brotli_compression` or `fetch_compressed` options enabled.
The properties Enabled, Value are required.
func (RuleTemplateNewParamsOptionsSlice) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsSlice) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsSlice) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsSlice) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsSni ¶
type RuleTemplateNewParamsOptionsSni struct {
// Custom SNI hostname.
//
// It is required if `sni_type` is set to custom.
CustomHostname string `json:"custom_hostname,required" format:"domain"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// SNI (Server Name Indication) type.
//
// Possible values:
//
// - **dynamic** - SNI hostname depends on `hostHeader` and `forward_host_header`
// options. It has several possible combinations:
// - If the `hostHeader` option is enabled and specified, SNI hostname matches the
// Host header.
// - If the `forward_host_header` option is enabled and has true value, SNI
// hostname matches the Host header used in the request made to a CDN.
// - If the `hostHeader` and `forward_host_header` options are disabled, SNI
// hostname matches the primary CNAME.
// - **custom** - custom SNI hostname is in use.
//
// Any of "dynamic", "custom".
SniType string `json:"sni_type,omitzero"`
// contains filtered or unexported fields
}
The hostname that is added to SNI requests from CDN servers to the origin server via HTTPS.
SNI is generally only required if your origin uses shared hosting or does not have a dedicated IP address. If the origin server presents multiple certificates, SNI allows the origin server to know which certificate to use for the connection.
The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
The properties CustomHostname, Enabled are required.
func (RuleTemplateNewParamsOptionsSni) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsSni) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsSni) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsSni) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsStale ¶
type RuleTemplateNewParamsOptionsStale struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Defines list of errors for which "Always online" option is applied.
//
// Any of "error", "http_403", "http_404", "http_429", "http_500", "http_502",
// "http_503", "http_504", "invalid_header", "timeout", "updating".
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Serves stale cached content in case of origin unavailability.
The properties Enabled, Value are required.
func (RuleTemplateNewParamsOptionsStale) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsStale) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsStale) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsStale) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsStaticHeaders
deprecated
type RuleTemplateNewParamsOptionsStaticHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// A MAP for static headers in a format of `header_name: header_value`.
//
// Restrictions:
//
// - **Header name** - Maximum 128 symbols, may contain Latin letters (A-Z, a-z),
// numbers (0-9), dashes, and underscores.
// - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
// (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
// with a letter, number, asterisk or {.
Value any `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
**Legacy option**. Use the `static_response_headers` option instead.
Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP Headers can be specified. May contain a header with multiple values.
Deprecated: deprecated
The properties Enabled, Value are required.
func (RuleTemplateNewParamsOptionsStaticHeaders) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsStaticHeaders) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsStaticHeaders) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsStaticHeaders) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsStaticRequestHeaders ¶
type RuleTemplateNewParamsOptionsStaticRequestHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// A MAP for static headers in a format of `header_name: header_value`.
//
// Restrictions:
//
// - **Header name** - Maximum 255 symbols, may contain Latin letters (A-Z, a-z),
// numbers (0-9), dashes, and underscores.
// - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
// (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
// with a letter, number, asterisk or {.
Value map[string]string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP Headers can be specified.
The properties Enabled, Value are required.
func (RuleTemplateNewParamsOptionsStaticRequestHeaders) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsStaticRequestHeaders) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsStaticRequestHeaders) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsStaticRequestHeaders) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsStaticResponseHeaders ¶
type RuleTemplateNewParamsOptionsStaticResponseHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
Value []RuleTemplateNewParamsOptionsStaticResponseHeadersValue `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Custom HTTP Headers that a CDN server adds to a response.
The properties Enabled, Value are required.
func (RuleTemplateNewParamsOptionsStaticResponseHeaders) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsStaticResponseHeaders) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsStaticResponseHeaders) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsStaticResponseHeaders) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsStaticResponseHeadersValue ¶
type RuleTemplateNewParamsOptionsStaticResponseHeadersValue struct {
// HTTP Header name.
//
// Restrictions:
//
// - Maximum 128 symbols.
// - Latin letters (A-Z, a-z,) numbers (0-9,) dashes, and underscores only.
Name string `json:"name,required"`
// Header value.
//
// Restrictions:
//
// - Maximum 512 symbols.
// - Letters (a-z), numbers (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+
// /|\";:?.,><{}[]).
// - Must start with a letter, number, asterisk or {.
// - Multiple values can be added.
Value []string `json:"value,omitzero,required"`
// Defines whether the header will be added to a response from CDN regardless of
// response code.
//
// Possible values:
//
// - **true** - Header will be added to a response from CDN regardless of response
// code.
// - **false** - Header will be added only to the following response codes: 200,
// 201, 204, 206, 301, 302, 303, 304, 307, 308.
Always param.Opt[bool] `json:"always,omitzero"`
// contains filtered or unexported fields
}
The properties Name, Value are required.
func (RuleTemplateNewParamsOptionsStaticResponseHeadersValue) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsStaticResponseHeadersValue) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsStaticResponseHeadersValue) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsStaticResponseHeadersValue) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsUserAgentACL ¶
type RuleTemplateNewParamsOptionsUserAgentACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of User-Agents that will be allowed/denied.
//
// The meaning of the parameter depends on `policy_type`:
//
// - **allow** - List of User-Agents for which access is prohibited.
// - **deny** - List of User-Agents for which access is allowed.
//
// Use an empty string `""` to allow/deny access when the User-Agent header is
// empty.
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"user_agent"`
// User-Agents policy type.
//
// Possible values:
//
// - **allow** - Allow access for all User-Agents except specified in
// `excepted_values` field.
// - **deny** - Deny access for all User-Agents except specified in
// `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Controls access to the content for specified User-Agents.
The properties Enabled, ExceptedValues, PolicyType are required.
func (RuleTemplateNewParamsOptionsUserAgentACL) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsUserAgentACL) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsUserAgentACL) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsUserAgentACL) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsWaap ¶
type RuleTemplateNewParamsOptionsWaap struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Allows to enable WAAP (Web Application and API Protection).
The properties Enabled, Value are required.
func (RuleTemplateNewParamsOptionsWaap) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsWaap) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsWaap) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsWaap) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOptionsWebsockets ¶
type RuleTemplateNewParamsOptionsWebsockets struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Enables or disables WebSockets connections to an origin server.
The properties Enabled, Value are required.
func (RuleTemplateNewParamsOptionsWebsockets) MarshalJSON ¶
func (r RuleTemplateNewParamsOptionsWebsockets) MarshalJSON() (data []byte, err error)
func (*RuleTemplateNewParamsOptionsWebsockets) UnmarshalJSON ¶
func (r *RuleTemplateNewParamsOptionsWebsockets) UnmarshalJSON(data []byte) error
type RuleTemplateNewParamsOverrideOriginProtocol ¶
type RuleTemplateNewParamsOverrideOriginProtocol string
Sets a protocol other than the one specified in the CDN resource settings to connect to the origin.
Possible values:
- **HTTPS** - CDN servers connect to origin via HTTPS protocol.
- **HTTP** - CDN servers connect to origin via HTTP protocol.
- **MATCH** - Connection protocol is chosen automatically; in this case, content on origin source should be available for the CDN both through HTTP and HTTPS protocols.
- **null** - `originProtocol` setting is inherited from the CDN resource settings.
const ( RuleTemplateNewParamsOverrideOriginProtocolHTTPS RuleTemplateNewParamsOverrideOriginProtocol = "HTTPS" RuleTemplateNewParamsOverrideOriginProtocolHTTP RuleTemplateNewParamsOverrideOriginProtocol = "HTTP" RuleTemplateNewParamsOverrideOriginProtocolMatch RuleTemplateNewParamsOverrideOriginProtocol = "MATCH" )
type RuleTemplateOptions ¶
type RuleTemplateOptions struct {
// HTTP methods allowed for content requests from the CDN.
AllowedHTTPMethods RuleTemplateOptionsAllowedHTTPMethods `json:"allowedHttpMethods,nullable"`
// Allows to prevent online services from overloading and ensure your business
// workflow running smoothly.
BotProtection RuleTemplateOptionsBotProtection `json:"bot_protection,nullable"`
// Compresses content with Brotli on the CDN side. CDN servers will request only
// uncompressed content from the origin.
//
// Notes:
//
// 1. CDN only supports "Brotli compression" when the "origin shielding" feature is
// activated.
// 2. If a precache server is not active for a CDN resource, no compression occurs,
// even if the option is enabled.
// 3. `brotli_compression` is not supported with `fetch_compressed` or `slice`
// options enabled.
// 4. `fetch_compressed` option in CDN resource settings overrides
// `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN
// resource and want to enable `brotli_compression` in a rule, you must specify
// `fetch_compressed:false` in the rule.
BrotliCompression RuleTemplateOptionsBrotliCompression `json:"brotli_compression,nullable"`
// Cache expiration time for users browsers in seconds.
//
// Cache expiration time is applied to the following response codes: 200, 201, 204,
// 206, 301, 302, 303, 304, 307, 308.
//
// Responses with other codes will not be cached.
BrowserCacheSettings RuleTemplateOptionsBrowserCacheSettings `json:"browser_cache_settings,nullable"`
// **Legacy option**. Use the `response_headers_hiding_policy` option instead.
//
// HTTP Headers that must be included in the response.
//
// Deprecated: deprecated
CacheHTTPHeaders RuleTemplateOptionsCacheHTTPHeaders `json:"cache_http_headers,nullable"`
// Enables or disables CORS (Cross-Origin Resource Sharing) header support.
//
// CORS header support allows the CDN to add the Access-Control-Allow-Origin header
// to a response to a browser.
Cors RuleTemplateOptionsCors `json:"cors,nullable"`
// Enables control access to content for specified countries.
CountryACL RuleTemplateOptionsCountryACL `json:"country_acl,nullable"`
// **Legacy option**. Use the `edge_cache_settings` option instead.
//
// Allows the complete disabling of content caching.
//
// Deprecated: deprecated
DisableCache RuleTemplateOptionsDisableCache `json:"disable_cache,nullable"`
// Allows 206 responses regardless of the settings of an origin source.
DisableProxyForceRanges RuleTemplateOptionsDisableProxyForceRanges `json:"disable_proxy_force_ranges,nullable"`
// Cache expiration time for CDN servers.
//
// `value` and `default` fields cannot be used simultaneously.
EdgeCacheSettings RuleTemplateOptionsEdgeCacheSettings `json:"edge_cache_settings,nullable"`
// Allows to configure FastEdge app to be called on different request/response
// phases.
//
// Note: At least one of `on_request_headers`, `on_request_body`,
// `on_response_headers`, or `on_response_body` must be specified.
Fastedge RuleTemplateOptionsFastedge `json:"fastedge,nullable"`
// Makes the CDN request compressed content from the origin.
//
// The origin server should support compression. CDN servers will not decompress
// your content even if a user browser does not accept compression.
//
// Notes:
//
// 1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or
// `slice` options enabled.
// 2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If
// you enable it in CDN resource and want to use `gzipON` and
// `brotli_compression` in a rule, you have to specify
// `"fetch_compressed": false` in the rule.
FetchCompressed RuleTemplateOptionsFetchCompressed `json:"fetch_compressed,nullable"`
// Enables redirection from origin. If the origin server returns a redirect, the
// option allows the CDN to pull the requested content from the origin server that
// was returned in the redirect.
FollowOriginRedirect RuleTemplateOptionsFollowOriginRedirect `json:"follow_origin_redirect,nullable"`
// Applies custom HTTP response codes for CDN content.
//
// The following codes are reserved by our system and cannot be specified in this
// option: 408, 444, 477, 494, 495, 496, 497, 499.
ForceReturn RuleTemplateOptionsForceReturn `json:"force_return,nullable"`
// Forwards the Host header from a end-user request to an origin server.
//
// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
ForwardHostHeader RuleTemplateOptionsForwardHostHeader `json:"forward_host_header,nullable"`
// Compresses content with gzip on the CDN end. CDN servers will request only
// uncompressed content from the origin.
//
// Notes:
//
// 1. Compression with gzip is not supported with `fetch_compressed` or `slice`
// options enabled.
// 2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in
// rules. If you enable `fetch_compressed` in CDN resource and want to enable
// `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
GzipOn RuleTemplateOptionsGzipOn `json:"gzipOn,nullable"`
// Sets the Host header that CDN servers use when request content from an origin
// server. Your server must be able to process requests with the chosen header.
//
// If the option is `null`, the Host Header value is equal to first CNAME.
//
// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
HostHeader RuleTemplateOptionsHostHeader `json:"hostHeader,nullable"`
// Defines whether the files with the Set-Cookies header are cached as one file or
// as different ones.
IgnoreCookie RuleTemplateOptionsIgnoreCookie `json:"ignore_cookie,nullable"`
// How a file with different query strings is cached: either as one object (option
// is enabled) or as different objects (option is disabled.)
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
IgnoreQueryString RuleTemplateOptionsIgnoreQueryString `json:"ignoreQueryString,nullable"`
// Transforms JPG and PNG images (for example, resize or crop) and automatically
// converts them to WebP or AVIF format.
ImageStack RuleTemplateOptionsImageStack `json:"image_stack,nullable"`
// Controls access to the CDN resource content for specific IP addresses.
//
// If you want to use IPs from our CDN servers IP list for IP ACL configuration,
// you have to independently monitor their relevance. We recommend you use a script
// for automatically update IP ACL.
// [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
IPAddressACL RuleTemplateOptionsIPAddressACL `json:"ip_address_acl,nullable"`
// Allows to control the download speed per connection.
LimitBandwidth RuleTemplateOptionsLimitBandwidth `json:"limit_bandwidth,nullable"`
// Allows you to modify your cache key. If omitted, the default value is
// `$request_uri`.
//
// Combine the specified variables to create a key for caching.
//
// - **$`request_uri`**
// - **$scheme**
// - **$uri**
//
// **Warning**: Enabling and changing this option can invalidate your current cache
// and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will
// not work.
ProxyCacheKey RuleTemplateOptionsProxyCacheKey `json:"proxy_cache_key,nullable"`
// Caching for POST requests along with default GET and HEAD.
ProxyCacheMethodsSet RuleTemplateOptionsProxyCacheMethodsSet `json:"proxy_cache_methods_set,nullable"`
// The time limit for establishing a connection with the origin.
ProxyConnectTimeout RuleTemplateOptionsProxyConnectTimeout `json:"proxy_connect_timeout,nullable"`
// The time limit for receiving a partial response from the origin. If no response
// is received within this time, the connection will be closed.
//
// **Note:** When used with a WebSocket connection, this option supports values
// only in the range 1–20 seconds (instead of the usual 1–30 seconds).
ProxyReadTimeout RuleTemplateOptionsProxyReadTimeout `json:"proxy_read_timeout,nullable"`
// Files with the specified query parameters are cached as one object, files with
// other parameters are cached as different objects.
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
QueryParamsBlacklist RuleTemplateOptionsQueryParamsBlacklist `json:"query_params_blacklist,nullable"`
// Files with the specified query parameters are cached as different objects, files
// with other parameters are cached as one object.
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
QueryParamsWhitelist RuleTemplateOptionsQueryParamsWhitelist `json:"query_params_whitelist,nullable"`
// The Query String Forwarding feature allows for the seamless transfer of
// parameters embedded in playlist files to the corresponding media chunk files.
// This functionality ensures that specific attributes, such as authentication
// tokens or tracking information, are consistently passed along from the playlist
// manifest to the individual media segments. This is particularly useful for
// maintaining continuity in security, analytics, and any other parameter-based
// operations across the entire media delivery workflow.
QueryStringForwarding RuleTemplateOptionsQueryStringForwarding `json:"query_string_forwarding,nullable"`
// Enables redirect from HTTP to HTTPS.
//
// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
// simultaneously.
RedirectHTTPToHTTPS RuleTemplateOptionsRedirectHTTPToHTTPS `json:"redirect_http_to_https,nullable"`
// Enables redirect from HTTPS to HTTP.
//
// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
// simultaneously.
RedirectHTTPSToHTTP RuleTemplateOptionsRedirectHTTPSToHTTP `json:"redirect_https_to_http,nullable"`
// Controls access to the CDN resource content for specified domain names.
ReferrerACL RuleTemplateOptionsReferrerACL `json:"referrer_acl,nullable"`
// Option allows to limit the amount of HTTP requests.
RequestLimiter RuleTemplateOptionsRequestLimiter `json:"request_limiter,nullable"`
// Hides HTTP headers from an origin server in the CDN response.
ResponseHeadersHidingPolicy RuleTemplateOptionsResponseHeadersHidingPolicy `json:"response_headers_hiding_policy,nullable"`
// Changes and redirects requests from the CDN to the origin. It operates according
// to the
// [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite)
// configuration.
Rewrite RuleTemplateOptionsRewrite `json:"rewrite,nullable"`
// Configures access with tokenized URLs. This makes impossible to access content
// without a valid (unexpired) token.
SecureKey RuleTemplateOptionsSecureKey `json:"secure_key,nullable"`
// Requests and caches files larger than 10 MB in parts (no larger than 10 MB per
// part.) This reduces time to first byte.
//
// The option is based on the
// [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
//
// Notes:
//
// 1. Origin must support HTTP Range requests.
// 2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed`
// options enabled.
Slice RuleTemplateOptionsSlice `json:"slice,nullable"`
// The hostname that is added to SNI requests from CDN servers to the origin server
// via HTTPS.
//
// SNI is generally only required if your origin uses shared hosting or does not
// have a dedicated IP address. If the origin server presents multiple
// certificates, SNI allows the origin server to know which certificate to use for
// the connection.
//
// The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
Sni RuleTemplateOptionsSni `json:"sni,nullable"`
// Serves stale cached content in case of origin unavailability.
Stale RuleTemplateOptionsStale `json:"stale,nullable"`
// Custom HTTP Headers that a CDN server adds to a response.
StaticResponseHeaders RuleTemplateOptionsStaticResponseHeaders `json:"static_response_headers,nullable"`
// **Legacy option**. Use the `static_response_headers` option instead.
//
// Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP
// Headers can be specified. May contain a header with multiple values.
//
// Deprecated: deprecated
StaticHeaders RuleTemplateOptionsStaticHeaders `json:"staticHeaders,nullable"`
// Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP
// Headers can be specified.
StaticRequestHeaders RuleTemplateOptionsStaticRequestHeaders `json:"staticRequestHeaders,nullable"`
// Controls access to the content for specified User-Agents.
UserAgentACL RuleTemplateOptionsUserAgentACL `json:"user_agent_acl,nullable"`
// Allows to enable WAAP (Web Application and API Protection).
Waap RuleTemplateOptionsWaap `json:"waap,nullable"`
// Enables or disables WebSockets connections to an origin server.
Websockets RuleTemplateOptionsWebsockets `json:"websockets,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AllowedHTTPMethods respjson.Field
BotProtection respjson.Field
BrotliCompression respjson.Field
BrowserCacheSettings respjson.Field
CacheHTTPHeaders respjson.Field
Cors respjson.Field
CountryACL respjson.Field
DisableCache respjson.Field
DisableProxyForceRanges respjson.Field
EdgeCacheSettings respjson.Field
Fastedge respjson.Field
FetchCompressed respjson.Field
FollowOriginRedirect respjson.Field
ForceReturn respjson.Field
ForwardHostHeader respjson.Field
GzipOn respjson.Field
HostHeader respjson.Field
IgnoreCookie respjson.Field
IgnoreQueryString respjson.Field
ImageStack respjson.Field
IPAddressACL respjson.Field
LimitBandwidth respjson.Field
ProxyCacheKey respjson.Field
ProxyCacheMethodsSet respjson.Field
ProxyConnectTimeout respjson.Field
ProxyReadTimeout respjson.Field
QueryParamsBlacklist respjson.Field
QueryParamsWhitelist respjson.Field
QueryStringForwarding respjson.Field
RedirectHTTPToHTTPS respjson.Field
RedirectHTTPSToHTTP respjson.Field
ReferrerACL respjson.Field
RequestLimiter respjson.Field
ResponseHeadersHidingPolicy respjson.Field
Rewrite respjson.Field
SecureKey respjson.Field
Slice respjson.Field
Sni respjson.Field
Stale respjson.Field
StaticResponseHeaders respjson.Field
StaticHeaders respjson.Field
StaticRequestHeaders respjson.Field
UserAgentACL respjson.Field
Waap respjson.Field
Websockets respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
List of options that can be configured for the rule.
In case of `null` value the option is not added to the rule. Option inherits its value from the CDN resource settings.
func (RuleTemplateOptions) RawJSON ¶
func (r RuleTemplateOptions) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptions) UnmarshalJSON ¶
func (r *RuleTemplateOptions) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsAllowedHTTPMethods ¶
type RuleTemplateOptionsAllowedHTTPMethods struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
Value []string `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
HTTP methods allowed for content requests from the CDN.
func (RuleTemplateOptionsAllowedHTTPMethods) RawJSON ¶
func (r RuleTemplateOptionsAllowedHTTPMethods) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsAllowedHTTPMethods) UnmarshalJSON ¶
func (r *RuleTemplateOptionsAllowedHTTPMethods) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsBotProtection ¶
type RuleTemplateOptionsBotProtection struct {
// Controls the bot challenge module state.
BotChallenge RuleTemplateOptionsBotProtectionBotChallenge `json:"bot_challenge,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
BotChallenge respjson.Field
Enabled respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Allows to prevent online services from overloading and ensure your business workflow running smoothly.
func (RuleTemplateOptionsBotProtection) RawJSON ¶
func (r RuleTemplateOptionsBotProtection) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsBotProtection) UnmarshalJSON ¶
func (r *RuleTemplateOptionsBotProtection) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsBotProtectionBotChallenge ¶
type RuleTemplateOptionsBotProtectionBotChallenge struct {
// Possible values:
//
// - **true** - Bot challenge is enabled.
// - **false** - Bot challenge is disabled.
Enabled bool `json:"enabled"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Controls the bot challenge module state.
func (RuleTemplateOptionsBotProtectionBotChallenge) RawJSON ¶
func (r RuleTemplateOptionsBotProtectionBotChallenge) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsBotProtectionBotChallenge) UnmarshalJSON ¶
func (r *RuleTemplateOptionsBotProtectionBotChallenge) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsBrotliCompression ¶
type RuleTemplateOptionsBrotliCompression struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Allows to select the content types you want to compress.
//
// `text/html` is a mandatory content type.
//
// Any of "application/javascript", "application/json",
// "application/vnd.ms-fontobject", "application/wasm", "application/x-font-ttf",
// "application/x-javascript", "application/xml", "application/xml+rss",
// "image/svg+xml", "image/x-icon", "text/css", "text/html", "text/javascript",
// "text/plain", "text/xml".
Value []string `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Compresses content with Brotli on the CDN side. CDN servers will request only uncompressed content from the origin.
Notes:
- CDN only supports "Brotli compression" when the "origin shielding" feature is activated.
- If a precache server is not active for a CDN resource, no compression occurs, even if the option is enabled.
- `brotli_compression` is not supported with `fetch_compressed` or `slice` options enabled.
- `fetch_compressed` option in CDN resource settings overrides `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN resource and want to enable `brotli_compression` in a rule, you must specify `fetch_compressed:false` in the rule.
func (RuleTemplateOptionsBrotliCompression) RawJSON ¶
func (r RuleTemplateOptionsBrotliCompression) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsBrotliCompression) UnmarshalJSON ¶
func (r *RuleTemplateOptionsBrotliCompression) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsBrowserCacheSettings ¶
type RuleTemplateOptionsBrowserCacheSettings struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Set the cache expiration time to '0s' to disable caching.
//
// The maximum duration is any equivalent to `1y`.
Value string `json:"value,required" format:"nginx time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Cache expiration time for users browsers in seconds.
Cache expiration time is applied to the following response codes: 200, 201, 204, 206, 301, 302, 303, 304, 307, 308.
Responses with other codes will not be cached.
func (RuleTemplateOptionsBrowserCacheSettings) RawJSON ¶
func (r RuleTemplateOptionsBrowserCacheSettings) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsBrowserCacheSettings) UnmarshalJSON ¶
func (r *RuleTemplateOptionsBrowserCacheSettings) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsCacheHTTPHeaders
deprecated
type RuleTemplateOptionsCacheHTTPHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
Value []string `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
**Legacy option**. Use the `response_headers_hiding_policy` option instead.
HTTP Headers that must be included in the response.
Deprecated: deprecated
func (RuleTemplateOptionsCacheHTTPHeaders) RawJSON ¶
func (r RuleTemplateOptionsCacheHTTPHeaders) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsCacheHTTPHeaders) UnmarshalJSON ¶
func (r *RuleTemplateOptionsCacheHTTPHeaders) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsCors ¶
type RuleTemplateOptionsCors struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Value of the Access-Control-Allow-Origin header.
//
// Possible values:
//
// - **Adds \* as the Access-Control-Allow-Origin header value** - Content will be
// uploaded for requests from any domain. `"value": ["*"]`
// - **Adds "$http_origin" as the Access-Control-Allow-Origin header value if the
// origin matches one of the listed domains** - Content will be uploaded only for
// requests from the domains specified in the field.
// `"value": ["domain.com", "second.dom.com"]`
// - **Adds "$http_origin" as the Access-Control-Allow-Origin header value** -
// Content will be uploaded for requests from any domain, and the domain from
// which the request was sent will be added to the "Access-Control-Allow-Origin"
// header in the response. `"value": ["$http_origin"]`
Value []string `json:"value,required"`
// Defines whether the Access-Control-Allow-Origin header should be added to a
// response from CDN regardless of response code.
//
// Possible values:
//
// - **true** - Header will be added to a response regardless of response code.
// - **false** - Header will only be added to responses with codes: 200, 201, 204,
// 206, 301, 302, 303, 304, 307, 308.
Always bool `json:"always"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
Always respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Enables or disables CORS (Cross-Origin Resource Sharing) header support.
CORS header support allows the CDN to add the Access-Control-Allow-Origin header to a response to a browser.
func (RuleTemplateOptionsCors) RawJSON ¶
func (r RuleTemplateOptionsCors) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsCors) UnmarshalJSON ¶
func (r *RuleTemplateOptionsCors) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsCountryACL ¶
type RuleTemplateOptionsCountryACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of countries according to ISO-3166-1.
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of countries for which access is prohibited.
// - **deny** - List of countries for which access is allowed.
ExceptedValues []string `json:"excepted_values,required" format:"country-code"`
// Defines the type of CDN resource access policy.
//
// Possible values:
//
// - **allow** - Access is allowed for all the countries except for those specified
// in `excepted_values` field.
// - **deny** - Access is denied for all the countries except for those specified
// in `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
ExceptedValues respjson.Field
PolicyType respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Enables control access to content for specified countries.
func (RuleTemplateOptionsCountryACL) RawJSON ¶
func (r RuleTemplateOptionsCountryACL) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsCountryACL) UnmarshalJSON ¶
func (r *RuleTemplateOptionsCountryACL) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsDisableCache
deprecated
type RuleTemplateOptionsDisableCache struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - content caching is disabled.
// - **false** - content caching is enabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
**Legacy option**. Use the `edge_cache_settings` option instead.
Allows the complete disabling of content caching.
Deprecated: deprecated
func (RuleTemplateOptionsDisableCache) RawJSON ¶
func (r RuleTemplateOptionsDisableCache) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsDisableCache) UnmarshalJSON ¶
func (r *RuleTemplateOptionsDisableCache) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsDisableProxyForceRanges ¶
type RuleTemplateOptionsDisableProxyForceRanges struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Allows 206 responses regardless of the settings of an origin source.
func (RuleTemplateOptionsDisableProxyForceRanges) RawJSON ¶
func (r RuleTemplateOptionsDisableProxyForceRanges) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsDisableProxyForceRanges) UnmarshalJSON ¶
func (r *RuleTemplateOptionsDisableProxyForceRanges) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsEdgeCacheSettings ¶
type RuleTemplateOptionsEdgeCacheSettings struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// A MAP object representing the caching time in seconds for a response with a
// specific response code.
//
// These settings have a higher priority than the `value` field.
//
// - Use `any` key to specify caching time for all response codes.
// - Use `0s` value to disable caching for a specific response code.
CustomValues map[string]string `json:"custom_values" format:"nginx time"`
// Enables content caching according to the origin cache settings.
//
// The value is applied to the following response codes 200, 201, 204, 206, 301,
// 302, 303, 304, 307, 308, if an origin server does not have caching HTTP headers.
//
// Responses with other codes will not be cached.
//
// The maximum duration is any equivalent to `1y`.
Default string `json:"default" format:"nginx time"`
// Caching time.
//
// The value is applied to the following response codes: 200, 206, 301, 302.
// Responses with codes 4xx, 5xx will not be cached.
//
// Use `0s` to disable caching.
//
// The maximum duration is any equivalent to `1y`.
Value string `json:"value" format:"nginx time"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
CustomValues respjson.Field
Default respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Cache expiration time for CDN servers.
`value` and `default` fields cannot be used simultaneously.
func (RuleTemplateOptionsEdgeCacheSettings) RawJSON ¶
func (r RuleTemplateOptionsEdgeCacheSettings) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsEdgeCacheSettings) UnmarshalJSON ¶
func (r *RuleTemplateOptionsEdgeCacheSettings) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsFastedge ¶
type RuleTemplateOptionsFastedge struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Allows to configure FastEdge application that will be called to handle request
// body as soon as CDN receives incoming HTTP request.
OnRequestBody RuleTemplateOptionsFastedgeOnRequestBody `json:"on_request_body"`
// Allows to configure FastEdge application that will be called to handle request
// headers as soon as CDN receives incoming HTTP request.
OnRequestHeaders RuleTemplateOptionsFastedgeOnRequestHeaders `json:"on_request_headers"`
// Allows to configure FastEdge application that will be called to handle response
// body before CDN sends the HTTP response.
OnResponseBody RuleTemplateOptionsFastedgeOnResponseBody `json:"on_response_body"`
// Allows to configure FastEdge application that will be called to handle response
// headers before CDN sends the HTTP response.
OnResponseHeaders RuleTemplateOptionsFastedgeOnResponseHeaders `json:"on_response_headers"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
OnRequestBody respjson.Field
OnRequestHeaders respjson.Field
OnResponseBody respjson.Field
OnResponseHeaders respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Allows to configure FastEdge app to be called on different request/response phases.
Note: At least one of `on_request_headers`, `on_request_body`, `on_response_headers`, or `on_response_body` must be specified.
func (RuleTemplateOptionsFastedge) RawJSON ¶
func (r RuleTemplateOptionsFastedge) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsFastedge) UnmarshalJSON ¶
func (r *RuleTemplateOptionsFastedge) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsFastedgeOnRequestBody ¶
type RuleTemplateOptionsFastedgeOnRequestBody struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled bool `json:"enabled"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge bool `json:"execute_on_edge"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield bool `json:"execute_on_shield"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError bool `json:"interrupt_on_error"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AppID respjson.Field
Enabled respjson.Field
ExecuteOnEdge respjson.Field
ExecuteOnShield respjson.Field
InterruptOnError respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Allows to configure FastEdge application that will be called to handle request body as soon as CDN receives incoming HTTP request.
func (RuleTemplateOptionsFastedgeOnRequestBody) RawJSON ¶
func (r RuleTemplateOptionsFastedgeOnRequestBody) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsFastedgeOnRequestBody) UnmarshalJSON ¶
func (r *RuleTemplateOptionsFastedgeOnRequestBody) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsFastedgeOnRequestHeaders ¶
type RuleTemplateOptionsFastedgeOnRequestHeaders struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled bool `json:"enabled"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge bool `json:"execute_on_edge"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield bool `json:"execute_on_shield"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError bool `json:"interrupt_on_error"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AppID respjson.Field
Enabled respjson.Field
ExecuteOnEdge respjson.Field
ExecuteOnShield respjson.Field
InterruptOnError respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request.
func (RuleTemplateOptionsFastedgeOnRequestHeaders) RawJSON ¶
func (r RuleTemplateOptionsFastedgeOnRequestHeaders) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsFastedgeOnRequestHeaders) UnmarshalJSON ¶
func (r *RuleTemplateOptionsFastedgeOnRequestHeaders) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsFastedgeOnResponseBody ¶
type RuleTemplateOptionsFastedgeOnResponseBody struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled bool `json:"enabled"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge bool `json:"execute_on_edge"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield bool `json:"execute_on_shield"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError bool `json:"interrupt_on_error"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AppID respjson.Field
Enabled respjson.Field
ExecuteOnEdge respjson.Field
ExecuteOnShield respjson.Field
InterruptOnError respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Allows to configure FastEdge application that will be called to handle response body before CDN sends the HTTP response.
func (RuleTemplateOptionsFastedgeOnResponseBody) RawJSON ¶
func (r RuleTemplateOptionsFastedgeOnResponseBody) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsFastedgeOnResponseBody) UnmarshalJSON ¶
func (r *RuleTemplateOptionsFastedgeOnResponseBody) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsFastedgeOnResponseHeaders ¶
type RuleTemplateOptionsFastedgeOnResponseHeaders struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled bool `json:"enabled"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge bool `json:"execute_on_edge"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield bool `json:"execute_on_shield"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError bool `json:"interrupt_on_error"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
AppID respjson.Field
Enabled respjson.Field
ExecuteOnEdge respjson.Field
ExecuteOnShield respjson.Field
InterruptOnError respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Allows to configure FastEdge application that will be called to handle response headers before CDN sends the HTTP response.
func (RuleTemplateOptionsFastedgeOnResponseHeaders) RawJSON ¶
func (r RuleTemplateOptionsFastedgeOnResponseHeaders) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsFastedgeOnResponseHeaders) UnmarshalJSON ¶
func (r *RuleTemplateOptionsFastedgeOnResponseHeaders) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsFetchCompressed ¶
type RuleTemplateOptionsFetchCompressed struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Makes the CDN request compressed content from the origin.
The origin server should support compression. CDN servers will not decompress your content even if a user browser does not accept compression.
Notes:
- `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or `slice` options enabled.
- `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If you enable it in CDN resource and want to use `gzipON` and `brotli_compression` in a rule, you have to specify `"fetch_compressed": false` in the rule.
func (RuleTemplateOptionsFetchCompressed) RawJSON ¶
func (r RuleTemplateOptionsFetchCompressed) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsFetchCompressed) UnmarshalJSON ¶
func (r *RuleTemplateOptionsFetchCompressed) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsFollowOriginRedirect ¶
type RuleTemplateOptionsFollowOriginRedirect struct {
// Redirect status code that the origin server returns.
//
// To serve up to date content to end users, you will need to purge the cache after
// managing the option.
//
// Any of 301, 302, 303, 307, 308.
Codes []int64 `json:"codes,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Codes respjson.Field
Enabled respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Enables redirection from origin. If the origin server returns a redirect, the option allows the CDN to pull the requested content from the origin server that was returned in the redirect.
func (RuleTemplateOptionsFollowOriginRedirect) RawJSON ¶
func (r RuleTemplateOptionsFollowOriginRedirect) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsFollowOriginRedirect) UnmarshalJSON ¶
func (r *RuleTemplateOptionsFollowOriginRedirect) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsForceReturn ¶
type RuleTemplateOptionsForceReturn struct {
// URL for redirection or text.
Body string `json:"body,required"`
// Status code value.
Code int64 `json:"code,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Controls the time at which a custom HTTP response code should be applied. By
// default, a custom HTTP response code is applied at any time.
TimeInterval RuleTemplateOptionsForceReturnTimeInterval `json:"time_interval,nullable"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Body respjson.Field
Code respjson.Field
Enabled respjson.Field
TimeInterval respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Applies custom HTTP response codes for CDN content.
The following codes are reserved by our system and cannot be specified in this option: 408, 444, 477, 494, 495, 496, 497, 499.
func (RuleTemplateOptionsForceReturn) RawJSON ¶
func (r RuleTemplateOptionsForceReturn) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsForceReturn) UnmarshalJSON ¶
func (r *RuleTemplateOptionsForceReturn) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsForceReturnTimeInterval ¶
type RuleTemplateOptionsForceReturnTimeInterval struct {
// Time until which a custom HTTP response code should be applied. Indicated in
// 24-hour format.
EndTime string `json:"end_time,required"`
// Time from which a custom HTTP response code should be applied. Indicated in
// 24-hour format.
StartTime string `json:"start_time,required"`
// Time zone used to calculate time.
TimeZone string `json:"time_zone" format:"timezone"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
EndTime respjson.Field
StartTime respjson.Field
TimeZone respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Controls the time at which a custom HTTP response code should be applied. By default, a custom HTTP response code is applied at any time.
func (RuleTemplateOptionsForceReturnTimeInterval) RawJSON ¶
func (r RuleTemplateOptionsForceReturnTimeInterval) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsForceReturnTimeInterval) UnmarshalJSON ¶
func (r *RuleTemplateOptionsForceReturnTimeInterval) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsForwardHostHeader ¶
type RuleTemplateOptionsForwardHostHeader struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Forwards the Host header from a end-user request to an origin server.
`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
func (RuleTemplateOptionsForwardHostHeader) RawJSON ¶
func (r RuleTemplateOptionsForwardHostHeader) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsForwardHostHeader) UnmarshalJSON ¶
func (r *RuleTemplateOptionsForwardHostHeader) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsGzipOn ¶
type RuleTemplateOptionsGzipOn struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Compresses content with gzip on the CDN end. CDN servers will request only uncompressed content from the origin.
Notes:
- Compression with gzip is not supported with `fetch_compressed` or `slice` options enabled.
- `fetch_compressed` option in CDN resource settings overrides `gzipON` in rules. If you enable `fetch_compressed` in CDN resource and want to enable `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
func (RuleTemplateOptionsGzipOn) RawJSON ¶
func (r RuleTemplateOptionsGzipOn) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsGzipOn) UnmarshalJSON ¶
func (r *RuleTemplateOptionsGzipOn) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsHostHeader ¶
type RuleTemplateOptionsHostHeader struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Host Header value.
Value string `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Sets the Host header that CDN servers use when request content from an origin server. Your server must be able to process requests with the chosen header.
If the option is `null`, the Host Header value is equal to first CNAME.
`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
func (RuleTemplateOptionsHostHeader) RawJSON ¶
func (r RuleTemplateOptionsHostHeader) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsHostHeader) UnmarshalJSON ¶
func (r *RuleTemplateOptionsHostHeader) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsIPAddressACL ¶
type RuleTemplateOptionsIPAddressACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of IP addresses with a subnet mask.
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of IP addresses for which access is prohibited.
// - **deny** - List of IP addresses for which access is allowed.
//
// Examples:
//
// - `192.168.3.2/32`
// - `2a03:d000:2980:7::8/128`
ExceptedValues []string `json:"excepted_values,required" format:"ipv4net or ipv6net"`
// IP access policy type.
//
// Possible values:
//
// - **allow** - Allow access to all IPs except IPs specified in "excepted_values"
// field.
// - **deny** - Deny access to all IPs except IPs specified in "excepted_values"
// field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
ExceptedValues respjson.Field
PolicyType respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Controls access to the CDN resource content for specific IP addresses.
If you want to use IPs from our CDN servers IP list for IP ACL configuration, you have to independently monitor their relevance. We recommend you use a script for automatically update IP ACL. [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
func (RuleTemplateOptionsIPAddressACL) RawJSON ¶
func (r RuleTemplateOptionsIPAddressACL) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsIPAddressACL) UnmarshalJSON ¶
func (r *RuleTemplateOptionsIPAddressACL) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsIgnoreCookie ¶
type RuleTemplateOptionsIgnoreCookie struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled, files with cookies are cached as one file.
// - **false** - Option is disabled, files with cookies are cached as different
// files.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Defines whether the files with the Set-Cookies header are cached as one file or as different ones.
func (RuleTemplateOptionsIgnoreCookie) RawJSON ¶
func (r RuleTemplateOptionsIgnoreCookie) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsIgnoreCookie) UnmarshalJSON ¶
func (r *RuleTemplateOptionsIgnoreCookie) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsIgnoreQueryString ¶
type RuleTemplateOptionsIgnoreQueryString struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
How a file with different query strings is cached: either as one object (option is enabled) or as different objects (option is disabled.)
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
func (RuleTemplateOptionsIgnoreQueryString) RawJSON ¶
func (r RuleTemplateOptionsIgnoreQueryString) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsIgnoreQueryString) UnmarshalJSON ¶
func (r *RuleTemplateOptionsIgnoreQueryString) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsImageStack ¶
type RuleTemplateOptionsImageStack struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Enables or disables automatic conversion of JPEG and PNG images to AVI format.
AvifEnabled bool `json:"avif_enabled"`
// Enables or disables compression without quality loss for PNG format.
PngLossless bool `json:"png_lossless"`
// Defines quality settings for JPG and PNG images. The higher the value, the
// better the image quality, and the larger the file size after conversion.
Quality int64 `json:"quality"`
// Enables or disables automatic conversion of JPEG and PNG images to WebP format.
WebpEnabled bool `json:"webp_enabled"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
AvifEnabled respjson.Field
PngLossless respjson.Field
Quality respjson.Field
WebpEnabled respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Transforms JPG and PNG images (for example, resize or crop) and automatically converts them to WebP or AVIF format.
func (RuleTemplateOptionsImageStack) RawJSON ¶
func (r RuleTemplateOptionsImageStack) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsImageStack) UnmarshalJSON ¶
func (r *RuleTemplateOptionsImageStack) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsLimitBandwidth ¶
type RuleTemplateOptionsLimitBandwidth struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Method of controlling the download speed per connection.
//
// Possible values:
//
// - **static** - Use speed and buffer fields to set the download speed limit.
// - **dynamic** - Use query strings **speed** and **buffer** to set the download
// speed limit.
//
// # For example, when requesting content at the link
//
// “`
// http://cdn.example.com/video.mp4?speed=50k&buffer=500k
// “`
//
// the download speed will be limited to 50kB/s after 500 kB.
//
// Any of "static", "dynamic".
LimitType string `json:"limit_type,required"`
// Amount of downloaded data after which the user will be rate limited.
Buffer int64 `json:"buffer"`
// Maximum download speed per connection.
Speed int64 `json:"speed"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
LimitType respjson.Field
Buffer respjson.Field
Speed respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Allows to control the download speed per connection.
func (RuleTemplateOptionsLimitBandwidth) RawJSON ¶
func (r RuleTemplateOptionsLimitBandwidth) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsLimitBandwidth) UnmarshalJSON ¶
func (r *RuleTemplateOptionsLimitBandwidth) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsProxyCacheKey ¶
type RuleTemplateOptionsProxyCacheKey struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Key for caching.
Value string `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Allows you to modify your cache key. If omitted, the default value is `$request_uri`.
Combine the specified variables to create a key for caching.
- **$`request_uri`** - **$scheme** - **$uri**
**Warning**: Enabling and changing this option can invalidate your current cache and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will not work.
func (RuleTemplateOptionsProxyCacheKey) RawJSON ¶
func (r RuleTemplateOptionsProxyCacheKey) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsProxyCacheKey) UnmarshalJSON ¶
func (r *RuleTemplateOptionsProxyCacheKey) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsProxyCacheMethodsSet ¶
type RuleTemplateOptionsProxyCacheMethodsSet struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Caching for POST requests along with default GET and HEAD.
func (RuleTemplateOptionsProxyCacheMethodsSet) RawJSON ¶
func (r RuleTemplateOptionsProxyCacheMethodsSet) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsProxyCacheMethodsSet) UnmarshalJSON ¶
func (r *RuleTemplateOptionsProxyCacheMethodsSet) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsProxyConnectTimeout ¶
type RuleTemplateOptionsProxyConnectTimeout struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Timeout value in seconds.
//
// Supported range: **1s - 5s**.
Value string `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The time limit for establishing a connection with the origin.
func (RuleTemplateOptionsProxyConnectTimeout) RawJSON ¶
func (r RuleTemplateOptionsProxyConnectTimeout) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsProxyConnectTimeout) UnmarshalJSON ¶
func (r *RuleTemplateOptionsProxyConnectTimeout) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsProxyReadTimeout ¶
type RuleTemplateOptionsProxyReadTimeout struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Timeout value in seconds.
//
// Supported range: **1s - 30s**.
Value string `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The time limit for receiving a partial response from the origin. If no response is received within this time, the connection will be closed.
**Note:** When used with a WebSocket connection, this option supports values only in the range 1–20 seconds (instead of the usual 1–30 seconds).
func (RuleTemplateOptionsProxyReadTimeout) RawJSON ¶
func (r RuleTemplateOptionsProxyReadTimeout) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsProxyReadTimeout) UnmarshalJSON ¶
func (r *RuleTemplateOptionsProxyReadTimeout) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsQueryParamsBlacklist ¶
type RuleTemplateOptionsQueryParamsBlacklist struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of query parameters.
Value []string `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Files with the specified query parameters are cached as one object, files with other parameters are cached as different objects.
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
func (RuleTemplateOptionsQueryParamsBlacklist) RawJSON ¶
func (r RuleTemplateOptionsQueryParamsBlacklist) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsQueryParamsBlacklist) UnmarshalJSON ¶
func (r *RuleTemplateOptionsQueryParamsBlacklist) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsQueryParamsWhitelist ¶
type RuleTemplateOptionsQueryParamsWhitelist struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of query parameters.
Value []string `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Files with the specified query parameters are cached as different objects, files with other parameters are cached as one object.
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
func (RuleTemplateOptionsQueryParamsWhitelist) RawJSON ¶
func (r RuleTemplateOptionsQueryParamsWhitelist) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsQueryParamsWhitelist) UnmarshalJSON ¶
func (r *RuleTemplateOptionsQueryParamsWhitelist) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsQueryStringForwarding ¶
type RuleTemplateOptionsQueryStringForwarding struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// The `forward_from_files_types` field specifies the types of playlist files from
// which parameters will be extracted and forwarded. This typically includes
// formats that list multiple media chunk references, such as HLS and DASH
// playlists. Parameters associated with these playlist files (like query strings
// or headers) will be propagated to the chunks they reference.
ForwardFromFileTypes []string `json:"forward_from_file_types,required"`
// The field specifies the types of media chunk files to which parameters,
// extracted from playlist files, will be forwarded. These refer to the actual
// segments of media content that are delivered to viewers. Ensuring the correct
// parameters are forwarded to these files is crucial for maintaining the integrity
// of the streaming session.
ForwardToFileTypes []string `json:"forward_to_file_types,required"`
// The `forward_except_keys` field provides a mechanism to exclude specific
// parameters from being forwarded from playlist files to media chunk files. By
// listing certain keys in this field, you can ensure that these parameters are
// omitted during the forwarding process. This is particularly useful for
// preventing sensitive or irrelevant information from being included in requests
// for media chunks, thereby enhancing security and optimizing performance.
ForwardExceptKeys []string `json:"forward_except_keys"`
// The `forward_only_keys` field allows for granular control over which specific
// parameters are forwarded from playlist files to media chunk files. By specifying
// certain keys, only those parameters will be propagated, ensuring that only
// relevant information is passed along. This is particularly useful for security
// and performance optimization, as it prevents unnecessary or sensitive data from
// being included in requests for media chunks.
ForwardOnlyKeys []string `json:"forward_only_keys"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
ForwardFromFileTypes respjson.Field
ForwardToFileTypes respjson.Field
ForwardExceptKeys respjson.Field
ForwardOnlyKeys respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The Query String Forwarding feature allows for the seamless transfer of parameters embedded in playlist files to the corresponding media chunk files. This functionality ensures that specific attributes, such as authentication tokens or tracking information, are consistently passed along from the playlist manifest to the individual media segments. This is particularly useful for maintaining continuity in security, analytics, and any other parameter-based operations across the entire media delivery workflow.
func (RuleTemplateOptionsQueryStringForwarding) RawJSON ¶
func (r RuleTemplateOptionsQueryStringForwarding) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsQueryStringForwarding) UnmarshalJSON ¶
func (r *RuleTemplateOptionsQueryStringForwarding) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsRedirectHTTPSToHTTP ¶
type RuleTemplateOptionsRedirectHTTPSToHTTP struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Enables redirect from HTTPS to HTTP.
`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.
func (RuleTemplateOptionsRedirectHTTPSToHTTP) RawJSON ¶
func (r RuleTemplateOptionsRedirectHTTPSToHTTP) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsRedirectHTTPSToHTTP) UnmarshalJSON ¶
func (r *RuleTemplateOptionsRedirectHTTPSToHTTP) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsRedirectHTTPToHTTPS ¶
type RuleTemplateOptionsRedirectHTTPToHTTPS struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Enables redirect from HTTP to HTTPS.
`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.
func (RuleTemplateOptionsRedirectHTTPToHTTPS) RawJSON ¶
func (r RuleTemplateOptionsRedirectHTTPToHTTPS) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsRedirectHTTPToHTTPS) UnmarshalJSON ¶
func (r *RuleTemplateOptionsRedirectHTTPToHTTPS) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsReferrerACL ¶
type RuleTemplateOptionsReferrerACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of domain names or wildcard domains (without protocol: `http://` or
// `https://`.)
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of domain names for which access is prohibited.
// - **deny** - List of IP domain names for which access is allowed.
//
// Examples:
//
// - `example.com`
// - `*.example.com`
ExceptedValues []string `json:"excepted_values,required" format:"domain or wildcard"`
// Policy type.
//
// Possible values:
//
// - **allow** - Allow access to all domain names except the domain names specified
// in `excepted_values` field.
// - **deny** - Deny access to all domain names except the domain names specified
// in `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
ExceptedValues respjson.Field
PolicyType respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Controls access to the CDN resource content for specified domain names.
func (RuleTemplateOptionsReferrerACL) RawJSON ¶
func (r RuleTemplateOptionsReferrerACL) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsReferrerACL) UnmarshalJSON ¶
func (r *RuleTemplateOptionsReferrerACL) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsRequestLimiter ¶
type RuleTemplateOptionsRequestLimiter struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Maximum request rate.
Rate int64 `json:"rate,required"`
Burst int64 `json:"burst"`
Delay int64 `json:"delay"`
// Units of measurement for the `rate` field.
//
// Possible values:
//
// - **r/s** - Requests per second.
// - **r/m** - Requests per minute.
//
// If the rate is less than one request per second, it is specified in request per
// minute (r/m.)
//
// Any of "r/s", "r/m".
RateUnit string `json:"rate_unit"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Rate respjson.Field
Burst respjson.Field
Delay respjson.Field
RateUnit respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Option allows to limit the amount of HTTP requests.
func (RuleTemplateOptionsRequestLimiter) RawJSON ¶
func (r RuleTemplateOptionsRequestLimiter) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsRequestLimiter) UnmarshalJSON ¶
func (r *RuleTemplateOptionsRequestLimiter) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsResponseHeadersHidingPolicy ¶
type RuleTemplateOptionsResponseHeadersHidingPolicy struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of HTTP headers.
//
// Parameter meaning depends on the value of the `mode` field:
//
// - **show** - List of HTTP headers to hide from response.
// - **hide** - List of HTTP headers to include in response. Other HTTP headers
// will be hidden.
//
// The following headers are required and cannot be hidden from response:
//
// - `Connection`
// - `Content-Length`
// - `Content-Type`
// - `Date`
// - `Server`
Excepted []string `json:"excepted,required" format:"http_header"`
// How HTTP headers are hidden from the response.
//
// Possible values:
//
// - **show** - Hide only HTTP headers listed in the `excepted` field.
// - **hide** - Hide all HTTP headers except headers listed in the "excepted"
// field.
//
// Any of "hide", "show".
Mode string `json:"mode,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Excepted respjson.Field
Mode respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Hides HTTP headers from an origin server in the CDN response.
func (RuleTemplateOptionsResponseHeadersHidingPolicy) RawJSON ¶
func (r RuleTemplateOptionsResponseHeadersHidingPolicy) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsResponseHeadersHidingPolicy) UnmarshalJSON ¶
func (r *RuleTemplateOptionsResponseHeadersHidingPolicy) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsRewrite ¶
type RuleTemplateOptionsRewrite struct {
// Path for the Rewrite option.
//
// Example:
//
// - `/(.*) /media/$1`
Body string `json:"body,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Flag for the Rewrite option.
//
// Possible values:
//
// - **last** - Stop processing the current set of `ngx_http_rewrite_module`
// directives and start a search for a new location matching changed URI.
// - **break** - Stop processing the current set of the Rewrite option.
// - **redirect** - Return a temporary redirect with the 302 code; used when a
// replacement string does not start with `http://`, `https://`, or `$scheme`.
// - **permanent** - Return a permanent redirect with the 301 code.
//
// Any of "break", "last", "redirect", "permanent".
Flag string `json:"flag"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Body respjson.Field
Enabled respjson.Field
Flag respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Changes and redirects requests from the CDN to the origin. It operates according to the [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite) configuration.
func (RuleTemplateOptionsRewrite) RawJSON ¶
func (r RuleTemplateOptionsRewrite) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsRewrite) UnmarshalJSON ¶
func (r *RuleTemplateOptionsRewrite) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsSecureKey ¶
type RuleTemplateOptionsSecureKey struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Key generated on your side that will be used for URL signing.
Key string `json:"key,required"`
// Type of URL signing.
//
// Possible types:
//
// - **Type 0** - Includes end user IP to secure token generation.
// - **Type 2** - Excludes end user IP from secure token generation.
//
// Any of 0, 2.
Type int64 `json:"type"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Key respjson.Field
Type respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Configures access with tokenized URLs. This makes impossible to access content without a valid (unexpired) token.
func (RuleTemplateOptionsSecureKey) RawJSON ¶
func (r RuleTemplateOptionsSecureKey) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsSecureKey) UnmarshalJSON ¶
func (r *RuleTemplateOptionsSecureKey) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsSlice ¶
type RuleTemplateOptionsSlice struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Requests and caches files larger than 10 MB in parts (no larger than 10 MB per part.) This reduces time to first byte.
The option is based on the [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
Notes:
- Origin must support HTTP Range requests.
- Not supported with `gzipON`, `brotli_compression` or `fetch_compressed` options enabled.
func (RuleTemplateOptionsSlice) RawJSON ¶
func (r RuleTemplateOptionsSlice) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsSlice) UnmarshalJSON ¶
func (r *RuleTemplateOptionsSlice) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsSni ¶
type RuleTemplateOptionsSni struct {
// Custom SNI hostname.
//
// It is required if `sni_type` is set to custom.
CustomHostname string `json:"custom_hostname,required" format:"domain"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// SNI (Server Name Indication) type.
//
// Possible values:
//
// - **dynamic** - SNI hostname depends on `hostHeader` and `forward_host_header`
// options. It has several possible combinations:
// - If the `hostHeader` option is enabled and specified, SNI hostname matches the
// Host header.
// - If the `forward_host_header` option is enabled and has true value, SNI
// hostname matches the Host header used in the request made to a CDN.
// - If the `hostHeader` and `forward_host_header` options are disabled, SNI
// hostname matches the primary CNAME.
// - **custom** - custom SNI hostname is in use.
//
// Any of "dynamic", "custom".
SniType string `json:"sni_type"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
CustomHostname respjson.Field
Enabled respjson.Field
SniType respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
The hostname that is added to SNI requests from CDN servers to the origin server via HTTPS.
SNI is generally only required if your origin uses shared hosting or does not have a dedicated IP address. If the origin server presents multiple certificates, SNI allows the origin server to know which certificate to use for the connection.
The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
func (RuleTemplateOptionsSni) RawJSON ¶
func (r RuleTemplateOptionsSni) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsSni) UnmarshalJSON ¶
func (r *RuleTemplateOptionsSni) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsStale ¶
type RuleTemplateOptionsStale struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Defines list of errors for which "Always online" option is applied.
//
// Any of "error", "http_403", "http_404", "http_429", "http_500", "http_502",
// "http_503", "http_504", "invalid_header", "timeout", "updating".
Value []string `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Serves stale cached content in case of origin unavailability.
func (RuleTemplateOptionsStale) RawJSON ¶
func (r RuleTemplateOptionsStale) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsStale) UnmarshalJSON ¶
func (r *RuleTemplateOptionsStale) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsStaticHeaders
deprecated
type RuleTemplateOptionsStaticHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// A MAP for static headers in a format of `header_name: header_value`.
//
// Restrictions:
//
// - **Header name** - Maximum 128 symbols, may contain Latin letters (A-Z, a-z),
// numbers (0-9), dashes, and underscores.
// - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
// (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
// with a letter, number, asterisk or {.
Value any `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
**Legacy option**. Use the `static_response_headers` option instead.
Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP Headers can be specified. May contain a header with multiple values.
Deprecated: deprecated
func (RuleTemplateOptionsStaticHeaders) RawJSON ¶
func (r RuleTemplateOptionsStaticHeaders) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsStaticHeaders) UnmarshalJSON ¶
func (r *RuleTemplateOptionsStaticHeaders) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsStaticRequestHeaders ¶
type RuleTemplateOptionsStaticRequestHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// A MAP for static headers in a format of `header_name: header_value`.
//
// Restrictions:
//
// - **Header name** - Maximum 255 symbols, may contain Latin letters (A-Z, a-z),
// numbers (0-9), dashes, and underscores.
// - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
// (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
// with a letter, number, asterisk or {.
Value map[string]string `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP Headers can be specified.
func (RuleTemplateOptionsStaticRequestHeaders) RawJSON ¶
func (r RuleTemplateOptionsStaticRequestHeaders) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsStaticRequestHeaders) UnmarshalJSON ¶
func (r *RuleTemplateOptionsStaticRequestHeaders) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsStaticResponseHeaders ¶
type RuleTemplateOptionsStaticResponseHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
Value []RuleTemplateOptionsStaticResponseHeadersValue `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Custom HTTP Headers that a CDN server adds to a response.
func (RuleTemplateOptionsStaticResponseHeaders) RawJSON ¶
func (r RuleTemplateOptionsStaticResponseHeaders) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsStaticResponseHeaders) UnmarshalJSON ¶
func (r *RuleTemplateOptionsStaticResponseHeaders) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsStaticResponseHeadersValue ¶
type RuleTemplateOptionsStaticResponseHeadersValue struct {
// HTTP Header name.
//
// Restrictions:
//
// - Maximum 128 symbols.
// - Latin letters (A-Z, a-z,) numbers (0-9,) dashes, and underscores only.
Name string `json:"name,required"`
// Header value.
//
// Restrictions:
//
// - Maximum 512 symbols.
// - Letters (a-z), numbers (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+
// /|\";:?.,><{}[]).
// - Must start with a letter, number, asterisk or {.
// - Multiple values can be added.
Value []string `json:"value,required"`
// Defines whether the header will be added to a response from CDN regardless of
// response code.
//
// Possible values:
//
// - **true** - Header will be added to a response from CDN regardless of response
// code.
// - **false** - Header will be added only to the following response codes: 200,
// 201, 204, 206, 301, 302, 303, 304, 307, 308.
Always bool `json:"always"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Name respjson.Field
Value respjson.Field
Always respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (RuleTemplateOptionsStaticResponseHeadersValue) RawJSON ¶
func (r RuleTemplateOptionsStaticResponseHeadersValue) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsStaticResponseHeadersValue) UnmarshalJSON ¶
func (r *RuleTemplateOptionsStaticResponseHeadersValue) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsUserAgentACL ¶
type RuleTemplateOptionsUserAgentACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of User-Agents that will be allowed/denied.
//
// The meaning of the parameter depends on `policy_type`:
//
// - **allow** - List of User-Agents for which access is prohibited.
// - **deny** - List of User-Agents for which access is allowed.
//
// Use an empty string `""` to allow/deny access when the User-Agent header is
// empty.
ExceptedValues []string `json:"excepted_values,required" format:"user_agent"`
// User-Agents policy type.
//
// Possible values:
//
// - **allow** - Allow access for all User-Agents except specified in
// `excepted_values` field.
// - **deny** - Deny access for all User-Agents except specified in
// `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
ExceptedValues respjson.Field
PolicyType respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Controls access to the content for specified User-Agents.
func (RuleTemplateOptionsUserAgentACL) RawJSON ¶
func (r RuleTemplateOptionsUserAgentACL) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsUserAgentACL) UnmarshalJSON ¶
func (r *RuleTemplateOptionsUserAgentACL) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsWaap ¶
type RuleTemplateOptionsWaap struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Allows to enable WAAP (Web Application and API Protection).
func (RuleTemplateOptionsWaap) RawJSON ¶
func (r RuleTemplateOptionsWaap) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsWaap) UnmarshalJSON ¶
func (r *RuleTemplateOptionsWaap) UnmarshalJSON(data []byte) error
type RuleTemplateOptionsWebsockets ¶
type RuleTemplateOptionsWebsockets struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Enabled respjson.Field
Value respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Enables or disables WebSockets connections to an origin server.
func (RuleTemplateOptionsWebsockets) RawJSON ¶
func (r RuleTemplateOptionsWebsockets) RawJSON() string
Returns the unmodified JSON received from the API
func (*RuleTemplateOptionsWebsockets) UnmarshalJSON ¶
func (r *RuleTemplateOptionsWebsockets) UnmarshalJSON(data []byte) error
type RuleTemplateOverrideOriginProtocol ¶
type RuleTemplateOverrideOriginProtocol string
Sets a protocol other than the one specified in the CDN resource settings to connect to the origin.
Possible values:
- **HTTPS** - CDN servers connect to origin via HTTPS protocol.
- **HTTP** - CDN servers connect to origin via HTTP protocol.
- **MATCH** - Connection protocol is chosen automatically; in this case, content on origin source should be available for the CDN both through HTTP and HTTPS protocols.
- **null** - `originProtocol` setting is inherited from the CDN resource settings.
const ( RuleTemplateOverrideOriginProtocolHTTPS RuleTemplateOverrideOriginProtocol = "HTTPS" RuleTemplateOverrideOriginProtocolHTTP RuleTemplateOverrideOriginProtocol = "HTTP" RuleTemplateOverrideOriginProtocolMatch RuleTemplateOverrideOriginProtocol = "MATCH" )
type RuleTemplateReplaceParams ¶
type RuleTemplateReplaceParams struct {
// Path to the file or folder for which the rule will be applied.
//
// The rule is applied if the requested URI matches the rule path.
//
// We add a leading forward slash to any rule path. Specify a path without a
// forward slash.
Rule string `json:"rule,required"`
// Rule type.
//
// Possible values:
//
// - **Type 0** - Regular expression. Must start with '^/' or '/'.
// - **Type 1** - Regular expression. Note that for this rule type we automatically
// add / to each rule pattern before your regular expression. This type is
// **legacy**, please use Type 0.
RuleType int64 `json:"ruleType,required"`
// Rule template name.
Name param.Opt[string] `json:"name,omitzero"`
// Rule execution order: from lowest (1) to highest.
//
// If requested URI matches multiple rules, the one higher in the order of the
// rules will be applied.
Weight param.Opt[int64] `json:"weight,omitzero"`
// Sets a protocol other than the one specified in the CDN resource settings to
// connect to the origin.
//
// Possible values:
//
// - **HTTPS** - CDN servers connect to origin via HTTPS protocol.
// - **HTTP** - CDN servers connect to origin via HTTP protocol.
// - **MATCH** - Connection protocol is chosen automatically; in this case, content
// on origin source should be available for the CDN both through HTTP and HTTPS
// protocols.
// - **null** - `originProtocol` setting is inherited from the CDN resource
// settings.
//
// Any of "HTTPS", "HTTP", "MATCH".
OverrideOriginProtocol RuleTemplateReplaceParamsOverrideOriginProtocol `json:"overrideOriginProtocol,omitzero"`
// List of options that can be configured for the rule.
//
// In case of `null` value the option is not added to the rule. Option inherits its
// value from the CDN resource settings.
Options RuleTemplateReplaceParamsOptions `json:"options,omitzero"`
// contains filtered or unexported fields
}
func (RuleTemplateReplaceParams) MarshalJSON ¶
func (r RuleTemplateReplaceParams) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParams) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParams) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptions ¶
type RuleTemplateReplaceParamsOptions struct {
// HTTP methods allowed for content requests from the CDN.
AllowedHTTPMethods RuleTemplateReplaceParamsOptionsAllowedHTTPMethods `json:"allowedHttpMethods,omitzero"`
// Allows to prevent online services from overloading and ensure your business
// workflow running smoothly.
BotProtection RuleTemplateReplaceParamsOptionsBotProtection `json:"bot_protection,omitzero"`
// Compresses content with Brotli on the CDN side. CDN servers will request only
// uncompressed content from the origin.
//
// Notes:
//
// 1. CDN only supports "Brotli compression" when the "origin shielding" feature is
// activated.
// 2. If a precache server is not active for a CDN resource, no compression occurs,
// even if the option is enabled.
// 3. `brotli_compression` is not supported with `fetch_compressed` or `slice`
// options enabled.
// 4. `fetch_compressed` option in CDN resource settings overrides
// `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN
// resource and want to enable `brotli_compression` in a rule, you must specify
// `fetch_compressed:false` in the rule.
BrotliCompression RuleTemplateReplaceParamsOptionsBrotliCompression `json:"brotli_compression,omitzero"`
// Cache expiration time for users browsers in seconds.
//
// Cache expiration time is applied to the following response codes: 200, 201, 204,
// 206, 301, 302, 303, 304, 307, 308.
//
// Responses with other codes will not be cached.
BrowserCacheSettings RuleTemplateReplaceParamsOptionsBrowserCacheSettings `json:"browser_cache_settings,omitzero"`
// **Legacy option**. Use the `response_headers_hiding_policy` option instead.
//
// HTTP Headers that must be included in the response.
//
// Deprecated: deprecated
CacheHTTPHeaders RuleTemplateReplaceParamsOptionsCacheHTTPHeaders `json:"cache_http_headers,omitzero"`
// Enables or disables CORS (Cross-Origin Resource Sharing) header support.
//
// CORS header support allows the CDN to add the Access-Control-Allow-Origin header
// to a response to a browser.
Cors RuleTemplateReplaceParamsOptionsCors `json:"cors,omitzero"`
// Enables control access to content for specified countries.
CountryACL RuleTemplateReplaceParamsOptionsCountryACL `json:"country_acl,omitzero"`
// **Legacy option**. Use the `edge_cache_settings` option instead.
//
// Allows the complete disabling of content caching.
//
// Deprecated: deprecated
DisableCache RuleTemplateReplaceParamsOptionsDisableCache `json:"disable_cache,omitzero"`
// Allows 206 responses regardless of the settings of an origin source.
DisableProxyForceRanges RuleTemplateReplaceParamsOptionsDisableProxyForceRanges `json:"disable_proxy_force_ranges,omitzero"`
// Cache expiration time for CDN servers.
//
// `value` and `default` fields cannot be used simultaneously.
EdgeCacheSettings RuleTemplateReplaceParamsOptionsEdgeCacheSettings `json:"edge_cache_settings,omitzero"`
// Allows to configure FastEdge app to be called on different request/response
// phases.
//
// Note: At least one of `on_request_headers`, `on_request_body`,
// `on_response_headers`, or `on_response_body` must be specified.
Fastedge RuleTemplateReplaceParamsOptionsFastedge `json:"fastedge,omitzero"`
// Makes the CDN request compressed content from the origin.
//
// The origin server should support compression. CDN servers will not decompress
// your content even if a user browser does not accept compression.
//
// Notes:
//
// 1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or
// `slice` options enabled.
// 2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If
// you enable it in CDN resource and want to use `gzipON` and
// `brotli_compression` in a rule, you have to specify
// `"fetch_compressed": false` in the rule.
FetchCompressed RuleTemplateReplaceParamsOptionsFetchCompressed `json:"fetch_compressed,omitzero"`
// Enables redirection from origin. If the origin server returns a redirect, the
// option allows the CDN to pull the requested content from the origin server that
// was returned in the redirect.
FollowOriginRedirect RuleTemplateReplaceParamsOptionsFollowOriginRedirect `json:"follow_origin_redirect,omitzero"`
// Applies custom HTTP response codes for CDN content.
//
// The following codes are reserved by our system and cannot be specified in this
// option: 408, 444, 477, 494, 495, 496, 497, 499.
ForceReturn RuleTemplateReplaceParamsOptionsForceReturn `json:"force_return,omitzero"`
// Forwards the Host header from a end-user request to an origin server.
//
// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
ForwardHostHeader RuleTemplateReplaceParamsOptionsForwardHostHeader `json:"forward_host_header,omitzero"`
// Compresses content with gzip on the CDN end. CDN servers will request only
// uncompressed content from the origin.
//
// Notes:
//
// 1. Compression with gzip is not supported with `fetch_compressed` or `slice`
// options enabled.
// 2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in
// rules. If you enable `fetch_compressed` in CDN resource and want to enable
// `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
GzipOn RuleTemplateReplaceParamsOptionsGzipOn `json:"gzipOn,omitzero"`
// Sets the Host header that CDN servers use when request content from an origin
// server. Your server must be able to process requests with the chosen header.
//
// If the option is `null`, the Host Header value is equal to first CNAME.
//
// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
HostHeader RuleTemplateReplaceParamsOptionsHostHeader `json:"hostHeader,omitzero"`
// Defines whether the files with the Set-Cookies header are cached as one file or
// as different ones.
IgnoreCookie RuleTemplateReplaceParamsOptionsIgnoreCookie `json:"ignore_cookie,omitzero"`
// How a file with different query strings is cached: either as one object (option
// is enabled) or as different objects (option is disabled.)
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
IgnoreQueryString RuleTemplateReplaceParamsOptionsIgnoreQueryString `json:"ignoreQueryString,omitzero"`
// Transforms JPG and PNG images (for example, resize or crop) and automatically
// converts them to WebP or AVIF format.
ImageStack RuleTemplateReplaceParamsOptionsImageStack `json:"image_stack,omitzero"`
// Controls access to the CDN resource content for specific IP addresses.
//
// If you want to use IPs from our CDN servers IP list for IP ACL configuration,
// you have to independently monitor their relevance. We recommend you use a script
// for automatically update IP ACL.
// [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
IPAddressACL RuleTemplateReplaceParamsOptionsIPAddressACL `json:"ip_address_acl,omitzero"`
// Allows to control the download speed per connection.
LimitBandwidth RuleTemplateReplaceParamsOptionsLimitBandwidth `json:"limit_bandwidth,omitzero"`
// Allows you to modify your cache key. If omitted, the default value is
// `$request_uri`.
//
// Combine the specified variables to create a key for caching.
//
// - **$`request_uri`**
// - **$scheme**
// - **$uri**
//
// **Warning**: Enabling and changing this option can invalidate your current cache
// and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will
// not work.
ProxyCacheKey RuleTemplateReplaceParamsOptionsProxyCacheKey `json:"proxy_cache_key,omitzero"`
// Caching for POST requests along with default GET and HEAD.
ProxyCacheMethodsSet RuleTemplateReplaceParamsOptionsProxyCacheMethodsSet `json:"proxy_cache_methods_set,omitzero"`
// The time limit for establishing a connection with the origin.
ProxyConnectTimeout RuleTemplateReplaceParamsOptionsProxyConnectTimeout `json:"proxy_connect_timeout,omitzero"`
// The time limit for receiving a partial response from the origin. If no response
// is received within this time, the connection will be closed.
//
// **Note:** When used with a WebSocket connection, this option supports values
// only in the range 1–20 seconds (instead of the usual 1–30 seconds).
ProxyReadTimeout RuleTemplateReplaceParamsOptionsProxyReadTimeout `json:"proxy_read_timeout,omitzero"`
// Files with the specified query parameters are cached as one object, files with
// other parameters are cached as different objects.
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
QueryParamsBlacklist RuleTemplateReplaceParamsOptionsQueryParamsBlacklist `json:"query_params_blacklist,omitzero"`
// Files with the specified query parameters are cached as different objects, files
// with other parameters are cached as one object.
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
QueryParamsWhitelist RuleTemplateReplaceParamsOptionsQueryParamsWhitelist `json:"query_params_whitelist,omitzero"`
// The Query String Forwarding feature allows for the seamless transfer of
// parameters embedded in playlist files to the corresponding media chunk files.
// This functionality ensures that specific attributes, such as authentication
// tokens or tracking information, are consistently passed along from the playlist
// manifest to the individual media segments. This is particularly useful for
// maintaining continuity in security, analytics, and any other parameter-based
// operations across the entire media delivery workflow.
QueryStringForwarding RuleTemplateReplaceParamsOptionsQueryStringForwarding `json:"query_string_forwarding,omitzero"`
// Enables redirect from HTTP to HTTPS.
//
// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
// simultaneously.
RedirectHTTPToHTTPS RuleTemplateReplaceParamsOptionsRedirectHTTPToHTTPS `json:"redirect_http_to_https,omitzero"`
// Enables redirect from HTTPS to HTTP.
//
// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
// simultaneously.
RedirectHTTPSToHTTP RuleTemplateReplaceParamsOptionsRedirectHTTPSToHTTP `json:"redirect_https_to_http,omitzero"`
// Controls access to the CDN resource content for specified domain names.
ReferrerACL RuleTemplateReplaceParamsOptionsReferrerACL `json:"referrer_acl,omitzero"`
// Option allows to limit the amount of HTTP requests.
RequestLimiter RuleTemplateReplaceParamsOptionsRequestLimiter `json:"request_limiter,omitzero"`
// Hides HTTP headers from an origin server in the CDN response.
ResponseHeadersHidingPolicy RuleTemplateReplaceParamsOptionsResponseHeadersHidingPolicy `json:"response_headers_hiding_policy,omitzero"`
// Changes and redirects requests from the CDN to the origin. It operates according
// to the
// [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite)
// configuration.
Rewrite RuleTemplateReplaceParamsOptionsRewrite `json:"rewrite,omitzero"`
// Configures access with tokenized URLs. This makes impossible to access content
// without a valid (unexpired) token.
SecureKey RuleTemplateReplaceParamsOptionsSecureKey `json:"secure_key,omitzero"`
// Requests and caches files larger than 10 MB in parts (no larger than 10 MB per
// part.) This reduces time to first byte.
//
// The option is based on the
// [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
//
// Notes:
//
// 1. Origin must support HTTP Range requests.
// 2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed`
// options enabled.
Slice RuleTemplateReplaceParamsOptionsSlice `json:"slice,omitzero"`
// The hostname that is added to SNI requests from CDN servers to the origin server
// via HTTPS.
//
// SNI is generally only required if your origin uses shared hosting or does not
// have a dedicated IP address. If the origin server presents multiple
// certificates, SNI allows the origin server to know which certificate to use for
// the connection.
//
// The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
Sni RuleTemplateReplaceParamsOptionsSni `json:"sni,omitzero"`
// Serves stale cached content in case of origin unavailability.
Stale RuleTemplateReplaceParamsOptionsStale `json:"stale,omitzero"`
// Custom HTTP Headers that a CDN server adds to a response.
StaticResponseHeaders RuleTemplateReplaceParamsOptionsStaticResponseHeaders `json:"static_response_headers,omitzero"`
// **Legacy option**. Use the `static_response_headers` option instead.
//
// Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP
// Headers can be specified. May contain a header with multiple values.
//
// Deprecated: deprecated
StaticHeaders RuleTemplateReplaceParamsOptionsStaticHeaders `json:"staticHeaders,omitzero"`
// Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP
// Headers can be specified.
StaticRequestHeaders RuleTemplateReplaceParamsOptionsStaticRequestHeaders `json:"staticRequestHeaders,omitzero"`
// Controls access to the content for specified User-Agents.
UserAgentACL RuleTemplateReplaceParamsOptionsUserAgentACL `json:"user_agent_acl,omitzero"`
// Allows to enable WAAP (Web Application and API Protection).
Waap RuleTemplateReplaceParamsOptionsWaap `json:"waap,omitzero"`
// Enables or disables WebSockets connections to an origin server.
Websockets RuleTemplateReplaceParamsOptionsWebsockets `json:"websockets,omitzero"`
// contains filtered or unexported fields
}
List of options that can be configured for the rule.
In case of `null` value the option is not added to the rule. Option inherits its value from the CDN resource settings.
func (RuleTemplateReplaceParamsOptions) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptions) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptions) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptions) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsAllowedHTTPMethods ¶
type RuleTemplateReplaceParamsOptionsAllowedHTTPMethods struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
HTTP methods allowed for content requests from the CDN.
The properties Enabled, Value are required.
func (RuleTemplateReplaceParamsOptionsAllowedHTTPMethods) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsAllowedHTTPMethods) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsAllowedHTTPMethods) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsAllowedHTTPMethods) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsBotProtection ¶
type RuleTemplateReplaceParamsOptionsBotProtection struct {
// Controls the bot challenge module state.
BotChallenge RuleTemplateReplaceParamsOptionsBotProtectionBotChallenge `json:"bot_challenge,omitzero,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// contains filtered or unexported fields
}
Allows to prevent online services from overloading and ensure your business workflow running smoothly.
The properties BotChallenge, Enabled are required.
func (RuleTemplateReplaceParamsOptionsBotProtection) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsBotProtection) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsBotProtection) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsBotProtection) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsBotProtectionBotChallenge ¶
type RuleTemplateReplaceParamsOptionsBotProtectionBotChallenge struct {
// Possible values:
//
// - **true** - Bot challenge is enabled.
// - **false** - Bot challenge is disabled.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// contains filtered or unexported fields
}
Controls the bot challenge module state.
func (RuleTemplateReplaceParamsOptionsBotProtectionBotChallenge) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsBotProtectionBotChallenge) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsBotProtectionBotChallenge) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsBotProtectionBotChallenge) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsBrotliCompression ¶
type RuleTemplateReplaceParamsOptionsBrotliCompression struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Allows to select the content types you want to compress.
//
// `text/html` is a mandatory content type.
//
// Any of "application/javascript", "application/json",
// "application/vnd.ms-fontobject", "application/wasm", "application/x-font-ttf",
// "application/x-javascript", "application/xml", "application/xml+rss",
// "image/svg+xml", "image/x-icon", "text/css", "text/html", "text/javascript",
// "text/plain", "text/xml".
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Compresses content with Brotli on the CDN side. CDN servers will request only uncompressed content from the origin.
Notes:
- CDN only supports "Brotli compression" when the "origin shielding" feature is activated.
- If a precache server is not active for a CDN resource, no compression occurs, even if the option is enabled.
- `brotli_compression` is not supported with `fetch_compressed` or `slice` options enabled.
- `fetch_compressed` option in CDN resource settings overrides `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN resource and want to enable `brotli_compression` in a rule, you must specify `fetch_compressed:false` in the rule.
The properties Enabled, Value are required.
func (RuleTemplateReplaceParamsOptionsBrotliCompression) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsBrotliCompression) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsBrotliCompression) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsBrotliCompression) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsBrowserCacheSettings ¶
type RuleTemplateReplaceParamsOptionsBrowserCacheSettings struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Set the cache expiration time to '0s' to disable caching.
//
// The maximum duration is any equivalent to `1y`.
Value string `json:"value,required" format:"nginx time"`
// contains filtered or unexported fields
}
Cache expiration time for users browsers in seconds.
Cache expiration time is applied to the following response codes: 200, 201, 204, 206, 301, 302, 303, 304, 307, 308.
Responses with other codes will not be cached.
The properties Enabled, Value are required.
func (RuleTemplateReplaceParamsOptionsBrowserCacheSettings) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsBrowserCacheSettings) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsBrowserCacheSettings) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsBrowserCacheSettings) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsCacheHTTPHeaders
deprecated
type RuleTemplateReplaceParamsOptionsCacheHTTPHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
**Legacy option**. Use the `response_headers_hiding_policy` option instead.
HTTP Headers that must be included in the response.
Deprecated: deprecated
The properties Enabled, Value are required.
func (RuleTemplateReplaceParamsOptionsCacheHTTPHeaders) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsCacheHTTPHeaders) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsCacheHTTPHeaders) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsCacheHTTPHeaders) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsCors ¶
type RuleTemplateReplaceParamsOptionsCors struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Value of the Access-Control-Allow-Origin header.
//
// Possible values:
//
// - **Adds \* as the Access-Control-Allow-Origin header value** - Content will be
// uploaded for requests from any domain. `"value": ["*"]`
// - **Adds "$http_origin" as the Access-Control-Allow-Origin header value if the
// origin matches one of the listed domains** - Content will be uploaded only for
// requests from the domains specified in the field.
// `"value": ["domain.com", "second.dom.com"]`
// - **Adds "$http_origin" as the Access-Control-Allow-Origin header value** -
// Content will be uploaded for requests from any domain, and the domain from
// which the request was sent will be added to the "Access-Control-Allow-Origin"
// header in the response. `"value": ["$http_origin"]`
Value []string `json:"value,omitzero,required"`
// Defines whether the Access-Control-Allow-Origin header should be added to a
// response from CDN regardless of response code.
//
// Possible values:
//
// - **true** - Header will be added to a response regardless of response code.
// - **false** - Header will only be added to responses with codes: 200, 201, 204,
// 206, 301, 302, 303, 304, 307, 308.
Always param.Opt[bool] `json:"always,omitzero"`
// contains filtered or unexported fields
}
Enables or disables CORS (Cross-Origin Resource Sharing) header support.
CORS header support allows the CDN to add the Access-Control-Allow-Origin header to a response to a browser.
The properties Enabled, Value are required.
func (RuleTemplateReplaceParamsOptionsCors) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsCors) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsCors) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsCors) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsCountryACL ¶
type RuleTemplateReplaceParamsOptionsCountryACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of countries according to ISO-3166-1.
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of countries for which access is prohibited.
// - **deny** - List of countries for which access is allowed.
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"country-code"`
// Defines the type of CDN resource access policy.
//
// Possible values:
//
// - **allow** - Access is allowed for all the countries except for those specified
// in `excepted_values` field.
// - **deny** - Access is denied for all the countries except for those specified
// in `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Enables control access to content for specified countries.
The properties Enabled, ExceptedValues, PolicyType are required.
func (RuleTemplateReplaceParamsOptionsCountryACL) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsCountryACL) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsCountryACL) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsCountryACL) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsDisableCache
deprecated
type RuleTemplateReplaceParamsOptionsDisableCache struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - content caching is disabled.
// - **false** - content caching is enabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
**Legacy option**. Use the `edge_cache_settings` option instead.
Allows the complete disabling of content caching.
Deprecated: deprecated
The properties Enabled, Value are required.
func (RuleTemplateReplaceParamsOptionsDisableCache) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsDisableCache) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsDisableCache) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsDisableCache) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsDisableProxyForceRanges ¶
type RuleTemplateReplaceParamsOptionsDisableProxyForceRanges struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Allows 206 responses regardless of the settings of an origin source.
The properties Enabled, Value are required.
func (RuleTemplateReplaceParamsOptionsDisableProxyForceRanges) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsDisableProxyForceRanges) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsDisableProxyForceRanges) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsDisableProxyForceRanges) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsEdgeCacheSettings ¶
type RuleTemplateReplaceParamsOptionsEdgeCacheSettings struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Enables content caching according to the origin cache settings.
//
// The value is applied to the following response codes 200, 201, 204, 206, 301,
// 302, 303, 304, 307, 308, if an origin server does not have caching HTTP headers.
//
// Responses with other codes will not be cached.
//
// The maximum duration is any equivalent to `1y`.
Default param.Opt[string] `json:"default,omitzero" format:"nginx time"`
// Caching time.
//
// The value is applied to the following response codes: 200, 206, 301, 302.
// Responses with codes 4xx, 5xx will not be cached.
//
// Use `0s` to disable caching.
//
// The maximum duration is any equivalent to `1y`.
Value param.Opt[string] `json:"value,omitzero" format:"nginx time"`
// A MAP object representing the caching time in seconds for a response with a
// specific response code.
//
// These settings have a higher priority than the `value` field.
//
// - Use `any` key to specify caching time for all response codes.
// - Use `0s` value to disable caching for a specific response code.
CustomValues map[string]string `json:"custom_values,omitzero" format:"nginx time"`
// contains filtered or unexported fields
}
Cache expiration time for CDN servers.
`value` and `default` fields cannot be used simultaneously.
The property Enabled is required.
func (RuleTemplateReplaceParamsOptionsEdgeCacheSettings) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsEdgeCacheSettings) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsEdgeCacheSettings) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsEdgeCacheSettings) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsFastedge ¶
type RuleTemplateReplaceParamsOptionsFastedge struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Allows to configure FastEdge application that will be called to handle request
// body as soon as CDN receives incoming HTTP request.
OnRequestBody RuleTemplateReplaceParamsOptionsFastedgeOnRequestBody `json:"on_request_body,omitzero"`
// Allows to configure FastEdge application that will be called to handle request
// headers as soon as CDN receives incoming HTTP request.
OnRequestHeaders RuleTemplateReplaceParamsOptionsFastedgeOnRequestHeaders `json:"on_request_headers,omitzero"`
// Allows to configure FastEdge application that will be called to handle response
// body before CDN sends the HTTP response.
OnResponseBody RuleTemplateReplaceParamsOptionsFastedgeOnResponseBody `json:"on_response_body,omitzero"`
// Allows to configure FastEdge application that will be called to handle response
// headers before CDN sends the HTTP response.
OnResponseHeaders RuleTemplateReplaceParamsOptionsFastedgeOnResponseHeaders `json:"on_response_headers,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge app to be called on different request/response phases.
Note: At least one of `on_request_headers`, `on_request_body`, `on_response_headers`, or `on_response_body` must be specified.
The property Enabled is required.
func (RuleTemplateReplaceParamsOptionsFastedge) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsFastedge) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsFastedge) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsFastedge) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsFastedgeOnRequestBody ¶
type RuleTemplateReplaceParamsOptionsFastedgeOnRequestBody struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle request body as soon as CDN receives incoming HTTP request.
The property AppID is required.
func (RuleTemplateReplaceParamsOptionsFastedgeOnRequestBody) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsFastedgeOnRequestBody) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsFastedgeOnRequestBody) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsFastedgeOnRequestBody) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsFastedgeOnRequestHeaders ¶
type RuleTemplateReplaceParamsOptionsFastedgeOnRequestHeaders struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request.
The property AppID is required.
func (RuleTemplateReplaceParamsOptionsFastedgeOnRequestHeaders) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsFastedgeOnRequestHeaders) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsFastedgeOnResponseBody ¶
type RuleTemplateReplaceParamsOptionsFastedgeOnResponseBody struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle response body before CDN sends the HTTP response.
The property AppID is required.
func (RuleTemplateReplaceParamsOptionsFastedgeOnResponseBody) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsFastedgeOnResponseBody) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsFastedgeOnResponseBody) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsFastedgeOnResponseBody) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsFastedgeOnResponseHeaders ¶
type RuleTemplateReplaceParamsOptionsFastedgeOnResponseHeaders struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle response headers before CDN sends the HTTP response.
The property AppID is required.
func (RuleTemplateReplaceParamsOptionsFastedgeOnResponseHeaders) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsFastedgeOnResponseHeaders) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsFastedgeOnResponseHeaders) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsFastedgeOnResponseHeaders) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsFetchCompressed ¶
type RuleTemplateReplaceParamsOptionsFetchCompressed struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Makes the CDN request compressed content from the origin.
The origin server should support compression. CDN servers will not decompress your content even if a user browser does not accept compression.
Notes:
- `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or `slice` options enabled.
- `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If you enable it in CDN resource and want to use `gzipON` and `brotli_compression` in a rule, you have to specify `"fetch_compressed": false` in the rule.
The properties Enabled, Value are required.
func (RuleTemplateReplaceParamsOptionsFetchCompressed) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsFetchCompressed) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsFetchCompressed) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsFetchCompressed) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsFollowOriginRedirect ¶
type RuleTemplateReplaceParamsOptionsFollowOriginRedirect struct {
// Redirect status code that the origin server returns.
//
// To serve up to date content to end users, you will need to purge the cache after
// managing the option.
//
// Any of 301, 302, 303, 307, 308.
Codes []int64 `json:"codes,omitzero,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// contains filtered or unexported fields
}
Enables redirection from origin. If the origin server returns a redirect, the option allows the CDN to pull the requested content from the origin server that was returned in the redirect.
The properties Codes, Enabled are required.
func (RuleTemplateReplaceParamsOptionsFollowOriginRedirect) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsFollowOriginRedirect) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsFollowOriginRedirect) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsFollowOriginRedirect) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsForceReturn ¶
type RuleTemplateReplaceParamsOptionsForceReturn struct {
// URL for redirection or text.
Body string `json:"body,required"`
// Status code value.
Code int64 `json:"code,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Controls the time at which a custom HTTP response code should be applied. By
// default, a custom HTTP response code is applied at any time.
TimeInterval RuleTemplateReplaceParamsOptionsForceReturnTimeInterval `json:"time_interval,omitzero"`
// contains filtered or unexported fields
}
Applies custom HTTP response codes for CDN content.
The following codes are reserved by our system and cannot be specified in this option: 408, 444, 477, 494, 495, 496, 497, 499.
The properties Body, Code, Enabled are required.
func (RuleTemplateReplaceParamsOptionsForceReturn) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsForceReturn) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsForceReturn) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsForceReturn) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsForceReturnTimeInterval ¶
type RuleTemplateReplaceParamsOptionsForceReturnTimeInterval struct {
// Time until which a custom HTTP response code should be applied. Indicated in
// 24-hour format.
EndTime string `json:"end_time,required"`
// Time from which a custom HTTP response code should be applied. Indicated in
// 24-hour format.
StartTime string `json:"start_time,required"`
// Time zone used to calculate time.
TimeZone param.Opt[string] `json:"time_zone,omitzero" format:"timezone"`
// contains filtered or unexported fields
}
Controls the time at which a custom HTTP response code should be applied. By default, a custom HTTP response code is applied at any time.
The properties EndTime, StartTime are required.
func (RuleTemplateReplaceParamsOptionsForceReturnTimeInterval) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsForceReturnTimeInterval) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsForceReturnTimeInterval) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsForceReturnTimeInterval) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsForwardHostHeader ¶
type RuleTemplateReplaceParamsOptionsForwardHostHeader struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Forwards the Host header from a end-user request to an origin server.
`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (RuleTemplateReplaceParamsOptionsForwardHostHeader) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsForwardHostHeader) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsForwardHostHeader) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsForwardHostHeader) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsGzipOn ¶
type RuleTemplateReplaceParamsOptionsGzipOn struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Compresses content with gzip on the CDN end. CDN servers will request only uncompressed content from the origin.
Notes:
- Compression with gzip is not supported with `fetch_compressed` or `slice` options enabled.
- `fetch_compressed` option in CDN resource settings overrides `gzipON` in rules. If you enable `fetch_compressed` in CDN resource and want to enable `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
The properties Enabled, Value are required.
func (RuleTemplateReplaceParamsOptionsGzipOn) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsGzipOn) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsGzipOn) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsGzipOn) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsHostHeader ¶
type RuleTemplateReplaceParamsOptionsHostHeader struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Host Header value.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
Sets the Host header that CDN servers use when request content from an origin server. Your server must be able to process requests with the chosen header.
If the option is `null`, the Host Header value is equal to first CNAME.
`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (RuleTemplateReplaceParamsOptionsHostHeader) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsHostHeader) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsHostHeader) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsHostHeader) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsIPAddressACL ¶
type RuleTemplateReplaceParamsOptionsIPAddressACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of IP addresses with a subnet mask.
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of IP addresses for which access is prohibited.
// - **deny** - List of IP addresses for which access is allowed.
//
// Examples:
//
// - `192.168.3.2/32`
// - `2a03:d000:2980:7::8/128`
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"ipv4net or ipv6net"`
// IP access policy type.
//
// Possible values:
//
// - **allow** - Allow access to all IPs except IPs specified in "excepted_values"
// field.
// - **deny** - Deny access to all IPs except IPs specified in "excepted_values"
// field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Controls access to the CDN resource content for specific IP addresses.
If you want to use IPs from our CDN servers IP list for IP ACL configuration, you have to independently monitor their relevance. We recommend you use a script for automatically update IP ACL. [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
The properties Enabled, ExceptedValues, PolicyType are required.
func (RuleTemplateReplaceParamsOptionsIPAddressACL) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsIPAddressACL) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsIPAddressACL) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsIPAddressACL) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsIgnoreCookie ¶
type RuleTemplateReplaceParamsOptionsIgnoreCookie struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled, files with cookies are cached as one file.
// - **false** - Option is disabled, files with cookies are cached as different
// files.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Defines whether the files with the Set-Cookies header are cached as one file or as different ones.
The properties Enabled, Value are required.
func (RuleTemplateReplaceParamsOptionsIgnoreCookie) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsIgnoreCookie) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsIgnoreCookie) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsIgnoreCookie) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsIgnoreQueryString ¶
type RuleTemplateReplaceParamsOptionsIgnoreQueryString struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
How a file with different query strings is cached: either as one object (option is enabled) or as different objects (option is disabled.)
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (RuleTemplateReplaceParamsOptionsIgnoreQueryString) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsIgnoreQueryString) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsIgnoreQueryString) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsIgnoreQueryString) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsImageStack ¶
type RuleTemplateReplaceParamsOptionsImageStack struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Enables or disables automatic conversion of JPEG and PNG images to AVI format.
AvifEnabled param.Opt[bool] `json:"avif_enabled,omitzero"`
// Enables or disables compression without quality loss for PNG format.
PngLossless param.Opt[bool] `json:"png_lossless,omitzero"`
// Defines quality settings for JPG and PNG images. The higher the value, the
// better the image quality, and the larger the file size after conversion.
Quality param.Opt[int64] `json:"quality,omitzero"`
// Enables or disables automatic conversion of JPEG and PNG images to WebP format.
WebpEnabled param.Opt[bool] `json:"webp_enabled,omitzero"`
// contains filtered or unexported fields
}
Transforms JPG and PNG images (for example, resize or crop) and automatically converts them to WebP or AVIF format.
The property Enabled is required.
func (RuleTemplateReplaceParamsOptionsImageStack) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsImageStack) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsImageStack) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsImageStack) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsLimitBandwidth ¶
type RuleTemplateReplaceParamsOptionsLimitBandwidth struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Method of controlling the download speed per connection.
//
// Possible values:
//
// - **static** - Use speed and buffer fields to set the download speed limit.
// - **dynamic** - Use query strings **speed** and **buffer** to set the download
// speed limit.
//
// # For example, when requesting content at the link
//
// “`
// http://cdn.example.com/video.mp4?speed=50k&buffer=500k
// “`
//
// the download speed will be limited to 50kB/s after 500 kB.
//
// Any of "static", "dynamic".
LimitType string `json:"limit_type,omitzero,required"`
// Amount of downloaded data after which the user will be rate limited.
Buffer param.Opt[int64] `json:"buffer,omitzero"`
// Maximum download speed per connection.
Speed param.Opt[int64] `json:"speed,omitzero"`
// contains filtered or unexported fields
}
Allows to control the download speed per connection.
The properties Enabled, LimitType are required.
func (RuleTemplateReplaceParamsOptionsLimitBandwidth) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsLimitBandwidth) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsLimitBandwidth) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsLimitBandwidth) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsProxyCacheKey ¶
type RuleTemplateReplaceParamsOptionsProxyCacheKey struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Key for caching.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
Allows you to modify your cache key. If omitted, the default value is `$request_uri`.
Combine the specified variables to create a key for caching.
- **$`request_uri`** - **$scheme** - **$uri**
**Warning**: Enabling and changing this option can invalidate your current cache and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will not work.
The properties Enabled, Value are required.
func (RuleTemplateReplaceParamsOptionsProxyCacheKey) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsProxyCacheKey) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsProxyCacheKey) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsProxyCacheKey) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsProxyCacheMethodsSet ¶
type RuleTemplateReplaceParamsOptionsProxyCacheMethodsSet struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Caching for POST requests along with default GET and HEAD.
The properties Enabled, Value are required.
func (RuleTemplateReplaceParamsOptionsProxyCacheMethodsSet) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsProxyCacheMethodsSet) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsProxyCacheMethodsSet) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsProxyCacheMethodsSet) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsProxyConnectTimeout ¶
type RuleTemplateReplaceParamsOptionsProxyConnectTimeout struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Timeout value in seconds.
//
// Supported range: **1s - 5s**.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
The time limit for establishing a connection with the origin.
The properties Enabled, Value are required.
func (RuleTemplateReplaceParamsOptionsProxyConnectTimeout) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsProxyConnectTimeout) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsProxyConnectTimeout) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsProxyConnectTimeout) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsProxyReadTimeout ¶
type RuleTemplateReplaceParamsOptionsProxyReadTimeout struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Timeout value in seconds.
//
// Supported range: **1s - 30s**.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
The time limit for receiving a partial response from the origin. If no response is received within this time, the connection will be closed.
**Note:** When used with a WebSocket connection, this option supports values only in the range 1–20 seconds (instead of the usual 1–30 seconds).
The properties Enabled, Value are required.
func (RuleTemplateReplaceParamsOptionsProxyReadTimeout) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsProxyReadTimeout) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsProxyReadTimeout) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsProxyReadTimeout) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsQueryParamsBlacklist ¶
type RuleTemplateReplaceParamsOptionsQueryParamsBlacklist struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of query parameters.
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Files with the specified query parameters are cached as one object, files with other parameters are cached as different objects.
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (RuleTemplateReplaceParamsOptionsQueryParamsBlacklist) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsQueryParamsBlacklist) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsQueryParamsBlacklist) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsQueryParamsBlacklist) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsQueryParamsWhitelist ¶
type RuleTemplateReplaceParamsOptionsQueryParamsWhitelist struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of query parameters.
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Files with the specified query parameters are cached as different objects, files with other parameters are cached as one object.
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (RuleTemplateReplaceParamsOptionsQueryParamsWhitelist) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsQueryParamsWhitelist) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsQueryParamsWhitelist) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsQueryParamsWhitelist) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsQueryStringForwarding ¶
type RuleTemplateReplaceParamsOptionsQueryStringForwarding struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// The `forward_from_files_types` field specifies the types of playlist files from
// which parameters will be extracted and forwarded. This typically includes
// formats that list multiple media chunk references, such as HLS and DASH
// playlists. Parameters associated with these playlist files (like query strings
// or headers) will be propagated to the chunks they reference.
ForwardFromFileTypes []string `json:"forward_from_file_types,omitzero,required"`
// The field specifies the types of media chunk files to which parameters,
// extracted from playlist files, will be forwarded. These refer to the actual
// segments of media content that are delivered to viewers. Ensuring the correct
// parameters are forwarded to these files is crucial for maintaining the integrity
// of the streaming session.
ForwardToFileTypes []string `json:"forward_to_file_types,omitzero,required"`
// The `forward_except_keys` field provides a mechanism to exclude specific
// parameters from being forwarded from playlist files to media chunk files. By
// listing certain keys in this field, you can ensure that these parameters are
// omitted during the forwarding process. This is particularly useful for
// preventing sensitive or irrelevant information from being included in requests
// for media chunks, thereby enhancing security and optimizing performance.
ForwardExceptKeys []string `json:"forward_except_keys,omitzero"`
// The `forward_only_keys` field allows for granular control over which specific
// parameters are forwarded from playlist files to media chunk files. By specifying
// certain keys, only those parameters will be propagated, ensuring that only
// relevant information is passed along. This is particularly useful for security
// and performance optimization, as it prevents unnecessary or sensitive data from
// being included in requests for media chunks.
ForwardOnlyKeys []string `json:"forward_only_keys,omitzero"`
// contains filtered or unexported fields
}
The Query String Forwarding feature allows for the seamless transfer of parameters embedded in playlist files to the corresponding media chunk files. This functionality ensures that specific attributes, such as authentication tokens or tracking information, are consistently passed along from the playlist manifest to the individual media segments. This is particularly useful for maintaining continuity in security, analytics, and any other parameter-based operations across the entire media delivery workflow.
The properties Enabled, ForwardFromFileTypes, ForwardToFileTypes are required.
func (RuleTemplateReplaceParamsOptionsQueryStringForwarding) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsQueryStringForwarding) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsQueryStringForwarding) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsQueryStringForwarding) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsRedirectHTTPSToHTTP ¶
type RuleTemplateReplaceParamsOptionsRedirectHTTPSToHTTP struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Enables redirect from HTTPS to HTTP.
`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (RuleTemplateReplaceParamsOptionsRedirectHTTPSToHTTP) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsRedirectHTTPSToHTTP) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsRedirectHTTPSToHTTP) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsRedirectHTTPSToHTTP) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsRedirectHTTPToHTTPS ¶
type RuleTemplateReplaceParamsOptionsRedirectHTTPToHTTPS struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Enables redirect from HTTP to HTTPS.
`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (RuleTemplateReplaceParamsOptionsRedirectHTTPToHTTPS) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsRedirectHTTPToHTTPS) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsRedirectHTTPToHTTPS) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsRedirectHTTPToHTTPS) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsReferrerACL ¶
type RuleTemplateReplaceParamsOptionsReferrerACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of domain names or wildcard domains (without protocol: `http://` or
// `https://`.)
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of domain names for which access is prohibited.
// - **deny** - List of IP domain names for which access is allowed.
//
// Examples:
//
// - `example.com`
// - `*.example.com`
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"domain or wildcard"`
// Policy type.
//
// Possible values:
//
// - **allow** - Allow access to all domain names except the domain names specified
// in `excepted_values` field.
// - **deny** - Deny access to all domain names except the domain names specified
// in `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Controls access to the CDN resource content for specified domain names.
The properties Enabled, ExceptedValues, PolicyType are required.
func (RuleTemplateReplaceParamsOptionsReferrerACL) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsReferrerACL) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsReferrerACL) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsReferrerACL) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsRequestLimiter ¶
type RuleTemplateReplaceParamsOptionsRequestLimiter struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Maximum request rate.
Rate int64 `json:"rate,required"`
// Units of measurement for the `rate` field.
//
// Possible values:
//
// - **r/s** - Requests per second.
// - **r/m** - Requests per minute.
//
// If the rate is less than one request per second, it is specified in request per
// minute (r/m.)
//
// Any of "r/s", "r/m".
RateUnit string `json:"rate_unit,omitzero"`
// contains filtered or unexported fields
}
Option allows to limit the amount of HTTP requests.
The properties Enabled, Rate are required.
func (RuleTemplateReplaceParamsOptionsRequestLimiter) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsRequestLimiter) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsRequestLimiter) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsRequestLimiter) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsResponseHeadersHidingPolicy ¶
type RuleTemplateReplaceParamsOptionsResponseHeadersHidingPolicy struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of HTTP headers.
//
// Parameter meaning depends on the value of the `mode` field:
//
// - **show** - List of HTTP headers to hide from response.
// - **hide** - List of HTTP headers to include in response. Other HTTP headers
// will be hidden.
//
// The following headers are required and cannot be hidden from response:
//
// - `Connection`
// - `Content-Length`
// - `Content-Type`
// - `Date`
// - `Server`
Excepted []string `json:"excepted,omitzero,required" format:"http_header"`
// How HTTP headers are hidden from the response.
//
// Possible values:
//
// - **show** - Hide only HTTP headers listed in the `excepted` field.
// - **hide** - Hide all HTTP headers except headers listed in the "excepted"
// field.
//
// Any of "hide", "show".
Mode string `json:"mode,omitzero,required"`
// contains filtered or unexported fields
}
Hides HTTP headers from an origin server in the CDN response.
The properties Enabled, Excepted, Mode are required.
func (RuleTemplateReplaceParamsOptionsResponseHeadersHidingPolicy) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsResponseHeadersHidingPolicy) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsResponseHeadersHidingPolicy) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsResponseHeadersHidingPolicy) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsRewrite ¶
type RuleTemplateReplaceParamsOptionsRewrite struct {
// Path for the Rewrite option.
//
// Example:
//
// - `/(.*) /media/$1`
Body string `json:"body,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Flag for the Rewrite option.
//
// Possible values:
//
// - **last** - Stop processing the current set of `ngx_http_rewrite_module`
// directives and start a search for a new location matching changed URI.
// - **break** - Stop processing the current set of the Rewrite option.
// - **redirect** - Return a temporary redirect with the 302 code; used when a
// replacement string does not start with `http://`, `https://`, or `$scheme`.
// - **permanent** - Return a permanent redirect with the 301 code.
//
// Any of "break", "last", "redirect", "permanent".
Flag string `json:"flag,omitzero"`
// contains filtered or unexported fields
}
Changes and redirects requests from the CDN to the origin. It operates according to the [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite) configuration.
The properties Body, Enabled are required.
func (RuleTemplateReplaceParamsOptionsRewrite) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsRewrite) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsRewrite) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsRewrite) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsSecureKey ¶
type RuleTemplateReplaceParamsOptionsSecureKey struct {
// Key generated on your side that will be used for URL signing.
Key param.Opt[string] `json:"key,omitzero,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Type of URL signing.
//
// Possible types:
//
// - **Type 0** - Includes end user IP to secure token generation.
// - **Type 2** - Excludes end user IP from secure token generation.
//
// Any of 0, 2.
Type int64 `json:"type,omitzero"`
// contains filtered or unexported fields
}
Configures access with tokenized URLs. This makes impossible to access content without a valid (unexpired) token.
The properties Enabled, Key are required.
func (RuleTemplateReplaceParamsOptionsSecureKey) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsSecureKey) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsSecureKey) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsSecureKey) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsSlice ¶
type RuleTemplateReplaceParamsOptionsSlice struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Requests and caches files larger than 10 MB in parts (no larger than 10 MB per part.) This reduces time to first byte.
The option is based on the [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
Notes:
- Origin must support HTTP Range requests.
- Not supported with `gzipON`, `brotli_compression` or `fetch_compressed` options enabled.
The properties Enabled, Value are required.
func (RuleTemplateReplaceParamsOptionsSlice) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsSlice) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsSlice) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsSlice) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsSni ¶
type RuleTemplateReplaceParamsOptionsSni struct {
// Custom SNI hostname.
//
// It is required if `sni_type` is set to custom.
CustomHostname string `json:"custom_hostname,required" format:"domain"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// SNI (Server Name Indication) type.
//
// Possible values:
//
// - **dynamic** - SNI hostname depends on `hostHeader` and `forward_host_header`
// options. It has several possible combinations:
// - If the `hostHeader` option is enabled and specified, SNI hostname matches the
// Host header.
// - If the `forward_host_header` option is enabled and has true value, SNI
// hostname matches the Host header used in the request made to a CDN.
// - If the `hostHeader` and `forward_host_header` options are disabled, SNI
// hostname matches the primary CNAME.
// - **custom** - custom SNI hostname is in use.
//
// Any of "dynamic", "custom".
SniType string `json:"sni_type,omitzero"`
// contains filtered or unexported fields
}
The hostname that is added to SNI requests from CDN servers to the origin server via HTTPS.
SNI is generally only required if your origin uses shared hosting or does not have a dedicated IP address. If the origin server presents multiple certificates, SNI allows the origin server to know which certificate to use for the connection.
The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
The properties CustomHostname, Enabled are required.
func (RuleTemplateReplaceParamsOptionsSni) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsSni) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsSni) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsSni) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsStale ¶
type RuleTemplateReplaceParamsOptionsStale struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Defines list of errors for which "Always online" option is applied.
//
// Any of "error", "http_403", "http_404", "http_429", "http_500", "http_502",
// "http_503", "http_504", "invalid_header", "timeout", "updating".
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Serves stale cached content in case of origin unavailability.
The properties Enabled, Value are required.
func (RuleTemplateReplaceParamsOptionsStale) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsStale) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsStale) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsStale) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsStaticHeaders
deprecated
type RuleTemplateReplaceParamsOptionsStaticHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// A MAP for static headers in a format of `header_name: header_value`.
//
// Restrictions:
//
// - **Header name** - Maximum 128 symbols, may contain Latin letters (A-Z, a-z),
// numbers (0-9), dashes, and underscores.
// - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
// (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
// with a letter, number, asterisk or {.
Value any `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
**Legacy option**. Use the `static_response_headers` option instead.
Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP Headers can be specified. May contain a header with multiple values.
Deprecated: deprecated
The properties Enabled, Value are required.
func (RuleTemplateReplaceParamsOptionsStaticHeaders) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsStaticHeaders) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsStaticHeaders) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsStaticHeaders) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsStaticRequestHeaders ¶
type RuleTemplateReplaceParamsOptionsStaticRequestHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// A MAP for static headers in a format of `header_name: header_value`.
//
// Restrictions:
//
// - **Header name** - Maximum 255 symbols, may contain Latin letters (A-Z, a-z),
// numbers (0-9), dashes, and underscores.
// - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
// (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
// with a letter, number, asterisk or {.
Value map[string]string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP Headers can be specified.
The properties Enabled, Value are required.
func (RuleTemplateReplaceParamsOptionsStaticRequestHeaders) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsStaticRequestHeaders) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsStaticRequestHeaders) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsStaticRequestHeaders) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsStaticResponseHeaders ¶
type RuleTemplateReplaceParamsOptionsStaticResponseHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
Value []RuleTemplateReplaceParamsOptionsStaticResponseHeadersValue `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Custom HTTP Headers that a CDN server adds to a response.
The properties Enabled, Value are required.
func (RuleTemplateReplaceParamsOptionsStaticResponseHeaders) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsStaticResponseHeaders) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsStaticResponseHeaders) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsStaticResponseHeaders) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsStaticResponseHeadersValue ¶
type RuleTemplateReplaceParamsOptionsStaticResponseHeadersValue struct {
// HTTP Header name.
//
// Restrictions:
//
// - Maximum 128 symbols.
// - Latin letters (A-Z, a-z,) numbers (0-9,) dashes, and underscores only.
Name string `json:"name,required"`
// Header value.
//
// Restrictions:
//
// - Maximum 512 symbols.
// - Letters (a-z), numbers (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+
// /|\";:?.,><{}[]).
// - Must start with a letter, number, asterisk or {.
// - Multiple values can be added.
Value []string `json:"value,omitzero,required"`
// Defines whether the header will be added to a response from CDN regardless of
// response code.
//
// Possible values:
//
// - **true** - Header will be added to a response from CDN regardless of response
// code.
// - **false** - Header will be added only to the following response codes: 200,
// 201, 204, 206, 301, 302, 303, 304, 307, 308.
Always param.Opt[bool] `json:"always,omitzero"`
// contains filtered or unexported fields
}
The properties Name, Value are required.
func (RuleTemplateReplaceParamsOptionsStaticResponseHeadersValue) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsStaticResponseHeadersValue) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsStaticResponseHeadersValue) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsStaticResponseHeadersValue) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsUserAgentACL ¶
type RuleTemplateReplaceParamsOptionsUserAgentACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of User-Agents that will be allowed/denied.
//
// The meaning of the parameter depends on `policy_type`:
//
// - **allow** - List of User-Agents for which access is prohibited.
// - **deny** - List of User-Agents for which access is allowed.
//
// Use an empty string `""` to allow/deny access when the User-Agent header is
// empty.
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"user_agent"`
// User-Agents policy type.
//
// Possible values:
//
// - **allow** - Allow access for all User-Agents except specified in
// `excepted_values` field.
// - **deny** - Deny access for all User-Agents except specified in
// `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Controls access to the content for specified User-Agents.
The properties Enabled, ExceptedValues, PolicyType are required.
func (RuleTemplateReplaceParamsOptionsUserAgentACL) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsUserAgentACL) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsUserAgentACL) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsUserAgentACL) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsWaap ¶
type RuleTemplateReplaceParamsOptionsWaap struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Allows to enable WAAP (Web Application and API Protection).
The properties Enabled, Value are required.
func (RuleTemplateReplaceParamsOptionsWaap) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsWaap) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsWaap) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsWaap) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOptionsWebsockets ¶
type RuleTemplateReplaceParamsOptionsWebsockets struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Enables or disables WebSockets connections to an origin server.
The properties Enabled, Value are required.
func (RuleTemplateReplaceParamsOptionsWebsockets) MarshalJSON ¶
func (r RuleTemplateReplaceParamsOptionsWebsockets) MarshalJSON() (data []byte, err error)
func (*RuleTemplateReplaceParamsOptionsWebsockets) UnmarshalJSON ¶
func (r *RuleTemplateReplaceParamsOptionsWebsockets) UnmarshalJSON(data []byte) error
type RuleTemplateReplaceParamsOverrideOriginProtocol ¶
type RuleTemplateReplaceParamsOverrideOriginProtocol string
Sets a protocol other than the one specified in the CDN resource settings to connect to the origin.
Possible values:
- **HTTPS** - CDN servers connect to origin via HTTPS protocol.
- **HTTP** - CDN servers connect to origin via HTTP protocol.
- **MATCH** - Connection protocol is chosen automatically; in this case, content on origin source should be available for the CDN both through HTTP and HTTPS protocols.
- **null** - `originProtocol` setting is inherited from the CDN resource settings.
const ( RuleTemplateReplaceParamsOverrideOriginProtocolHTTPS RuleTemplateReplaceParamsOverrideOriginProtocol = "HTTPS" RuleTemplateReplaceParamsOverrideOriginProtocolHTTP RuleTemplateReplaceParamsOverrideOriginProtocol = "HTTP" RuleTemplateReplaceParamsOverrideOriginProtocolMatch RuleTemplateReplaceParamsOverrideOriginProtocol = "MATCH" )
type RuleTemplateService ¶
type RuleTemplateService struct {
Options []option.RequestOption
}
RuleTemplateService 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 NewRuleTemplateService method instead.
func NewRuleTemplateService ¶
func NewRuleTemplateService(opts ...option.RequestOption) (r RuleTemplateService)
NewRuleTemplateService 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 (*RuleTemplateService) Delete ¶
func (r *RuleTemplateService) Delete(ctx context.Context, ruleTemplateID int64, opts ...option.RequestOption) (err error)
Delete rule template
func (*RuleTemplateService) Get ¶
func (r *RuleTemplateService) Get(ctx context.Context, ruleTemplateID int64, opts ...option.RequestOption) (res *RuleTemplate, err error)
Get rule template details
func (*RuleTemplateService) List ¶
func (r *RuleTemplateService) List(ctx context.Context, opts ...option.RequestOption) (res *RuleTemplateList, err error)
Get rule templates list
func (*RuleTemplateService) New ¶
func (r *RuleTemplateService) New(ctx context.Context, body RuleTemplateNewParams, opts ...option.RequestOption) (res *RuleTemplate, err error)
Create rule template
func (*RuleTemplateService) Replace ¶
func (r *RuleTemplateService) Replace(ctx context.Context, ruleTemplateID int64, body RuleTemplateReplaceParams, opts ...option.RequestOption) (res *RuleTemplate, err error)
Change rule template
func (*RuleTemplateService) Update ¶
func (r *RuleTemplateService) Update(ctx context.Context, ruleTemplateID int64, body RuleTemplateUpdateParams, opts ...option.RequestOption) (res *RuleTemplate, err error)
Change rule template
type RuleTemplateUpdateParams ¶
type RuleTemplateUpdateParams struct {
// Rule template name.
Name param.Opt[string] `json:"name,omitzero"`
// Path to the file or folder for which the rule will be applied.
//
// The rule is applied if the requested URI matches the rule path.
//
// We add a leading forward slash to any rule path. Specify a path without a
// forward slash.
Rule param.Opt[string] `json:"rule,omitzero"`
// Rule type.
//
// Possible values:
//
// - **Type 0** - Regular expression. Must start with '^/' or '/'.
// - **Type 1** - Regular expression. Note that for this rule type we automatically
// add / to each rule pattern before your regular expression. This type is
// **legacy**, please use Type 0.
RuleType param.Opt[int64] `json:"ruleType,omitzero"`
// Rule execution order: from lowest (1) to highest.
//
// If requested URI matches multiple rules, the one higher in the order of the
// rules will be applied.
Weight param.Opt[int64] `json:"weight,omitzero"`
// Sets a protocol other than the one specified in the CDN resource settings to
// connect to the origin.
//
// Possible values:
//
// - **HTTPS** - CDN servers connect to origin via HTTPS protocol.
// - **HTTP** - CDN servers connect to origin via HTTP protocol.
// - **MATCH** - Connection protocol is chosen automatically; in this case, content
// on origin source should be available for the CDN both through HTTP and HTTPS
// protocols.
// - **null** - `originProtocol` setting is inherited from the CDN resource
// settings.
//
// Any of "HTTPS", "HTTP", "MATCH".
OverrideOriginProtocol RuleTemplateUpdateParamsOverrideOriginProtocol `json:"overrideOriginProtocol,omitzero"`
// List of options that can be configured for the rule.
//
// In case of `null` value the option is not added to the rule. Option inherits its
// value from the CDN resource settings.
Options RuleTemplateUpdateParamsOptions `json:"options,omitzero"`
// contains filtered or unexported fields
}
func (RuleTemplateUpdateParams) MarshalJSON ¶
func (r RuleTemplateUpdateParams) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParams) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParams) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptions ¶
type RuleTemplateUpdateParamsOptions struct {
// HTTP methods allowed for content requests from the CDN.
AllowedHTTPMethods RuleTemplateUpdateParamsOptionsAllowedHTTPMethods `json:"allowedHttpMethods,omitzero"`
// Allows to prevent online services from overloading and ensure your business
// workflow running smoothly.
BotProtection RuleTemplateUpdateParamsOptionsBotProtection `json:"bot_protection,omitzero"`
// Compresses content with Brotli on the CDN side. CDN servers will request only
// uncompressed content from the origin.
//
// Notes:
//
// 1. CDN only supports "Brotli compression" when the "origin shielding" feature is
// activated.
// 2. If a precache server is not active for a CDN resource, no compression occurs,
// even if the option is enabled.
// 3. `brotli_compression` is not supported with `fetch_compressed` or `slice`
// options enabled.
// 4. `fetch_compressed` option in CDN resource settings overrides
// `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN
// resource and want to enable `brotli_compression` in a rule, you must specify
// `fetch_compressed:false` in the rule.
BrotliCompression RuleTemplateUpdateParamsOptionsBrotliCompression `json:"brotli_compression,omitzero"`
// Cache expiration time for users browsers in seconds.
//
// Cache expiration time is applied to the following response codes: 200, 201, 204,
// 206, 301, 302, 303, 304, 307, 308.
//
// Responses with other codes will not be cached.
BrowserCacheSettings RuleTemplateUpdateParamsOptionsBrowserCacheSettings `json:"browser_cache_settings,omitzero"`
// **Legacy option**. Use the `response_headers_hiding_policy` option instead.
//
// HTTP Headers that must be included in the response.
//
// Deprecated: deprecated
CacheHTTPHeaders RuleTemplateUpdateParamsOptionsCacheHTTPHeaders `json:"cache_http_headers,omitzero"`
// Enables or disables CORS (Cross-Origin Resource Sharing) header support.
//
// CORS header support allows the CDN to add the Access-Control-Allow-Origin header
// to a response to a browser.
Cors RuleTemplateUpdateParamsOptionsCors `json:"cors,omitzero"`
// Enables control access to content for specified countries.
CountryACL RuleTemplateUpdateParamsOptionsCountryACL `json:"country_acl,omitzero"`
// **Legacy option**. Use the `edge_cache_settings` option instead.
//
// Allows the complete disabling of content caching.
//
// Deprecated: deprecated
DisableCache RuleTemplateUpdateParamsOptionsDisableCache `json:"disable_cache,omitzero"`
// Allows 206 responses regardless of the settings of an origin source.
DisableProxyForceRanges RuleTemplateUpdateParamsOptionsDisableProxyForceRanges `json:"disable_proxy_force_ranges,omitzero"`
// Cache expiration time for CDN servers.
//
// `value` and `default` fields cannot be used simultaneously.
EdgeCacheSettings RuleTemplateUpdateParamsOptionsEdgeCacheSettings `json:"edge_cache_settings,omitzero"`
// Allows to configure FastEdge app to be called on different request/response
// phases.
//
// Note: At least one of `on_request_headers`, `on_request_body`,
// `on_response_headers`, or `on_response_body` must be specified.
Fastedge RuleTemplateUpdateParamsOptionsFastedge `json:"fastedge,omitzero"`
// Makes the CDN request compressed content from the origin.
//
// The origin server should support compression. CDN servers will not decompress
// your content even if a user browser does not accept compression.
//
// Notes:
//
// 1. `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or
// `slice` options enabled.
// 2. `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If
// you enable it in CDN resource and want to use `gzipON` and
// `brotli_compression` in a rule, you have to specify
// `"fetch_compressed": false` in the rule.
FetchCompressed RuleTemplateUpdateParamsOptionsFetchCompressed `json:"fetch_compressed,omitzero"`
// Enables redirection from origin. If the origin server returns a redirect, the
// option allows the CDN to pull the requested content from the origin server that
// was returned in the redirect.
FollowOriginRedirect RuleTemplateUpdateParamsOptionsFollowOriginRedirect `json:"follow_origin_redirect,omitzero"`
// Applies custom HTTP response codes for CDN content.
//
// The following codes are reserved by our system and cannot be specified in this
// option: 408, 444, 477, 494, 495, 496, 497, 499.
ForceReturn RuleTemplateUpdateParamsOptionsForceReturn `json:"force_return,omitzero"`
// Forwards the Host header from a end-user request to an origin server.
//
// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
ForwardHostHeader RuleTemplateUpdateParamsOptionsForwardHostHeader `json:"forward_host_header,omitzero"`
// Compresses content with gzip on the CDN end. CDN servers will request only
// uncompressed content from the origin.
//
// Notes:
//
// 1. Compression with gzip is not supported with `fetch_compressed` or `slice`
// options enabled.
// 2. `fetch_compressed` option in CDN resource settings overrides `gzipON` in
// rules. If you enable `fetch_compressed` in CDN resource and want to enable
// `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
GzipOn RuleTemplateUpdateParamsOptionsGzipOn `json:"gzipOn,omitzero"`
// Sets the Host header that CDN servers use when request content from an origin
// server. Your server must be able to process requests with the chosen header.
//
// If the option is `null`, the Host Header value is equal to first CNAME.
//
// `hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
HostHeader RuleTemplateUpdateParamsOptionsHostHeader `json:"hostHeader,omitzero"`
// Defines whether the files with the Set-Cookies header are cached as one file or
// as different ones.
IgnoreCookie RuleTemplateUpdateParamsOptionsIgnoreCookie `json:"ignore_cookie,omitzero"`
// How a file with different query strings is cached: either as one object (option
// is enabled) or as different objects (option is disabled.)
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
IgnoreQueryString RuleTemplateUpdateParamsOptionsIgnoreQueryString `json:"ignoreQueryString,omitzero"`
// Transforms JPG and PNG images (for example, resize or crop) and automatically
// converts them to WebP or AVIF format.
ImageStack RuleTemplateUpdateParamsOptionsImageStack `json:"image_stack,omitzero"`
// Controls access to the CDN resource content for specific IP addresses.
//
// If you want to use IPs from our CDN servers IP list for IP ACL configuration,
// you have to independently monitor their relevance. We recommend you use a script
// for automatically update IP ACL.
// [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
IPAddressACL RuleTemplateUpdateParamsOptionsIPAddressACL `json:"ip_address_acl,omitzero"`
// Allows to control the download speed per connection.
LimitBandwidth RuleTemplateUpdateParamsOptionsLimitBandwidth `json:"limit_bandwidth,omitzero"`
// Allows you to modify your cache key. If omitted, the default value is
// `$request_uri`.
//
// Combine the specified variables to create a key for caching.
//
// - **$`request_uri`**
// - **$scheme**
// - **$uri**
//
// **Warning**: Enabling and changing this option can invalidate your current cache
// and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will
// not work.
ProxyCacheKey RuleTemplateUpdateParamsOptionsProxyCacheKey `json:"proxy_cache_key,omitzero"`
// Caching for POST requests along with default GET and HEAD.
ProxyCacheMethodsSet RuleTemplateUpdateParamsOptionsProxyCacheMethodsSet `json:"proxy_cache_methods_set,omitzero"`
// The time limit for establishing a connection with the origin.
ProxyConnectTimeout RuleTemplateUpdateParamsOptionsProxyConnectTimeout `json:"proxy_connect_timeout,omitzero"`
// The time limit for receiving a partial response from the origin. If no response
// is received within this time, the connection will be closed.
//
// **Note:** When used with a WebSocket connection, this option supports values
// only in the range 1–20 seconds (instead of the usual 1–30 seconds).
ProxyReadTimeout RuleTemplateUpdateParamsOptionsProxyReadTimeout `json:"proxy_read_timeout,omitzero"`
// Files with the specified query parameters are cached as one object, files with
// other parameters are cached as different objects.
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
QueryParamsBlacklist RuleTemplateUpdateParamsOptionsQueryParamsBlacklist `json:"query_params_blacklist,omitzero"`
// Files with the specified query parameters are cached as different objects, files
// with other parameters are cached as one object.
//
// `ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist`
// options cannot be enabled simultaneously.
QueryParamsWhitelist RuleTemplateUpdateParamsOptionsQueryParamsWhitelist `json:"query_params_whitelist,omitzero"`
// The Query String Forwarding feature allows for the seamless transfer of
// parameters embedded in playlist files to the corresponding media chunk files.
// This functionality ensures that specific attributes, such as authentication
// tokens or tracking information, are consistently passed along from the playlist
// manifest to the individual media segments. This is particularly useful for
// maintaining continuity in security, analytics, and any other parameter-based
// operations across the entire media delivery workflow.
QueryStringForwarding RuleTemplateUpdateParamsOptionsQueryStringForwarding `json:"query_string_forwarding,omitzero"`
// Enables redirect from HTTP to HTTPS.
//
// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
// simultaneously.
RedirectHTTPToHTTPS RuleTemplateUpdateParamsOptionsRedirectHTTPToHTTPS `json:"redirect_http_to_https,omitzero"`
// Enables redirect from HTTPS to HTTP.
//
// `redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled
// simultaneously.
RedirectHTTPSToHTTP RuleTemplateUpdateParamsOptionsRedirectHTTPSToHTTP `json:"redirect_https_to_http,omitzero"`
// Controls access to the CDN resource content for specified domain names.
ReferrerACL RuleTemplateUpdateParamsOptionsReferrerACL `json:"referrer_acl,omitzero"`
// Option allows to limit the amount of HTTP requests.
RequestLimiter RuleTemplateUpdateParamsOptionsRequestLimiter `json:"request_limiter,omitzero"`
// Hides HTTP headers from an origin server in the CDN response.
ResponseHeadersHidingPolicy RuleTemplateUpdateParamsOptionsResponseHeadersHidingPolicy `json:"response_headers_hiding_policy,omitzero"`
// Changes and redirects requests from the CDN to the origin. It operates according
// to the
// [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite)
// configuration.
Rewrite RuleTemplateUpdateParamsOptionsRewrite `json:"rewrite,omitzero"`
// Configures access with tokenized URLs. This makes impossible to access content
// without a valid (unexpired) token.
SecureKey RuleTemplateUpdateParamsOptionsSecureKey `json:"secure_key,omitzero"`
// Requests and caches files larger than 10 MB in parts (no larger than 10 MB per
// part.) This reduces time to first byte.
//
// The option is based on the
// [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
//
// Notes:
//
// 1. Origin must support HTTP Range requests.
// 2. Not supported with `gzipON`, `brotli_compression` or `fetch_compressed`
// options enabled.
Slice RuleTemplateUpdateParamsOptionsSlice `json:"slice,omitzero"`
// The hostname that is added to SNI requests from CDN servers to the origin server
// via HTTPS.
//
// SNI is generally only required if your origin uses shared hosting or does not
// have a dedicated IP address. If the origin server presents multiple
// certificates, SNI allows the origin server to know which certificate to use for
// the connection.
//
// The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
Sni RuleTemplateUpdateParamsOptionsSni `json:"sni,omitzero"`
// Serves stale cached content in case of origin unavailability.
Stale RuleTemplateUpdateParamsOptionsStale `json:"stale,omitzero"`
// Custom HTTP Headers that a CDN server adds to a response.
StaticResponseHeaders RuleTemplateUpdateParamsOptionsStaticResponseHeaders `json:"static_response_headers,omitzero"`
// **Legacy option**. Use the `static_response_headers` option instead.
//
// Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP
// Headers can be specified. May contain a header with multiple values.
//
// Deprecated: deprecated
StaticHeaders RuleTemplateUpdateParamsOptionsStaticHeaders `json:"staticHeaders,omitzero"`
// Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP
// Headers can be specified.
StaticRequestHeaders RuleTemplateUpdateParamsOptionsStaticRequestHeaders `json:"staticRequestHeaders,omitzero"`
// Controls access to the content for specified User-Agents.
UserAgentACL RuleTemplateUpdateParamsOptionsUserAgentACL `json:"user_agent_acl,omitzero"`
// Allows to enable WAAP (Web Application and API Protection).
Waap RuleTemplateUpdateParamsOptionsWaap `json:"waap,omitzero"`
// Enables or disables WebSockets connections to an origin server.
Websockets RuleTemplateUpdateParamsOptionsWebsockets `json:"websockets,omitzero"`
// contains filtered or unexported fields
}
List of options that can be configured for the rule.
In case of `null` value the option is not added to the rule. Option inherits its value from the CDN resource settings.
func (RuleTemplateUpdateParamsOptions) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptions) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptions) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptions) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsAllowedHTTPMethods ¶
type RuleTemplateUpdateParamsOptionsAllowedHTTPMethods struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Any of "GET", "HEAD", "POST", "PUT", "PATCH", "DELETE", "OPTIONS".
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
HTTP methods allowed for content requests from the CDN.
The properties Enabled, Value are required.
func (RuleTemplateUpdateParamsOptionsAllowedHTTPMethods) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsAllowedHTTPMethods) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsAllowedHTTPMethods) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsAllowedHTTPMethods) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsBotProtection ¶
type RuleTemplateUpdateParamsOptionsBotProtection struct {
// Controls the bot challenge module state.
BotChallenge RuleTemplateUpdateParamsOptionsBotProtectionBotChallenge `json:"bot_challenge,omitzero,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// contains filtered or unexported fields
}
Allows to prevent online services from overloading and ensure your business workflow running smoothly.
The properties BotChallenge, Enabled are required.
func (RuleTemplateUpdateParamsOptionsBotProtection) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsBotProtection) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsBotProtection) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsBotProtection) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsBotProtectionBotChallenge ¶
type RuleTemplateUpdateParamsOptionsBotProtectionBotChallenge struct {
// Possible values:
//
// - **true** - Bot challenge is enabled.
// - **false** - Bot challenge is disabled.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// contains filtered or unexported fields
}
Controls the bot challenge module state.
func (RuleTemplateUpdateParamsOptionsBotProtectionBotChallenge) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsBotProtectionBotChallenge) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsBotProtectionBotChallenge) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsBotProtectionBotChallenge) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsBrotliCompression ¶
type RuleTemplateUpdateParamsOptionsBrotliCompression struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Allows to select the content types you want to compress.
//
// `text/html` is a mandatory content type.
//
// Any of "application/javascript", "application/json",
// "application/vnd.ms-fontobject", "application/wasm", "application/x-font-ttf",
// "application/x-javascript", "application/xml", "application/xml+rss",
// "image/svg+xml", "image/x-icon", "text/css", "text/html", "text/javascript",
// "text/plain", "text/xml".
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Compresses content with Brotli on the CDN side. CDN servers will request only uncompressed content from the origin.
Notes:
- CDN only supports "Brotli compression" when the "origin shielding" feature is activated.
- If a precache server is not active for a CDN resource, no compression occurs, even if the option is enabled.
- `brotli_compression` is not supported with `fetch_compressed` or `slice` options enabled.
- `fetch_compressed` option in CDN resource settings overrides `brotli_compression` in rules. If you enabled `fetch_compressed` in CDN resource and want to enable `brotli_compression` in a rule, you must specify `fetch_compressed:false` in the rule.
The properties Enabled, Value are required.
func (RuleTemplateUpdateParamsOptionsBrotliCompression) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsBrotliCompression) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsBrotliCompression) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsBrotliCompression) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsBrowserCacheSettings ¶
type RuleTemplateUpdateParamsOptionsBrowserCacheSettings struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Set the cache expiration time to '0s' to disable caching.
//
// The maximum duration is any equivalent to `1y`.
Value string `json:"value,required" format:"nginx time"`
// contains filtered or unexported fields
}
Cache expiration time for users browsers in seconds.
Cache expiration time is applied to the following response codes: 200, 201, 204, 206, 301, 302, 303, 304, 307, 308.
Responses with other codes will not be cached.
The properties Enabled, Value are required.
func (RuleTemplateUpdateParamsOptionsBrowserCacheSettings) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsBrowserCacheSettings) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsBrowserCacheSettings) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsBrowserCacheSettings) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsCacheHTTPHeaders
deprecated
type RuleTemplateUpdateParamsOptionsCacheHTTPHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
**Legacy option**. Use the `response_headers_hiding_policy` option instead.
HTTP Headers that must be included in the response.
Deprecated: deprecated
The properties Enabled, Value are required.
func (RuleTemplateUpdateParamsOptionsCacheHTTPHeaders) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsCacheHTTPHeaders) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsCacheHTTPHeaders) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsCacheHTTPHeaders) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsCors ¶
type RuleTemplateUpdateParamsOptionsCors struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Value of the Access-Control-Allow-Origin header.
//
// Possible values:
//
// - **Adds \* as the Access-Control-Allow-Origin header value** - Content will be
// uploaded for requests from any domain. `"value": ["*"]`
// - **Adds "$http_origin" as the Access-Control-Allow-Origin header value if the
// origin matches one of the listed domains** - Content will be uploaded only for
// requests from the domains specified in the field.
// `"value": ["domain.com", "second.dom.com"]`
// - **Adds "$http_origin" as the Access-Control-Allow-Origin header value** -
// Content will be uploaded for requests from any domain, and the domain from
// which the request was sent will be added to the "Access-Control-Allow-Origin"
// header in the response. `"value": ["$http_origin"]`
Value []string `json:"value,omitzero,required"`
// Defines whether the Access-Control-Allow-Origin header should be added to a
// response from CDN regardless of response code.
//
// Possible values:
//
// - **true** - Header will be added to a response regardless of response code.
// - **false** - Header will only be added to responses with codes: 200, 201, 204,
// 206, 301, 302, 303, 304, 307, 308.
Always param.Opt[bool] `json:"always,omitzero"`
// contains filtered or unexported fields
}
Enables or disables CORS (Cross-Origin Resource Sharing) header support.
CORS header support allows the CDN to add the Access-Control-Allow-Origin header to a response to a browser.
The properties Enabled, Value are required.
func (RuleTemplateUpdateParamsOptionsCors) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsCors) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsCors) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsCors) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsCountryACL ¶
type RuleTemplateUpdateParamsOptionsCountryACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of countries according to ISO-3166-1.
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of countries for which access is prohibited.
// - **deny** - List of countries for which access is allowed.
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"country-code"`
// Defines the type of CDN resource access policy.
//
// Possible values:
//
// - **allow** - Access is allowed for all the countries except for those specified
// in `excepted_values` field.
// - **deny** - Access is denied for all the countries except for those specified
// in `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Enables control access to content for specified countries.
The properties Enabled, ExceptedValues, PolicyType are required.
func (RuleTemplateUpdateParamsOptionsCountryACL) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsCountryACL) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsCountryACL) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsCountryACL) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsDisableCache
deprecated
type RuleTemplateUpdateParamsOptionsDisableCache struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - content caching is disabled.
// - **false** - content caching is enabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
**Legacy option**. Use the `edge_cache_settings` option instead.
Allows the complete disabling of content caching.
Deprecated: deprecated
The properties Enabled, Value are required.
func (RuleTemplateUpdateParamsOptionsDisableCache) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsDisableCache) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsDisableCache) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsDisableCache) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsDisableProxyForceRanges ¶
type RuleTemplateUpdateParamsOptionsDisableProxyForceRanges struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Allows 206 responses regardless of the settings of an origin source.
The properties Enabled, Value are required.
func (RuleTemplateUpdateParamsOptionsDisableProxyForceRanges) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsDisableProxyForceRanges) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsDisableProxyForceRanges) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsDisableProxyForceRanges) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsEdgeCacheSettings ¶
type RuleTemplateUpdateParamsOptionsEdgeCacheSettings struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Enables content caching according to the origin cache settings.
//
// The value is applied to the following response codes 200, 201, 204, 206, 301,
// 302, 303, 304, 307, 308, if an origin server does not have caching HTTP headers.
//
// Responses with other codes will not be cached.
//
// The maximum duration is any equivalent to `1y`.
Default param.Opt[string] `json:"default,omitzero" format:"nginx time"`
// Caching time.
//
// The value is applied to the following response codes: 200, 206, 301, 302.
// Responses with codes 4xx, 5xx will not be cached.
//
// Use `0s` to disable caching.
//
// The maximum duration is any equivalent to `1y`.
Value param.Opt[string] `json:"value,omitzero" format:"nginx time"`
// A MAP object representing the caching time in seconds for a response with a
// specific response code.
//
// These settings have a higher priority than the `value` field.
//
// - Use `any` key to specify caching time for all response codes.
// - Use `0s` value to disable caching for a specific response code.
CustomValues map[string]string `json:"custom_values,omitzero" format:"nginx time"`
// contains filtered or unexported fields
}
Cache expiration time for CDN servers.
`value` and `default` fields cannot be used simultaneously.
The property Enabled is required.
func (RuleTemplateUpdateParamsOptionsEdgeCacheSettings) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsEdgeCacheSettings) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsEdgeCacheSettings) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsEdgeCacheSettings) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsFastedge ¶
type RuleTemplateUpdateParamsOptionsFastedge struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Allows to configure FastEdge application that will be called to handle request
// body as soon as CDN receives incoming HTTP request.
OnRequestBody RuleTemplateUpdateParamsOptionsFastedgeOnRequestBody `json:"on_request_body,omitzero"`
// Allows to configure FastEdge application that will be called to handle request
// headers as soon as CDN receives incoming HTTP request.
OnRequestHeaders RuleTemplateUpdateParamsOptionsFastedgeOnRequestHeaders `json:"on_request_headers,omitzero"`
// Allows to configure FastEdge application that will be called to handle response
// body before CDN sends the HTTP response.
OnResponseBody RuleTemplateUpdateParamsOptionsFastedgeOnResponseBody `json:"on_response_body,omitzero"`
// Allows to configure FastEdge application that will be called to handle response
// headers before CDN sends the HTTP response.
OnResponseHeaders RuleTemplateUpdateParamsOptionsFastedgeOnResponseHeaders `json:"on_response_headers,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge app to be called on different request/response phases.
Note: At least one of `on_request_headers`, `on_request_body`, `on_response_headers`, or `on_response_body` must be specified.
The property Enabled is required.
func (RuleTemplateUpdateParamsOptionsFastedge) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsFastedge) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsFastedge) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsFastedge) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsFastedgeOnRequestBody ¶
type RuleTemplateUpdateParamsOptionsFastedgeOnRequestBody struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle request body as soon as CDN receives incoming HTTP request.
The property AppID is required.
func (RuleTemplateUpdateParamsOptionsFastedgeOnRequestBody) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsFastedgeOnRequestBody) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsFastedgeOnRequestBody) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsFastedgeOnRequestBody) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsFastedgeOnRequestHeaders ¶
type RuleTemplateUpdateParamsOptionsFastedgeOnRequestHeaders struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle request headers as soon as CDN receives incoming HTTP request.
The property AppID is required.
func (RuleTemplateUpdateParamsOptionsFastedgeOnRequestHeaders) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsFastedgeOnRequestHeaders) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsFastedgeOnRequestHeaders) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsFastedgeOnResponseBody ¶
type RuleTemplateUpdateParamsOptionsFastedgeOnResponseBody struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle response body before CDN sends the HTTP response.
The property AppID is required.
func (RuleTemplateUpdateParamsOptionsFastedgeOnResponseBody) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsFastedgeOnResponseBody) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsFastedgeOnResponseBody) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsFastedgeOnResponseBody) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsFastedgeOnResponseHeaders ¶
type RuleTemplateUpdateParamsOptionsFastedgeOnResponseHeaders struct {
// The ID of the application in FastEdge.
AppID string `json:"app_id,required"`
// Determines if the FastEdge application should be called whenever HTTP request
// headers are received.
Enabled param.Opt[bool] `json:"enabled,omitzero"`
// Determines if the request should be executed at the edge nodes.
ExecuteOnEdge param.Opt[bool] `json:"execute_on_edge,omitzero"`
// Determines if the request should be executed at the shield nodes.
ExecuteOnShield param.Opt[bool] `json:"execute_on_shield,omitzero"`
// Determines if the request execution should be interrupted when an error occurs.
InterruptOnError param.Opt[bool] `json:"interrupt_on_error,omitzero"`
// contains filtered or unexported fields
}
Allows to configure FastEdge application that will be called to handle response headers before CDN sends the HTTP response.
The property AppID is required.
func (RuleTemplateUpdateParamsOptionsFastedgeOnResponseHeaders) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsFastedgeOnResponseHeaders) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsFastedgeOnResponseHeaders) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsFastedgeOnResponseHeaders) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsFetchCompressed ¶
type RuleTemplateUpdateParamsOptionsFetchCompressed struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Makes the CDN request compressed content from the origin.
The origin server should support compression. CDN servers will not decompress your content even if a user browser does not accept compression.
Notes:
- `fetch_compressed` is not supported with `gzipON` or `brotli_compression` or `slice` options enabled.
- `fetch_compressed` overrides `gzipON` and `brotli_compression` in rule. If you enable it in CDN resource and want to use `gzipON` and `brotli_compression` in a rule, you have to specify `"fetch_compressed": false` in the rule.
The properties Enabled, Value are required.
func (RuleTemplateUpdateParamsOptionsFetchCompressed) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsFetchCompressed) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsFetchCompressed) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsFetchCompressed) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsFollowOriginRedirect ¶
type RuleTemplateUpdateParamsOptionsFollowOriginRedirect struct {
// Redirect status code that the origin server returns.
//
// To serve up to date content to end users, you will need to purge the cache after
// managing the option.
//
// Any of 301, 302, 303, 307, 308.
Codes []int64 `json:"codes,omitzero,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// contains filtered or unexported fields
}
Enables redirection from origin. If the origin server returns a redirect, the option allows the CDN to pull the requested content from the origin server that was returned in the redirect.
The properties Codes, Enabled are required.
func (RuleTemplateUpdateParamsOptionsFollowOriginRedirect) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsFollowOriginRedirect) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsFollowOriginRedirect) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsFollowOriginRedirect) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsForceReturn ¶
type RuleTemplateUpdateParamsOptionsForceReturn struct {
// URL for redirection or text.
Body string `json:"body,required"`
// Status code value.
Code int64 `json:"code,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Controls the time at which a custom HTTP response code should be applied. By
// default, a custom HTTP response code is applied at any time.
TimeInterval RuleTemplateUpdateParamsOptionsForceReturnTimeInterval `json:"time_interval,omitzero"`
// contains filtered or unexported fields
}
Applies custom HTTP response codes for CDN content.
The following codes are reserved by our system and cannot be specified in this option: 408, 444, 477, 494, 495, 496, 497, 499.
The properties Body, Code, Enabled are required.
func (RuleTemplateUpdateParamsOptionsForceReturn) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsForceReturn) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsForceReturn) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsForceReturn) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsForceReturnTimeInterval ¶
type RuleTemplateUpdateParamsOptionsForceReturnTimeInterval struct {
// Time until which a custom HTTP response code should be applied. Indicated in
// 24-hour format.
EndTime string `json:"end_time,required"`
// Time from which a custom HTTP response code should be applied. Indicated in
// 24-hour format.
StartTime string `json:"start_time,required"`
// Time zone used to calculate time.
TimeZone param.Opt[string] `json:"time_zone,omitzero" format:"timezone"`
// contains filtered or unexported fields
}
Controls the time at which a custom HTTP response code should be applied. By default, a custom HTTP response code is applied at any time.
The properties EndTime, StartTime are required.
func (RuleTemplateUpdateParamsOptionsForceReturnTimeInterval) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsForceReturnTimeInterval) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsForceReturnTimeInterval) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsForceReturnTimeInterval) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsForwardHostHeader ¶
type RuleTemplateUpdateParamsOptionsForwardHostHeader struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Forwards the Host header from a end-user request to an origin server.
`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (RuleTemplateUpdateParamsOptionsForwardHostHeader) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsForwardHostHeader) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsForwardHostHeader) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsForwardHostHeader) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsGzipOn ¶
type RuleTemplateUpdateParamsOptionsGzipOn struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Compresses content with gzip on the CDN end. CDN servers will request only uncompressed content from the origin.
Notes:
- Compression with gzip is not supported with `fetch_compressed` or `slice` options enabled.
- `fetch_compressed` option in CDN resource settings overrides `gzipON` in rules. If you enable `fetch_compressed` in CDN resource and want to enable `gzipON` in rules, you need to specify `"fetch_compressed":false` for rules.
The properties Enabled, Value are required.
func (RuleTemplateUpdateParamsOptionsGzipOn) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsGzipOn) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsGzipOn) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsGzipOn) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsHostHeader ¶
type RuleTemplateUpdateParamsOptionsHostHeader struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Host Header value.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
Sets the Host header that CDN servers use when request content from an origin server. Your server must be able to process requests with the chosen header.
If the option is `null`, the Host Header value is equal to first CNAME.
`hostHeader` and `forward_host_header` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (RuleTemplateUpdateParamsOptionsHostHeader) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsHostHeader) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsHostHeader) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsHostHeader) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsIPAddressACL ¶
type RuleTemplateUpdateParamsOptionsIPAddressACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of IP addresses with a subnet mask.
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of IP addresses for which access is prohibited.
// - **deny** - List of IP addresses for which access is allowed.
//
// Examples:
//
// - `192.168.3.2/32`
// - `2a03:d000:2980:7::8/128`
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"ipv4net or ipv6net"`
// IP access policy type.
//
// Possible values:
//
// - **allow** - Allow access to all IPs except IPs specified in "excepted_values"
// field.
// - **deny** - Deny access to all IPs except IPs specified in "excepted_values"
// field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Controls access to the CDN resource content for specific IP addresses.
If you want to use IPs from our CDN servers IP list for IP ACL configuration, you have to independently monitor their relevance. We recommend you use a script for automatically update IP ACL. [Read more.](/docs/api-reference/cdn/ip-addresses-list/get-cdn-servers-ip-addresses)
The properties Enabled, ExceptedValues, PolicyType are required.
func (RuleTemplateUpdateParamsOptionsIPAddressACL) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsIPAddressACL) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsIPAddressACL) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsIPAddressACL) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsIgnoreCookie ¶
type RuleTemplateUpdateParamsOptionsIgnoreCookie struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled, files with cookies are cached as one file.
// - **false** - Option is disabled, files with cookies are cached as different
// files.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Defines whether the files with the Set-Cookies header are cached as one file or as different ones.
The properties Enabled, Value are required.
func (RuleTemplateUpdateParamsOptionsIgnoreCookie) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsIgnoreCookie) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsIgnoreCookie) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsIgnoreCookie) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsIgnoreQueryString ¶
type RuleTemplateUpdateParamsOptionsIgnoreQueryString struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
How a file with different query strings is cached: either as one object (option is enabled) or as different objects (option is disabled.)
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (RuleTemplateUpdateParamsOptionsIgnoreQueryString) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsIgnoreQueryString) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsIgnoreQueryString) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsIgnoreQueryString) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsImageStack ¶
type RuleTemplateUpdateParamsOptionsImageStack struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Enables or disables automatic conversion of JPEG and PNG images to AVI format.
AvifEnabled param.Opt[bool] `json:"avif_enabled,omitzero"`
// Enables or disables compression without quality loss for PNG format.
PngLossless param.Opt[bool] `json:"png_lossless,omitzero"`
// Defines quality settings for JPG and PNG images. The higher the value, the
// better the image quality, and the larger the file size after conversion.
Quality param.Opt[int64] `json:"quality,omitzero"`
// Enables or disables automatic conversion of JPEG and PNG images to WebP format.
WebpEnabled param.Opt[bool] `json:"webp_enabled,omitzero"`
// contains filtered or unexported fields
}
Transforms JPG and PNG images (for example, resize or crop) and automatically converts them to WebP or AVIF format.
The property Enabled is required.
func (RuleTemplateUpdateParamsOptionsImageStack) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsImageStack) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsImageStack) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsImageStack) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsLimitBandwidth ¶
type RuleTemplateUpdateParamsOptionsLimitBandwidth struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Method of controlling the download speed per connection.
//
// Possible values:
//
// - **static** - Use speed and buffer fields to set the download speed limit.
// - **dynamic** - Use query strings **speed** and **buffer** to set the download
// speed limit.
//
// # For example, when requesting content at the link
//
// “`
// http://cdn.example.com/video.mp4?speed=50k&buffer=500k
// “`
//
// the download speed will be limited to 50kB/s after 500 kB.
//
// Any of "static", "dynamic".
LimitType string `json:"limit_type,omitzero,required"`
// Amount of downloaded data after which the user will be rate limited.
Buffer param.Opt[int64] `json:"buffer,omitzero"`
// Maximum download speed per connection.
Speed param.Opt[int64] `json:"speed,omitzero"`
// contains filtered or unexported fields
}
Allows to control the download speed per connection.
The properties Enabled, LimitType are required.
func (RuleTemplateUpdateParamsOptionsLimitBandwidth) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsLimitBandwidth) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsLimitBandwidth) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsLimitBandwidth) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsProxyCacheKey ¶
type RuleTemplateUpdateParamsOptionsProxyCacheKey struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Key for caching.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
Allows you to modify your cache key. If omitted, the default value is `$request_uri`.
Combine the specified variables to create a key for caching.
- **$`request_uri`** - **$scheme** - **$uri**
**Warning**: Enabling and changing this option can invalidate your current cache and affect the cache hit ratio. Furthermore, the "Purge by pattern" option will not work.
The properties Enabled, Value are required.
func (RuleTemplateUpdateParamsOptionsProxyCacheKey) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsProxyCacheKey) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsProxyCacheKey) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsProxyCacheKey) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsProxyCacheMethodsSet ¶
type RuleTemplateUpdateParamsOptionsProxyCacheMethodsSet struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Caching for POST requests along with default GET and HEAD.
The properties Enabled, Value are required.
func (RuleTemplateUpdateParamsOptionsProxyCacheMethodsSet) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsProxyCacheMethodsSet) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsProxyCacheMethodsSet) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsProxyCacheMethodsSet) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsProxyConnectTimeout ¶
type RuleTemplateUpdateParamsOptionsProxyConnectTimeout struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Timeout value in seconds.
//
// Supported range: **1s - 5s**.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
The time limit for establishing a connection with the origin.
The properties Enabled, Value are required.
func (RuleTemplateUpdateParamsOptionsProxyConnectTimeout) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsProxyConnectTimeout) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsProxyConnectTimeout) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsProxyConnectTimeout) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsProxyReadTimeout ¶
type RuleTemplateUpdateParamsOptionsProxyReadTimeout struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Timeout value in seconds.
//
// Supported range: **1s - 30s**.
Value string `json:"value,required"`
// contains filtered or unexported fields
}
The time limit for receiving a partial response from the origin. If no response is received within this time, the connection will be closed.
**Note:** When used with a WebSocket connection, this option supports values only in the range 1–20 seconds (instead of the usual 1–30 seconds).
The properties Enabled, Value are required.
func (RuleTemplateUpdateParamsOptionsProxyReadTimeout) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsProxyReadTimeout) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsProxyReadTimeout) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsProxyReadTimeout) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsQueryParamsBlacklist ¶
type RuleTemplateUpdateParamsOptionsQueryParamsBlacklist struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of query parameters.
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Files with the specified query parameters are cached as one object, files with other parameters are cached as different objects.
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (RuleTemplateUpdateParamsOptionsQueryParamsBlacklist) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsQueryParamsBlacklist) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsQueryParamsBlacklist) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsQueryParamsBlacklist) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsQueryParamsWhitelist ¶
type RuleTemplateUpdateParamsOptionsQueryParamsWhitelist struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of query parameters.
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Files with the specified query parameters are cached as different objects, files with other parameters are cached as one object.
`ignoreQueryString`, `query_params_whitelist` and `query_params_blacklist` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (RuleTemplateUpdateParamsOptionsQueryParamsWhitelist) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsQueryParamsWhitelist) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsQueryParamsWhitelist) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsQueryParamsWhitelist) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsQueryStringForwarding ¶
type RuleTemplateUpdateParamsOptionsQueryStringForwarding struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// The `forward_from_files_types` field specifies the types of playlist files from
// which parameters will be extracted and forwarded. This typically includes
// formats that list multiple media chunk references, such as HLS and DASH
// playlists. Parameters associated with these playlist files (like query strings
// or headers) will be propagated to the chunks they reference.
ForwardFromFileTypes []string `json:"forward_from_file_types,omitzero,required"`
// The field specifies the types of media chunk files to which parameters,
// extracted from playlist files, will be forwarded. These refer to the actual
// segments of media content that are delivered to viewers. Ensuring the correct
// parameters are forwarded to these files is crucial for maintaining the integrity
// of the streaming session.
ForwardToFileTypes []string `json:"forward_to_file_types,omitzero,required"`
// The `forward_except_keys` field provides a mechanism to exclude specific
// parameters from being forwarded from playlist files to media chunk files. By
// listing certain keys in this field, you can ensure that these parameters are
// omitted during the forwarding process. This is particularly useful for
// preventing sensitive or irrelevant information from being included in requests
// for media chunks, thereby enhancing security and optimizing performance.
ForwardExceptKeys []string `json:"forward_except_keys,omitzero"`
// The `forward_only_keys` field allows for granular control over which specific
// parameters are forwarded from playlist files to media chunk files. By specifying
// certain keys, only those parameters will be propagated, ensuring that only
// relevant information is passed along. This is particularly useful for security
// and performance optimization, as it prevents unnecessary or sensitive data from
// being included in requests for media chunks.
ForwardOnlyKeys []string `json:"forward_only_keys,omitzero"`
// contains filtered or unexported fields
}
The Query String Forwarding feature allows for the seamless transfer of parameters embedded in playlist files to the corresponding media chunk files. This functionality ensures that specific attributes, such as authentication tokens or tracking information, are consistently passed along from the playlist manifest to the individual media segments. This is particularly useful for maintaining continuity in security, analytics, and any other parameter-based operations across the entire media delivery workflow.
The properties Enabled, ForwardFromFileTypes, ForwardToFileTypes are required.
func (RuleTemplateUpdateParamsOptionsQueryStringForwarding) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsQueryStringForwarding) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsQueryStringForwarding) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsQueryStringForwarding) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsRedirectHTTPSToHTTP ¶
type RuleTemplateUpdateParamsOptionsRedirectHTTPSToHTTP struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Enables redirect from HTTPS to HTTP.
`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (RuleTemplateUpdateParamsOptionsRedirectHTTPSToHTTP) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsRedirectHTTPSToHTTP) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsRedirectHTTPSToHTTP) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsRedirectHTTPSToHTTP) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsRedirectHTTPToHTTPS ¶
type RuleTemplateUpdateParamsOptionsRedirectHTTPToHTTPS struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Enables redirect from HTTP to HTTPS.
`redirect_http_to_https` and `redirect_https_to_http` options cannot be enabled simultaneously.
The properties Enabled, Value are required.
func (RuleTemplateUpdateParamsOptionsRedirectHTTPToHTTPS) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsRedirectHTTPToHTTPS) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsRedirectHTTPToHTTPS) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsRedirectHTTPToHTTPS) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsReferrerACL ¶
type RuleTemplateUpdateParamsOptionsReferrerACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of domain names or wildcard domains (without protocol: `http://` or
// `https://`.)
//
// The meaning of the parameter depends on `policy_type` value:
//
// - **allow** - List of domain names for which access is prohibited.
// - **deny** - List of IP domain names for which access is allowed.
//
// Examples:
//
// - `example.com`
// - `*.example.com`
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"domain or wildcard"`
// Policy type.
//
// Possible values:
//
// - **allow** - Allow access to all domain names except the domain names specified
// in `excepted_values` field.
// - **deny** - Deny access to all domain names except the domain names specified
// in `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Controls access to the CDN resource content for specified domain names.
The properties Enabled, ExceptedValues, PolicyType are required.
func (RuleTemplateUpdateParamsOptionsReferrerACL) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsReferrerACL) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsReferrerACL) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsReferrerACL) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsRequestLimiter ¶
type RuleTemplateUpdateParamsOptionsRequestLimiter struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Maximum request rate.
Rate int64 `json:"rate,required"`
// Units of measurement for the `rate` field.
//
// Possible values:
//
// - **r/s** - Requests per second.
// - **r/m** - Requests per minute.
//
// If the rate is less than one request per second, it is specified in request per
// minute (r/m.)
//
// Any of "r/s", "r/m".
RateUnit string `json:"rate_unit,omitzero"`
// contains filtered or unexported fields
}
Option allows to limit the amount of HTTP requests.
The properties Enabled, Rate are required.
func (RuleTemplateUpdateParamsOptionsRequestLimiter) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsRequestLimiter) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsRequestLimiter) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsRequestLimiter) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsResponseHeadersHidingPolicy ¶
type RuleTemplateUpdateParamsOptionsResponseHeadersHidingPolicy struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of HTTP headers.
//
// Parameter meaning depends on the value of the `mode` field:
//
// - **show** - List of HTTP headers to hide from response.
// - **hide** - List of HTTP headers to include in response. Other HTTP headers
// will be hidden.
//
// The following headers are required and cannot be hidden from response:
//
// - `Connection`
// - `Content-Length`
// - `Content-Type`
// - `Date`
// - `Server`
Excepted []string `json:"excepted,omitzero,required" format:"http_header"`
// How HTTP headers are hidden from the response.
//
// Possible values:
//
// - **show** - Hide only HTTP headers listed in the `excepted` field.
// - **hide** - Hide all HTTP headers except headers listed in the "excepted"
// field.
//
// Any of "hide", "show".
Mode string `json:"mode,omitzero,required"`
// contains filtered or unexported fields
}
Hides HTTP headers from an origin server in the CDN response.
The properties Enabled, Excepted, Mode are required.
func (RuleTemplateUpdateParamsOptionsResponseHeadersHidingPolicy) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsResponseHeadersHidingPolicy) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsResponseHeadersHidingPolicy) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsResponseHeadersHidingPolicy) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsRewrite ¶
type RuleTemplateUpdateParamsOptionsRewrite struct {
// Path for the Rewrite option.
//
// Example:
//
// - `/(.*) /media/$1`
Body string `json:"body,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Flag for the Rewrite option.
//
// Possible values:
//
// - **last** - Stop processing the current set of `ngx_http_rewrite_module`
// directives and start a search for a new location matching changed URI.
// - **break** - Stop processing the current set of the Rewrite option.
// - **redirect** - Return a temporary redirect with the 302 code; used when a
// replacement string does not start with `http://`, `https://`, or `$scheme`.
// - **permanent** - Return a permanent redirect with the 301 code.
//
// Any of "break", "last", "redirect", "permanent".
Flag string `json:"flag,omitzero"`
// contains filtered or unexported fields
}
Changes and redirects requests from the CDN to the origin. It operates according to the [Nginx](https://nginx.org/en/docs/http/ngx_http_rewrite_module.html#rewrite) configuration.
The properties Body, Enabled are required.
func (RuleTemplateUpdateParamsOptionsRewrite) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsRewrite) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsRewrite) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsRewrite) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsSecureKey ¶
type RuleTemplateUpdateParamsOptionsSecureKey struct {
// Key generated on your side that will be used for URL signing.
Key param.Opt[string] `json:"key,omitzero,required"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Type of URL signing.
//
// Possible types:
//
// - **Type 0** - Includes end user IP to secure token generation.
// - **Type 2** - Excludes end user IP from secure token generation.
//
// Any of 0, 2.
Type int64 `json:"type,omitzero"`
// contains filtered or unexported fields
}
Configures access with tokenized URLs. This makes impossible to access content without a valid (unexpired) token.
The properties Enabled, Key are required.
func (RuleTemplateUpdateParamsOptionsSecureKey) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsSecureKey) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsSecureKey) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsSecureKey) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsSlice ¶
type RuleTemplateUpdateParamsOptionsSlice struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Requests and caches files larger than 10 MB in parts (no larger than 10 MB per part.) This reduces time to first byte.
The option is based on the [Slice](https://nginx.org/en/docs/http/ngx_http_slice_module.html) module.
Notes:
- Origin must support HTTP Range requests.
- Not supported with `gzipON`, `brotli_compression` or `fetch_compressed` options enabled.
The properties Enabled, Value are required.
func (RuleTemplateUpdateParamsOptionsSlice) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsSlice) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsSlice) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsSlice) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsSni ¶
type RuleTemplateUpdateParamsOptionsSni struct {
// Custom SNI hostname.
//
// It is required if `sni_type` is set to custom.
CustomHostname string `json:"custom_hostname,required" format:"domain"`
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// SNI (Server Name Indication) type.
//
// Possible values:
//
// - **dynamic** - SNI hostname depends on `hostHeader` and `forward_host_header`
// options. It has several possible combinations:
// - If the `hostHeader` option is enabled and specified, SNI hostname matches the
// Host header.
// - If the `forward_host_header` option is enabled and has true value, SNI
// hostname matches the Host header used in the request made to a CDN.
// - If the `hostHeader` and `forward_host_header` options are disabled, SNI
// hostname matches the primary CNAME.
// - **custom** - custom SNI hostname is in use.
//
// Any of "dynamic", "custom".
SniType string `json:"sni_type,omitzero"`
// contains filtered or unexported fields
}
The hostname that is added to SNI requests from CDN servers to the origin server via HTTPS.
SNI is generally only required if your origin uses shared hosting or does not have a dedicated IP address. If the origin server presents multiple certificates, SNI allows the origin server to know which certificate to use for the connection.
The option works only if `originProtocol` parameter is `HTTPS` or `MATCH`.
The properties CustomHostname, Enabled are required.
func (RuleTemplateUpdateParamsOptionsSni) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsSni) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsSni) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsSni) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsStale ¶
type RuleTemplateUpdateParamsOptionsStale struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Defines list of errors for which "Always online" option is applied.
//
// Any of "error", "http_403", "http_404", "http_429", "http_500", "http_502",
// "http_503", "http_504", "invalid_header", "timeout", "updating".
Value []string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Serves stale cached content in case of origin unavailability.
The properties Enabled, Value are required.
func (RuleTemplateUpdateParamsOptionsStale) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsStale) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsStale) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsStale) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsStaticHeaders
deprecated
type RuleTemplateUpdateParamsOptionsStaticHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// A MAP for static headers in a format of `header_name: header_value`.
//
// Restrictions:
//
// - **Header name** - Maximum 128 symbols, may contain Latin letters (A-Z, a-z),
// numbers (0-9), dashes, and underscores.
// - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
// (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
// with a letter, number, asterisk or {.
Value any `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
**Legacy option**. Use the `static_response_headers` option instead.
Custom HTTP Headers that a CDN server adds to response. Up to fifty custom HTTP Headers can be specified. May contain a header with multiple values.
Deprecated: deprecated
The properties Enabled, Value are required.
func (RuleTemplateUpdateParamsOptionsStaticHeaders) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsStaticHeaders) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsStaticHeaders) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsStaticHeaders) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsStaticRequestHeaders ¶
type RuleTemplateUpdateParamsOptionsStaticRequestHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// A MAP for static headers in a format of `header_name: header_value`.
//
// Restrictions:
//
// - **Header name** - Maximum 255 symbols, may contain Latin letters (A-Z, a-z),
// numbers (0-9), dashes, and underscores.
// - **Header value** - Maximum 512 symbols, may contain letters (a-z), numbers
// (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+ /|\";:?.,><{}[]). Must start
// with a letter, number, asterisk or {.
Value map[string]string `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Custom HTTP Headers for a CDN server to add to request. Up to fifty custom HTTP Headers can be specified.
The properties Enabled, Value are required.
func (RuleTemplateUpdateParamsOptionsStaticRequestHeaders) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsStaticRequestHeaders) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsStaticRequestHeaders) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsStaticRequestHeaders) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsStaticResponseHeaders ¶
type RuleTemplateUpdateParamsOptionsStaticResponseHeaders struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
Value []RuleTemplateUpdateParamsOptionsStaticResponseHeadersValue `json:"value,omitzero,required"`
// contains filtered or unexported fields
}
Custom HTTP Headers that a CDN server adds to a response.
The properties Enabled, Value are required.
func (RuleTemplateUpdateParamsOptionsStaticResponseHeaders) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsStaticResponseHeaders) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsStaticResponseHeaders) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsStaticResponseHeaders) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsStaticResponseHeadersValue ¶
type RuleTemplateUpdateParamsOptionsStaticResponseHeadersValue struct {
// HTTP Header name.
//
// Restrictions:
//
// - Maximum 128 symbols.
// - Latin letters (A-Z, a-z,) numbers (0-9,) dashes, and underscores only.
Name string `json:"name,required"`
// Header value.
//
// Restrictions:
//
// - Maximum 512 symbols.
// - Letters (a-z), numbers (0-9), spaces, and symbols (`~!@#%%^&\*()-\_=+
// /|\";:?.,><{}[]).
// - Must start with a letter, number, asterisk or {.
// - Multiple values can be added.
Value []string `json:"value,omitzero,required"`
// Defines whether the header will be added to a response from CDN regardless of
// response code.
//
// Possible values:
//
// - **true** - Header will be added to a response from CDN regardless of response
// code.
// - **false** - Header will be added only to the following response codes: 200,
// 201, 204, 206, 301, 302, 303, 304, 307, 308.
Always param.Opt[bool] `json:"always,omitzero"`
// contains filtered or unexported fields
}
The properties Name, Value are required.
func (RuleTemplateUpdateParamsOptionsStaticResponseHeadersValue) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsStaticResponseHeadersValue) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsStaticResponseHeadersValue) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsStaticResponseHeadersValue) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsUserAgentACL ¶
type RuleTemplateUpdateParamsOptionsUserAgentACL struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// List of User-Agents that will be allowed/denied.
//
// The meaning of the parameter depends on `policy_type`:
//
// - **allow** - List of User-Agents for which access is prohibited.
// - **deny** - List of User-Agents for which access is allowed.
//
// Use an empty string `""` to allow/deny access when the User-Agent header is
// empty.
ExceptedValues []string `json:"excepted_values,omitzero,required" format:"user_agent"`
// User-Agents policy type.
//
// Possible values:
//
// - **allow** - Allow access for all User-Agents except specified in
// `excepted_values` field.
// - **deny** - Deny access for all User-Agents except specified in
// `excepted_values` field.
//
// Any of "allow", "deny".
PolicyType string `json:"policy_type,omitzero,required"`
// contains filtered or unexported fields
}
Controls access to the content for specified User-Agents.
The properties Enabled, ExceptedValues, PolicyType are required.
func (RuleTemplateUpdateParamsOptionsUserAgentACL) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsUserAgentACL) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsUserAgentACL) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsUserAgentACL) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsWaap ¶
type RuleTemplateUpdateParamsOptionsWaap struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Allows to enable WAAP (Web Application and API Protection).
The properties Enabled, Value are required.
func (RuleTemplateUpdateParamsOptionsWaap) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsWaap) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsWaap) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsWaap) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOptionsWebsockets ¶
type RuleTemplateUpdateParamsOptionsWebsockets struct {
// Controls the option state.
//
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Enabled bool `json:"enabled,required"`
// Possible values:
//
// - **true** - Option is enabled.
// - **false** - Option is disabled.
Value bool `json:"value,required"`
// contains filtered or unexported fields
}
Enables or disables WebSockets connections to an origin server.
The properties Enabled, Value are required.
func (RuleTemplateUpdateParamsOptionsWebsockets) MarshalJSON ¶
func (r RuleTemplateUpdateParamsOptionsWebsockets) MarshalJSON() (data []byte, err error)
func (*RuleTemplateUpdateParamsOptionsWebsockets) UnmarshalJSON ¶
func (r *RuleTemplateUpdateParamsOptionsWebsockets) UnmarshalJSON(data []byte) error
type RuleTemplateUpdateParamsOverrideOriginProtocol ¶
type RuleTemplateUpdateParamsOverrideOriginProtocol string
Sets a protocol other than the one specified in the CDN resource settings to connect to the origin.
Possible values:
- **HTTPS** - CDN servers connect to origin via HTTPS protocol.
- **HTTP** - CDN servers connect to origin via HTTP protocol.
- **MATCH** - Connection protocol is chosen automatically; in this case, content on origin source should be available for the CDN both through HTTP and HTTPS protocols.
- **null** - `originProtocol` setting is inherited from the CDN resource settings.
const ( RuleTemplateUpdateParamsOverrideOriginProtocolHTTPS RuleTemplateUpdateParamsOverrideOriginProtocol = "HTTPS" RuleTemplateUpdateParamsOverrideOriginProtocolHTTP RuleTemplateUpdateParamsOverrideOriginProtocol = "HTTP" RuleTemplateUpdateParamsOverrideOriginProtocolMatch RuleTemplateUpdateParamsOverrideOriginProtocol = "MATCH" )
type ShieldAggregatedStats ¶
type ShieldAggregatedStats struct {
// CDN resource ID for which statistics data is shown.
Number1Example any `json:"1 (example)"`
// Statistics parameters.
Metrics any `json:"metrics"`
// Resources IDs by which statistics data is grouped.
Resource any `json:"resource"`
// Number of CDN resources that used origin shielding.
ShieldUsage string `json:"shield_usage"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
Number1Example respjson.Field
Metrics respjson.Field
Resource respjson.Field
ShieldUsage respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ShieldAggregatedStats) RawJSON ¶
func (r ShieldAggregatedStats) RawJSON() string
Returns the unmodified JSON received from the API
func (*ShieldAggregatedStats) UnmarshalJSON ¶
func (r *ShieldAggregatedStats) UnmarshalJSON(data []byte) error
type ShieldListResponse ¶
type ShieldListResponse struct {
// Origin shielding location ID.
ID int64 `json:"id"`
// City of origin shielding location.
City string `json:"city"`
// Country of origin shielding location.
Country string `json:"country"`
// Name of origin shielding location datacenter.
Datacenter string `json:"datacenter"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
City respjson.Field
Country respjson.Field
Datacenter respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (ShieldListResponse) RawJSON ¶
func (r ShieldListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*ShieldListResponse) UnmarshalJSON ¶
func (r *ShieldListResponse) UnmarshalJSON(data []byte) error
type ShieldService ¶
type ShieldService struct {
Options []option.RequestOption
}
ShieldService 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 NewShieldService method instead.
func NewShieldService ¶
func NewShieldService(opts ...option.RequestOption) (r ShieldService)
NewShieldService 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 (*ShieldService) List ¶
func (r *ShieldService) List(ctx context.Context, opts ...option.RequestOption) (res *[]ShieldListResponse, err error)
Get information about all origin shielding locations available in the account.
type SslDetail ¶
type SslDetail struct {
// SSL certificate ID.
ID int64 `json:"id"`
// How the SSL certificate was issued.
//
// Possible values:
//
// - **true** - Certificate was issued automatically.
// - **false** - Certificate was added by a use.
Automated bool `json:"automated"`
// Name of the certification center issued the SSL certificate.
CertIssuer string `json:"cert_issuer"`
// Alternative domain names that the SSL certificate secures.
CertSubjectAlt string `json:"cert_subject_alt"`
// Domain name that the SSL certificate secures.
CertSubjectCn string `json:"cert_subject_cn"`
// Defines whether the certificate has been deleted. Parameter is **deprecated**.
//
// Possible values:
//
// - **true** - Certificate has been deleted.
// - **false** - Certificate has not been deleted.
Deleted bool `json:"deleted"`
// Defines whether the SSL certificate is used by a CDN resource.
//
// Possible values:
//
// - **true** - Certificate is used by a CDN resource.
// - **false** - Certificate is not used by a CDN resource.
HasRelatedResources bool `json:"hasRelatedResources"`
// SSL certificate name.
Name string `json:"name"`
// Parameter is **deprecated**.
SslCertificateChain string `json:"sslCertificateChain"`
// Date when certificate become untrusted (ISO 8601/RFC 3339 format, UTC.)
ValidityNotAfter string `json:"validity_not_after"`
// Date when certificate become valid (ISO 8601/RFC 3339 format, UTC.)
ValidityNotBefore string `json:"validity_not_before"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Automated respjson.Field
CertIssuer respjson.Field
CertSubjectAlt respjson.Field
CertSubjectCn respjson.Field
Deleted respjson.Field
HasRelatedResources respjson.Field
Name respjson.Field
SslCertificateChain respjson.Field
ValidityNotAfter respjson.Field
ValidityNotBefore respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (*SslDetail) UnmarshalJSON ¶
type SslDetailList ¶
type SslDetailList []SslDetail
type SslRequestStatus ¶
type SslRequestStatus struct {
// ID of the attempt to issue a Let's Encrypt certificate.
ID int64 `json:"id"`
// Defines whether the Let's Encrypt certificate issuing process is active.
//
// Possible values:
//
// - **true** - Issuing process is active.
// - **false** - Issuing process is completed.
Active bool `json:"active"`
// Number of attempts to issue the Let's Encrypt certificate.
AttemptsCount int64 `json:"attempts_count"`
// Date when the process of issuing a Let's Encrypt certificate was finished (ISO
// 8601/RFC 3339 format, UTC).
//
// The field is **null** if the issuing process is not finished.
Finished string `json:"finished"`
// Detailed information about last attempt to issue a Let's Encrypt certificate.
LatestStatus SslRequestStatusLatestStatus `json:"latest_status"`
// Time of the next scheduled attempt to issue the Let's Encrypt certificate (ISO
// 8601/RFC 3339 format, UTC).
NextAttemptTime string `json:"next_attempt_time,nullable"`
// CDN resource ID.
Resource int64 `json:"resource"`
// Date when the process of issuing a Let's Encrypt certificate was started (ISO
// 8601/RFC 3339 format, UTC).
Started string `json:"started"`
// Detailed information about attempts to issue a Let's Encrypt certificate.
Statuses []SslRequestStatusStatus `json:"statuses"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Active respjson.Field
AttemptsCount respjson.Field
Finished respjson.Field
LatestStatus respjson.Field
NextAttemptTime respjson.Field
Resource respjson.Field
Started respjson.Field
Statuses respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SslRequestStatus) RawJSON ¶
func (r SslRequestStatus) RawJSON() string
Returns the unmodified JSON received from the API
func (*SslRequestStatus) UnmarshalJSON ¶
func (r *SslRequestStatus) UnmarshalJSON(data []byte) error
type SslRequestStatusLatestStatus ¶
type SslRequestStatusLatestStatus struct {
// ID of the attempt to issue the Let's Encrypt certificate.
ID int64 `json:"id"`
// Date and time when the issuing attempt status was created (ISO 8601/RFC 3339
// format, UTC).
Created string `json:"created"`
// Detailed description of the error that occurred when trying to issue a Let's
// Encrypt certificate.
Details string `json:"details"`
// Brief description of the error that occurred when trying to issue a Let's
// Encrypt certificate.
Error string `json:"error"`
// Date indicating when the certificate issuance limit will be lifted (ISO 8601/RFC
// 3339 format, UTC).
//
// It is filled in only if error = RateLimited.
RetryAfter string `json:"retry_after"`
// Status of the attempt to issue the Let's Encrypt certificate.
//
// Possible values:
//
// - **Done** - Attempt is successful. Let's Encrypt certificate was issued.
// - **Failed** - Attempt failed. Let's Encrypt certificate was not issued.
// - **Cancelled** - Attempt is canceled. Let's Encrypt certificate was not issued.
Status string `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Created respjson.Field
Details respjson.Field
Error respjson.Field
RetryAfter respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
Detailed information about last attempt to issue a Let's Encrypt certificate.
func (SslRequestStatusLatestStatus) RawJSON ¶
func (r SslRequestStatusLatestStatus) RawJSON() string
Returns the unmodified JSON received from the API
func (*SslRequestStatusLatestStatus) UnmarshalJSON ¶
func (r *SslRequestStatusLatestStatus) UnmarshalJSON(data []byte) error
type SslRequestStatusStatus ¶
type SslRequestStatusStatus struct {
// ID of the attempt to issue the Let's Encrypt certificate.
ID int64 `json:"id"`
// Date and time when the issuing attempt status was created (ISO 8601/RFC 3339
// format, UTC).
Created string `json:"created"`
// Detailed description of the error that occurred when trying to issue a Let's
// Encrypt certificate.
Details string `json:"details"`
// Brief description of the error that occurred when trying to issue a Let's
// Encrypt certificate.
Error string `json:"error"`
// Date indicating when the certificate issuance limit will be lifted (ISO 8601/RFC
// 3339 format, UTC).
//
// It is filled in only if error = RateLimited.
RetryAfter string `json:"retry_after"`
// Status of the attempt to issue the Let's Encrypt certificate.
//
// Possible values:
//
// - **Done** - Attempt is successful. Let's Encrypt certificate was issued.
// - **Failed** - Attempt failed. Let's Encrypt certificate was not issued.
// - **Cancelled** - Attempt is canceled. Let's Encrypt certificate was not issued.
Status string `json:"status"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ID respjson.Field
Created respjson.Field
Details respjson.Field
Error respjson.Field
RetryAfter respjson.Field
Status respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (SslRequestStatusStatus) RawJSON ¶
func (r SslRequestStatusStatus) RawJSON() string
Returns the unmodified JSON received from the API
func (*SslRequestStatusStatus) UnmarshalJSON ¶
func (r *SslRequestStatusStatus) UnmarshalJSON(data []byte) error
type StatisticGetLogsUsageAggregatedParams ¶
type StatisticGetLogsUsageAggregatedParams struct {
// Beginning of the requested time period (ISO 8601/RFC 3339 format, UTC.)
From string `query:"from,required" json:"-"`
// End of the requested time period (ISO 8601/RFC 3339 format, UTC.)
To string `query:"to,required" json:"-"`
// The way the parameters are arranged in the response.
//
// Possible values:
//
// - **true** – Flat structure is used.
// - **false** – Embedded structure is used (default.)
Flat param.Opt[bool] `query:"flat,omitzero" json:"-"`
// Output data grouping.
//
// Possible value:
//
// - **resource** - Data is grouped by CDN resources.
GroupBy param.Opt[string] `query:"group_by,omitzero" json:"-"`
// CDN resources IDs by that statistics data is grouped.
//
// To request multiple values, use:
//
// - &resource=1&resource=2
//
// If CDN resource ID is not specified, data related to all CDN resources is
// returned.
Resource param.Opt[int64] `query:"resource,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (StatisticGetLogsUsageAggregatedParams) URLQuery ¶
func (r StatisticGetLogsUsageAggregatedParams) URLQuery() (v url.Values, err error)
URLQuery serializes StatisticGetLogsUsageAggregatedParams's query parameters as `url.Values`.
type StatisticGetLogsUsageSeriesParams ¶
type StatisticGetLogsUsageSeriesParams struct {
// Beginning of the requested time period (ISO 8601/RFC 3339 format, UTC.)
From string `query:"from,required" json:"-"`
// End of the requested time period (ISO 8601/RFC 3339 format, UTC.)
To string `query:"to,required" json:"-"`
// CDN resources IDs by that statistics data is grouped.
//
// To request multiple values, use:
//
// - &resource=1&resource=2
//
// If CDN resource ID is not specified, data related to all CDN resources is
// returned.
Resource param.Opt[int64] `query:"resource,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (StatisticGetLogsUsageSeriesParams) URLQuery ¶
func (r StatisticGetLogsUsageSeriesParams) URLQuery() (v url.Values, err error)
URLQuery serializes StatisticGetLogsUsageSeriesParams's query parameters as `url.Values`.
type StatisticGetResourceUsageAggregatedParams ¶
type StatisticGetResourceUsageAggregatedParams struct {
// Beginning of the requested time period (ISO 8601/RFC 3339 format, UTC.)
From string `query:"from,required" json:"-"`
// Types of statistics data.
//
// Possible values:
//
// - **`upstream_bytes`** – Traffic in bytes from an origin server to CDN servers
// or to origin shielding when used.
// - **`sent_bytes`** – Traffic in bytes from CDN servers to clients.
// - **`shield_bytes`** – Traffic in bytes from origin shielding to CDN servers.
// - **`backblaze_bytes`** - Traffic in bytes from Backblaze origin.
// - **`total_bytes`** – `shield_bytes`, `upstream_bytes` and `sent_bytes`
// combined.
// - **`cdn_bytes`** – `sent_bytes` and `shield_bytes` combined.
// - **requests** – Number of requests to edge servers.
// - **`responses_2xx`** – Number of 2xx response codes.
// - **`responses_3xx`** – Number of 3xx response codes.
// - **`responses_4xx`** – Number of 4xx response codes.
// - **`responses_5xx`** – Number of 5xx response codes.
// - **`responses_hit`** – Number of responses with the header Cache: HIT.
// - **`responses_miss`** – Number of responses with the header Cache: MISS.
// - **`response_types`** – Statistics by content type. It returns a number of
// responses for content with different MIME types.
// - **`cache_hit_traffic_ratio`** – Formula: 1 - `upstream_bytes` / `sent_bytes`.
// We deduct the non-cached traffic from the total traffic amount.
// - **`cache_hit_requests_ratio`** – Formula: `responses_hit` / requests. The
// share of sending cached content.
// - **`shield_traffic_ratio`** – Formula: (`shield_bytes` - `upstream_bytes`) /
// `shield_bytes`. The efficiency of the Origin Shielding: how much more traffic
// is sent from the Origin Shielding than from the origin.
// - **`image_processed`** - Number of images transformed on the Image optimization
// service.
// - **`request_time`** - Time elapsed between the first bytes of a request were
// processed and logging after the last bytes were sent to a user.
// - **`upstream_response_time`** - Number of milliseconds it took to receive a
// response from an origin. If upstream `response_time_` contains several
// indications for one request (in case of more than 1 origin), we summarize
// them. In case of aggregating several queries, the average of this amount is
// calculated.
// - **`95_percentile`** - Represents the 95th percentile of network bandwidth
// usage in bytes per second. This means that 95% of the time, the network
// resource usage was below this value.
// - **`max_bandwidth`** - The maximum network bandwidth that was used during the
// selected time represented in bytes per second.
// - **`min_bandwidth`** - The minimum network bandwidth that was used during the
// selected time represented in bytes per second.
//
// Metrics **`upstream_response_time`** and **`request_time`** should be requested
// separately from other metrics
Metrics string `query:"metrics,required" json:"-"`
// Service name.
//
// Possible value:
//
// - CDN
Service string `query:"service,required" json:"-"`
// End of the requested time period (ISO 8601/RFC 3339 format, UTC.)
To string `query:"to,required" json:"-"`
// Names of countries for which data should be displayed. English short name from
// [ISO 3166 standard][1] without the definite article ("the") should be used.
//
// To request multiple values, use:
//
// - &countries=france&countries=denmark
//
// [1]: https://www.iso.org/obp/ui/#search/code/
Countries param.Opt[string] `query:"countries,omitzero" json:"-"`
// The way the parameters are arranged in the response.
//
// Possible values:
//
// - **true** – Flat structure is used.
// - **false** – Embedded structure is used (default.)
Flat param.Opt[bool] `query:"flat,omitzero" json:"-"`
// Output data grouping.
//
// Possible values:
//
// - **resource** – Data is grouped by CDN resources IDs.
// - **region** – Data is grouped by regions of CDN edge servers.
// - **country** – Data is grouped by countries of CDN edge servers.
// - **vhost** – Data is grouped by resources CNAMEs.
// - **`client_country`** - Data is grouped by countries, based on end-users'
// location.
//
// To request multiple values, use:
//
// - &`group_by`=region&`group_by`=resource
GroupBy param.Opt[string] `query:"group_by,omitzero" json:"-"`
// Regions for which data is displayed.
//
// Possible values:
//
// - **na** – North America
// - **eu** – Europe
// - **cis** – Commonwealth of Independent States
// - **asia** – Asia
// - **au** – Australia
// - **latam** – Latin America
// - **me** – Middle East
// - **africa** - Africa
// - **sa** - South America
Regions param.Opt[string] `query:"regions,omitzero" json:"-"`
// CDN resources IDs by that statistics data is grouped.
//
// To request multiple values, use:
//
// - &resource=1&resource=2
//
// If CDN resource ID is not specified, data related to all CDN resources is
// returned.
Resource param.Opt[int64] `query:"resource,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (StatisticGetResourceUsageAggregatedParams) URLQuery ¶
func (r StatisticGetResourceUsageAggregatedParams) URLQuery() (v url.Values, err error)
URLQuery serializes StatisticGetResourceUsageAggregatedParams's query parameters as `url.Values`.
type StatisticGetResourceUsageSeriesParams ¶
type StatisticGetResourceUsageSeriesParams struct {
// Beginning of the requested time period (ISO 8601/RFC 3339 format, UTC.)
From string `query:"from,required" json:"-"`
// Duration of the time blocks into which the data will be divided.
//
// Possible values:
//
// - **1m** - available only for up to 1 month in the past.
// - **5m**
// - **15m**
// - **1h**
// - **1d**
Granularity string `query:"granularity,required" json:"-"`
// Types of statistics data.
//
// Possible values:
//
// - **`upstream_bytes`** – Traffic in bytes from an origin server to CDN servers
// or to origin shielding when used.
// - **`sent_bytes`** – Traffic in bytes from CDN servers to clients.
// - **`shield_bytes`** – Traffic in bytes from origin shielding to CDN servers.
// - **`backblaze_bytes`** - Traffic in bytes from Backblaze origin.
// - **`total_bytes`** – `shield_bytes`, `upstream_bytes` and `sent_bytes`
// combined.
// - **`cdn_bytes`** – `sent_bytes` and `shield_bytes` combined.
// - **requests** – Number of requests to edge servers.
// - **`responses_2xx`** – Number of 2xx response codes.
// - **`responses_3xx`** – Number of 3xx response codes.
// - **`responses_4xx`** – Number of 4xx response codes.
// - **`responses_5xx`** – Number of 5xx response codes.
// - **`responses_hit`** – Number of responses with the header Cache: HIT.
// - **`responses_miss`** – Number of responses with the header Cache: MISS.
// - **`response_types`** – Statistics by content type. It returns a number of
// responses for content with different MIME types.
// - **`cache_hit_traffic_ratio`** – Formula: 1 - `upstream_bytes` / `sent_bytes`.
// We deduct the non-cached traffic from the total traffic amount.
// - **`cache_hit_requests_ratio`** – Formula: `responses_hit` / requests. The
// share of sending cached content.
// - **`shield_traffic_ratio`** – Formula: (`shield_bytes` - `upstream_bytes`) /
// `shield_bytes`. The efficiency of the Origin Shielding: how much more traffic
// is sent from the Origin Shielding than from the origin.
// - **`image_processed`** - Number of images transformed on the Image optimization
// service.
// - **`request_time`** - Time elapsed between the first bytes of a request were
// processed and logging after the last bytes were sent to a user.
// - **`upstream_response_time`** - Number of milliseconds it took to receive a
// response from an origin. If upstream `response_time_` contains several
// indications for one request (in case of more than 1 origin), we summarize
// them. In case of aggregating several queries, the average of this amount is
// calculated.
//
// Metrics **`upstream_response_time`** and **`request_time`** should be requested
// separately from other metrics
Metrics string `query:"metrics,required" json:"-"`
// Service name.
//
// Possible value:
//
// - CDN
Service string `query:"service,required" json:"-"`
// End of the requested time period (ISO 8601/RFC 3339 format, UTC.)
To string `query:"to,required" json:"-"`
// Names of countries for which data should be displayed. English short name from
// [ISO 3166 standard][1] without the definite article ("the") should be used.
//
// To request multiple values, use:
//
// - &countries=france&countries=denmark
//
// [1]: https://www.iso.org/obp/ui/#search/code/
Countries param.Opt[string] `query:"countries,omitzero" json:"-"`
// Output data grouping.
//
// Possible values:
//
// - **resource** – Data is grouped by CDN resources IDs.
// - **region** – Data is grouped by regions of CDN edge servers.
// - **country** – Data is grouped by countries of CDN edge servers.
// - **vhost** – Data is grouped by resources CNAMEs.
// - **`client_country`** - Data is grouped by countries, based on end-users'
// location.
//
// To request multiple values, use:
//
// - &`group_by`=region&`group_by`=resource
GroupBy param.Opt[string] `query:"group_by,omitzero" json:"-"`
// Regions for which data is displayed.
//
// Possible values:
//
// - **na** – North America
// - **eu** – Europe
// - **cis** – Commonwealth of Independent States
// - **asia** – Asia
// - **au** – Australia
// - **latam** – Latin America
// - **me** – Middle East
// - **africa** - Africa
// - **sa** - South America
Regions param.Opt[string] `query:"regions,omitzero" json:"-"`
// CDN resources IDs by that statistics data is grouped.
//
// To request multiple values, use:
//
// - &resource=1&resource=2
//
// If CDN resource ID is not specified, data related to all CDN resources is
// returned.
Resource param.Opt[int64] `query:"resource,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (StatisticGetResourceUsageSeriesParams) URLQuery ¶
func (r StatisticGetResourceUsageSeriesParams) URLQuery() (v url.Values, err error)
URLQuery serializes StatisticGetResourceUsageSeriesParams's query parameters as `url.Values`.
type StatisticGetShieldUsageAggregatedParams ¶
type StatisticGetShieldUsageAggregatedParams struct {
// Beginning of the requested time period (ISO 8601/RFC 3339 format, UTC.)
From string `query:"from,required" json:"-"`
// End of the requested time period (ISO 8601/RFC 3339 format, UTC.)
To string `query:"to,required" json:"-"`
// The way the parameters are arranged in the response.
//
// Possible values:
//
// - **true** – Flat structure is used.
// - **false** – Embedded structure is used (default.)
Flat param.Opt[bool] `query:"flat,omitzero" json:"-"`
// Output data grouping.
//
// Possible value:
//
// - **resource** - Data is grouped by CDN resources.
GroupBy param.Opt[string] `query:"group_by,omitzero" json:"-"`
// CDN resources IDs by that statistics data is grouped.
//
// To request multiple values, use:
//
// - &resource=1&resource=2
//
// If CDN resource ID is not specified, data related to all CDN resources is
// returned.
Resource param.Opt[int64] `query:"resource,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (StatisticGetShieldUsageAggregatedParams) URLQuery ¶
func (r StatisticGetShieldUsageAggregatedParams) URLQuery() (v url.Values, err error)
URLQuery serializes StatisticGetShieldUsageAggregatedParams's query parameters as `url.Values`.
type StatisticGetShieldUsageSeriesParams ¶
type StatisticGetShieldUsageSeriesParams struct {
// Beginning of the requested time period (ISO 8601/RFC 3339 format, UTC.)
From string `query:"from,required" json:"-"`
// End of the requested time period (ISO 8601/RFC 3339 format, UTC.)
To string `query:"to,required" json:"-"`
// CDN resources IDs by that statistics data is grouped.
//
// To request multiple values, use:
//
// - &resource=1&resource=2
//
// If CDN resource ID is not specified, data related to all CDN resources is
// returned.
Resource param.Opt[int64] `query:"resource,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (StatisticGetShieldUsageSeriesParams) URLQuery ¶
func (r StatisticGetShieldUsageSeriesParams) URLQuery() (v url.Values, err error)
URLQuery serializes StatisticGetShieldUsageSeriesParams's query parameters as `url.Values`.
type StatisticService ¶
type StatisticService struct {
Options []option.RequestOption
}
StatisticService 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 NewStatisticService method instead.
func NewStatisticService ¶
func NewStatisticService(opts ...option.RequestOption) (r StatisticService)
NewStatisticService 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 (*StatisticService) GetLogsUsageAggregated ¶
func (r *StatisticService) GetLogsUsageAggregated(ctx context.Context, query StatisticGetLogsUsageAggregatedParams, opts ...option.RequestOption) (res *LogsAggregatedStats, err error)
Get the number of CDN resources that used Logs uploader.
Request URL parameters should be added as a query string after the endpoint.
func (*StatisticService) GetLogsUsageSeries ¶
func (r *StatisticService) GetLogsUsageSeries(ctx context.Context, query StatisticGetLogsUsageSeriesParams, opts ...option.RequestOption) (res *UsageSeriesStats, err error)
Get Logs uploader usage statistics for up to 90 days starting today.
Request URL parameters should be added as a query string after the endpoint.
func (*StatisticService) GetResourceUsageAggregated ¶
func (r *StatisticService) GetResourceUsageAggregated(ctx context.Context, query StatisticGetResourceUsageAggregatedParams, opts ...option.RequestOption) (res *ResourceAggregatedStats, err error)
Get aggregated CDN resources statistics.
Request URL parameters should be added as a query string after the endpoint.
Aggregated data does not include data for the last two hours.
func (*StatisticService) GetResourceUsageSeries ¶
func (r *StatisticService) GetResourceUsageSeries(ctx context.Context, query StatisticGetResourceUsageSeriesParams, opts ...option.RequestOption) (res *ResourceUsageStats, err error)
Get CDN resources statistics for up to 365 days starting today.
func (*StatisticService) GetShieldUsageAggregated ¶
func (r *StatisticService) GetShieldUsageAggregated(ctx context.Context, query StatisticGetShieldUsageAggregatedParams, opts ...option.RequestOption) (res *ShieldAggregatedStats, err error)
The number of CDN resources that use origin shielding.
Request URL parameters should be added as a query string after the endpoint.
func (*StatisticService) GetShieldUsageSeries ¶
func (r *StatisticService) GetShieldUsageSeries(ctx context.Context, query StatisticGetShieldUsageSeriesParams, opts ...option.RequestOption) (res *UsageSeriesStats, err error)
Get origin shielding usage statistics for up to 365 days starting from today.
Request URL parameters should be added as a query string after the endpoint.
type TrustedCaCertificateListParams ¶
type TrustedCaCertificateListParams struct {
// How the certificate was issued.
//
// Possible values:
//
// - **true** – Certificate was issued automatically.
// - **false** – Certificate was added by a user.
Automated param.Opt[bool] `query:"automated,omitzero" json:"-"`
// CDN resource ID for which the certificates are requested.
ResourceID param.Opt[int64] `query:"resource_id,omitzero" json:"-"`
// Date and time when the certificate become untrusted (ISO 8601/RFC 3339 format,
// UTC.)
//
// Response will contain certificates valid until the specified time.
ValidityNotAfterLte param.Opt[string] `query:"validity_not_after_lte,omitzero" json:"-"`
// contains filtered or unexported fields
}
func (TrustedCaCertificateListParams) URLQuery ¶
func (r TrustedCaCertificateListParams) URLQuery() (v url.Values, err error)
URLQuery serializes TrustedCaCertificateListParams's query parameters as `url.Values`.
type TrustedCaCertificateNewParams ¶
type TrustedCaCertificateNewParams struct {
// CA certificate name.
//
// It must be unique.
Name string `json:"name,required"`
// Public part of the CA certificate.
//
// It must be in the PEM format.
SslCertificate string `json:"sslCertificate,required"`
// contains filtered or unexported fields
}
func (TrustedCaCertificateNewParams) MarshalJSON ¶
func (r TrustedCaCertificateNewParams) MarshalJSON() (data []byte, err error)
func (*TrustedCaCertificateNewParams) UnmarshalJSON ¶
func (r *TrustedCaCertificateNewParams) UnmarshalJSON(data []byte) error
type TrustedCaCertificateReplaceParams ¶
type TrustedCaCertificateReplaceParams struct {
// CA certificate name.
//
// It must be unique.
Name string `json:"name,required"`
// contains filtered or unexported fields
}
func (TrustedCaCertificateReplaceParams) MarshalJSON ¶
func (r TrustedCaCertificateReplaceParams) MarshalJSON() (data []byte, err error)
func (*TrustedCaCertificateReplaceParams) UnmarshalJSON ¶
func (r *TrustedCaCertificateReplaceParams) UnmarshalJSON(data []byte) error
type TrustedCaCertificateService ¶
type TrustedCaCertificateService struct {
Options []option.RequestOption
}
TrustedCaCertificateService 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 NewTrustedCaCertificateService method instead.
func NewTrustedCaCertificateService ¶
func NewTrustedCaCertificateService(opts ...option.RequestOption) (r TrustedCaCertificateService)
NewTrustedCaCertificateService 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 (*TrustedCaCertificateService) Delete ¶
func (r *TrustedCaCertificateService) Delete(ctx context.Context, id int64, opts ...option.RequestOption) (err error)
Delete trusted CA certificate
func (*TrustedCaCertificateService) Get ¶
func (r *TrustedCaCertificateService) Get(ctx context.Context, id int64, opts ...option.RequestOption) (res *CaCertificate, err error)
Get trusted CA certificate details
func (*TrustedCaCertificateService) List ¶
func (r *TrustedCaCertificateService) List(ctx context.Context, query TrustedCaCertificateListParams, opts ...option.RequestOption) (res *CaCertificateList, err error)
Get list of trusted CA certificates used to verify an origin.
func (*TrustedCaCertificateService) New ¶
func (r *TrustedCaCertificateService) New(ctx context.Context, body TrustedCaCertificateNewParams, opts ...option.RequestOption) (res *CaCertificate, err error)
Add a trusted CA certificate to verify an origin.
Enter all strings of the certificate in one string parameter. Each string should be separated by the "\n" symbol.
func (*TrustedCaCertificateService) Replace ¶
func (r *TrustedCaCertificateService) Replace(ctx context.Context, id int64, body TrustedCaCertificateReplaceParams, opts ...option.RequestOption) (res *CaCertificate, err error)
Change trusted CA certificate
type UsageSeriesStat ¶
type UsageSeriesStat struct {
// Date and time when paid feature was enabled (ISO 8601/RFC 3339 format, UTC.)
ActiveFrom string `json:"active_from"`
// Date and time when paid feature was disabled (ISO 8601/RFC 3339 format, UTC.)
//
// It returns **null** if the paid feature is enabled.
ActiveTo string `json:"active_to,nullable"`
// Client ID.
ClientID int64 `json:"client_id"`
// CDN resource CNAME.
Cname string `json:"cname"`
// CDN resource ID.
ResourceID int64 `json:"resource_id"`
// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
JSON struct {
ActiveFrom respjson.Field
ActiveTo respjson.Field
ClientID respjson.Field
Cname respjson.Field
ResourceID respjson.Field
ExtraFields map[string]respjson.Field
// contains filtered or unexported fields
} `json:"-"`
}
func (UsageSeriesStat) RawJSON ¶
func (r UsageSeriesStat) RawJSON() string
Returns the unmodified JSON received from the API
func (*UsageSeriesStat) UnmarshalJSON ¶
func (r *UsageSeriesStat) UnmarshalJSON(data []byte) error
type UsageSeriesStats ¶
type UsageSeriesStats []UsageSeriesStat