添加归档任务
添加归档任务,用于将录音文件或备份文件归档到归档服务器。
请求 URL
POST {base_url}/{api_path}/archive_task/create?access_token={access_token}
请求参数
| 参数 | 是否必填 | 类型 | 说明 |
|---|---|---|---|
| name | 是 | String | 归档任务的名称。 |
| file_type | 是 | String | 归档文件的类型。 取值范围:
|
| time_range | 是 | String | 归档文件的时间范围。 取值范围:
|
| time_begin | 否 | String | 归档时间范围的开始时间,采用系统日期和时间格式。 注: 当
time_range 为 custom 时,此参数必填。 |
| time_end | 否 | String | 归档时间范围的结束时间,采用系统日期和时间格式。 注:
|
| freq_type | 是 | String | 归档任务的执行频率。 取值范围:
|
| freq_week | 否 | Integer | 执行归档任务的星期。 取值范围:
注: 当
freq_type 为 weekly
时,此参数必填。 |
| freq_day | 否 | Integer | 执行归档任务的日期。 取值范围: 注: 当
freq_type 为 monthly 时,此参数必填。 |
| freq_time | 否 | String | 归档任务的执行时间,采用 24 小时制。 注: 当 freq_type
不为 now 时,此参数必填。 |
| record_file_format | 否 | String | 录音文件的格式。 注: 当 file_type 为
recording_files 时,此参数必填。取值范围:
|
| auth_info_id | 是 | Integer | 关联的归档服务器的 ID。 注: 可通过 查询归档服务器列表 接口获取该 ID。 |
| file_path | 否 | String | 归档服务器上的目标文件路径。 注: 仅当关联归档服务器的
server_type 为 ftp 或 sftp
时,此参数才生效。 |
| bucket_name | 否 | String | 存储桶的名称。 注: 仅当关联归档服务器的 server_type 为
amazon_s3 或 google_storage
时,此参数才生效。 |
| bucket_path | 否 | String | 存储桶内的目标路径前缀。 |
| region | 否 | String | 云存储的区域。 |
| site_id | 否 | String | SharePoint 站点的 ID。 注:
|
| site_name | 否 | String | SharePoint 站点的名称。 注:
|
| drive_id | 否 | String | SharePoint 文档库的 ID。 注:
|
| drive_name | 否 | String | SharePoint 文档库的名称。 注:
|
| path_id | 否 | String | SharePoint 文件夹的 ID。 注: 仅当关联归档服务器的
server_type 为 sharepoint
时,此参数才生效。 |
| storage_method | 否 | String | 归档文件的存储方式。 取值范围:
注: 当
freq_type 不为 now
时,此参数不能设置为 create_folder_once。 |
| enb_skip_achive_file | 否 | Integer | 是否跳过已归档的录音文件。 取值范围:
|
| enb_delete_local_file | 否 | Integer | 归档后是否删除本地文件。 取值范围:
|
| enable_retention | 否 | Integer | 是否启用文件保留策略。 取值范围:
|
| retention_type | 否 | String | 文件保留方式。 注: 当 enable_retention 为
1 时,此参数必填。取值范围:
|
| retention_unit | 否 | String | 保留单位。 注: 当 enable_retention 为
1 时,此参数必填。取值范围:
|
| file_rotation_num | 否 | Integer | 保留上限,单位由 retention_type 指定。 注: 仅当
enable_retention 为 1 时,此参数才会生效。 |
| file_organization_by_date | 否 | Integer | 是否按日期分类存储归档文件。 取值范围:
|
响应参数
| 参数 | 类型 | 说明 |
|---|---|---|
| errcode | Integer | 返回错误码。
注: 更多错误码和错误信息说明,请参见 错误码 & 错误信息。
|
| errmsg | String | 返回信息。
|
| id | Integer | 创建的归档任务的 ID。 |
| upper_limited | Integer | 归档任务的数量上限,当 errcode 为 60002 (达到数量上限)
时返回。 |
示例
请求示例
POST /openapi/v1.0/archive_task/create?access_token=gwakjgu9ZBUfz36wql4ndsVKkryI0kdj HTTP/1.1
Host: yeastardocs.example.yeastarcloud.com
Content-Type: application/json
{
"name": "January-Backup",
"auth_info_id": 9,
"file_type": "backup_files",
"time_range": "today",
"freq_type": "now",
"storage_method": "create_folder_once",
"enb_skip_achive_file": 0,
"enb_delete_local_file": 0,
"file_organization_by_date": 0
}
响应示例
HTTP/1.1 200 OK
{
"errcode": 0,
"errmsg": "SUCCESS",
"submsg": "",
"id": 12,
"upper_limited": 0
}