{"bucket": "examplebucket-1250000000", // ZIP 파일이 최종적으로 전송되는 버킷"region": "ap-guangzhou", // ZIP 파일이 최종적으로 전송되는 버킷 소재 리전"key": "mypack.zip", // 최종적으로 전송되는 ZIP 파일의 이름"flatten": false, // 소스 파일 경로의 플랫 처리 여부/*** sourceList는 패키징할 소스 파일 목록을 지정하는 데 사용되며 형식은 JSON 배열입니다.* 각 항목에는 소스 파일 url, 이름 변경 경로 renamePath 등이 포함됩니다.** 소스 파일 리스트가 너무 길면 sourceList 매개변수를 JSON 문자열화할 수 있습니다.* .json 파일을 작성하고 COS에 업로드한 후, sourceConfigList 매개변수를 통해 지정합니다.** sourceList 및 sourceConfigList 매개변수 중 하나만 지정하면 됩니다.*/"sourceList": [{"url": "https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/dir1/file1.jpg","renamePath": "dir1_rename/file1.jpg"},{"url": "https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/dir2/file2.mp4","renamePath": "file2.mp4"},{"url": "https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/file3.md"}],"sourceConfigList": [{"url": "https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/sourceList.json"}]}
매개변수 이름 | 매개변수 설명 | 유형 | 필수 입력 여부 |
bucket | ZIP 파일이 최종적으로 전송되는 버킷입니다. 이름 형식은 BucketName-APPID입니다. 여기에 입력되는 버킷 이름은 examplebucket-1250000000과 같은 형식이어야 합니다. | String | 예 |
region | String | 예 | |
key | String | 예 | |
flatten | 경로 플랫 처리 여부(소스 디렉터리 구조 제거)로, 예: 소스 파일 URL이 https://domain/source/test.mp4이고 소스 파일 경로가 source/test.mp4, true이면, true일 때 ZIP 파일 중 해당 파일 경로는 test.mp4이고, 그렇지 않으면 ZIP 파일 중 해당 파일 경로는 source/test.mp4입니다. 기본값은 false입니다. | Boolean | 아니요 |
sourceList | 소스 파일 리스트. sourceList와 sourceConfigList는 동시에 비워 둘 수 없습니다 | Array | 예 |
sourceList[].url | 소스 파일 URL | String | 예 |
sourceList[].renamePath | 경로를 수반한 이름 변경. 즉 소스 파일의 ZIP 파일에서의 파일 경로. 예: dir1/file1.jpg의 이름을 dir1_rename/file1.jpg로 바꿉니다. 참고: renamePath의 우선순위는 flatten보다 높으며, 이름 변경 후의 경로는 플랫 처리 영향을 받지 않습니다. | String | 아니요 |
sourceConfigList | sourceList 구성 파일 리스트. 요청 시 전체 sourceList를 수반하지 않으려면 sourceList 매개변수 JSON 문자열을 처리하여 json 구성 파일을 생성하고, COS에 업로드한 후sourceConfigList에서 해당 파일 URL을 지정할 수 있습니다. 다중 구성 파일 지정을 지원하며, sourceList와 sourceConfigList는 동시에 비워 둘 수 없습니다 | Array | 아니요 |
sourceConfigList[].url | sourceList 구성 파일 중의 URL | String | 아니요 |
{code: 0,data: {Bucket: "examplebucket-1250000000",ETag: "\\"35bb5e5f050e22bed8f443d8da5dbfb8-1\\"",Key: "mypack.zip",Location: "examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/mypack.zip"},error: null,message: "cos zip file success"}
매개변수 이름 | 매개변수 설명 | 유형 |
code | 비즈니스 오류 코드, 0이면 실행 성공, 그렇지 않으면 실행 실패 | Number |
message | 실행 결과의 텍스트 설명, null일 수 있음 | String |
data | 실행 완료 메시지, 실행 성공 시 ZIP 파일의 url 정보 포함 | Object |
error | 실행 오류 메시지, 실행 성공 시 null | Object or String |
{"bucket": "examplebucket-1250000000","region": "ap-guangzhou","key": "mypack.zip","flatten": false,"sourceList": [{"url": "https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/dir1/file1.jpg"},{"url": "https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/dir2/file2.mp4"},{"url": "https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/file3.md"}]}
mypack.zip├── dir1/file1.jpg├── dir2/file2.mp4└── file3.md
{"bucket": "examplebucket-1250000000","region": "ap-guangzhou","key": "mypack.zip","flatten": true, // flatten이 true이면 소스 파일 경로를 플랫 처리합니다."sourceList": [{"url": "https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/dir1/file1.jpg"},{"url": "https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/dir2/file2.mp4"},{"url": "https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/file3.md"}]}
mypack.zip├── file1.jpg├── file2.mp4└── file3.md
{"bucket": "examplebucket-1250000000","region": "ap-guangzhou","key": "mypack.zip","flatten": false,"sourceList": [{"url": "https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/dir1/file1.jpg",// dir1/file1.jpg의 경로 이름을 dir1_rename/file1.jpg로 변경"renamePath": "dir1_rename/file1.jpg"},{"url": "https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/dir2/file2.mp4",// dir2/file2.mp4의 이름을 file2.mp4로 변경"renamePath": "file2.mp4"},{"url": "https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/file3.md"}]}
mypack.zip├── dir1_rename/file1.jpg├── file2.mp4└── file3.md
{"bucket": "examplebucket-1250000000","region": "ap-guangzhou","key": "mypack.zip","flatten": true, // flatten가 true일 경우, 소스 파일 경로 플랫 처리 진행"sourceList": [{"url": "https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/dir1/file1.jpg"},{"url": "https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/dir2/file2.mp4"},{"url": "https://examplebucket-1250000000.cos.ap-guangzhou.myqcloud.com/file3.md",// file3.md의 이름을 dir3/file3.md로 변경, renamePath 우선 순위가 flatten보다 높기 때문에, 이름 변경 후의 경로는 플랫 처리되지 않음"renamePath": "dir3/file3.md"}]}
mypack.zip├── file1.jpg├── file2.mp4└── dir3/file3.md
피드백