Create edge
    • PDF

    Create edge

    • PDF

    Article summary

    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 nameRequiredTypeRestrictionsDescription
    profileIdYesLongProfile ID
    edgeNameYesStringOnly English letters, numbers, and special characters "-" and "_" are allowed.
    distributionConfigYesCdnDistributionConfigDeployment settings
    originalCopyConfigYesCdnOriginalCopyConfigOrigin settings
    cachingConfigYesCdnCachingConfigCache settings
    managedRuleYesManagedRuleSet managed rule
    headerPoliciesYesList<HeaderPolicy>Set header
    optimizationConfigYesOptimizationConfigSet optimization
    accessControlYesAccessControlAccess control setting

    CdnDistributionConfig

    Parameter nameRequiredTypeRestrictionsDescription
    protocolTypeYesStringHTTP, HTTPS, ALLService protocol
    regionTypeYesStringKOREA, JAPAN, GLOBAL (performance prioritized), GLOBAL (availability prioritized)Service area
    serviceDomainYesServiceDomainService domain
    edgeLoggingYesEdgeLoggingSet edge logging

    ServiceDomain

    Parameter nameRequiredTypeRestrictionsDescription
    domainTypeYesStringNCP_DOMAIN_AUTO, NCP_DOMAIN_CUSTOM, CUSTOM_DOMAINDomain usage type
    domainNameYesStringUse domainType as domain format when using a custom domain
    certificateNoCertificateRequired when using HTTPS and personal domain together

    Certificate

    Parameter nameRequiredTypeRestrictionsDescription
    idYesLongcertificateNo of the certificate registered in Certificate Manager

    EdgeLogging

    Parameter nameRequiredTypeRestrictionsDescription
    enabledYesbooleantrue, falseUse status
    bucketPrefixNoString
    objectStorageNoObjectStorageRequired when setting enabled to true

    ObjectStorage

    Parameter nameRequiredTypeRestrictionsDescription
    regionYesStringKR, USWN, SGN, JPN, DENKorea (KR), US West (USWN), Singapore (SGN), Japan (JPN), and Germany (DEN)
    bucketNameYesStringObject Storage bucket name

    CdnOriginalCopyConfig

    Parameter nameRequiredTypeRestrictionsDescription
    originalCopyLocationYesOriginalCopyLocationSet origin domain
    forwardHostHeaderYesForwardHostHeaderForward Host Header
    originalCopyProtocolYesOriginalCopyProtocolOrigin protocol settings
    originalCopyPathNoStringSource path
    originShieldYesOriginShieldSet origin shield
    originFailoverConfigNoOriginFailoverConfigSet failover policy

    OriginalCopyLocation

    Parameter nameRequiredTypeRestrictionsDescription
    typeYesStringOBJECT_STORAGE, CUSTOM, NONEOrigin type
    regionNoStringKR, SGN, JPN, USWN, DENKorea (KR), Singapore (SGN), Japan (JPN), US West (USWN), and Germany (DEN); required when using Object Storage
    bucketNameNoStringRequired when type is Object StorageObject Storage bucket name
    customLocationNoStringRequired when type is customOnly one of bucketName and customLocation can be used according to type

    ForwardHostHeader

    Parameter nameRequiredTypeRestrictionsDescription
    typeYesStringINCOMING_HOST_HEADER, ORIGIN_HOSTNAME, CUSTOM
    customHostHeaderNoStringRequired when type is custom

    OriginalCopyProtocol

    Parameter nameRequiredTypeRestrictionsDescription
    typeYesStringHTTP, HTTPSOrigin protocol
    portYesIntegerOrigin port

    OriginShield

    Parameter nameRequiredTypeRestrictionsDescription
    enabledYesbooleantrue, falseUse status
    regionNoStringKR, SGN, JPN, USWN, DENKorea (KR), Singapore (SGN), Japan (JPN), US West (USWN), and Germany (DEN); required when setting enabled to true

    OriginFailoverConfig

    Parameter nameRequiredTypeRestrictionsDescription
    ruleNameYesString
    statusCodesYesList<Integer>404, 500, 502, 503, 504
    originalCopyLocationYesOriginalCopyLocation

    CdnCachingConfig

    Parameter nameRequiredTypeRestrictionsDescription
    defaultCachingYesDefaultCachingSet default cache
    negativeTtlYesbooleantrue, falseSet usage status, error response cache
    bypassQueryStringYesBypassQueryString
    cacheKeyHostnameYesStringINCOMING_HOST_HEADER, ORIGIN_HOSTNAME
    cacheKeyIgnoreQueryStringYesCacheKeyIgnoreQueryString
    removeVaryHeaderYesbooleantrue, falseUse status
    edgeAuthYesEdgeAuthValidate user request using tokens
    cachingRulesYesList<CachingRule>Detailed cache settings

    DefaultCaching

    Parameter nameRequiredTypeRestrictionsDescription
    enabledYesbooleantrue, falseUse status
    ruleDefinitionTypeYesStringCACHING, BYPASS_CACHE, ORIGIN_CACHE_CONTROL_HEADER
    cacheRevalidateConfigYesCacheRevalidateConfig

    CacheRevalidateConfig

    Parameter nameRequiredTypeRestrictionsDescription
    typeYesStringIF_POSSIBLE, ALWAYSServe stale if unable to validate(IF_POSSIBLE), Always revalidate with origin(ALWAYS)
    ageTypeYesStringSECONDS, MINUTES, HOURS, DAYS
    ageYesIntegerChange time unit based on ageType

    BypassQueryString

    Parameter nameRequiredTypeRestrictionsDescription
    enabledYesbooleantrue, falseUse status
    queryStringsNoList<String>Required when setting enabled to true

    CacheKeyIgnoreQueryString

    Parameter nameRequiredTypeRestrictionsDescription
    typeYesStringALL_IGNORED, ALL_ALLOWED, ALLOW_SPECIFIC_STRING
    queryStringsNoList<String>Required when using ALLOW_SPECIFIC_STRING as type

    EdgeAuth

    Parameter nameRequiredTypeRestrictionsDescription
    enabledYesbooleantrue, falseUse status
    typeYesStringSIGNED_URL, JWT, MEDIA_VAULTOnly MEDIA_VAULT is available when selecting service region as Global
    Everything is available when selecting service region as Korea/Japan
    tokenNameNoStringEnglish lowercase letters only without spaces; required when enabled is set to true
    tokenKeyNoStringRequired when setting enabled to true
    bypassValuesNoList<String>MEDIA_VAULT not supportedExtensions to exclude from authentication (up to 20)
    e.g., .ts, .jpg, .exe
    tokenBypassValuesNoList<String>MEDIA_VAULT not supportedExtensions to forward authentication values to as origin (up to 20)
    e.g., playlist.m3u8, index.m3u8, .ts, .png

    CachingRule

    Parameter nameRequiredTypeRestrictionsDescription
    ruleNameYesString
    ruleTypeYesStringDIRECTORY, FILE_EXTENSION, ADVANCED
    ruleConditionsYesList<String>
    ruleDefinitionTypeYesStringCACHING, BYPASS_CACHE, ORIGIN_CACHE_CONTROL_HEADER
    cacheRevalidateConfigYesCacheRevalidateConfig
    ruleBasedRoutingConfigYesRuleBasedRoutingConfig
    browserCacheYesBrowserCache
    cacheKeyQueryParameterYesCacheKeyQueryParameter
    accessDenyYesbooleantrue, false
    urlRedirectYesUrlRedirect
    urlRewriteYesUrlRewrite

    RuleBasedRoutingConfig

    Parameter nameRequiredTypeRestrictionsDescription
    enabledYesbooleantrue, falseUse status
    originalCopyLocationNoOriginalCopyLocationRequired when setting enabled to true

    BrowserCache

    Parameter nameRequiredTypeRestrictionsDescription
    enabledYesbooleantrue, falseUse status
    typeNoStringRequired when setting ALLOW_CACHE, NO_CACHE, enabled to true
    ageTypeNoStringRequired when setting SECONDS, MINUTES, HOURS, DAYS, enabled to true
    ageNoIntegerRequired when setting enabled to true

    CacheKeyQueryParameter

    Parameter nameRequiredTypeRestrictionsDescription
    enabledYesbooleantrue, falseUse status
    typeYesStringALL_IGNORED, ALL_ALLOWED, ALLOW_SPECIFIC_STRING, IGNORE_SPECIFIC_STRING
    queryParametersNoList<String>Required when using ALLOW_SPECIFIC_STRING, IGNORE_SPECIFIC_STRING as type

    UrlRedirect

    Parameter nameRequiredTypeRestrictionsDescription
    enabledYesbooleantrue, falseUsage status; UrlRedirect and UrlRewrite can't be used concurrently
    destinationProtocolNoStringRequired when setting HTTP, HTTPS, enabled to true
    destinationHostnameNoStringRequired when setting enabled to true
    destinationPathNoStringRequired when setting enabled to true
    responseCodeNoStringRequired when setting MOVED_PERMANENTLY_301, FOUND_302, enabled to true

    UrlRewrite

    Parameter nameRequiredTypeRestrictionsDescription
    enabledYesbooleantrue, falseUsage status; UrlRedirect and UrlRewrite can't be used concurrently
    rewriteTargetNoStringRequired when setting enabled to true

    ManagedRule

    Parameter nameRequiredTypeRestrictionsDescription
    corsYesbooleantrue, falseUse status
    http2Yesbooleantrue, falseUse status
    trueClientIpHeaderYesbooleantrue, falseUse status
    hstsYesbooleantrue, falseUse status

    HeaderPolicy

    Parameter nameRequiredTypeRestrictionsDescription
    typeYesStringORIGIN_REQUEST, CLIENT_RESPONSE
    ruleNameYesString
    headerYesHeader

    Header

    Parameter nameRequiredTypeRestrictionsDescription
    typeYesStringADD, MODIFY, REMOVE
    nameYesString
    valueYesString

    OptimizationConfig

    Parameter nameRequiredTypeRestrictionsDescription
    httpCompressionYesbooleantrue, falseUse status
    largeFileOptimizationYesbooleantrue, falseUse status

    AccessControl

    Parameter nameRequiredTypeRestrictionsDescription
    typeYesWHITELIST, BLACKLISTEvery access control rule can only use one policy
    ipPoliciesYesList<String>IP format only
    geoPoliciesYesList<String>ISO 3166-1 alpha-2 country codes available
    refererPoliciesYesList<String>Domain format only

    Response

    All responses return success or failure as an HTTP status code.

    HTTP status codeCode messageDescription
    200SuccessSearch succeeded
    401UnauthorizedAuthentication failed
    500Internal Server ErrorServer 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 codeDescription
    0032Unauthorized request
    9999Server error occurred

    Was this article helpful?

    What's Next
    Changing your password will log you out immediately. Use the new password to log back in.
    First name must have atleast 2 characters. Numbers and special characters are not allowed.
    Last name must have atleast 1 characters. Numbers and special characters are not allowed.
    Enter a valid email
    Enter a valid password
    Your profile has been successfully updated.