Modify Object Classification Configuration¶
POST /api/v1/objc_cfg/{objc_name}/modify
Overview¶
Modify the object classification configuration.
Route Parameters¶
Parameter Name | Type | Required | Description |
---|---|---|---|
objc_name | string | Y | Object classification configuration name |
Body Request Parameters¶
Parameter Name | Type | Required | Description |
---|---|---|---|
sourceType | string | Y | Source type, default value is custom_object Allow null: False Options: ['object', 'custom_object'] |
objcGroupUUID | string | Business group UUID Allow null: False Example: Haha Allow empty string: True Maximum length: 64 |
|
fields | array | Custom attribute fields (the reported data must contain these fields; otherwise, the reported data will be discarded) Allow null: False Example: [{'name': 'ak', 'alias': 'machine gun'}] |
|
templateInfo | json | Template configuration details Allow null: False Example: {} |
Additional Parameter Descriptions¶
Description of fields
parameter
This parameter stores bound field information in list form. The list member parameters are as follows:
Parameter Name | Type | Description |
---|---|---|
name | string | Field name |
alias | string | Field alias |
Description of templateInfo
parameter
For detailed structure description, please refer to [Create Resource Explorer - JSON Configuration - Template Configuration Description]
1. source parameter description Defines the resource category and the text content that needs to be displayed on the UI page. List member parameters are as follows:
Parameter Name | Type | Description |
---|---|---|
key | string | Resource class |
name | string | Resource class alias |
2. filters parameter description Defines the default display fields for quick filtering in the resource explorer. Format is as follows:
3. columns parameter description Defines the default display fields in the resource explorer's list. Format is as follows:
4. views parameter description
Parameter | Required | Description | Example Syntax |
---|---|---|---|
title | / | Tab display title | "text" |
required | false | Whether the tab page is hidden, fixed values: true, false.
|
"false" |
keys | / | Linked with the required parameter, configure key fields and matching logic for field values, show if matched. Note: In this case, the value of the required parameter must be true |
|
timerange | default | Definition of the time range for querying interface data. Basic format:
|
|
viewType | / | Page type. Currently supports two types: "built-in page" and "built-in view", corresponding to "component" and "dashboard". | / |
viewName | / | Page name. If the page type is a built-in page, fill in the relative path address of the page; if the page type is a built-in view, fill in the view name only. Refer to the following [Link Built-in Pages][Link Built-in Views] descriptions | / |
5. templateInfo parameter example
{
"main": [
{
"class":"custom_object",
"source": {
"key":"resource classification",
"name":"resource classification alias"
},
"filters":[
{
"key":"field name"
},
{
"key":"field name"
}
],
"table":{
"columns":[
{
"key":"field name",
},
{
"key":"field name",
}
],
},
"detail":{
"views":[
{
"title":"Tab title",
"required":"false",
"keys":{},
"view_type": "component",
"viewName":"built-in page"
},
{
"title":"Tab title",
"required":"false",
"keys":{},
"timerange":"default",
"view_type": "dashboard",
"viewName":"built-in view"
}
]
}
}
],
"title": "Resource classification or alias"
}
Request Example¶
curl 'https://openapi.guance.com/api/v1/objc_cfg/test/modify' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json;charset=UTF-8' \
--data-raw '{"sourceType":"custom_object","objcGroupUUID":"objcg_xxxx","fields":[{"name":"name"}],"templateInfo":{"iconSet":{},"main":[{"class":"custom_object","source":{"key":"test","name":""},"filters":[],"fills":[],"groups":[],"table":{"columns":[],"detail":{"views":[{"keys":{},"viewType":"dashboard","viewName":"NtpQ Monitoring View","title":"viewer","required":true,"timerange":"default"}]}}}],"title":"test"}}' \
--compressed
Response¶
{
"code": 200,
"content": {
"conditions": "{ source = 'kodo-log' and ( hostname in [ '127.0.0.1' ] )}",
"createAt": 1677653414,
"creator": "acnt_xxxx32",
"deleteAt": -1,
"desc": "",
"filters": [
{
"condition": "and",
"name": "hostname",
"operation": "in",
"value": [
"127.0.0.1"
]
}
],
"id": 24,
"name": "Rule 1",
"source": "kodo-log",
"status": 0,
"type": "logging",
"updateAt": 1678029845.282458,
"updator": "xxxx",
"uuid": "blist_xxxx32",
"workspaceUUID": "wksp_xxxx32"
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-BC365EB4-B4BA-4194-B0BB-B1AC8FA29804"
}