Skip to content

Latest commit

 

History

History
720 lines (672 loc) · 55.2 KB

HOW-TO.md

File metadata and controls

720 lines (672 loc) · 55.2 KB

Go API client for arvancloud

Use this documentation to learn how to use the ArvanCloud SDK.

API version: 4.115.7

Dependencies

Install the following packages:

go get github.com/stretchr/testify/assert
go get golang.org/x/net/context

Usage

Get the package:

go get github.com/arvancloud/cdn-go

Put the package under your project folder and add the following in import:

import arvancloud "git.arvancloud.ir/arvancloud/cdn-go-sdk"

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value sw.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), arvancloud.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value sw.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), arvancloud.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using sw.ContextOperationServerIndices and sw.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), arvancloud.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), arvancloud.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to https://napi.arvancloud.ir/cdn/4.0

Class Method HTTP request Description
AccelerationApi AccelerationShow Get /domains/{domain}/acceleration Get the content of acceleration settings
AccelerationApi AccelerationUpdate Patch /domains/{domain}/acceleration Update the content of acceleration settings
AccelerationApi ImageResizeShow Get /domains/{domain}/image-resize Get the content of image resize settings
AccelerationApi ImageResizeUpdate Patch /domains/{domain}/image-resize Update the content of image resize settings
ActiveHealthCheckApi ActiveHealthCheckDestroy Delete /domains/{domain}/health-checks/{healthcheck} Delete healthcheck
ActiveHealthCheckApi ActiveHealthCheckIndex Get /domains/{domain}/health-checks Get Defined HealthCheck
ActiveHealthCheckApi ActiveHealthCheckReportsDetails Get /domains/{domain}/health-checks/reports/details Get reports of a single healthcheck monitoring
ActiveHealthCheckApi ActiveHealthCheckReportsSummary Get /domains/{domain}/health-checks/reports/summary Get summary reports of a single healthcheck monitoring
ActiveHealthCheckApi ActiveHealthCheckShow Get /domains/{domain}/health-checks/{healthcheck} Get a single healthcheck
ActiveHealthCheckApi ActiveHealthCheckStore Post /domains/{domain}/health-checks Store a new HealthCheck
ActiveHealthCheckApi ActiveHealthCheckUpdate Patch /domains/{domain}/health-checks/{healthcheck} Update Health check
ActiveHealthCheckApi HealthChecksZonesIndex Get /health-checks/zones Get list of all health-check zones
CDNAppsApi AppsCategoryIndex Get /apps/category Get the list of application categories
CDNAppsApi AppsCategoryShow Get /apps/category/{application-category} Get an existing application category
CDNAppsApi AppsIndex Get /apps Get list of all available cdn-apps
CDNAppsApi AppsLike Post /apps/{id} Expressing like and dislike about a single cdn-app
CDNAppsApi AppsShow Get /apps/{id} Get a single cdn-app
CDNAppsApi DomainsAppsDestroy Delete /domains/{domain}/apps/{id} Uninstall the application from domain
CDNAppsApi DomainsAppsIndex Get /domains/{domain}/apps Get list of all applications installed on a domain
CDNAppsApi DomainsAppsInstalled Get /domains/{domain}/apps/{id} Check the application is installed on the domain
CDNAppsApi DomainsAppsStore Post /domains/{domain}/apps/{id} Install the application on the domain
CDNAppsApi DomainsAppsTriggerWebhook Post /domains/{domain}/apps/{id}/actions/trigger_webhook trigger webhook event
CachingApi CachingDeprecatedPurge Delete /domains/{domain}/caching Purge CDN Cache
CachingApi CachingIndex Get /domains/{domain}/caching Get caching settings
CachingApi CachingPurge Post /domains/{domain}/caching/purge Purge CDN Cache
CachingApi CachingUpdate Patch /domains/{domain}/caching Update caching settings
CachingApi PurgeTagsDestroy Delete /domains/{domain}/purge-tags Delete a Domain's Purge tag
CachingApi PurgeTagsIndex Get /domains/{domain}/purge-tags Get domain's Purge tags
CustomPagesApi CustomPagesShow Get /domains/{domain}/custom-pages Get list of custom pages
CustomPagesApi CustomPagesUpdate Post /domains/{domain}/custom-pages Update custom page
DDoSApi DdosReprioritize Post /domains/{domain}/ddos/actions/reprioritize Change priority of ddos rules
DDoSApi DdosRulesDestroy Delete /domains/{domain}/ddos/rules/{id} Delete DDoS protection rule
DDoSApi DdosRulesIndex Get /domains/{domain}/ddos/rules Get DDoS Protection Rules
DDoSApi DdosRulesShow Get /domains/{domain}/ddos/rules/{id} Get DDoS protection's rule information
DDoSApi DdosRulesStore Post /domains/{domain}/ddos/rules Create new DDoS protection rule
DDoSApi DdosRulesUpdate Patch /domains/{domain}/ddos/rules/{id} Update the DDoS protection rule
DDoSApi DdosSettingsIndex Get /domains/{domain}/ddos/settings Get DDoS protection settings
DDoSApi DdosSettingsUpdate Patch /domains/{domain}/ddos/settings Update domain's DDoS protection configuration
DNSManagementApi DnsRecordsCloud Put /domains/{domain}/dns-records/{id}/cloud Toggle cloud status (To proxy or not proxy, that's the question!)
DNSManagementApi DnsRecordsDestroy Delete /domains/{domain}/dns-records/{id} Remove a DNS record
DNSManagementApi DnsRecordsDnsSecShow Get /domains/{domain}/dns-records/dnssec Get status of DNSSEC
DNSManagementApi DnsRecordsDnsSecUpdate Put /domains/{domain}/dns-records/dnssec/actions Update DNSSEC status
DNSManagementApi DnsRecordsImport Post /domains/{domain}/dns-records/import Import DNS records using BIND file
DNSManagementApi DnsRecordsIndex Get /domains/{domain}/dns-records Get list of DNS records
DNSManagementApi DnsRecordsShow Get /domains/{domain}/dns-records/{id} Get information of a record
DNSManagementApi DnsRecordsStore Post /domains/{domain}/dns-records Create new DNS record
DNSManagementApi DnsRecordsUpdate Put /domains/{domain}/dns-records/{id} Update a DNS record
DomainApi DomainsClone Post /domains/{domain}/clone Clone a domain config from another one
DomainApi DomainsCnameSetupCheck Get /domains/{domain}/cname-setup/check Check Cname Setup to find whether domain is activated
DomainApi DomainsCnameSetupConvert Post /domains/{domain}/cname-setup/convert Convert domain setup to cname
DomainApi DomainsCnameSetupReset Delete /domains/{domain}/cname-setup/custom Reset the custom record of CNAME Setup to the default value
DomainApi DomainsCnameSetupSet Put /domains/{domain}/cname-setup/custom Set a custom record for using CNAME Setup
DomainApi DomainsDestroy Delete /domains/{domain} Remove the domain
DomainApi DomainsIndex Get /domains Get the list of domains
DomainApi DomainsNameserversCheck Get /domains/{domain}/ns-keys/check Check NS to find whether domain is activated
DomainApi DomainsNameserversDeprecatedCheck Put /domains/{domain}/dns-service/check-ns Deprecated in favor /ns-keys/check
DomainApi DomainsNameserversOptional Post /domains/{domain}/ns-keys/use-optional-keys Use optional NS keys
DomainApi DomainsNameserversReset Delete /domains/{domain}/ns-keys Reset custom Nameserver keys to the default values for the domain
DomainApi DomainsNameserversSet Put /domains/{domain}/ns-keys Set custom NS records for the domain
DomainApi DomainsRegenerate Post /domains/{domain}/regenerate Regenerate domain settings for edge servers
DomainApi DomainsShow Get /domains/{domain} Get information of the domain
DomainApi DomainsStore Post /domains/dns-service Create new domain
DomainTransferApi DomainsTransferIndex Get /domains/transfer Get the list of pending transfers
DomainTransferApi DomainsTransferStore Post /domains/{domain}/transfer Transfer domain to another account
DomainTransferApi DomainsTransferUpdate Post /domains/transfer/change-status Accept or cancel transferring a domain
EmailForwardingApi EmailForwardingsActivate Post /domains/{domain}/email-forwardings/activate Activate email forwarding
EmailForwardingApi EmailForwardingsAliasesDestroy Delete /domains/{domain}/email-forwardings/{emailForwardingId}/aliases/{emailForwardingAliasId} Delete an alias
EmailForwardingApi EmailForwardingsAliasesIndex Get /domains/{domain}/email-forwardings/{emailForwardingId}/aliases List of email forwarding aliases for given domain
EmailForwardingApi EmailForwardingsAliasesStore Post /domains/{domain}/email-forwardings/{emailForwardingId}/aliases Create new alias
EmailForwardingApi EmailForwardingsAliasesToggleActivation Patch /domains/{domain}/email-forwardings/{emailForwardingId}/aliases/{emailForwardingAliasId}/toggle-activation Toggle alias activation
EmailForwardingApi EmailForwardingsAliasesUpdateRecipients Patch /domains/{domain}/email-forwardings/{emailForwardingId}/aliases/{emailForwardingAliasId}/recipients Update alias recipients
EmailForwardingApi EmailForwardingsCatchAllActivate Post /domains/{domain}/email-forwardings/catch-all/activate Activate email forwarding catch all
EmailForwardingApi EmailForwardingsCatchAllDeactivate Post /domains/{domain}/email-forwardings/catch-all/deactivate Deactivate email forwarding catch all
EmailForwardingApi EmailForwardingsDeactivate Post /domains/{domain}/email-forwardings/deactivate Deactivate email forwarding
EmailForwardingApi EmailForwardingsRecipientsDestroy Delete /domains/{domain}/email-forwardings/{emailForwardingId}/recipients/{emailForwardingRecipientId} Delete a recipient
EmailForwardingApi EmailForwardingsRecipientsIndex Get /domains/{domain}/email-forwardings/{emailForwardingId}/recipients List recipients of an email forwarding
EmailForwardingApi EmailForwardingsRecipientsResendVerification Post /domains/{domain}/email-forwardings/{emailForwardingId}/recipients/{emailForwardingRecipientId}/resend-verification Resend Verification
EmailForwardingApi EmailForwardingsRecipientsSetDefault Patch /domains/{domain}/email-forwardings/{emailForwardingId}/recipients/{emailForwardingRecipientId}/set-default Set default recipient
EmailForwardingApi EmailForwardingsRecipientsStore Post /domains/{domain}/email-forwardings/{emailForwardingId}/recipients Create new recipient
EmailForwardingApi EmailForwardingsRecipientsVerify Post /domains/{domain}/email-forwardings/{emailForwardingId}/recipients/{emailForwardingRecipientId}/verify Verify recipient
EmailForwardingApi EmailForwardingsStats Get /domains/{domain}/email-forwardings/stats Show stats of domain's email forwarding
FirewallApi FirewallReprioritize Post /domains/{domain}/firewall/actions/reprioritize Change priority of firewall rules
FirewallApi FirewallRulesDestroy Delete /domains/{domain}/firewall/rules/{id} Delete firewall rule
FirewallApi FirewallRulesIndex Get /domains/{domain}/firewall/rules Get domain's firewall rules
FirewallApi FirewallRulesShow Get /domains/{domain}/firewall/rules/{id} Get firewall rule information
FirewallApi FirewallRulesStore Post /domains/{domain}/firewall/rules Create new firewall rule
FirewallApi FirewallRulesUpdate Patch /domains/{domain}/firewall/rules/{id} Update the firewall rule
FirewallApi FirewallSettingsIndex Get /domains/{domain}/firewall/settings Get domain's firewall configuration
FirewallApi FirewallSettingsUpdate Patch /domains/{domain}/firewall/settings Update domain's firewall configuration
ListApi ListsDestroy Delete /dynamic-fields/{id} Delete List
ListApi ListsIndex Get /dynamic-fields Get the list of Lists
ListApi ListsShow Get /dynamic-fields/{id} Get an existing List
ListApi ListsStore Post /dynamic-fields Store new List
ListApi ListsUpdate Patch /dynamic-fields/{id} Update an existing List
LoadBalancingApi LoadBalancersDestroy Delete /domains/{domain}/load-balancers/{loadBalancerId} Remove a load balancer
LoadBalancingApi LoadBalancersIndex Get /domains/{domain}/load-balancers Get list of load balancers
LoadBalancingApi LoadBalancersPoolsDestroy Delete /domains/{domain}/load-balancers/{loadBalancerId}/pools/{loadBalancerPoolId} Remove a load balancer pool
LoadBalancingApi LoadBalancersPoolsIndex Get /domains/{domain}/load-balancers/{loadBalancerId}/pools Get the list of pools of a load balancers
LoadBalancingApi LoadBalancersPoolsOriginsDestroy Delete /domains/{domain}/load-balancers/{loadBalancerId}/pools/{loadBalancerPoolId}/origins/{loadBalancerPoolOriginId} Remove an origin from the pool of the load balancer
LoadBalancingApi LoadBalancersPoolsOriginsIndex Get /domains/{domain}/load-balancers/{loadBalancerId}/pools/{loadBalancerPoolId}/origins Get list of origins of a pool
LoadBalancingApi LoadBalancersPoolsOriginsShow Get /domains/{domain}/load-balancers/{loadBalancerId}/pools/{loadBalancerPoolId}/origins/{loadBalancerPoolOriginId} Get load balancer origin information
LoadBalancingApi LoadBalancersPoolsOriginsStore Post /domains/{domain}/load-balancers/{loadBalancerId}/pools/{loadBalancerPoolId}/origins Create a new origin in the pool of the load balancer
LoadBalancingApi LoadBalancersPoolsOriginsUpdate Patch /domains/{domain}/load-balancers/{loadBalancerId}/pools/{loadBalancerPoolId}/origins/{loadBalancerPoolOriginId} Update an existing origin of the pool
LoadBalancingApi LoadBalancersPoolsShow Get /domains/{domain}/load-balancers/{loadBalancerId}/pools/{loadBalancerPoolId} Get load balancer pool information
LoadBalancingApi LoadBalancersPoolsStore Post /domains/{domain}/load-balancers/{loadBalancerId}/pools Create a new pool for the load balancer
LoadBalancingApi LoadBalancersPoolsUpdate Put /domains/{domain}/load-balancers/{loadBalancerId}/pools/{loadBalancerPoolId} Update an existing load balancer pool with origins
LoadBalancingApi LoadBalancersPoolsUpdatePool Patch /domains/{domain}/load-balancers/{loadBalancerId}/pools/{loadBalancerPoolId} Update an existing load balancer pool without origins
LoadBalancingApi LoadBalancersPrioritizePool Post /domains/{domain}/load-balancers/{loadBalancerId}/prioritize Reorder the priority of load balancer pools
LoadBalancingApi LoadBalancersRegionsIndex Get /load-balancers/regions Get list of regions for load balancers
LoadBalancingApi LoadBalancersSettingsShow Get /domains/{domain}/load-balancers/settings Get list of domain load balancer global settings
LoadBalancingApi LoadBalancersSettingsUpdate Patch /domains/{domain}/load-balancers/settings Update domain's global load balancer settings
LoadBalancingApi LoadBalancersShow Get /domains/{domain}/load-balancers/{loadBalancerId} Get load balancer information
LoadBalancingApi LoadBalancersStore Post /domains/{domain}/load-balancers Create a new load balancer
LoadBalancingApi LoadBalancersUpdate Patch /domains/{domain}/load-balancers/{loadBalancerId} Update a load balancer
LoadBalancingApi LoadBalancersUpdateWithPools Put /domains/{domain}/load-balancers/{loadBalancerId} Update a load balancer
LogForwardersApi LogForwardersDestroy Delete /domains/{domain}/log-forwarders/{logForwarderId} Delete a log forwarder
LogForwardersApi LogForwardersIndex Get /domains/{domain}/log-forwarders Show list of log forwarders for given domain
LogForwardersApi LogForwardersShow Get /domains/{domain}/log-forwarders/{logForwarderId} Show a log forwarder's details based on given id
LogForwardersApi LogForwardersStore Post /domains/{domain}/log-forwarders Create new log forwarder
LogForwardersApi LogForwardersUpdate Put /domains/{domain}/log-forwarders/{logForwarderId} Update a log forwarder
LogForwardersApi LogForwardersUpdateStatus Patch /domains/{domain}/log-forwarders/{logForwarderId}/status Update a log forwarder's status
PageRuleApi PageRulesDestroy Delete /domains/{domain}/page-rules/{id} Delete the page-rule
PageRuleApi PageRulesDiffShow Get /domains/{domain}/page-rules/{id}/diff Get the page-rule's exceptions
PageRuleApi PageRulesDiffUpdate Patch /domains/{domain}/page-rules/{id}/diff Update the page-rule's exceptions
PageRuleApi PageRulesIndex Get /domains/{domain}/page-rules Get list of page-rules
PageRuleApi PageRulesPurge Delete /domains/{domain}/page-rules/{id}/purge Purge the page-rule
PageRuleApi PageRulesShow Get /domains/{domain}/page-rules/{id} Get the page-rule's information
PageRuleApi PageRulesStatusUpdate Patch /domains/{domain}/page-rules/{id} Toggle status of the page-rule
PageRuleApi PageRulesStore Post /domains/{domain}/page-rules Create new page-rule
PageRuleApi PageRulesUpdate Put /domains/{domain}/page-rules/{id} Update the page-rule
PlanApi DomainsPlans Get /domains/{domain}/plans Get the list of feature defintions for plans based on different sets
PlanApi DomainsPlansUpdate Put /domains/{domain}/plan Update the domain's plan
PlanApi DomainsPlansUsages Get /domains/{domain}/plan/usages Get usages based on features and an estimated cost
PlanApi DomainsPlansViolations Get /domains/{domain}/plan/violations Get violations based on plans
PlanApi PlansIndex Get /plans Get the list of feature defintions for plans based on different sets
RateLimitingApi RateLimitingActionsReprioritize Post /domains/{domain}/rate-limit/actions/reprioritize Change priority of Rate limiting's rules
RateLimitingApi RateLimitingRulesDestroy Delete /domains/{domain}/rate-limit/rules/{id} Delete Rate limiting's rule
RateLimitingApi RateLimitingRulesIndex Get /domains/{domain}/rate-limit/rules Get Rate limiting rules
RateLimitingApi RateLimitingRulesShow Get /domains/{domain}/rate-limit/rules/{id} Get Rate limiting's rule information
RateLimitingApi RateLimitingRulesStore Post /domains/{domain}/rate-limit/rules Store new Rate limiting rule
RateLimitingApi RateLimitingRulesUpdate Patch /domains/{domain}/rate-limit/rules/{id} Update the Rate limiting's rule
RateLimitingApi RateLimitingSettingsIndex Get /domains/{domain}/rate-limit/settings Get Rate limiting settings
RateLimitingApi RateLimitingSettingsUpdate Patch /domains/{domain}/rate-limit/settings Update domain's Rate limiting configuration
RedirectApi RedirectShow Get /domains/{domain}/settings/www-redirect Get redirect settings
RedirectApi RedirectUpdate Put /domains/{domain}/settings/www-redirect Update redirect settings
ReportsApi BulkReportsTrafficsTotal Post /bulk/reports/traffics Get traffic report for multiple domains
ReportsApi BulkReportsVisitorsTotal Post /bulk/reports/visitors Get visitor report for multiple domains
ReportsApi ReportsAttacksAttackers Get /domains/{domain}/reports/attacks/attackers Get list of attackers information
ReportsApi ReportsAttacksIndex Get /domains/{domain}/reports/attacks/list Get list of attacks details
ReportsApi ReportsAttacksMap Get /domains/{domain}/reports/attacks/map Get geo-map of attacks
ReportsApi ReportsAttacksShow Get /domains/{domain}/reports/attacks Get report of attacks
ReportsApi ReportsAttacksUri Get /domains/{domain}/reports/attacks/uri Get list of URLs under attack
ReportsApi ReportsDnsGeo Get /domains/{domain}/reports/dns-geo Get DNS requests as geo-map
ReportsApi ReportsDnsRequests Get /domains/{domain}/reports/dns-requests Get response time report
ReportsApi ReportsErrorLogDetails Get /domains/{domain}/reports/error-log-details Get detail of an error
ReportsApi ReportsErrorLogs Get /domains/{domain}/reports/error-logs Get list of errors
ReportsApi ReportsErrorLogsChart Get /domains/{domain}/reports/error-logs/chart Get chart view of errors
ReportsApi ReportsResponseTimeIndex Get /domains/{domain}/reports/response-time Get response time report
ReportsApi ReportsStatusIndex Get /domains/{domain}/reports/status Get status codes pie chart
ReportsApi ReportsStatusSummary Get /domains/{domain}/reports/status/summary Get an overview of status codes pie chart
ReportsApi ReportsTrafficsMap Get /domains/{domain}/reports/traffics/map Get traffic as geo-map
ReportsApi ReportsTrafficsSaved Get /domains/{domain}/reports/traffics/saved Get traffic saved to total pie chart
ReportsApi ReportsTrafficsTotal Get /domains/{domain}/reports/traffics Get traffic report for domain
ReportsApi ReportsTransportLayerProxiesTraffics Get /domains/{domain}/reports/transport-layer-proxies/{transportLayerProxyId}/traffics Get traffic report for transport layer proxy
ReportsApi ReportsVisitorsHighRequestIps Get /domains/{domain}/reports/high-request-ips Get report of IPs with highest number of requests
ReportsApi ReportsVisitorsIndex Get /domains/{domain}/reports/visitors Get report of visitors for domain
SSLTLSApi SslCertDestroy Delete /domains/{domain}/ssl/certificates/{id} Delete an unused customer certificate
SSLTLSApi SslCertOrderIndex Get /domains/{domain}/ssl/orders Get All Managed certificate orders history
SSLTLSApi SslCertOrderRetry Post /domains/{domain}/ssl/orders/action/retry Retry a previously `killed` order
SSLTLSApi SslCertStore Post /domains/{domain}/ssl/certificates Upload Certificate
SSLTLSApi SslIndex Get /domains/{domain}/ssl Get SSL settings
SSLTLSApi SslUpdate Patch /domains/{domain}/ssl Update domain's SSL settings
TransportLayerProxyApi TransportLayerProxiesDestroy Delete /domains/{domain}/transport-layer-proxies/{transportLayerProxyId} delete a transport layer proxy
TransportLayerProxyApi TransportLayerProxiesIndex Get /domains/{domain}/transport-layer-proxies Show list of transport layer proxies for given domain
TransportLayerProxyApi TransportLayerProxiesShow Get /domains/{domain}/transport-layer-proxies/{transportLayerProxyId} Show a transport layer proxy's details based on given id
TransportLayerProxyApi TransportLayerProxiesStore Post /domains/{domain}/transport-layer-proxies Create new transport layer proxy
TransportLayerProxyApi TransportLayerProxiesUpdate Put /domains/{domain}/transport-layer-proxies/{transportLayerProxyId} Update a transport layer proxy
TroubleshootApi TroubleshootsIndex Get /domains/{domain}/troubleshoots Show list of troubleshoots for given domain
TroubleshootApi TroubleshootsLatest Get /domains/{domain}/troubleshoots/latest Show the latest troubleshoot for given domain
TroubleshootApi TroubleshootsStore Post /domains/{domain}/troubleshoots Create new troubleshoot
WAFApi GlobalWafIndex Get /waf Get WAF presets
WAFApi GlobalWafShowPackage Get /waf/packages/{packageId} Get WAF package details
WAFApi WafPackageReprioritize Post /domains/{domain}/waf/actions/reprioritize-package Change priority of WAF packages
WAFApi WafPackagesDestroy Delete /domains/{domain}/waf/packages/{id} Delete WAF package from domain
WAFApi WafPackagesIndex Get /domains/{domain}/waf/packages Get WAF packages
WAFApi WafPackagesShow Get /domains/{domain}/waf/packages/{id} Get WAF package information
WAFApi WafPackagesStore Post /domains/{domain}/waf/packages Add new WAF package to domain
WAFApi WafPackagesUpdate Patch /domains/{domain}/waf/packages/{id} Update the WAF package
WAFApi WafReconfigure Post /domains/{domain}/waf/actions/reconfigure Reconfigure WAF module using a preset
WAFApi WafReprioritize Post /domains/{domain}/waf/actions/reprioritize Change priority of WAF rules
WAFApi WafRulesDestroy Delete /domains/{domain}/waf/rules/{id} Delete WAF rule
WAFApi WafRulesIndex Get /domains/{domain}/waf/rules Get WAF Rules
WAFApi WafRulesShow Get /domains/{domain}/waf/rules/{id} Get WAF rule information
WAFApi WafRulesStore Post /domains/{domain}/waf/rules Create new WAF rule
WAFApi WafRulesUpdate Patch /domains/{domain}/waf/rules/{id} Update the WAF rule
WAFApi WafSettingsIndex Get /domains/{domain}/waf/settings Get WAF configuration
WAFApi WafSettingsUpdate Patch /domains/{domain}/waf/settings Configure WAF module of the domain

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

UserToken

  • Type: HTTP Bearer token authentication

Example

auth := context.WithValue(context.Background(), sw.ContextAccessToken, "BEARER_TOKEN_STRING")
r, err := client.Service.Operation(auth, args)

ApiKey

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Note, each API key must be added to a map of map[string]APIKey where the key is: Authorization and passed in as the auth context for each request.

Example

auth := context.WithValue(
		context.Background(),
		sw.ContextAPIKeys,
		map[string]sw.APIKey{
			"Authorization": {Key: "API_KEY_STRING"},
		},
	)
r, err := client.Service.Operation(auth, args)

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author