Modify¶
POST /api/v1/objc_cfg/{objc_name}/modify
Overview¶
Modify Resource Catalog configuration
Route Parameters¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| objc_name | string | Y | Resource Catalog configuration name |
Body Request Parameters¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| sourceType | string | Y | Source type, default value is custom_objectAllow empty: False Allowed values: ['object', 'custom_object'] |
| objcGroupUUID | string | Business group UUID Allow empty: False Example: haha Allow empty string: True Max length: 64 |
|
| fields | array | Custom attribute fields (reported data must contain these fields, otherwise the data will be discarded) Allow empty: False Example: [{'name': 'ak', 'alias': 'machine gun'}] |
|
| templateInfo | json | Template configuration details Allow empty: False Example: {} |
Parameter Additional Explanation¶
fields Parameter Explanation
This parameter stores the 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 |
templateInfo Parameter Explanation
For a detailed structure explanation, please refer to 【Create Resource Explorer-JSON Configuration-Template Configuration Explanation】
1. source Parameter Explanation Defines the resource's category and the text content to be displayed on the UI page. The list member parameters are as follows
| Parameter Name | Type | Description |
|---|---|---|
| key | string | Resource Class |
| name | string | Resource Class alias |
2. filters Parameter Explanation Defines the default listed display fields for the Resource Explorer in the quick filter section. The format is as follows:
3. columns Parameter Explanation Defines the default listed display fields for the Resource Explorer in the list. The format is as follows:
4. views Parameter Explanation
| Parameter | Required | Description | Writing Example |
|---|---|---|---|
| title | / | Tab display title | "Text" |
| required | false | Whether the Tab page is not displayed by default. Fixed values: true, false.
|
"false" |
| keys | / | Used in conjunction with the required parameter. Configures key field and field value matching logic. Displays if matched. Note: When this parameter is used, the required parameter value must be true |
|
| timerange | default | Defines the data query time range on the interface. Basic format:
|
|
| viewType | / | Page type. Currently supports "built-in page" and "built-in view" types, corresponding to "component" and "dashboard" respectively. | / |
| 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. Refer to the 【Link Built-in Page】【Link Built-in View】 explanation below | / |
5. templateInfo Parameter Example
{
"main": [
{
"class":"custom_object",
"source": {
"key":"Resource Class",
"name":"Resource Class 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 Class 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 Monitor 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": "Rule1",
"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"
}