Create¶
POST /api/v1/objc_cfg/create
Overview¶
Create Resource Catalog Configuration
Body Request Parameters¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| sourceType | string | Y | Source type, default value is custom_objectAllow 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 (Reported data must contain these fields, otherwise the reported data will be discarded) Allow empty: False Example: [{'name': 'ak', 'alias': '机枪'}] |
|
| templateInfo | json | Template configuration information Allow empty: False Example: {} |
Parameter Supplementary Explanation¶
fields Parameter Description
This parameter stores the bound field information in a list format. The list member parameters are as follows
| Parameter Name | Type | Description |
|---|---|---|
| name | string | Field name |
| alias | string | Field alias |
templateInfo Parameter Description
For a detailed structure explanation, please refer to [Create Resource Explorer - JSON Configuration - Template Configuration Description]
1. source Parameter Description Defines 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 Class |
| name | string | Resource Class alias |
2. filters Parameter Description Defines the default listed display fields for the resource explorer in the quick filter section. The format is as follows:
3. columns Parameter Description Defines the default listed display fields for the resource explorer in the list. The format is as follows:
4. views Parameter Description
| 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 | / | Linked with the required parameter. Key fields and field value matching logic can be configured. Displayed if matched. Note: When this parameter is applied, the required parameter value must be true |
|
| timerange | default | Definition of the data query time range in 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, the relative path address of the page needs to be filled in; if the page type is a built-in view, the view name can be filled in. Refer to the [Associate Built-in Page] [Associate Built-in View] description 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/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"
}