Skip to main content
PUT
/
resources
/
{resource_id}
Change Resource
curl --request PUT \
  --url https://api.___serverhost___/security/resources/{resource_id} \
  --header 'Content-Type: application/json' \
  --data '
{
  "id": 1,
  "name": "ddosprotection1.com",
  "active": true,
  "client": 2,
  "is_waf_enabled": false,
  "is_redirect_to_https_enabled": true,
  "service_botprotect": 0,
  "service_cdn": 0,
  "service_cdn_host": "",
  "service_cdn_proxy_host": "",
  "service_client_id": 2,
  "service_enable": 1,
  "service_forcessl": 0,
  "service_geoip_list": "",
  "service_geoip_mode": 0,
  "service_global_whitelist": 1,
  "service_hsts": 0,
  "service_http2": 0,
  "service_https2http": 0,
  "service_id": 1,
  "service_ip": "1.2.3.4",
  "service_iphash": 0,
  "service_methods": 0,
  "service_wwwredir": 0,
  "service_ssl_crt": "-----BEGIN CERTIFICATE-----\u001bxamplecrt\n-----END CERTIFICATE-----",
  "service_ssl_key": "-----BEGIN PRIVATE KEY-----\u001bxamplekey\n-----END PRIVATE KEY-----\n",
  "ssl_type": "custom",
  "aliases": [
    {
      "id": 2,
      "alias_id": 2,
      "alias_data": "alias1.ddosprotection1.com",
      "alias_ssl_expire": 0
    },
    {
      "id": 1,
      "alias_id": 1,
      "alias_data": "alias2.ddosprotection1.com",
      "alias_ssl_expire": 0
    }
  ],
  "origins": [
    {
      "id": 1,
      "origin_id": 1,
      "origin_data": "4.3.2.1",
      "origin_weight": 50,
      "origin_mode": "primary"
    }
  ],
  "rate_limier_rules": [
    {
      "method": "GET",
      "path": "helloworld",
      "value": 2
    },
    {
      "method": "POST",
      "path": "api",
      "value": 10,
      "test_cookie": false
    },
    {
      "method": "GET",
      "path": "docs",
      "value": 10,
      "test_cookie": false
    }
  ],
  "blacklists": [
    {
      "blacklist_data": "11.111.111.111"
    }
  ],
  "whitelists": [
    {
      "whitelist_data": "11.111.111.110"
    }
  ]
}
'
This response has no body data.

Path Parameters

resource_id
integer
required

Resource ID.

Body

application/json
id
integer

Resource ID.

enabled
boolean

The field shows if your Resource enabled or disabled.

  • True — Resource is actived. Content is being delivered.
  • False — Resource is deactivated and content is not being delivered.
This parameter is read only.

active
boolean

You can control enabled or disabled state of the Resource by setting value for this parameter.

name
string

The domain name of the protected resource.

is_waf_enabled
boolean

Enable or disable WAF for ddos resource.

is_redirect_to_https_enabled
boolean

With this option, all requests through http will be redirected to https. Only applied if ssl certificate is provided. Value true is used by default
Available values:

  • true - Enabled
  • false - Disabled

status
string

The status of the Protection service.

Active status means that your Resources is active. Suspended status means that your trial ended or your account is blocked.

In case of questions contact us at supportEmail

client
integer

ID of your control panel.

service_ip
string

Protected IP address. You should set it as A-record for your domain name.

service_botprotect
integer

Available values:

  • 0 - Disabled
  • 4 - Enabled

ssl_type
string

Enable or disable using HTTPS with SSL certificate for the resource.
Available values:

  • null - Disabled
  • custom - Custom SSL certificate enabled
  • le - Let's Encrypt SSL certificate enabled
To enable custom SSL certificate you should set service_ssl_crt and service_ssl_key parameters.

service_ssl_crt
string

Custom SSL certificate for the Resource.

service_ssl_key
string

Private key for custom SSL certificate.

service_geoip_mode
integer

The parameter that determines the access policy for the protected resource. Sets up together with service_geoip_list. Available values:

  • 0 - Disabled
  • 1 - Allow, except list
  • 2 - Deny, except list

service_geoip_list
string

This parameter sets up a list of countries for geo restrictions for the protected resource. Should be set together with parameter service_geoip_mode.

service_https2http
integer

With this option, your website can be accessible to users via HTTPS, and the connection between the DDoS Protection platform and your web server will be via HTTP.
Available values:

  • 0 - Disabled
  • 1 - Enabled

service_wwwredir
integer

This parameter allows to set up a redirect from the www.domain.com to domain.com.
Available values:

  • 0 - Disabled
  • 1 - Enabled

service_cdn
integer

For internal use.

service_cdn_host
string

For internal use.

service_cdn_proxy_host
string

For internal use.

service_enable
integer

For internal use.

service_forcessl
integer

For internal use.

service_global_whitelist
integer

For internal use.

service_http2
integer

For internal use.

service_id
integer

For internal use.

service_iphash
integer

For internal use.

service_methods
integer

For internal use.

service_stream
integer

For internal use.

created
string

Shows the date when the Resource was created.

updated
string

Shows the date when the Resource was changed.

aliases
object

Aliases for the Resource.

origins
object

Origins for the Resource.

rate_limier_rules
object

Enable rate limiter rules for endpoints

whitelists
object

Whitelists for the Resource.

blacklists
object

Blacklists for the Resource.

Response

200 - undefined