Classic/VPC 환경에서 이용 가능합니다.
라이브 채널의 메인 스트림과 백업 스트림 간 활성 송출을 전환합니다. 채널이 PUBLISHING 상태일 때만 전환할 수 있습니다.
요청
요청 형식을 설명합니다. 요청 형식은 다음과 같습니다.
| 메서드 | URI |
|---|---|
| PUT | /api/v2/channels/{channelId}/switch-stream |
요청 헤더
Live Station API에서 공통으로 사용하는 헤더에 대한 정보는 Live Station 요청 헤더를 참조해 주십시오.
요청 경로 파라미터
요청 경로 파라미터에 대한 설명은 다음과 같습니다.
| 필드 | 타입 | 필수 여부 | 설명 |
|---|---|---|---|
channelId |
String | Required | 채널 아이디
|
요청 예시
요청 예시는 다음과 같습니다.
curl --location --request PUT 'https://livestation.apigw.ntruss.com/api/v2/channels/ls-20250814******-zTwK2/switch-stream' \
--header 'x-ncp-apigw-timestamp: {Timestamp}' \
--header 'x-ncp-iam-access-key: {Access Key}' \
--header 'x-ncp-apigw-signature-v2: {API Gateway Signature}' \
--header 'x-ncp-region_code: KR' \
--header 'Content-Type: application/json'
응답
응답 형식을 설명합니다.
응답 바디
응답 바디에 대한 설명은 다음과 같습니다.
| 필드 | 타입 | 필수 여부 | 설명 |
|---|---|---|---|
content.channelId |
String | - | 채널 ID |
content.channelName |
String | - | 채널 이름 |
content.instanceNo |
Integer | - | 채널 인스턴스 번호 |
content.qualitySetId |
Integer | - | 화질 설정 ID |
content.qualitySetName |
String | - | 화질 설정 이름 |
content.outputProtocol |
String | - | 출력 프로토콜
|
content.channelStatus |
String | - | 채널 상태
|
content.isRecording |
Boolean | - | 녹화 여부
|
content.useDVR |
Boolean | - | DVR 사용 여부
|
content.immediateOnAir |
Boolean | - | 즉시 OnAir 여부
|
content.timemachineMin |
Integer | - | 타임머신 허용 분 |
content.cdn |
Object | - | CDN 정보 |
content.cdn.instanceNo |
String | - | CDN Instance No |
content.cdn.serviceName |
String | - | CDN 서비스명 |
content.cdn.statusName |
String | - | CDN 상태 이름 |
content.cdn.cdnType |
String | - | CDN 타입
|
content.cdn.cdnDomain |
String | - | CDN 도메인 |
content.streamKey |
String | - | 메인 스트림 키 |
content.publishUrl |
String | - | 송출 RTMP URL |
content.totalPublishSeconds |
Integer | - | 총 송출 시간 (초) |
content.createdTime |
Long | - | 생성 시각 (epoch ms) |
content.alertOn |
Boolean | - | 알람 여부
|
content.recentPublishTime |
Long | - | 최근 송출 시각 (epoch ms) |
content.alertOptions |
Object | - | 알람 옵션 |
content.alertOptions.alertChangeStatus |
Boolean | - | 상태 변경 알람 |
content.alertOptions.alertVodUploadFail |
Boolean | - | VOD 업로드 실패 알람 |
content.alertOptions.alertReStreamFail |
Boolean | - | 재송출 실패 알람 |
content.alertOptions.alertStreamFailOver |
Boolean | - | 스트림 Failover 알람 |
content.callbackEndpoint |
String | - | 콜백 URL |
content.envType |
String | - | 환경 타입
|
content.record |
Object | - | 녹화 설정 |
content.record.type |
String | - | 녹화 타입
|
content.record.bucketName |
String | - | 버킷명 |
content.record.filePath |
String | - | 파일 경로 |
content.record.format |
String | - | 녹화 파일 포맷 |
content.record.accessControl |
String | - | 접근 제어 |
content.origin |
Object | - | Origin 정보 |
content.origin.originDomain |
String | - | Origin 도메인 |
content.origin.originPath |
String | - | Origin 경로 |
content.backupStreamKey |
String | - | 백업 스트림 키 |
content.isStreamFailOver |
Boolean | - | Failover 여부
|
content.snapshot |
Object | - | 스냅샷 정보 |
content.snapshot.snapshotId |
Long | - | 스냅샷 ID |
isPublishingBackUp |
Boolean | - | 백업 송출 소스 활성 여부
|
응답 상태 코드
Live Station API에서 공통으로 사용하는 응답 상태 코드에 대한 정보는 Live Station 응답 상태 코드를 참조해 주십시오.
응답 예시
응답 예시는 다음과 같습니다.
{
"content": {
"channelId": "ls-20250904******-DZUmt",
"channelName": "stream_switch_test",
"instanceNo": 10******9,
"qualitySetId": 5,
"qualitySetName": "480p-set",
"outputProtocol": "HLS,DASH",
"channelStatus": "PUBLISHING",
"isRecording": false,
"useDVR": true,
"immediateOnAir": false,
"timemachineMin": 360,
"cdn": {
"instanceNo": "4006",
"serviceName": "cdn-ls-20211109******-1bhF4",
"statusName": "RUNNING",
"cdnType": "CDN_PLUS",
"cdnDomain": "*************.cdn.beta.ntruss.com"
},
"streamKey": "ye*****************************7",
"publishUrl": "rtmp://***********.video.media.ntruss.com:8080/relay",
"globalPublishUrl": "",
"totalPublishSeconds": 22936,
"createdTime": 1756966010000,
"alertOn": false,
"recentPublishStartTime": 1764146744000,
"alertOptions": {
"alertChangeStatus": false,
"alertVodUploadFail": false,
"alertReStreamFail": false,
"alertStreamFailOver": false
},
"callbackEndpoint": "https://www.example.com",
"envType": "REAL",
"record": {
"type": "MANUAL_UPLOAD",
"accessControl": "PRIVATE"
},
"origin": {
"originDomain": "*****.video.media.ntruss.com",
"originPath": "6*****3"
},
"backupStreamKey": "ye*****************************7?backup=true",
"isStreamFailOver": true,
"isPublishingBackUp": true
}
}