Create¶
POST /api/v1/pipeline/add
Overview¶
Create a Pipeline and synchronously validate script syntax.
Prerequisites and Usage Steps¶
Validate the script and samples first, explicitly provide testData (use W10= when there is no sample), and create based on the real source/category. New configurations default to status=0 and configVersion=1; if cloning is needed, still submit the complete new body and use only versionAction and source fields to record provenance; it does not copy automatically.
For a default conflict, HTTP 200 is returned first with non-empty content.confirm and no normal entity; only after manual confirmation should you retry with isForce=true using the same configuration. Forced replacement also demotes the original default to non-default and archives it.
Saving synchronously validates syntax and updates the configuration/version. Whether actual collection or central processing takes effect depends on subsequent configuration retrieval and data flow; historical data is not rerun, and sample parsing results are not returned. After a create failure or timeout, first check the list by name and category to confirm whether a new configuration already exists, then use get to verify the version. Do not assume a UUID already exists when the first attempt fails.
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 fill in: Obtain an OpenAPI Key with the required operation permission from API Key Management in the target workspace. |
Body Request Parameters¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| source[*] | string | A non-empty string is recommended; the array is not strictly validated item by item; do not mix unrelated data domains. Example: nginxHow to obtain or fill in: A single real source identifier, or a wildcard pattern supported by the collection side. |
|
| extend.appID[*] | string | A non-empty string is recommended. Example: appid_exampleHow to obtain or fill in: Obtain a single appId from the application configuration. |
|
| extend.measurement[*] | string | A non-empty string is recommended. Example: viewHow to obtain or fill in: The original name of the real measurement. |
|
| name | string | Y | Required. Maximum 256 count units (ASCII/half-width katakana counts as 1, other characters as 2). Allows letters, digits, underscores, Chinese characters U+4e00..9fa5, and hyphens; non-empty is recommended. Duplicate names within the same category are not allowed, even if local/central differs or the old item is disabled. This is not the input log source. Allows null: False Maximum length: 256 $notSearchRegExp: [^a-zA-Z0-9_\u4e00-\u9fa5-]+ Example: production_parserHow to obtain or fill in: A business-custom file name. First check non-deleted names in the same category from the Pipeline List. |
| type | string | Y | Required; local/central. For Synthetic Testing (dialtesting), create/modify can only use central. The workspace plan may restrict central. Modification replaces the original runtime type. Allows null: False Allowed values: ['local', 'central'] Example: localHow to obtain or fill in: Select local for local collector processing, or central for platform central processing, and verify the actual data entry point. |
| source | array | Optional, defaults to []. Omitting it on modification removes all source relationships. Sources containing * or ? do not participate in exact uniqueness conflict checks, and runtime behavior for all matches is not guaranteed; a normal exact source cannot be occupied by another non-deleted Pipeline within the same category/type. For rum/llm create/modify, this array is ignored; use extend.appID and measurement instead. Allows null: False Example: ["nginx"]How to obtain or fill in: Take the value from the source or source selector of the corresponding collected data, not the Pipeline name; for logs, you can refer to the real log source. |
|
| versionAction | string | Optional on create; if omitted, create is recorded. This parameter only verifies and records the source; it does not copy content/source/extend, etc. for you, and you must still submit the complete new configuration. Allows null: False Allowed values: ['official_clone', 'current_clone'] Example: current_cloneHow to obtain or fill in: Select official_clone or current_clone only when you need to record the clone source. |
|
| sourceTemplateName | string | Conditionally required for official_clone; verifies that the template exists. This is not the new name and does not automatically copy the template body. Allows null: False Allows empty string: False Example: nginxHow to obtain or fill in: The real template name obtained from the official template display, resolved with fallback according to the current language. |
|
| sourcePipelineUUID | string | Conditionally required for current_clone; the source must not be deleted, and a new object is still created for this operation. Allows null: False Allows empty string: False Example: pl_exampleHow to obtain or fill in: Get the source uuid in this workspace from the Pipeline List. |
|
| sourceConfigVersion | integer | Conditionally required for current_clone, ≥1; used to verify the source version. A conflict returns HTTP 409. This is not the new target version. Allows null: False $minValue: 1 Example: 1How to obtain or fill in: Read configVersion from the source's current details. |
|
| content | string | Y | Required base64 string; after decoding on create, it must be non-empty. The full decoded script must satisfy both a UI character count of ≤1048576 and UTF-8 bytes of ≤1048576; non-ASCII BMP characters count as 2, and supplementary characters count as 4. If either limit is exceeded, ft.ContextExceedLimit is returned. Saving synchronously compiles without samples and checks references from enabled scripts in the same category. Success does not mean debugging with real data passed or that the configuration has taken effect. Allows null: False Example: YWRkX2tleSgiZW52IiwgInByb2R1Y3Rpb24iKQ==How to obtain or fill in: Write the UTF-8 Pipeline script first, then perform standard base64 encoding; the example decodes to add_key("env", "production"). |
| testData | string | Declared optional, but if omitted on create, the controller decoding None may return InvalidBase64, so always explicitly provide W10= or an empty string. Omitting it on modification restores an empty string. Public add/modify accepts only an empty string, or a strictly base64-decoded empty value/JSON array; a single object cannot be encoded directly. Array members should be strings or objects; numeric/null values may cause a 500 due to historical item-by-item length validation; the historical limit per item is about 20480 (objects by serialized object memory size, strings by historical weighted length), not the script 1 MiB limit. Allows null: False Allows empty string: True Example: W3sibWVzc2FnZSI6ImV4YW1wbGUgbG9nIn1dHow to obtain or fill in: Serialize the sample array to JSON first, then UTF-8 encode and base64 encode it; an empty array [] is W10=. |
|
| dataType | string | Optional, defaults to line_protocol; supports line_protocol/json/message. Omitting it on modification restores line_protocol; this is not category. Although an empty string is declared compatible, explicitly select a supported value. Allows null: False Allows empty string: True Allowed values: ['line_protocol', 'json', 'message'] Example: jsonHow to obtain or fill in: Select according to the testData sample and script input. |
|
| isForce | boolean | Optional, defaults to false. Used only to confirm a default conflict; it cannot skip syntax, source, name, version, or other validation. Forced replacement changes the original default to non-default and archives its version. Allows null: False Example: falseHow to obtain or fill in: After receiving content.confirm, confirm replacement of the original default Pipeline, then set true. |
|
| category | string | Y | Required; lineage/logging/object/custom_object/network/tracing/rum/llm/agent_monitor/security/keyevent/metric/profiling/dialtesting/cloud_billing; billing is a legacy compatibility value. Modification can change the category, and the script, source, and extend must be checked together. Allows null: False Allows empty string: False Allowed values: ['lineage', 'logging', 'object', 'custom_object', 'network', 'tracing', 'rum', 'llm', 'agent_monitor', 'security', 'keyevent', 'metric', 'profiling', 'dialtesting', 'billing', 'cloud_billing', 'keyevent'] Example: loggingHow to obtain or fill in: Select according to the target data domain and collection configuration. |
| asDefault | int | Optional, defaults to 0; it is recommended to provide only 0/1. If a default already exists and isForce is not set, HTTP 200 returns a confirm array; the target configuration is not saved, and this is not treated as a successful create/modify. Allows null: False Example: 0How to obtain or fill in: Use 1 when it should serve as the fallback rule for the same category/type; otherwise 0. |
|
| enableByLogBackup | int | Optional, defaults to 0; 0/1 is recommended. Saving the flag does not guarantee that existing forwarded data is automatically rerun. Allows null: False Example: 0How to obtain or fill in: Use 1 when the rule needs to process forwarded data; confirm support from the actual data forwarding chain. |
|
| extend | json | Optional, defaults to {}. Modification replaces the whole value and does not merge. rum/llm uses appID × measurement combinations to generate source relationships; unknown subfields are rejected by public validation. Allows null: False Example: {"loggingIndex": "default"}How to obtain or fill in: Organize the following declared fields according to the category and existing details. |
|
| extend.appID | array | For rum/llm, provide a non-empty array together with measurement; if both are empty, there can be no dedicated source; if appID is present but measurement is absent, a missing parameter error is reported. Allows null: True Example: ["appid_example"]How to obtain or fill in: Obtain the real appId from the corresponding RUM/LLM application management. |
|
| extend.measurement | array | For rum/llm, combine with appID in a Cartesian product; if measurement is present but appID is absent, a missing parameter error is reported; saving does not verify that every application/measurement actually has data. Allows null: True Example: ["view"]How to obtain or fill in: Obtain from the measurement of the application's real data, such as RUM view/action, and fill in according to the actual category. |
|
| extend.loggingIndex | string | Optional Log Index echo field; no value is filled by default, and omitting it on modification clears it along with extend; this is not the source array. Allows null: True Example: defaultHow to obtain or fill in: Obtain the applicable index identifier from the Log Index List. |
|
| extend.ifAiCreate | boolean | Optional echo field; does not trigger an AI task. Allows null: True Example: falseHow to obtain or fill in: Records whether it was generated with AI assistance; omit it if this flag is not needed. |
|
| extend.aiTargetStructure | string | Optional string, saved for echo only; this API does not generate scripts. Allows empty string: True Allows null: True Example: How to obtain or fill in: Description of the target structure used during AI generation; omit it if not needed. |
|
| extend.exampleSource | string | Optional echo field; does not replace the source association. Allows empty string: True Allows null: True Example: nginxHow to obtain or fill in: Display value for the sample source; it must correspond to the real source. |
|
| extend.exampleType | string | Optional echo string; the server does not provide a fixed enumeration. Allows empty string: True Allows null: True Example: customHow to obtain or fill in: Display value for the sample type, defined by client business logic. |
Request Example¶
curl --request POST 'https://openapi.guance.com/api/v1/pipeline/add' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json' \
--data-raw '{"name":"production_parser","type":"local","category":"logging","content":"YWRkX2tleSgiZW52IiwgInByb2R1Y3Rpb24iKQ==","testData":"W3sibWVzc2FnZSI6ImV4YW1wbGUgbG9nIn1d","dataType":"json","asDefault":0,"enableByLogBackup":0,"extend":{"loggingIndex":"default"},"source":["nginx"]}'
Response¶
HTTP 200, application/json. The example below shows the main fields that can be read directly.
| Field | Type | Description |
|---|---|---|
| content.id | integer | Database ID; use uuid for operations. |
| content.uuid | string | pl_ object UUID. |
| content.workspaceUUID | string | Owning workspace; empty string for system templates. |
| content.isSysTemplate | string / integer / boolean | Whether it is a system template. The entity is a Text column, so a string flag may be returned; parse according to the actual flag, and do not determine it simply by whether the string is non-empty. |
| content.isCustomSysTemp | integer or boolean | Whether it is a customized system template. |
| content.language | string | Template/configuration language; may be an empty string. |
| content.status | integer | 0 enabled, 2 disabled, 3 deleted. |
| content.creator | string | Creator identity. |
| content.updator | string | Most recent updater identity. |
| content.createAt | integer | Creation Unix seconds. |
| content.updateAt | integer | Update Unix seconds. |
| content.deleteAt | integer | Deletion Unix seconds; -1 if not deleted. |
| content.name | string | Saved configuration: Required. Maximum 256 count units (ASCII/half-width katakana counts as 1, other characters as 2). Allows letters, digits, underscores, Chinese characters U+4e00..9fa5, and hyphens; non-empty is recommended. Duplicate names within the same category are not allowed, even if local/central differs or the old item is disabled. This is not the input log source. |
| content.type | string | Saved configuration: Required; local/central. For Synthetic Testing (dialtesting), create/modify can only use central. The workspace plan may restrict central. Modification replaces the original runtime type. |
| content.category | string | Saved configuration: Required; lineage/logging/object/custom_object/network/tracing/rum/llm/agent_monitor/security/keyevent/metric/profiling/dialtesting/cloud_billing; billing is a legacy compatibility value. Modification can change the category, and the script, source, and extend must be checked together. |
| content.content | string | Saved configuration: Required base64 string; after decoding on create, it must be non-empty. The full decoded script must satisfy both a UI character count of ≤1048576 and UTF-8 bytes of ≤1048576; non-ASCII BMP characters count as 2, and supplementary characters count as 4. If either limit is exceeded, ft.ContextExceedLimit is returned. Saving synchronously compiles without samples and checks references from enabled scripts in the same category. Success does not mean debugging with real data passed or that the configuration has taken effect. |
| content.testData | string | Saved configuration: Declared optional, but if omitted on create, the controller decoding None may return InvalidBase64, so always explicitly provide W10= or an empty string. Omitting it on modification restores an empty string. Public add/modify accepts only an empty string, or a strictly base64-decoded empty value/JSON array; a single object cannot be encoded directly. Array members should be strings or objects; numeric/null values may cause a 500 due to historical item-by-item length validation; the historical limit per item is about 20480 (objects by serialized object memory size, strings by historical weighted length), not the script 1 MiB limit. |
| content.dataType | string | Saved configuration: Optional, defaults to line_protocol; supports line_protocol/json/message. Omitting it on modification restores line_protocol; this is not category. Although an empty string is declared compatible, explicitly select a supported value. |
| content.asDefault | integer | Saved configuration: Optional, defaults to 0; it is recommended to provide only 0/1. If a default already exists and isForce is not set, HTTP 200 returns a confirm array; the target configuration is not saved, and this is not treated as a successful create/modify. |
| content.enableByLogBackup | integer | Saved configuration: Optional, defaults to 0; 0/1 is recommended. Saving the flag does not guarantee that existing forwarded data is automatically rerun. |
| content.extend | json | Saved configuration: Optional, defaults to {}. Modification replaces the whole value and does not merge. rum/llm uses appID × measurement combinations to generate source relationships; unknown subfields are rejected by public validation. |
| content.extend.appID | array | Saved configuration: For rum/llm, provide a non-empty array together with measurement; if both are empty, there can be no dedicated source; if appID is present but measurement is absent, a missing parameter error is reported. |
| content.extend.measurement | array | Saved configuration: For rum/llm, combine with appID in a Cartesian product; if measurement is present but appID is absent, a missing parameter error is reported; saving does not verify that every application/measurement actually has data. |
| content.extend.loggingIndex | string | Saved configuration: Optional Log Index echo field; no value is filled by default, and omitting it on modification clears it along with extend; this is not the source array. |
| content.extend.ifAiCreate | boolean | Saved configuration: Optional echo field; does not trigger an AI task. |
| content.extend.aiTargetStructure | string | Saved configuration: Optional string, saved for echo only; this API does not generate scripts. |
| content.extend.exampleSource | string | Saved configuration: Optional echo field; does not replace the source association. |
| content.extend.exampleType | string | Saved configuration: Optional echo string; the server does not provide a fixed enumeration. |
| content.extend.appID[] | string | Saved configuration: A non-empty string is recommended. |
| content.extend.measurement[] | string | Saved configuration: A non-empty string is recommended. |
| content.configVersion | integer | Current configuration version, initially 1; increments when the configuration actually changes. Enable/disable is not a configuration snapshot field. |
| content.configVersionAt | integer | Recorded time when this configuration version took effect, in Unix seconds. |
| content.configVersionOperator | string | Operator identity for this version. |
| content.configVersionSource | string | Source, such as openapi/console/history/workspace_restore/legacy/system. |
| content.configVersionAction | string | Such as create/modify/import/official_clone/current_clone/history_restore/history_clone/default_replace/baseline. |
| content.configVersionSourceInfo | object | Source action information; {} when there is no source, and fields may be omitted depending on the action. |
| content.configVersionSourceInfo.templateName | string | Template name of the official clone source. |
| content.configVersionSourceInfo.pipelineUUID | string | Source Pipeline UUID. |
| content.configVersionSourceInfo.configVersion | integer | Source configuration version number. |
| content.configVersionSourceInfo.pipelineHistoryUUID | string | History UUID of the history clone/restore source. |
| content.configVersionSourceInfo.replacedByName | string | New file name triggered by the default replacement. |
| content.configVersionSourceInfo.replacedByPipelineUUID | string | Pipeline UUID that triggered the default replacement. |
| content.declaration | object or null | Workspace common declaration attached to non-empty business objects; may be null or an empty object when not configured; an empty object is not added. |
| content.confirm | array<string> |
Replaces the normal entity on a default conflict and lists the categories that require replacement confirmation; this branch does not save the target of this operation. |
| content.confirm[] | string | A single category. |
| content.pl_errors | array<object> |
Compilation error array returned only in the content of an ft.PipelineSyntaxError error. |
| content.pl_errors[].error | string | Compilation error description. |
| content.pl_errors[].pos_chain | array<object> |
Reference/location chain. |
| content.pl_errors[].pos_chain[].file | string | File name. |
| content.pl_errors[].pos_chain[].ln | integer | Non-negative position index defined by the compiler; retain the original value for troubleshooting. |
| content.pl_errors[].pos_chain[].col | integer | Non-negative position index defined by the compiler; retain the original value for troubleshooting. |
| content.pl_errors[].pos_chain[].pos | integer | Non-negative position index defined by the compiler; retain the original value for troubleshooting. |
{
"code": 200,
"content": {
"id": 100,
"uuid": "pl_example",
"workspaceUUID": "wksp_example",
"name": "production_parser",
"type": "local",
"category": "logging",
"content": "YWRkX2tleSgiZW52IiwgInByb2R1Y3Rpb24iKQ==",
"testData": "W3sibWVzc2FnZSI6ImV4YW1wbGUgbG9nIn1d",
"dataType": "json",
"asDefault": 0,
"enableByLogBackup": 0,
"extend": {
"loggingIndex": "default"
},
"isSysTemplate": 0,
"isCustomSysTemp": 0,
"language": "",
"status": 0,
"creator": "wsak_example",
"updator": "wsak_example",
"createAt": 1785427200,
"updateAt": 1785427200,
"deleteAt": -1,
"configVersion": 1,
"configVersionAt": 1785427200,
"configVersionOperator": "wsak_example",
"configVersionSource": "openapi",
"configVersionAction": "create",
"configVersionSourceInfo": {},
"declaration": {}
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE"
}
Default replacement pending confirmation:
{
"code": 200,
"content": {
"confirm": [
"logging"
],
"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 Method |
|---|---|---|---|---|
| 406 | ft.ParameterValidationFailed | Request field is missing, or the field value violates the declared validation conditions | Parameter parsing failed | Check the parameter location, field name, type, and value. |
| 400 | ft.RequestJsonFormatError | Request JSON syntax is invalid | Request JSON format error | Correct the JSON according to content.reason, line, and column. |
| 406 | ft.InvalidBase64 | The script/test sample is not decodable UTF-8 base64; omitting testData on create may also trigger this | Invalid base64 content | Provide content and testData completely, performing UTF-8 first and then base64. |
| 406 | ft.ContextExceedLimit | The script exceeds the UI character count or 1 MiB of UTF-8 bytes, or a single test sample in add/modify exceeds the historical length | Text content exceeds the limit; limit is {} characters | Reduce the script/single sample; check the unit indicated in message. |
| 406 | ft.PipelineSyntaxError | Synchronous compilation without samples returns a script or reference syntax error | Pipeline script syntax error; check the error location | Locate and correct the error according to error and pos_chain in content.pl_errors, then retry. |
| 400 | ft.PipelineNameExists | A non-deleted script with the same name exists in the same workspace and category | A Pipeline with the same name already exists | Change the name or update the original UUID. |
| 400 | ft.PipelineSourceExists | A non-deleted rule in the same category/type already occupies the same exact source | The source for this type of Pipeline already exists | Check the source binding and use an appropriate source; wildcard entries do not participate in this check. |
| 403 | ft.ForbiddenFreeEditionWorkspace | The Pipeline runtime type restriction of the workspace plan does not allow this type | Free Plan workspaces do not support this feature. Upgrade to a Commercial Plan to unlock the restriction | Have the administrator confirm the workspace plan and supported runtime modes. |
| 500 | ft.InternalServerError | Synchronous compilation service unavailable/timeout/format anomaly (the internal PipelineValidationUnavailable is ultimately wrapped consistently), database or structure error, or formatting failure after submission | Internal error | Before retrying later, read the current configuration and version to confirm whether it has already been saved; if the failure persists, provide traceId. |
| 406 | ft.DialingPipelineOnlyCentral | dialtesting selects local | Availability Synthetic Test Pipeline only supports central Pipeline configuration | Use a supported central type and confirm the workspace plan. |
| 406 | ft.MissingNeededParmeterAppID | appID is non-empty but measurement is empty | appID needs to be specified | Provide both, or leave both empty; the error keys for modification and creation have historical compatibility differences. |
| 406 | ft.InvalidPipelineContent | The decoded script is empty on create | Invalid Pipeline content | Provide a non-empty valid script. |
| 406 | ft.InvalidPipelineTestData | The decoded public testData is not a JSON array | Invalid Pipeline testData; after base64 decoding, it must be empty or a JSON array | Serialize the array to JSON first, then base64 encode. |
| 403 | ft.ForbiddenFreeWKSPCentralPipeline | Creating central in a free/trial workspace | Free Plan workspaces do not support central Pipeline configurations | Confirm the plan that supports central processing. |
| 406 | ft.MissingNeededParmeterSource | Creating rum/llm with measurement but no appID | source is required when appID is present | Provide both arrays completely. |
| 406 | ft.InvalidParameter | The clone provenance action is missing the source name/UUID/version | Parameter {} is invalid |
Complete the corresponding source fields according to versionAction. |
| 404 | ft.NotFoundPipelineCfg | For official_clone, no system template matching by name and language fallback was found; or the current-workspace source Pipeline for current_clone does not exist/has been deleted | The specified Pipeline configuration was not found | Refresh the corresponding system template or current workspace Pipeline list to obtain the accurate target and source identifier for this operation. |
| 409 | ft.PipelineConfigVersionConflict | The current_clone source version has changed | The Pipeline configuration has been updated; refresh and retry | Re-read the current source version and then reassemble the new configuration. |