PUT
/
security
/
resources
/
{resource_id}
curl --request PUT \
  --url https://api.gcore.com/security/resources/{resource_id} \
  --header 'APIKey: <api-key>' \
  --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"
    }
  ]
}'

Authorizations

APIKey
string
header
required

API key for authentication.

Path Parameters

resource_id
integer
required

Resource ID.

Body

application/json