Did you find this summary helpful?
Thank you for your feedback
Overview
Create a new CDN edge.
- Up to 100 edges can be created per account.
Request
Request URL
POST
https://edge.apigw.ntruss.com/api/v1/cdn-edge
Request body
EdgeConfig
Parameter name | Required | Type | Restrictions | Description |
---|
profileId | Yes | Long | | Profile ID |
edgeName | Yes | String | Only English letters, numbers, and special characters "-" and "_" are allowed. | |
distributionConfig | Yes | CdnDistributionConfig | | Deployment settings |
originalCopyConfig | Yes | CdnOriginalCopyConfig | | Origin settings |
cachingConfig | Yes | CdnCachingConfig | | Cache settings |
managedRule | Yes | ManagedRule | | Set managed rule |
headerPolicies | Yes | List<HeaderPolicy> | | Set header |
optimizationConfig | Yes | OptimizationConfig | | Set optimization |
accessControl | Yes | AccessControl | | Access control setting |
CdnDistributionConfig
Parameter name | Required | Type | Restrictions | Description |
---|
protocolType | Yes | String | HTTP, HTTPS, ALL | Service protocol |
regionType | Yes | String | KOREA, JAPAN, GLOBAL (performance prioritized), GLOBAL (availability prioritized) | Service area |
serviceDomain | Yes | ServiceDomain | | Service domain |
edgeLogging | Yes | EdgeLogging | | Set edge logging |
ServiceDomain
Parameter name | Required | Type | Restrictions | Description |
---|
domainType | Yes | String | NCP_DOMAIN_AUTO, NCP_DOMAIN_CUSTOM, CUSTOM_DOMAIN | Domain usage type |
domainName | Yes | String | Use domainType as domain format when using a custom domain | |
certificate | No | Certificate | Required when using HTTPS and personal domain together | |
Certificate
Parameter name | Required | Type | Restrictions | Description |
---|
id | Yes | Long | | certificateNo of the certificate registered in Certificate Manager |
EdgeLogging
Parameter name | Required | Type | Restrictions | Description |
---|
enabled | Yes | boolean | true, false | Use status |
bucketPrefix | No | String | | |
objectStorage | No | ObjectStorage | Required when setting enabled to true | |
ObjectStorage
Parameter name | Required | Type | Restrictions | Description |
---|
region | Yes | String | KR, USWN, SGN, JPN, DEN | Korea (KR), US West (USWN), Singapore (SGN), Japan (JPN), and Germany (DEN) |
bucketName | Yes | String | | Object Storage bucket name |
CdnOriginalCopyConfig
Parameter name | Required | Type | Restrictions | Description |
---|
originalCopyLocation | Yes | OriginalCopyLocation | | Set origin domain |
forwardHostHeader | Yes | ForwardHostHeader | | Forward Host Header |
originalCopyProtocol | Yes | OriginalCopyProtocol | | Origin protocol settings |
originalCopyPath | No | String | | Source path |
originShield | Yes | OriginShield | | Set origin shield |
originFailoverConfig | No | OriginFailoverConfig | | Set failover policy |
OriginalCopyLocation
Parameter name | Required | Type | Restrictions | Description |
---|
type | Yes | String | OBJECT_STORAGE, CUSTOM, NONE | Origin type |
region | No | String | KR, SGN, JPN, USWN, DEN | Korea (KR), Singapore (SGN), Japan (JPN), US West (USWN), and Germany (DEN); required when using Object Storage |
bucketName | No | String | Required when type is Object Storage | Object Storage bucket name |
customLocation | No | String | Required when type is custom | Only one of bucketName and customLocation can be used according to type |
ForwardHostHeader
Parameter name | Required | Type | Restrictions | Description |
---|
type | Yes | String | INCOMING_HOST_HEADER, ORIGIN_HOSTNAME, CUSTOM | |
customHostHeader | No | String | Required when type is custom | |
OriginalCopyProtocol
Parameter name | Required | Type | Restrictions | Description |
---|
type | Yes | String | HTTP, HTTPS | Origin protocol |
port | Yes | Integer | | Origin port |
OriginShield
Parameter name | Required | Type | Restrictions | Description |
---|
enabled | Yes | boolean | true, false | Use status |
region | No | String | KR, SGN, JPN, USWN, DEN | Korea (KR), Singapore (SGN), Japan (JPN), US West (USWN), and Germany (DEN); required when setting enabled to true |
OriginFailoverConfig
Parameter name | Required | Type | Restrictions | Description |
---|
ruleName | Yes | String | | |
statusCodes | Yes | List<Integer> | 404, 500, 502, 503, 504 | |
originalCopyLocation | Yes | OriginalCopyLocation | | |
CdnCachingConfig
Parameter name | Required | Type | Restrictions | Description |
---|
defaultCaching | Yes | DefaultCaching | | Set default cache |
negativeTtl | Yes | boolean | true, false | Set usage status, error response cache |
bypassQueryString | Yes | BypassQueryString | | |
cacheKeyHostname | Yes | String | INCOMING_HOST_HEADER, ORIGIN_HOSTNAME | |
cacheKeyIgnoreQueryString | Yes | CacheKeyIgnoreQueryString | | |
removeVaryHeader | Yes | boolean | true, false | Use status |
edgeAuth | Yes | EdgeAuth | | Validate user request using tokens |
cachingRules | Yes | List<CachingRule> | | Detailed cache settings |
DefaultCaching
Parameter name | Required | Type | Restrictions | Description |
---|
enabled | Yes | boolean | true, false | Use status |
ruleDefinitionType | Yes | String | CACHING, BYPASS_CACHE, ORIGIN_CACHE_CONTROL_HEADER | |
cacheRevalidateConfig | Yes | CacheRevalidateConfig | | |
CacheRevalidateConfig
Parameter name | Required | Type | Restrictions | Description |
---|
type | Yes | String | IF_POSSIBLE, ALWAYS | Serve stale if unable to validate(IF_POSSIBLE), Always revalidate with origin(ALWAYS) |
ageType | Yes | String | SECONDS, MINUTES, HOURS, DAYS | |
age | Yes | Integer | | Change time unit based on ageType |
BypassQueryString
Parameter name | Required | Type | Restrictions | Description |
---|
enabled | Yes | boolean | true, false | Use status |
queryStrings | No | List<String> | Required when setting enabled to true | |
CacheKeyIgnoreQueryString
Parameter name | Required | Type | Restrictions | Description |
---|
type | Yes | String | ALL_IGNORED, ALL_ALLOWED, ALLOW_SPECIFIC_STRING | |
queryStrings | No | List<String> | Required when using ALLOW_SPECIFIC_STRING as type | |
EdgeAuth
Parameter name | Required | Type | Restrictions | Description |
---|
enabled | Yes | boolean | true, false | Use status |
type | Yes | String | SIGNED_URL, JWT, MEDIA_VAULT | Only MEDIA_VAULT is available when selecting service region as Global Everything is available when selecting service region as Korea/Japan |
tokenName | No | String | English lowercase letters only without spaces; required when enabled is set to true | |
tokenKey | No | String | Required when setting enabled to true | |
bypassValues | No | List<String> | MEDIA_VAULT not supported | Extensions to exclude from authentication (up to 20) e.g., .ts, .jpg, .exe |
tokenBypassValues | No | List<String> | MEDIA_VAULT not supported | Extensions to forward authentication values to as origin (up to 20) e.g., playlist.m3u8, index.m3u8, .ts, .png |
CachingRule
Parameter name | Required | Type | Restrictions | Description |
---|
ruleName | Yes | String | | |
ruleType | Yes | String | DIRECTORY, FILE_EXTENSION, ADVANCED | |
ruleConditions | Yes | List<String> | | |
ruleDefinitionType | Yes | String | CACHING, BYPASS_CACHE, ORIGIN_CACHE_CONTROL_HEADER | |
cacheRevalidateConfig | Yes | CacheRevalidateConfig | | |
ruleBasedRoutingConfig | Yes | RuleBasedRoutingConfig | | |
browserCache | Yes | BrowserCache | | |
cacheKeyQueryParameter | Yes | CacheKeyQueryParameter | | |
accessDeny | Yes | boolean | true, false | |
urlRedirect | Yes | UrlRedirect | | |
urlRewrite | Yes | UrlRewrite | | |
RuleBasedRoutingConfig
Parameter name | Required | Type | Restrictions | Description |
---|
enabled | Yes | boolean | true, false | Use status |
originalCopyLocation | No | OriginalCopyLocation | Required when setting enabled to true | |
BrowserCache
Parameter name | Required | Type | Restrictions | Description |
---|
enabled | Yes | boolean | true, false | Use status |
type | No | String | Required when setting ALLOW_CACHE, NO_CACHE, enabled to true | |
ageType | No | String | Required when setting SECONDS, MINUTES, HOURS, DAYS, enabled to true | |
age | No | Integer | Required when setting enabled to true | |
CacheKeyQueryParameter
Parameter name | Required | Type | Restrictions | Description |
---|
enabled | Yes | boolean | true, false | Use status |
type | Yes | String | ALL_IGNORED, ALL_ALLOWED, ALLOW_SPECIFIC_STRING, IGNORE_SPECIFIC_STRING | |
queryParameters | No | List<String> | Required when using ALLOW_SPECIFIC_STRING, IGNORE_SPECIFIC_STRING as type | |
UrlRedirect
Parameter name | Required | Type | Restrictions | Description |
---|
enabled | Yes | boolean | true, false | Usage status; UrlRedirect and UrlRewrite can't be used concurrently |
destinationProtocol | No | String | Required when setting HTTP, HTTPS, enabled to true | |
destinationHostname | No | String | Required when setting enabled to true | |
destinationPath | No | String | Required when setting enabled to true | |
responseCode | No | String | Required when setting MOVED_PERMANENTLY_301, FOUND_302, enabled to true | |
UrlRewrite
Parameter name | Required | Type | Restrictions | Description |
---|
enabled | Yes | boolean | true, false | Usage status; UrlRedirect and UrlRewrite can't be used concurrently |
rewriteTarget | No | String | Required when setting enabled to true | |
ManagedRule
Parameter name | Required | Type | Restrictions | Description |
---|
cors | Yes | boolean | true, false | Use status |
http2 | Yes | boolean | true, false | Use status |
trueClientIpHeader | Yes | boolean | true, false | Use status |
hsts | Yes | boolean | true, false | Use status |
HeaderPolicy
Parameter name | Required | Type | Restrictions | Description |
---|
type | Yes | String | ORIGIN_REQUEST, CLIENT_RESPONSE | |
ruleName | Yes | String | | |
header | Yes | Header | | |
Header
Parameter name | Required | Type | Restrictions | Description |
---|
type | Yes | String | ADD, MODIFY, REMOVE | |
name | Yes | String | | |
value | Yes | String | | |
OptimizationConfig
Parameter name | Required | Type | Restrictions | Description |
---|
httpCompression | Yes | boolean | true, false | Use status |
largeFileOptimization | Yes | boolean | true, false | Use status |
AccessControl
Parameter name | Required | Type | Restrictions | Description |
---|
type | Yes | WHITELIST, BLACKLIST | Every access control rule can only use one policy | |
ipPolicies | Yes | List<String> | IP format only | |
geoPolicies | Yes | List<String> | ISO 3166-1 alpha-2 country codes available | |
refererPolicies | Yes | List<String> | Domain format only | |
Response
All responses return success or failure as an HTTP status code.
HTTP status code | Code message | Description |
---|
200 | Success | Search succeeded |
401 | Unauthorized | Authentication failed |
500 | Internal Server Error | Server error |
Examples
Request example
https://edge.apigw.ntruss.com/api/v1/cdn-edge
{
"profileId": 234,
"edgeName": "sample-edge",
"distributionConfig": {
"protocolType": "ALL",
"regionType": "KOREA",
"serviceDomain": {
"domainType": "NCP_DOMAIN_AUTO",
"domainName": null,
"certificate": null
},
"edgeLogging": {
"enabled": true,
"objectStorage": {
"region": "KR",
"bucketName": "sample-bucket"
},
"bucketPrefix": "log/sample"
}
},
"originalCopyConfig": {
"originalCopyLocation": {
"type": "OBJECT_STORAGE",
"region": "KR",
"bucketName":"sample-bucket",
"customLocation": null
},
"forwardHostHeader": {
"type": "ORIGIN_HOSTNAME",
"customHostHeader": null
},
"originalCopyProtocol": {
"type": "HTTP",
"port": 80
},
"originalCopyPath": null,
"originShield": {
"enabled": true,
"region": "USWN"
},
"originFailoverConfig": null
},
"cachingConfig": {
"defaultCaching": {
"enabled": true,
"ruleDefinitionType": "CACHING",
"cacheRevalidateConfig": {
"type": "IF_POSSIBLE",
"ageType": "HOURS",
"age": "10"
}
},
"negativeTtl": true,
"bypassQueryString": {
"enabled": true,
"queryStrings": ["aaa", "bbb", "ccc"]
},
"cacheKeyHostname": "INCOMING_HOST_HEADER",
"cacheKeyIgnoreQueryString": {
"type": "ALL_ALLOWED",
"queryStrings": []
},
"removeVaryHeader": true,
"edgeAuth": {
"enabled": true,
"type": "SIGNED_URL",
"tokenName": "name",
"tokenKey": "902bceb96b2139771716910ff0b9befb"
},
"cachingRules": [{
"ruleName": "sample",
"ruleType": "DIRECTORY",
"ruleConditions": ["/sample/*"],
"ruleDefinitionType": "CACHING",
"cacheRevalidateConfig": {
"type": "IF_POSSIBLE",
"ageType": "SECONDS",
"age": 100
},
"ruleBasedRoutingConfig": {
"enabled": true,
"originalCopyLocation": {
"type": "OBJECT_STORAGE",
"region": "KR",
"bucketName": "sample-bucket",
"customLocation": null
}
},
"browserCache": {
"enabled": true,
"type": "ALLOW_CACHE",
"age": 100,
"ageType": "SECONDS"
},
"cacheKeyQueryParameter": {
"enabled": true,
"type": "IGNORE_SPECIFIC_STRING",
"queryParameters": ["aaa", "bbb", "ccc"]
},
"accessDeny": false,
"urlRedirect": {
"enabled": true,
"destinationProtocol": "HTTP",
"destinationHostname": "ncloud.com",
"destinationPath": "/home",
"responseCode": "FOUND_302"
},
"urlRewrite": {
"enabled": false,
"rewriteTarget": null
}
}]
},
"managedRule": {
"cors": true,
"http2": true,
"trueClientIpHeader": true,
"hsts": false
},
"headerPolicies": [{
"type": "ORIGIN_REQUEST",
"ruleName": "Modify Origin Reqeust Header",
"header": {
"type": "ADD",
"name": "name",
"value": "value"
}
}, {
"type": "CLIENT_RESPONSE",
"ruleName": "Modify Client Response Header",
"header": {
"type": "MODIFY",
"name": "name",
"value": "value"
}
}],
"optimizationConfig": {
"httpCompression": true,
"largeFileOptimization": true
},
"accessControl": {
"type": "WHITELIST",
"ipPolicies": ["1.1.1.1", "2.2.2.2", "3.3.3.3"],
"geoPolicies": ["AL", "SK", "ZM"],
"refererPolicies": ["ncloud.com", "naver.com"]
}
}
Response example
{
"code": "0000",
"message": "Success",
"result": {
"edgeId": 123
}
}
Errors
Error code | Description |
---|
0032 | Unauthorized request |
9999 | Server error occurred |
Was this article helpful?
Thank you for your feedback! Our team will get back to you