Add an Archive Task
Add an archive task to archive recording files or backup files to an archive server.
Request URL
POST {base_url}/{api_path}/archive_task/create?access_token={access_token}
Request parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| name | Yes | String | The name of the archive task. |
| file_type | Yes | String | The type of files to archive. Valid value:
|
| time_range | Yes | String | The time range of the files to archive. Valid value:
|
| time_begin | No | String | The start time of the archive time range, in the system date and time format.
Note: This parameter is required when
time_range is custom. |
| time_end | No | String | The end time of the archive time range, in the system date and time format.
Note:
|
| freq_type | Yes | String | The execution frequency of the archive task. Valid value:
|
| freq_week | No | Integer | The day of the week on which the archive task is executed. Valid value:
Note: This parameter is required when
freq_type is weekly. |
| freq_day | No | Integer | The day of the month on which the archive task is executed. Valid
value: Note: This
parameter is required when freq_type is
monthly. |
| freq_time | No | String | The execution time of the archive task, in 24-hour format. Note: This parameter is required when freq_type
is not now. |
| record_file_format | No | String | The format of the recording files. Note: This parameter
is required when file_type is
recording_files.Valid value:
|
| auth_info_id | Yes | Integer | The ID of the associated archive server. Note: You can
obtain the ID using the Query Archive Server List
interface. |
| file_path | No | String | The target path for archived files on the archive server. Note: This parameter takes effect only when the associated archive
server's server_type is ftp or
sftp. |
| bucket_name | No | String | The name of the storage bucket. Note: This parameter
takes effect only when the associated archive server's
server_type is amazon_s3 or
google_storage. |
| bucket_path | No | String | The target path prefix within the storage bucket. |
| region | No | String | The region of the cloud storage. |
| site_id | No | String | The ID of the SharePoint site. Note:
|
| site_name | No | String | The name of the SharePoint site. Note:
|
| drive_id | No | String | The ID of the SharePoint document library. Note:
|
| drive_name | No | String | The name of the SharePoint document library. Note:
|
| path_id | No | String | The ID of the target SharePoint folder. Note: This
parameter takes effect only when the associated archive server's
server_type is sharepoint. |
| storage_method | No | String | The method used to store archived files. Valid value:
Note: This parameter cannot be set to
create_folder_once when freq_type is NOT
now. |
| enb_skip_achive_file | No | Integer | Whether to skip the recording files that have already been archived. Valid value:
|
| enb_delete_local_file | No | Integer | Whether to delete the local files after archiving. Valid value:
|
| enable_retention | No | Integer | Whether to enable the file retention. Valid value:
|
| retention_type | No | String | The retention mode. Note: This parameter is required when
enable_retention is 1.Valid value:
|
| retention_unit | No | String | The retention unit. Note: This parameter is required when
enable_retention is 1.Valid value:
|
| file_rotation_num | No | Integer | The retention limit, measured according to retention_type.
Note: This parameter takes effect only when
enable_retention is 1. |
| file_organization_by_date | No | Integer | Whether to organized the archived files by date. Valid value:
|
Response parameters
| Parameter | Type | Description |
|---|---|---|
| errcode | Integer | Returned error code.
Note: You can check the error code and
error message in Error Code and Error Message.
|
| errmsg | String | Returned message.
|
| id | Integer | The ID of the created archive task. |
| upper_limited | Integer | The upper limit of archive tasks, returned when errcode is
60002 (the maximum is reached). |
Example
Request example
POST /openapi/v1.0/archive_task/create?access_token=gwakjgu9ZBUfz36wql4ndsVKkryI0kdj HTTP/1.1
Host: 192.168.5.150:8088
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
}
Response example
HTTP/1.1 200 OK
{
"errcode": 0,
"errmsg": "SUCCESS",
"submsg": "",
"id": 12,
"upper_limited": 0
}