Skip to content

Create



POST /api/v1/objc_cfg/create

Overview

Create a Resource Catalog 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 (data reported 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 Description


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 detailed structure description, please refer to [Create Resource Catalog Explorer - JSON Configuration - Template Configuration Description].

1. source Parameter Description Defines the resource classification and the text content to be displayed on the UI page for that classification. 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 fields to be listed in the quick filter section of the Resource Catalog Explorer. The format is as follows:

"filters":[
  {
    "key":"field name"
  },
  {
    "key":"field name"
  }
]

3. columns Parameter Description Defines the default fields to be listed in the table of the Resource Catalog Explorer. The format is as follows:

"columns":[
  {
    "key":"field name",
  },
  {
    "key":"field name",
  }
]

4. views Parameter Description

Parameter Required Description Example
title / Tab display title "text"
required false Whether the Tab page is hidden by default. Fixed values: true, false.
  • true: Hidden by default. Display is determined by matching the keys configuration. If matched, it will be shown.
  • false: Displayed by default
"false"
keys / Works in conjunction with the required parameter. Configures key fields and field value matching logic. If matched, the tab is displayed. Note: When using this parameter, the required parameter value must be true.
  • {"key":"*"} : Data satisfies the key field.
  • {"key":"value"} : The key field exists in the data and its value must be value.
  • {"key1":"value1","key2":"value2"} : The data contains the combination where key1 field value is value1 and key2 field value is value2.
timerange default Defines the data query time range on the interface. Basic formats:
  • default: Follows the platform's default time widget configuration, usually 15m (i.e., query data from the last 15 minutes).
  • Relative time: Custom relative time range. Time units include m(minutes), h(hours), d(days).
  • Link to the data's time field to configure offset periods ["forward offset","backward offset"].
  • "default" : Last 15 minutes
  • "15m" : Last 15 minutes
  • "1h" : Last 1 hour
  • "1d" : Last 1 day
  • ["15m","15m"] : Offset 15 minutes forward and 15 minutes backward from the current data's time field.
  • ["5m","30m"] : Offset 5 minutes forward and 30 minutes backward from the current data's time field.
viewType / Page type. Currently supports "built-in page" and "built-in view", 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 descriptions below for [Associate Built-in Page] and [Associate Built-in View]. /

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.truewatch.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"
}