Skip to content

Export



POST /api/v1/blacklist/export

Overview

Export the migratable configuration JSON for specified blacklists.

Before Calling and Usage Steps

Submit an array of target rule UUIDs. The response uses the unified application/json envelope; it is not a file download/CSV/archive, nor an asynchronous task. Use the content.blacklists array for the import Body.blacklists. When there are non-empty matches, only matched items are exported; it does not check that all requested UUIDs are present. If nothing matches at all (including []), 404 is returned.

The export does not include uuid, workspace, status, conditions, or creator identity; it cannot be used to preserve the original disabled state. The is_disable exported by workspace resource packages belongs to another process and is not a field of this API. Before migration, verify the same fields and whether the source exists in the target workspace.

Request Headers

Parameter Name Type Required Description
DF-API-KEY string Y OpenAPI authentication credential for the workspace.
Example: <DF-API-KEY>
How to obtain or enter: Obtain an OpenAPI Key with this operation permission from API Key Management in the target workspace.

Body Request Parameters

Parameter Name Type Required Description
blacklistUUIDs[*] string String element. Do not pass null, numbers, or objects; otherwise strip processing may return 500.
Example: blist_example
How to obtain or enter: Take the uuid of a single rule from the Blacklist List.
blacklistUUIDs array Y Required array of rule UUIDs, not a comma-separated string. The server trims leading and trailing whitespace from each item and ignores empty strings; unmatched UUIDs are ignored in some batch operations, but each item still needs to be checked.
Allow null: False
Example: ["blist_example"]
How to obtain or enter: Obtain the actual uuid from the Blacklist List.

Request Example

curl --request POST 'https://openapi.guance.com/api/v1/blacklist/export' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  -H 'Content-Type: application/json' \
  --data-raw '{"blacklistUUIDs":["blist_example"]}'

Response

HTTP 200, application/json. The example below shows the main fields that can be read directly.

Field Type Description
content.blacklists array<object> Configuration array that can be used directly as blacklists for import; includes only matched non-deleted items in the current workspace.
content.blacklists[].name string Rule name.
content.blacklists[].desc string Rule description.
content.blacklists[].type string Data category.
content.blacklists[].source string Saved single/all source expression; may be empty.
content.blacklists[].sources array<string> Saved multiple source names; takes precedence when non-empty.
content.blacklists[].sources[] string Single source name.
content.blacklists[].filters array<object> or object or null Original condition array; historical records may also be {} or null.
content.declaration object or null Workspace common declaration attached to non-empty business objects; may be null or an empty object when not configured.
{
  "code": 200,
  "content": {
    "blacklists": [
      {
        "name": "忽略健康检查日志",
        "desc": "过滤生产nginx健康检查请求。",
        "type": "logging",
        "source": "nginx",
        "sources": [],
        "filters": [
          {
            "name": "path",
            "condition": "and",
            "operation": "=",
            "value": [
              "/healthz"
            ]
          }
        ]
      }
    ],
    "declaration": {}
  },
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE"
}

Error Responses

For authentication, rate limiting, and common request errors, see Common Error Definitions.

HTTP Status errorCode Trigger Condition Message or Response Description Handling
406 ft.ParameterValidationFailed Request field is missing, or the field value violates the declared validation constraints Parameter parsing failed Check the parameter location, field name, type, and value.
400 ft.RequestJsonFormatError Invalid request JSON syntax Request JSON format error Fix the JSON according to content.reason, line, and column.
400 ft.JsonFormatError JSON top level is not an object Some JSON file format error Submit the JSON object in the parameter table.
404 ft.InvalidBlacklistuuid No non-deleted rule in the current workspace matches, including an empty array Blacklist does not exist Verify the UUID and workspace before exporting again.
500 ft.InternalServerError Rule query, export assembly, or response formatting failed Internal error Check the query conditions and UUID, then retry; if the failure persists, provide the traceId.
403 ft.Forbidden The API Key lacks the permission for the current operation You do not have permission to perform this operation Use an API Key for the current workspace that has the operation permission for this page. Check actual feature availability against the site configuration.

Feedback

Is this page helpful?