Skip to content

Create



POST /api/v1/pipeline/add

Overview

Create a Pipeline

When the category type is profiling, the rule will only take effect if the CentralPLServiceSwitch field in the workspace configuration (returned by the /workspace/get interface) is true.

Body Request Parameters

Parameter Name Type Required Description
name string Y Pipeline file name
Allow empty: False
Max length: 256
$notSearchRegExp: [^a-zA-Z0-9_\u4e00-\u9fa5-]+
type string Y Pipeline file type
Allow empty: False
Optional values: ['local', 'central']
source array Selected source list
Allow empty: False
content string Y Pipeline file content (base64 encoded)
Allow empty: False
testData string Test data (base64 encoded)
Allow empty: False
Allow empty string: True
dataType string Data type line_protocol-line protocol format; json-JSON format; message-Message
Example: line_protocol
Allow empty: False
Allow empty string: True
Optional values: ['line_protocol', 'json', 'message']
isForce boolean Whether to replace if a default type exists
Allow empty: False
category string Y Category
Allow empty: False
Allow empty string: False
Optional values: ['logging', 'object', 'custom_object', 'network', 'tracing', 'rum', 'security', 'keyevent', 'metric', 'profiling', 'dialtesting', 'billing', 'keyevent']
asDefault int Whether to set as the default pipeline for this type, 1 for default, 0 for non-default
Allow empty: False
enableByLogBackup int Enable Pipeline to process forwarded data, 1 for enable, 0 for disable
Allow empty: False
extend json Category
Allow empty: False
extend.appID array appID
Allow empty: True
extend.measurement array Source origin
Allow empty: True
extend.loggingIndex string Log index
Allow empty: True

Parameter Additional Notes

Request Example

curl 'https://openapi.guance.com/api/v1/notes/create' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json;charset=UTF-8' \
--data-raw '{"name":"openapi_test","category":"logging","asDefault":0,"content":"YWRkX2tleShjaXR5LCAic2hhbmdoYWkiKQ==","testData":"W10=","source":["nsqlookupd"]}' \
--compressed

Response

{
    "code": 200,
    "content": {
        "asDefault": 0,
        "category": "logging",
        "content": "YWRkX2tleShjaXR5LCAic2hhbmdoYWkiKQ==\n",
        "createAt": 1678026470,
        "creator": "xxxx",
        "deleteAt": -1,
        "extend": {},
        "id": null,
        "isSysTemplate": null,
        "name": "openapi_test",
        "status": 0,
        "testData": "W10=\n",
        "updateAt": 1678026470,
        "updator": "xxxx",
        "uuid": "pl_xxxx32",
        "workspaceUUID": "wksp_xxxx32"
    },
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "TRACE-74509B6F-DE3D-4905-AC9F-4FD96ED78EC3"
}

Feedback

Is this page helpful? ×