Available in Classic and VPC
Configure an edge that is either running or stopped. Existing settings will be overwritten based on the input.
Note the following when editing edges.
- The service area and service domain settings can't be edited.
- The edge name can only be edited in the console.
Request
This section describes the request format. The method and URI are as follows:
Method | URI |
---|---|
PUT | /api/v1/cdn-edges/{edgeId} |
Request headers
For information about the headers common to all Global Edge APIs, see Global Edge request headers.
Request path parameters
You can use the following path parameters with your request:
Field | Type | Required | Description |
---|---|---|---|
edgeId |
Long | Required | Edge ID
|
Request body
You can include the following data in the body of your request:
Field | Type | Required | Description |
---|---|---|---|
profileId |
Long | Required | Profile ID
|
edgeName |
String | Required | Edge name
|
distributionConfig |
Object | Required | Deployment settings: CdnDistributionConfig |
originalCopyConfig |
Object | Required | Origin settings: CdnOriginalCopyConfig |
cachingConfig |
Object | Required | Cache settings: CdnCachingConfig |
managedRule |
Object | Required | Managed rule: ManagedRule |
headerPolicies |
Array | Required | Header settings: HeaderPolicy
|
optimizationConfig |
Object | Required | Optimization settings: OptimizationConfig |
accessControl |
Object | Required | Access control settings: AccessControl |
CdnDistributionConfig
The following describes CdnDistributionConfig
.
Field | Type | Required | Description |
---|---|---|---|
protocolType |
String | Required | Service protocol
|
regionType |
String | Required | Service area
|
serviceDomain |
Object | Required | Service domain settings
|
serviceDomain.domainType |
String | Required | Service domain type
|
serviceDomain.domainName |
String | Conditional | Domain name
|
serviceDomain.certificate |
Object | Conditional | Certificate
|
serviceDomain.certificate.id |
Number | Conditional | Certificate slot ID
|
edgeLogging |
Object | Required | Edge log settings |
edgeLogging.enabled |
Boolean | Required | Feature usage status
|
edgeLogging.bucketPrefix |
String | Optional | Log storage path |
edgeLogging.objectStorage |
Object | Conditional | Log storage information
|
edgeLogging.objectStorage.region |
String | Conditional | Service Region
|
edgeLogging.objectStorage.bucketName |
String | Conditional | Bucket name |
CdnOriginalCopyConfig
The following describes CdnOriginalCopyConfig
.
Field | Type | Required | Description |
---|---|---|---|
originalCopyLocation |
Object | Required | Origin server settings |
originalCopyLocation.type |
String | Required | Origin type
|
originalCopyLocation.region |
String | Conditional | Service Region
|
originalCopyLocation.bucketName |
String | Conditional | Bucket name
|
originalCopyLocation.customLocation |
String | Conditional | Origin domain name
|
forwardHostHeader |
Object | Required | Host header forwarding settings |
forwardHostHeader.type |
String | Required | Forwarding type
|
forwardHostHeader.customHostHeader |
String | Conditional | Host header value
|
originalCopyProtocol |
Object | Required | Origin protocol settings |
originalCopyProtocol.type |
String | Required | Protocol type
|
originalCopyProtocol.port |
Integer | Required | Port number |
originalCopyPath |
String | Optional | Origin path
|
originFailoverConfig |
Object | Optional | Origin failover settings |
originFailoverConfig.ruleName |
String | Conditional | Failover rule name |
originFailoverConfig.statusCodes |
Array | Conditional | List of origin response codes
|
originFailoverConfig.originalCopyLocation |
Object | Conditional | Backup origin server information to forward requests to |
originFailoverConfig.originalCopyLocation.type |
String | Conditional | Backup origin type
|
originFailoverConfig.originalCopyLocation.region |
String | Conditional | Service Region
|
originFailoverConfig.originalCopyLocation.bucketName |
String | Conditional | Bucket name
|
originFailoverConfig.originalCopyLocation.customLocation |
String | Conditional | Origin domain name
|
CdnCachingConfig
The following describes CdnCachingConfig
.
Field | Type | Required | Description |
---|---|---|---|
defaultCaching |
Object | Required | Default cache settings |
defaultCaching.enabled |
Boolean | Required | Feature usage status
|
defaultCaching.ruleDefinitionType |
String | Required | Cache options
|
defaultCaching.cacheRevalidateConfig |
Object | Required | Set up revalidation of stale objects
|
defaultCaching.cacheRevalidateConfig.type |
String | Required | Revalidation type
|
defaultCaching.cacheRevalidateConfig.ageType |
String | Required | Maximum cache retention period unit
|
defaultCaching.cacheRevalidateConfig.age |
String | Required | Maximum cache retention period
|
negativeTtl |
Boolean | Required | Whether to use negative TTL
|
bypassQueryString |
Object | Required | Bypass query string settings
|
bypassQueryString.enabled |
Boolean | Required | Feature usage status
|
bypassQueryString.queryStrings |
Array | Conditional | Target string list |
cacheKeyHostname |
String | Required | Cache key host name type
|
cacheKeyIgnoreQueryString |
Object | Required | Cache key query string settings
|
cacheKeyIgnoreQueryString.type |
String | Required | Setting type
|
cacheKeyIgnoreQueryString.queryStrings |
Array | Conditional | Target string list
|
urlLetterCaseIgnoreUse |
Boolean | Optional | Whether to ignore cache key case sensitivity
|
removeVaryHeader |
Boolean | Required | Whether to remove the Vary header
|
edgeAuth |
Object | Required | Request authentication settings
|
edgeAuth.enabled |
Boolean | Required | Feature usage status
|
edgeAuth.type |
String | Conditional | Authentication type
|
edgeAuth.tokenName |
String | Conditional | Token name
|
edgeAuth.tokenKey |
String | Conditional | Token key value |
edgeAuth.bypassValues |
Array | Optional | List of authentication exclusion extensions
|
edgeAuth.tokenBypassValues |
Array | Optional | List of extensions that pass authentication values to origin
|
cachingRules |
Array | Required | Cache detailed rule settings: CachingRule |
CachingRule
The following describes CachingRule
.
Field | Type | Required | Description |
---|---|---|---|
ruleName |
String | Required | Cache detailed rule name |
ruleType |
String | Required | Rule condition type
|
ruleConditions |
Array | Required | Rule condition list
|
ruleDefinitionType |
String | Required | Cache options
|
cacheRevalidateConfig |
Object | Required | Set up revalidation of stale objects
|
cacheRevalidateConfig.type |
String | Required | Revalidation type
|
cacheRevalidateConfig.ageType |
String | Required | Maximum cache retention period unit
|
cacheRevalidateConfig.age |
Integer | Required | Maximum cache retention period
|
ruleBasedRoutingConfig |
Object | Required | Rule-based origin routing settings
|
ruleBasedRoutingConfig.enabled |
Boolean | Required | Feature usage status
|
ruleBasedRoutingConfig.originalCopyLocation |
Object | Conditional | Origin server settings |
ruleBasedRoutingConfig.originalCopyLocation.type |
String | Conditional | Origin type
|
ruleBasedRoutingConfig.originalCopyLocation.region |
String | Conditional | Service Region
|
ruleBasedRoutingConfig.originalCopyLocation.bucketName |
String | Conditional | Bucket name
|
ruleBasedRoutingConfig.originalCopyLocation.customLocation |
String | Conditional | Origin domain name
|
browserCache |
Object | Required | Browser cache settings
|
browserCache.enabled |
Boolean | Required | Feature usage status
|
browserCache.type |
String | Conditional | Browser cache allowance type
|
browserCache.ageType |
String | Conditional | Maximum cache retention period unit
|
browserCache.age |
Integer | Conditional | Maximum cache retention period
|
cacheKeyQueryParameter |
Object | Required | Cache key query parameter settings
|
cacheKeyQueryParameter.enabled |
Boolean | Required | Feature usage status
|
cacheKeyQueryParameter.type |
String | Conditional | Setting type
|
cacheKeyQueryParameter.queryParameters |
Array | Conditional | Target string list
|
accessDeny |
Boolean | Required | Whether to block access according to the rule condition (ruleConditions )
|
urlRedirect |
Object | Required | URL redirection settings
|
urlRedirect.enabled |
Boolean | Required | Feature usage status
|
urlRedirect.destinationProtocol |
String | Conditional | Redirect destination protocol
|
urlRedirect.destinationHostname |
String | Conditional | Redirect destination host
|
urlRedirect.destinationPath |
String | Conditional | Redirection destination detailed path |
urlRedirect.responseCode |
String | Conditional | Redirection status code
|
urlRewrite |
Object | Required | URL rewriting settings
|
urlRewrite.enabled |
Boolean | Required | Feature usage status
|
urlRewrite.rewriteTarget |
String | Conditional | Destination detailed path |
ManagedRule
The following describes ManagedRule
.
Field | Type | Required | Description |
---|---|---|---|
cors |
Boolean | Required | Whether to add the cross origin resource sharing header (CORS header)
|
corsPolicy |
Object | Conditional | Cross-Origin Resource Sharing (CORS) header details |
corsPolicy.allowOrigin |
String | Required | Access-Control-Allow-Origin settings
|
corsPolicy.allowMethods |
Array | Conditional | Access-Control-Allow-Methods settings
|
corsPolicy.allowHeaders |
Array | Conditional | Access-Control-Allow-Headers settings
|
corsPolicy.allowCredentials |
Boolean | Conditional | Access-Control-Allow-Credentials settings
|
corsPolicy.useMaxAge |
Boolean | Conditional | Access-Control-Max-Age settings
|
http2 |
Boolean | Required | Whether to use open network protocol (HTTP/2)
|
trueClientIpHeader |
Boolean | Required | Whether to add client IP header to headers when forwarding requests to origin server
|
hsts |
Boolean | Required | Whether to use HTTPS for browser connections
|
HeaderPolicy
The following describes HeaderPolicy
.
Field | Type | Required | Description |
---|---|---|---|
type |
String | Required | Header type
|
ruleName |
String | Required | Header setting name |
header |
Object | Required | Header detailed settings |
header.type |
String | Required | Action type
|
header.name |
String | Required | Header name |
header.value |
String | Conditional | Header value
|
OptimizationConfig
The following describes OptimizationConfig
.
Field | Type | Required | Description |
---|---|---|---|
httpCompression |
Boolean | Required | Whether to use Gzip or Brotli compressed transfers
|
largeFileOptimization |
Boolean | Required | Whether to enable large file transfer
|
headerMaxSize |
Object | Conditional | Request Header Size settings |
headerMaxSize.singleSize |
String | Required | Single Header Size settings
|
headerMaxSize.totalSize |
String | Required | Total Header Size settings
|
AccessControl
The following describes AccessControl
.
Field | Type | Required | Description |
---|---|---|---|
type |
String | Required | Access control type
|
ipPolicies |
Array | Required | Client IP or CIDR block
|
geoPolicies |
Array | Required | Client country code
|
refererPolicies |
Array | Required | HTTP request referrer header
|
Request example
The request example is as follows:
curl --location --request PUT 'https://edge.apigw.ntruss.com/api/v1/cdn-edges/123' \
--header 'x-ncp-apigw-timestamp: {Timestamp}' \
--header 'x-ncp-iam-access-key: {Access Key}' \
--header 'x-ncp-apigw-signature-v2: {API Gateway Signature}' \
--header 'Content-Type: application/json' \
--data '{
"profileId": 234,
"edgeName": "sample-edge",
"distributionConfig": {
"protocolType": "ALL",
"regionType": "KOREA",
"serviceDomain": {
"domainType": "NCP_DOMAIN_AUTO",
"domainName": null,
"certificate": null
},
"edgeLogging": {
"enabled": true,
"bucketPrefix": "log/sample",
"objectStorage": {
"region": "KR",
"bucketName": "sample-bucket"
}
}
},
"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,
"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": "902bceb96************10ff0b9befb"
},
"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",
"ageType": "SECONDS",
"age": 100
},
"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,
"corsPolicy": {
"allowOrigin": "*",
"allowMethods": [
"GET",
"POST",
"OPTIONS"
],
"allowHeaders": [
"origin"
],
"allowCredentials": false,
"useMaxAge": true
},
"http2": true,
"trueClientIpHeader": true,
"hsts": false
},
"headerPolicies": [
{
"type": "ORIGIN_REQUEST",
"ruleName": "Modify Origin Request 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,
"headerMaxSize": {
"singleSize": "SIZE_16KB",
"totalSize": "SIZE_32KB"
}
},
"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
This section describes the response format.
Response body
The response body includes the following data:
Field | Type | Required | Description |
---|---|---|---|
code |
String | - | Response code |
message |
String | - | Response message |
result |
Object | - | Response result |
result.edgeId |
Integer | - | Edge ID |
Response status codes
For information about the HTTP status codes common to all Global Edge APIs, see Global Edge response status codes.
Response example
The response example is as follows:
{
"code": "0000",
"message": "Success",
"result": {
"edgeId": 123
}
}