Create Access Control

This API is used to create access control for website acceleration or file download service.

1. Request Definition

  • API URL
https://cdn-api.swiftfederation.com/v1.0/services/{serviceId}/access_controls
  • Request Method
POST
  • Request Header

Refer to HTTP Request Headers

  • Request Body

Request Body Data Format: JSON

Field Required Type Description
name Mandatory string Policy name for access control.
type Mandatory string Access control type, could be "allow", "deny" or "token".
matchType Mandatory string Policy match type, could be "regex" or "prefix".
url Mandatory string Prefix or regex of url pattern.
subnet Optional string IP subnet for access control.
location Optional string Comma-separated list of geographic locations to be matched. Each location should be specified as a 2-letter ISO3166 code. E.g "SG,GB".
  • Request Body Example
{
    "name": "ac1001",
    "type": "allow",
    "matchType": "regex",
    "url": "/*.js",
    "subnet": "192.168.1.0/24",
    "location": "SG,CN"
}


2. Response Definition

  • Response Header

Refer to HTTP Response Headers

  • Response Body
Field Type Description
id int Policy ID number for access control.
name string Policy name for access control.
type string Access control type, could be "allow", "deny" or "token".
matchType string Policy match type, could be "regex" or "prefix".
url string Prefix or regex of url pattern.
subnet string IP subnet for access control.
location string Comma-separated list of geographic locations to be matched. Each location should be specified as a 2-letter ISO3166 code. E.g "SG,GB".
  • Response Body Example
{
    "id": 1001,
    "name": "ac1001",
    "type": "allow",
    "matchType": "regex",
    "url": "/*.js",
    "subnet": "192.168.1.0/24",
    "location": "SG,CN"
}
© 2019 Conversant Solutions Pte Ltd. All rights reserved.            Updated 2019-05-23 03:46:25

results matching ""

    No results matching ""