Classic/VPC 환경에서 이용 가능합니다.
프로필에 엣지를 생성합니다.
참고
계정당 엣지는 최대 100개까지 생성할 수 있습니다. 한도 상향 필요 시 고객 문의를 통해서 요청해 주십시오.
요청
요청 형식을 설명합니다. 요청 형식은 다음과 같습니다.
메서드 | URI |
---|---|
POST | /api/v1/cdn-edge |
요청 헤더
Global Edge API에서 공통으로 사용하는 헤더에 대한 정보는 Global Edge 요청 헤더를 참조해 주십시오.
요청 바디
요청 바디에 대한 설명은 다음과 같습니다.
필드 | 타입 | 필수 여부 | 설명 |
---|---|---|---|
profileId |
Long | Required | 프로필 아이디
|
edgeName |
String | Required | 엣지 이름
|
distributionConfig |
Object | Required | 배포 설정: CdnDistributionConfig |
originalCopyConfig |
Object | Required | 오리진 설정: CdnOriginalCopyConfig |
cachingConfig |
Object | Required | 캐시 설정: CdnCachingConfig |
managedRule |
Object | Required | 매니지드 룰: ManagedRule |
headerPolicies |
Array | Required | 헤더 설정: HeaderPolicy
|
optimizationConfig |
Object | Required | 최적화 설정: OptimizationConfig |
accessControl |
Object | Required | 접근 제어 설정: AccessControl |
CdnDistributionConfig
CdnDistributionConfig
에 대한 설명은 다음과 같습니다.
필드 | 타입 | 필수 여부 | 설명 |
---|---|---|---|
protocolType |
String | Required | 서비스 프로토콜
|
regionType |
String | Required | 서비스 지역
|
serviceDomain |
Object | Required | 서비스 도메인 설정 |
serviceDomain.domainType |
String | Required | 서비스 도메인 유형
|
serviceDomain.domainName |
String | Conditional | 도메인 이름
|
serviceDomain.certificate |
Object | Conditional | 인증서
|
serviceDomain.certificate.id |
Number | Conditional | 인증서 슬롯 아이디
|
edgeLogging |
Object | Required | 엣지 로그 설정 |
edgeLogging.enabled |
Boolean | Required | 기능 사용 여부
|
edgeLogging.bucketPrefix |
String | Optional | 로그 저장 경로 |
edgeLogging.objectStorage |
Object | Conditional | 로그 스토리지 정보
|
edgeLogging.objectStorage.region |
String | Conditional | 서비스 리전
|
edgeLogging.objectStorage.bucketName |
String | Conditional | 버킷 이름 |
CdnOriginalCopyConfig
CdnOriginalCopyConfig
에 대한 설명은 다음과 같습니다.
필드 | 타입 | 필수 여부 | 설명 |
---|---|---|---|
originalCopyLocation |
Object | Required | 오리진 서버 설정 |
originalCopyLocation.type |
String | Required | 오리진 유형
|
originalCopyLocation.region |
String | Conditional | 서비스 리전
|
originalCopyLocation.bucketName |
String | Conditional | 버킷 이름
|
originalCopyLocation.customLocation |
String | Conditional | 오리진 도메인 이름
|
forwardHostHeader |
Object | Required | 호스트 헤더 포워딩 설정 |
forwardHostHeader.type |
String | Required | 포워딩 유형
|
forwardHostHeader.customHostHeader |
String | Conditional | 호스트 헤더 값
|
originalCopyProtocol |
Object | Required | 오리진 프로토콜 설정 |
originalCopyProtocol.type |
String | Required | 프로토콜 유형
|
originalCopyProtocol.port |
Integer | Required | 포트 번호 |
originalCopyPath |
String | Optional | 오리진 경로
|
originFailoverConfig |
Object | Optional | 오리진 페일오버 설정 |
originFailoverConfig.ruleName |
String | Conditional | 페일오버 규칙 이름 |
originFailoverConfig.statusCodes |
Array | Conditional | 오리진 응답 코드 목록
|
originFailoverConfig.originalCopyLocation |
Object | Conditional | 요청을 포워딩할 백업 오리진 서버 정보 |
originFailoverConfig.originalCopyLocation.type |
String | Conditional | 백업 오리진 유형
|
originFailoverConfig.originalCopyLocation.region |
String | Conditional | 서비스 리전
|
originFailoverConfig.originalCopyLocation.bucketName |
String | Conditional | 버킷 이름
|
originFailoverConfig.originalCopyLocation.customLocation |
String | Conditional | 오리진 도메인 이름
|
CdnCachingConfig
CdnCachingConfig
에 대한 설명은 다음과 같습니다.
필드 | 타입 | 필수 여부 | 설명 |
---|---|---|---|
defaultCaching |
Object | Required | 캐시 기본 설정 |
defaultCaching.enabled |
Boolean | Required | 기능 사용 여부
|
defaultCaching.ruleDefinitionType |
String | Required | 캐시 옵션
|
defaultCaching.cacheRevalidateConfig |
Object | Required | 오래된 객체 재검증 설정
|
defaultCaching.cacheRevalidateConfig.type |
String | Required | 재검증 유형
|
defaultCaching.cacheRevalidateConfig.ageType |
String | Required | 캐시 최대 보관 기간 단위
|
defaultCaching.cacheRevalidateConfig.age |
String | Required | 캐시 최대 보관 기간
|
negativeTtl |
Boolean | Required | 네거티브 TTL 사용 여부
|
bypassQueryString |
Object | Required | 바이패스 쿼리 스트링 설정
|
bypassQueryString.enabled |
Boolean | Required | 기능 사용 여부
|
bypassQueryString.queryStrings |
Array | Conditional | 대상 문자열 목록 |
cacheKeyHostname |
String | Required | 캐시 키 호스트 이름 유형
|
cacheKeyIgnoreQueryString |
Object | Required | 캐시 키 쿼리 스트링 설정
|
cacheKeyIgnoreQueryString.type |
String | Required | 설정 유형
|
cacheKeyIgnoreQueryString.queryStrings |
Array | Conditional | 대상 문자열 목록
|
urlLetterCaseIgnoreUse |
Boolean | Optional | 캐시 키 대소문자 구분 무시 여부
|
removeVaryHeader |
Boolean | Required | Vary 헤더 제거 사용 여부
|
edgeAuth |
Object | Required | 요청 인증 설정
|
edgeAuth.enabled |
Boolean | Required | 기능 사용 여부
|
edgeAuth.type |
String | Conditional | 인증 유형
|
edgeAuth.tokenName |
String | Conditional | 토큰 이름
|
edgeAuth.tokenKey |
String | Conditional | 토큰 키 값 |
edgeAuth.bypassValues |
Array | Optional | 인증 제외 확장자 목록
|
edgeAuth.tokenBypassValues |
Array | Optional | 인증값을 오리진에 전달하는 확장자 목록
|
cachingRules |
Array | Required | 캐시 상세 룰 설정: CachingRule |
CachingRule
CachingRule
에 대한 설명은 다음과 같습니다.
필드 | 타입 | 필수 여부 | 설명 |
---|---|---|---|
ruleName |
String | Required | 캐시 상세 룰 이름 |
ruleType |
String | Required | 룰 조건 유형
|
ruleConditions |
Array | Required | 룰 조건 목록
|
ruleDefinitionType |
String | Required | 캐시 옵션
|
cacheRevalidateConfig |
Object | Required | 오래된 객체 재검증 설정
|
cacheRevalidateConfig.type |
String | Required | 재검증 유형
|
cacheRevalidateConfig.ageType |
String | Required | 캐시 최대 보관 기간 단위
|
cacheRevalidateConfig.age |
Integer | Required | 캐시 최대 보관 기간
|
ruleBasedRoutingConfig |
Object | Required | 룰 기반 오리진 라우팅 설정
|
ruleBasedRoutingConfig.enabled |
Boolean | Required | 기능 사용 여부
|
ruleBasedRoutingConfig.originalCopyLocation |
Object | Conditional | 오리진 서버 설정 |
ruleBasedRoutingConfig.originalCopyLocation.type |
String | Conditional | 오리진 유형
|
ruleBasedRoutingConfig.originalCopyLocation.region |
String | Conditional | 서비스 리전
|
ruleBasedRoutingConfig.originalCopyLocation.bucketName |
String | Conditional | 버킷 이름
|
ruleBasedRoutingConfig.originalCopyLocation.customLocation |
String | Conditional | 오리진 도메인 이름
|
browserCache |
Object | Required | 브라우저 캐시 설정
|
browserCache.enabled |
Boolean | Required | 기능 사용 여부
|
browserCache.type |
String | Conditional | 브라우저 캐시 허용 유형
|
browserCache.ageType |
String | Conditional | 캐시 최대 보관 기간 단위
|
browserCache.age |
Integer | Conditional | 캐시 최대 보관 기간
|
cacheKeyQueryParameter |
Object | Required | 캐시 키 쿼리 파라미터 설정
|
cacheKeyQueryParameter.enabled |
Boolean | Required | 기능 사용 여부
|
cacheKeyQueryParameter.type |
String | Conditional | 설정 유형
|
cacheKeyQueryParameter.queryParameters |
Array | Conditional | 대상 문자열 목록
|
accessDeny |
Boolean | Required | 룰 조건(ruleConditions )에 대한 접근 차단 여부
|
urlRedirect |
Object | Required | URL 리디렉션 설정
|
urlRedirect.enabled |
Boolean | Required | 기능 사용 여부
|
urlRedirect.destinationProtocol |
String | Conditional | 리디렉션 목적지 프로토콜
|
urlRedirect.destinationHostname |
String | Conditional | 리디렉션 목적지 호스트
|
urlRedirect.destinationPath |
String | Conditional | 리디렉션 목적지 상세 경로 |
urlRedirect.responseCode |
String | Conditional | 리디렉션 상태 코드
|
urlRewrite |
Object | Required | URL 리라이팅 설정
|
urlRewrite.enabled |
Boolean | Required | 기능 사용 여부
|
urlRewrite.rewriteTarget |
String | Conditional | 목적지 상세 경로 |
ManagedRule
ManagedRule
에 대한 설명은 다음과 같습니다.
필드 | 타입 | 필수 여부 | 설명 |
---|---|---|---|
cors |
Boolean | Required | CORS 헤더(교차 오리진 리소스 공유 헤더) 추가 여부
|
http2 |
Boolean | Required | HTTP/2(개방형 네트워크 프로토콜) 사용 여부
|
trueClientIpHeader |
Boolean | Required | 오리진 서버로 요청 포워딩 시 헤더에 클라이언트 IP 헤더 추가 여부
|
hsts |
Boolean | Required | 브라우저 연결에 HTTPS 사용 여부
|
HeaderPolicy
HeaderPolicy
에 대한 설명은 다음과 같습니다.
필드 | 타입 | 필수 여부 | 설명 |
---|---|---|---|
type |
String | Required | 헤더 유형
|
ruleName |
String | Required | 헤더 설정 이름 |
header |
Object | Required | 헤더 상세 설정 |
header.type |
String | Required | 액션 유형
|
header.name |
String | Required | 헤더 이름 |
header.value |
String | Conditional | 헤더 값
|
OptimizationConfig
OptimizationConfig
에 대한 설명은 다음과 같습니다.
필드 | 타입 | 필수 여부 | 설명 |
---|---|---|---|
httpCompression |
Boolean | Required | Gzip, Brotli 압축 전송 사용 여부
|
largeFileOptimization |
Boolean | Required | 대용량 파일 전송 사용 여부
|
AccessControl
AccessControl
에 대한 설명은 다음과 같습니다.
필드 | 타입 | 필수 여부 | 설명 |
---|---|---|---|
type |
String | Required | 접근 제어 유형
|
ipPolicies |
Array | Required | 클라이언트 IP 또는 CIDR 블록
|
geoPolicies |
Array | Required | 클라이언트 국가 코드
|
refererPolicies |
Array | Required | HTTP 요청 레퍼러 헤더
|
요청 예시
요청 예시는 다음과 같습니다.
curl --location --request POST 'https://edge.apigw.ntruss.com/api/v1/cdn-edge' \
--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": 4210,
"edgeName": "edge001",
"distributionConfig": {
"protocolType": "ALL",
"regionType": "KOREA",
"serviceDomain": {
"domainType": "NCP_DOMAIN_AUTO",
"domainName": null,
"certificate": null
},
"edgeLogging": {
"enabled": true,
"bucketPrefix": "edge/log",
"objectStorage": {
"region": "KR",
"bucketName": "mmmmbucket"
}
}
},
"originalCopyConfig": {
"originalCopyLocation": {
"type": "OBJECT_STORAGE",
"region": "KR",
"bucketName": "mybucket"
},
"forwardHostHeader": {
"type": "ORIGIN_HOSTNAME"
},
"originalCopyProtocol": {
"type": "HTTPS",
"port": 443
},
"originalCopyPath": null,
"originFailoverConfig": {
"ruleName": "failrule1",
"statusCodes": [
"404",
"500",
"502",
"503",
"504"
],
"originalCopyLocation": {
"type": "CUSTOM",
"customLocation": "customdomain.com"
}
}
},
"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"
},
"urlLetterCaseIgnoreUse": true,
"removeVaryHeader": true,
"edgeAuth": {
"enabled": true,
"type": "SIGNED_URL",
"tokenName": "tokenname",
"tokenKey": "b7*********************b45"
},
"cachingRules": [
{
"ruleName": "sample",
"ruleType": "DIRECTORY",
"ruleConditions": [
"/sample/*"
],
"ruleDefinitionType": "CACHING",
"cacheRevalidateConfig": {
"type": "IF_POSSIBLE",
"ageType": "SECONDS",
"age": 100
},
"ruleBasedRoutingConfig": {
"enabled": true,
"originalCopyLocation": {
"type": "CUSTOM",
"region": null,
"bucketName": null,
"customLocation": "admin.example.co.kr"
}
},
"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,
"http2": true,
"trueClientIpHeader": true,
"hsts": false
},
"headerPolicies": [
{
"type": "ORIGIN_REQUEST",
"ruleName": "Modify Origin Request Header",
"header": {
"type": "ADD",
"name": "headername",
"value": "headervalue"
}
},
{
"type": "CLIENT_RESPONSE",
"ruleName": "Modify Client Response Header",
"header": {
"type": "MODIFY",
"name": "rheadername",
"value": "rheadervalue"
}
}
],
"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"
]
}
}'
응답
응답 형식을 설명합니다.
응답 바디
응답 바디에 대한 설명은 다음과 같습니다.
필드 | 타입 | 필수 여부 | 설명 |
---|---|---|---|
code |
String | - | 응답 코드 |
message |
String | - | 응답 메시지 |
result |
Object | - | 응답 결과 |
result.edgeId |
Integer | - | 엣지 아이디 |
응답 상태 코드
Global Edge API에서 공통으로 사용하는 응답 상태 코드에 대한 정보는 Global Edge 응답 상태 코드를 참조해 주십시오.
응답 예시
응답 예시는 다음과 같습니다.
{
"code": "0000",
"message": "Success",
"result": {
"edgeId": 11207
}
}