Resource Class Configuration Create¶
POST /api/v1/objc_cfg/create
Overview¶
Create Resource Class Configuration
Body Request Parameters¶
Parameter Name | Type | Required | Description |
---|---|---|---|
sourceType | string | Y | Source type, default value is custom_object Allow empty: False Example: custom_object Allowed values: ['object', 'custom_object'] |
objcGroupUUID | string | Business group UUID Allow empty: False Example: objcg_xxxx Allow empty string: True Max length: 64 |
|
fields | array | Custom attribute fields (the reported data must contain these fields, otherwise the reported data will be discarded) Allow empty: False Example: [{'name': 'ak', 'alias': 'machine gun'}] |
|
templateInfo | json | Template configuration information Allow empty: False Example: {} |
Parameter Supplementary Explanation¶
fields
Parameter Explanation
This parameter stores the bound field information in the form of a list, and the list member parameters are as follows
Parameter Name | Type | Description |
---|---|---|
name | string | Field name |
alias | string | Field alias |
templateInfo
Parameter Explanation
For detailed structure explanation, please refer to 【Create Resource Explorer-JSON Configuration-Template Configuration Explanation】
1. source Parameter Explanation Define the resource category and the text content that the category needs to display on the UI page. The list member parameters are as follows
Parameter Name | Type | Description |
---|---|---|
key | string | Resource category |
name | string | Resource category alias |
2. filters Parameter Explanation Define the default listed display fields in the quick filter of the resource explorer, the format is as follows:
3. columns Parameter Explanation Define the default listed display fields in the list of the resource explorer, the format is as follows:
4. views Parameter Explanation
Parameter | Required | Description | Example |
---|---|---|---|
title | / | Tab display title | "text" |
required | false | Whether the tab page is not displayed, fixed values: true, false.
|
"false" |
keys | / | Linkage with required parameter, key fields and field value matching logic can be configured, display if matched. Note: when this parameter is applied, the required parameter value must be true |
|
timerange | default | Interface data query time range definition. Basic format:
|
|
viewType | / | Page type. Currently supports "built-in page" and "built-in view" two types, corresponding to "component" and "dashboard" respectively. | / |
viewName | / | Page name. If the page type is built-in page, you need to fill in the relative path address of the page; if the page type is built-in view, fill in the view name. Refer to the following 【Associate Built-in Page】【Associate Built-in View】 explanation | / |
5. templateInfo Parameter Example
{
"main": [
{
"class":"custom_object",
"source": {
"key":"resource category",
"name":"resource category 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 category or alias"
}
Request Example¶
curl 'https://openapi.guance.com/api/v1/objc_cfg/create' \
-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":{"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": {
"sourceType": "custom_object",
"name": "test",
"alias": "",
"workspaceUUID": "wksp_xxxx",
"objcGroupUUID": "objcg_xxx",
"dashboardBindSet": [],
"fields": [
{
"name": "name"
}
],
"extend": {
"fills": [],
"groups": [],
"columns": [],
"filters": [],
"iconSet": {},
"tableDetailViews": [
{
"keys": {},
"viewType": "dashboard",
"viewName": "NtpQ Monitor View",
"title": "viewer",
"required": true,
"timerange": "default"
}
]
},
"id": 260,
"uuid": "objc_xxxx",
"status": 0,
"creator": "acnt_xxxx",
"updator": "acnt_xxxx",
"createAt": 1734576782,
"deleteAt": -1,
"updateAt": 1734590084.4779553
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "96555412482790535"
}