Overview
Change the created CDN Edge settings.
- Available to request only during operation or in the stopped state.
- You cannot change service area and service domain.
Requests
Request URL
PUT
https://edge.apigw.ntruss.com/api/v1/cdn-edges/{edgeId}
Request body
EdgeConfig
Parameter name |
Requirement status |
Type |
Restrictions |
Description |
profileId |
Yes |
Long |
|
Profile ID |
edgeName |
Yes |
String |
Only English, numbers and special characters '-' and '_' can be used |
|
distributionConfig |
Yes |
CdnDistributionConfig |
|
Deployment settings |
originalCopyConfig |
Yes |
CdnOriginalCopyConfig |
|
Source settings |
cachingConfig |
Yes |
CdnCachingConfig |
|
Cache settings |
managedRule |
Yes |
ManagedRule |
|
Manage rule settings |
headerPolicies |
Yes |
List<HeaderPolicy> |
|
Header settings |
optimizationConfig |
Yes |
OptimizationConfig |
|
Optimization setting |
accessControl |
Yes |
AccessControl |
|
Access control settings |
CdnDistributionConfig
Parameter name |
Requirement status |
Type |
Restrictions |
Description |
protocolType |
Yes |
String |
HTTP, HTTPS, ALL |
Service protocol |
regionType |
Yes |
String |
KOREA, JAPAN, GLOBAL |
Service region |
serviceDomain |
Yes |
ServiceDomain |
|
Service domain |
edgeLogging |
Yes |
EdgeLogging |
|
Edge logging settings |
ServiceDomain
Parameter name |
Requirement status |
Type |
Restrictions |
Description |
domainType |
Yes |
String |
NCP_DOMAIN_AUTO, NCP_DOMAIN_CUSTOM, CUSTOM_DOMAIN |
Domain use type |
domainName |
Yes |
String |
Use domain format when using custom domain for domainType |
|
certificate |
No |
Certificate |
Required when using HTTPS and private domain together |
|
Certificate
Parameter name |
Requirement status |
Type |
Restrictions |
Description |
id |
Yes |
Long |
|
certificateNo of the certificate registered in Certificate Manager |
EdgeLogging
Parameter name |
Requirement status |
Type |
Restrictions |
Description |
enabled |
Yes |
boolean |
true, false |
Use status |
bucketPrefix |
No |
String |
|
|
objectStorage |
No |
ObjectStorage |
Required when enabled is set to true |
|
ObjectStorage
Parameter name |
Requirement status |
Type |
Restrictions |
Description |
region |
Yes |
String |
KR, USWN, SGN, JPN, DEN |
Korea (KR), US West (USWN), Singapore (SGN), Japan (JPN), Germany (DEN) |
bucketName |
Yes |
String |
|
Object Storage bucket name |
CdnOriginalCopyConfig
Parameter name |
Requirement status |
Type |
Restrictions |
Description |
originalCopyLocation |
Yes |
OriginalCopyLocation |
|
Source domain settings |
forwardHostHeader |
Yes |
ForwardHostHeader |
|
Forward Host Header |
originalCopyProtocol |
Yes |
OriginalCopyProtocol |
|
Source protocol settings |
originalCopyPath |
No |
String |
|
Source path |
originShield |
Yes |
OriginShield |
|
Origin shield settings |
originFailoverConfig |
No |
OriginFailoverConfig |
|
Failover policy settings |
OriginalCopyLocation
Parameter name |
Requirement status |
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), Germany (DEN), required when using Object Storage |
bucketName |
No |
String |
Required if type is Object Storage |
Object Storage bucket name |
customLocation |
No |
String |
Required if type is custom |
Only one bucketName and customLocation can be used depending on the type |
ForwardHostHeader
Parameter name |
Requirement status |
Type |
Restrictions |
Description |
type |
Yes |
String |
INCOMING_HOST_HEADER, ORIGIN_HOSTNAME, CUSTOM |
|
customHostHeader |
No |
String |
Required if type is custom |
|
OriginalCopyProtocol
Parameter name |
Requirement status |
Type |
Restrictions |
Description |
type |
Yes |
String |
HTTP, HTTPS |
Origin protocol |
port |
Yes |
Integer |
|
Origin port |
OriginShield
Parameter name |
Requirement status |
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), Germany (DEN), required when enabled is set to true |
OriginFailoverConfig
Parameter name |
Requirement status |
Type |
Restrictions |
Description |
ruleName |
Yes |
String |
|
|
statusCodes |
Yes |
List<Integer> |
404, 500, 502, 503, 504 |
|
originalCopyLocation |
Yes |
OriginalCopyLocation |
|
|
CdnCachingConfig
Parameter name |
Requirement status |
Type |
Restrictions |
Description |
defaultCaching |
Yes |
DefaultCaching |
|
Default cache settings |
negativeTtl |
Yes |
boolean |
true, false |
Use status, error response cache setting |
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 requests using tokens |
cachingRules |
Yes |
List<CachingRule> |
|
Cache detailed settings |
DefaultCaching
Parameter name |
Requirement status |
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 |
Requirement status |
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 unit of time according to ageType |
BypassQueryString
Parameter name |
Requirement status |
Type |
Restrictions |
Description |
enabled |
Yes |
boolean |
true, false |
Use status |
queryStrings |
No |
List<String> |
Required when enabled is set to true |
|
CacheKeyIgnoreQueryString
Parameter name |
Requirement status |
Type |
Restrictions |
Description |
type |
Yes |
String |
ALL_IGNORED, ALL_ALLOWED, ALLOW_SPECIFIC_STRING |
|
queryStrings |
No |
List<String> |
Required when using type ALLOW_SPECIFIC_STRING |
|
EdgeAuth
Parameter name |
Requirement status |
Type |
Restrictions |
Description |
enabled |
Yes |
boolean |
true, false |
Use status |
type |
Yes |
String |
SIGNED_URL, JWT, MEDIA_VAULT |
If Global is chosen as Service Region, only MEDIA_VAULT can be used Korea and Japan are both available for Service Regions |
tokenName |
No |
String |
Only English lowercase letters can be used without spaces, required when enabled is set to true |
|
tokenKey |
No |
String |
Required when enabled is set to true |
|
bypassValues |
No |
List<String> |
MEDIA_VAULT is not supported |
Expander for which certification is to be excluded (up to 20) e.g., .ts, .jpg, .exe |
tokenBypassValues |
No |
List<String> |
MEDIA_VAULT is not supported |
Expander for which original is to be transmitted as certification value (up to 20) e.g., playlist.m3u8, index.m3u8, .ts, .png |
CachingRule
Parameter name |
Requirement status |
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 |
Requirement status |
Type |
Restrictions |
Description |
enabled |
Yes |
boolean |
true, false |
Use status |
originalCopyLocation |
No |
OriginalCopyLocation |
Required when enabled is set to true |
|
BrowserCache
Parameter name |
Requirement status |
Type |
Restrictions |
Description |
enabled |
Yes |
boolean |
true, false |
Use status |
type |
No |
String |
Required when ALLOW_CACHE, NO_CACHE, enabled are set to true |
|
ageType |
No |
String |
Required when SECONDS, MINUTES, HOURS, DAYS, enabled are set to true |
|
age |
No |
Integer |
Required when enabled is set to true |
|
CacheKeyQueryParameter
Parameter name |
Requirement status |
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 type ALLOW_SPECIFIC_STRING, IGNORE_SPECIFIC_STRING |
|
UrlRedirect
Parameter name |
Requirement status |
Type |
Restrictions |
Description |
enabled |
Yes |
boolean |
true, false |
Use status, UrlRedirect and UrlRewrite cannot be used simultaneously |
destinationProtocol |
No |
String |
Required when HTTP, HTTPS, enabled are set to true |
|
destinationHostname |
No |
String |
Required when enabled is set to true |
|
destinationPath |
No |
String |
Required when enabled is set to true |
|
responseCode |
No |
String |
Required when MOVED_PERMANENTLY_301, FOUND_302, enabled are set to true |
|
UrlRewrite
Parameter name |
Requirement status |
Type |
Restrictions |
Description |
enabled |
Yes |
boolean |
true, false |
Use status, UrlRedirect and UrlRewrite cannot be used simultaneously |
rewriteTarget |
No |
String |
Required when enabled is set to true |
|
ManagedRule
Parameter name |
Requirement status |
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 |
Requirement status |
Type |
Restrictions |
Description |
type |
Yes |
String |
ORIGIN_REQUEST, CLIENT_RESPONSE |
|
ruleName |
Yes |
String |
|
|
header |
Yes |
Header |
|
|
Header
Parameter name |
Requirement status |
Type |
Restrictions |
Description |
type |
Yes |
String |
ADD, MODIFY, REMOVE |
|
name |
Yes |
String |
|
|
value |
Yes |
String |
|
|
OptimizationConfig
Parameter name |
Requirement status |
Type |
Restrictions |
Description |
httpCompression |
Yes |
boolean |
true, false |
Use status |
largeFileOptimization |
Yes |
boolean |
true, false |
Use status |
AccessControl
Parameter name |
Requirement status |
Type |
Restrictions |
Description |
type |
Yes |
WHITELIST, BLACKLIST |
All access control rules can use only one policy |
|
ipPolicies |
Yes |
List<String> |
Only IP format available |
|
geoPolicies |
Yes |
List<String> |
ISO 3166-1 alpha-2 country codes available |
|
refererPolicies |
Yes |
List<String> |
Only domain format available |
|
Responses
Every response returns success or failure with 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 Examples
https://edge.apigw.ntruss.com/api/v1/cdn-edges/123
{
"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 examples
{
"code": "0000",
"message": "Success",
"result": {
"edgeId": 123
}
}
Errors
Error code |
Description |
0032 |
Unauthorized request |
9999 |
Server error occurred |