Create a Single Data Forwarding Rule¶
POST /api/v1/log_backup_cfg/add
Overview¶
Create a single data forwarding rule
Body Request Parameters¶
Parameter Name | Type | Required | Description |
---|---|---|---|
name | string | Y | Rule name Example: xxx Allow empty: False |
extend | json | Custom data from frontend Allow empty: True |
|
syncExtensionField | boolean | Synchronize backup extension fields, true for synchronization, false for no synchronization, default is no synchronization Allow empty: False |
|
storeType | string | Y | Storage type Allow empty: False Possible values: ['guanceObject', 's3', 'obs', 'oss', 'kafka'] |
dataType | string | Data type Allow empty: False Possible values: ['logging', 'tracing', 'rum', 'keyevent'] |
|
duration | string | Data retention period, Example: 180d Possible values: ['180d', '360d', '720d'] |
|
accessCfg | json | External resource access configuration information Allow empty: False |
|
accessCfg.provider | string | Provider Allow empty: False Possible values: ['aliyun', 'aws', 'huawei'] |
|
accessCfg.grantType | string | Authorization type Allow empty: False Possible values: ['role', 'ram'] |
|
accessCfg.cloudAccountId | string | Cloud account ID Allow empty: False |
|
accessCfg.bucket | string | Bucket Allow empty: False |
|
accessCfg.externalId | string | External unique identifier ID (external unique identifier ID in AWS role authorization method) Allow empty: False |
|
accessCfg.role | string | Role name Allow empty: False |
|
accessCfg.ak | string | Access key ID Allow empty: False |
|
accessCfg.sk | string | Secret key Allow empty: False |
|
accessCfg.topic | string | Topic Allow empty: False Allow empty string: True |
|
accessCfg.url | string | Connection URL (for Kafka) Allow empty: False |
|
accessCfg.securityProtocol | string | Security protocol (for Kafka) Allow empty: False Possible values: ['plaintext', 'sasl_plaintext', 'sasl_ssl'] |
|
accessCfg.ca | string | Client SSL certificate content Allow empty: False Allow empty string: True |
|
accessCfg.mechanism | string | Authentication mechanism Allow empty: False Allow empty string: True Possible values: ['plain', 'scram-sha-256', 'scram-sha-512'] |
|
accessCfg.username | string | Username Allow empty: False Allow empty string: True |
|
accessCfg.password | string | Password Allow empty: False Allow empty string: True |
|
accessCfg.region | string | Region (if not provided, it defaults to the corresponding region of the current site's provider) Allow empty: False |
|
accessCfg.bucketPath | string | Bucket path Allow empty: False |
Additional Parameter Explanation¶
Request Example¶
curl 'https://openapi.guance.com/api/v1/log_backup_cfg/add' \
-H 'Accept: application/json, text/plain, */*' \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'DF-API-KEY: <DF-API-KEY>' \
--data-raw '{"extend":{"filters":[],"filterLogic":"and"},"syncExtensionField":true,"storeType":"obs","name":"temp_test","dataType":"tracing","accessCfg":{"cloudAccountId":"f000ee4d7327428da2f53a081e7109bd","bucket":"test-obs01-418d","region":"cn-south-1","provider":"huawei"}}' \
--compressed
Response¶
{
"code": 200,
"content": {
"conditions": "",
"createAt": 1697613651,
"creator": "xxx",
"dataType": "tracing",
"deleteAt": -1,
"extend": {
"filterLogic": "and",
"filters": []
},
"externalResourceAccessCfgUUID": "erac_xxxx32",
"id": null,
"name": "temp_test",
"status": 0,
"storeType": "obs",
"syncExtensionField": true,
"taskErrorCode": "",
"taskStatusCode": -1,
"updateAt": 1697613651,
"updator": "xxx",
"uuid": "lgbp_xxxx32",
"workspaceUUID": "wksp_xxxx32"
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-31D4417B-2665-4CFA-9BC9-60BD6A540744"
}