Workspace Resource Import¶
POST /api/v1/workspace/resource/upload
Overview¶
Upload a workspace resource archive and initiate the import process.
Parameter Details¶
1. Interface Purpose
Upload a workspace resource archive and initiate an import task.
This is an asynchronous task interface. It returns a taskId when there are no duplicate conflicts. If duplicate conflicts exist, no task is created, and duplicate information is returned directly.
2. Request Type
The request type is multipart/form-data.
Required file field:
- files
3. Recommended Call Flow
- First, upload
resource.zipalong with conflict handling parameters for each resource type. - If a
taskIdis returned, the task has been created, and you can proceed to poll the status interface. - If
repeat_name/repeat_identifieris returned, duplicates exist, and you need to adjust the import strategy and resubmit.
4. Response Branch Explanation
4.1 Can be imported directly.
4.2 Duplicates exist, awaiting confirmation from the caller.
{
"repeat_name": {
"checker": ["CPU Usage Alert"],
"tag": ["0306"]
},
"repeat_identifier": {
"dashboard": [
{
"identifier": "system_overview",
"existName": "System Overview",
"importName": "System Overview V2"
}
]
}
}
5. Conflict Handling Parameter Explanation
5.1 Monitor
repeatNameOp- Applicable Resource: Monitors
- Allowed Values:
check/skip/recover/continue
5.2 Dashboard and Explorer Identifier ID
repeatIdentifierOp- Applicable Resources: Dashboards, Explorers
- Allowed Values:
check/skip/recover
5.3 Other New Resource Duplicate Name Handling
The following parameters only support:
- check
- skip
- recover
Including:
- repeatNotifyObjectNameOp
- repeatAlertPolicyNameOp
- repeatLogBackupCfgNameOp
- repeatSloNameOp
- repeatSecurityRuleNameOp
- repeatFieldNameOp
- repeatLabelNameOp
- repeatEnvVariableNameOp
- repeatRoleNameOp
- repeatLogIndexNameOp
- repeatBlacklistNameOp
- repeatPipelineNameOp
- repeatRegularExpressionNameOp
- repeatFieldDisplayPermissionNameOp
- repeatSensitiveDataScannerNameOp
6. Current Resource Boundary Explanation
The current workspace resource import/export has the following boundaries:
- Environment variables do not include
scope=rum. - Log indices do not include external indices and
default. - Field management only handles workspace custom fields.
- Data access is currently not supported for workspace import/export.
7. Compatibility Explanation
During import, if the archive contains special data that is currently unsupported or has been marked for ignoring, the system will handle it by skipping or failing according to the current implementation rules. Please refer to the results returned by the task status interface for the actual outcome.
Request Example¶
curl 'https://openapi.truewatch.com/api/v1/workspace/resource/upload' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-F '[email protected]' \
-F 'repeatNameOp=check' \
-F 'repeatIdentifierOp=check' \
--compressed