Create¶
POST /api/v1/objc_cfg/create
Overview¶
Create a Resource Catalog display and reporting field configuration.
Before Calling and Usage Steps¶
This API requires the API Key to have the infrastructure.setManage permission.
During creation, the type/category is actually taken from templateInfo.main[0].class/source.key, and only the first item is processed. Although the outer sourceType is declared as required, the controller does not use it to determine the creation type, so make sure the two are consistent. An existing configuration with the same type and name reports a duplicate; this does not follow the old comment "overwrite if it exists." To update, use the update operation.
The final fields for creation must contain name and must not contain duplicates; outer fields override the template. Even though declared optional, a valid array must be provided in the outer fields or the template. When fields are actually submitted, downstream reporting filtering is synchronized; data missing required fields may be dropped, so verify with the collection side before making changes. Creating the object type also calls custom_object filtering synchronization after submission, which may affect reporting filtering for custom object catalogs with the same name. Before creating a system object, verify the custom_object with the same name and its required fields; for this creation, provide fields that have already been confirmed with the collection side.
When the template provides a non-empty main, omitting source.name can clear the alias, and omitting groups/fills sets them to []; filters/columns/views are used for the display configuration of this creation. If omitted, this template's and system defaults are used, and there is no old configuration to retain. Icon configuration is saved as a whole. The template groupCfg.name can attempt to create a group, but the compatibility branch for an existing group with the same name may return 500; it is recommended to explicitly fill in objcGroupUUID for the current workspace; an empty string explicitly means no grouping.
The local configuration is submitted first, and then downstream filtering is synchronized. If synchronization fails, 500 may be returned but the local configuration has been saved; verify via list/export before retrying. A successful response is the configuration entity, not a blacklist or a complete template; this page does not confirm that collection has reported data or that the page has rendered.
Request Headers¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| DF-API-KEY | string | Y | OpenAPI authentication credential for the workspace. Example: <DF-API-KEY>How to obtain or enter: Obtain an OpenAPI Key with this operation permission from API Key Management in the target workspace. |
Body Request Parameters¶
| Parameter Name | Type | Required | Description |
|---|---|---|---|
| fields[*] | json | Recommended object; the business reads name. Types are not validated item by item; an incorrect shape may return 500 instead of a clean business error. It may contain display extension fields; the server does not uniformly validate their consumption behavior.Example: {"name": "name", "alias": "资源名称"}How to obtain or enter: A single actual reporting field definition. |
|
| fields[*].name | string | Must be non-empty and match ^[a-zA-Z]+[0-9a-zA-Z_]+$: starts with a letter, followed by digits/letters/_, and is at least 2 characters. Must not be duplicated in the same array; dots, Chinese characters, and single letters are not supported.Example: nameHow to obtain or enter: The field name must exactly match the reporting key and must include at least name. |
|
| fields[*].alias | string | Optional display extension; the server does not uniformly enforce validation; omitting it does not affect the requirement for the name key.Example: 资源名称How to obtain or enter: The field display alias selected by the customer or the original exported value. |
|
| templateInfo.title | string | Optional; this input is not saved during the current creation/update. The title in the local configuration export is composed from alias/name; changing this value will not change the category name, alias, or export title.Example: 示例资源目录How to obtain or enter: The title of the original exported template. |
|
| templateInfo.summary | string | Optional; it is not saved as the Resource Catalog entity description during the current creation/update; do not assume from a 200 response that it has been persisted. Example: How to obtain or enter: The summary of the original exported template. |
|
| templateInfo.iconSet | json | Defaults to {} on creation; on update, omitting it keeps the value, and {} clears it. Dynamic objects are consumed by the template/UI; icon URL validity is not uniformly validated.Example: {}How to obtain or enter: The original exported icon configuration or valid icon information selected by the business. |
|
| templateInfo.iconSet.icon | string | Optional example key; not every enum is supported; select according to the actual UI icon. Example: databaseHow to obtain or enter: An icon identifier supported by the existing template. |
|
| templateInfo.iconSet.url | string | Optional; the server does not send a request here to validate it; do not put credential URLs here. Example: https://example.com/resource-icon.svgHow to obtain or enter: A valid icon resource URL accessible to the customer. |
|
| templateInfo.main | array | Creation requires at least 1 item; only the first item takes effect, and multiple categories are not created in batches. On update, if not provided, most display fields are kept; after providing it, verify the default clearing behavior. Example: [{}]How to obtain or enter: Back up the entire main array from the exported template. |
|
| templateInfo.main[*] | json | Only index 0 is consumed; only 1 item is recommended. Example: {}How to obtain or enter: A single Resource Catalog template. |
|
| templateInfo.main[*].class | string | Actual source type for creation; defaults to custom_object if omitted. Public dynamic templates are not uniformly enum-validated; other values may fail to store with 500. Update ignores this value; the actual type is taken from the outer sourceType.Example: custom_objectHow to obtain or enter: Consistent with the outer sourceType and the actual data type. |
|
| templateInfo.main[*].source | json | Creation requires a valid object; update only reads source.name as the alias and does not change the path category code. Do not backfill a string source from an old system template directly; convert it to an object first.Example: {"key": "example_resources", "name": "示例资源目录"}How to obtain or enter: Take the original reporting class code and the alias to display. |
|
| templateInfo.main[*].source.key | string | Non-empty string required for creation, trimmed; the name storage column is 256, and this length is not uniformly declared publicly, so no more than 256 is recommended. Update cannot rename based on this; only path objc_name is used for location.Example: example_resourcesHow to obtain or enter: The category name that exactly matches the object's reporting class. |
|
| templateInfo.main[*].source.name | string | Defaults to an empty string on creation; on update, once a non-empty main is provided but source.name is omitted, the alias is set to empty, not kept. The column is 256, so keep the length controlled.Example: 示例资源目录How to obtain or enter: The display alias selected by the customer, obtained from the original template/list alias. |
|
| templateInfo.main[*].groupCfg | json | When the outer objcGroupUUID is omitted, attempts to find or create a group by name; {} means no group. The compatibility branch for an existing group with the same name may return 500, so for stable operations it is recommended to explicitly fill in an existing UUID.Example: {}How to obtain or enter: Take the business group information from the export, or preferably explicitly use objcGroupUUID. |
|
| templateInfo.main[*].groupCfg.name | string | Optional; trimmed. Defaults to no group. It attempts to create a new group, not just display information; for an existing group, prefer the outer UUID. Example: 业务分组How to obtain or enter: Obtain from an existing group name or the group name the customer wants to create. |
|
| templateInfo.main[*].fields | array | Same structure as outer fields; when outer fields is present, it overrides this value. Creation must ultimately contain name; on update, if both are omitted, the existing target is kept, and a missing target can be created with fields=[] without validating name or synchronizing downstream filtering.Example: [{"name": "name"}]How to obtain or enter: The fields that must be included in actual reporting, or main[0].fields from the export. |
|
| templateInfo.main[*].fields[*] | json | Recommended object. Example: {"name": "name", "alias": "名称"}How to obtain or enter: A single field definition, consistent with outer fields. |
|
| templateInfo.main[*].fields[*].name | string | Same rule as fields[*].name; must ultimately contain name and must not have duplicate names.Example: nameHow to obtain or enter: The reporting field key. |
|
| templateInfo.main[*].fields[*].alias | string | Optional; does not replace name.Example: 名称How to obtain or enter: The display alias for this field. |
|
| templateInfo.main[*].filters | array | Defaults to [] on creation; on update, if the template does not provide this field, it is kept; [] clears it; a non-empty value replaces it as a whole.Example: [{"key": "env"}]How to obtain or enter: The quick filter configuration from the original template; fields come from actual object data. |
|
| templateInfo.main[*].filters[*] | json | Dynamic display object; the server saves it without executing query validation. Example: {"key": "env"}How to obtain or enter: A single quick filter item. |
|
| templateInfo.main[*].filters[*].key | string | A real non-empty key is recommended; do not enter a title. Example: envHow to obtain or enter: The actual object attribute field name. |
|
| templateInfo.main[*].groups | array | Dynamic display array; defaults to [] on creation. On update, once a non-empty main is provided but groups is omitted, it is also cleared to []. This is not the same as the catalog business group objcGroupUUID.Example: []How to obtain or enter: Retain the group display configuration from the original export. |
|
| templateInfo.main[*].groups[*] | JSON | Retained in full according to the original template; structure/enum validation is not uniformly enforced. Example: envHow to obtain or enter: A grouping item supported by the existing UI configuration. |
|
| templateInfo.main[*].fills | array | Dynamic array; defaults to [] on creation. On update, if a non-empty main is provided but fills is omitted, it is cleared to []. There is no uniform server-side required substructure.Example: []How to obtain or enter: Retain the fill display configuration from the original export. |
|
| templateInfo.main[*].fills[*] | JSON | Retained according to the original consumption structure; do not construct default rules out of thin air. Example: {}How to obtain or enter: The actual fill configuration item in the existing UI template. |
|
| templateInfo.main[*].table | json | Optional object; defaults to empty configuration on creation; on update, if its subfields are not provided, the corresponding values are kept. Example: {}How to obtain or enter: Copy the list and detail display configuration from the original template. |
|
| templateInfo.main[*].table.columns | array | Defaults to [] on creation; on update, omitting keeps it, [] clears it. This is different from fields collection filtering.Example: [{"key": "name"}]How to obtain or enter: The actual object fields to display in the list. |
|
| templateInfo.main[*].table.columns[*] | json | Dynamic column object; additional display attributes are not uniformly validated. Example: {"key": "name"}How to obtain or enter: A single list display column. |
|
| templateInfo.main[*].table.columns[*].key | string | Column location field, not an alias/title. Example: nameHow to obtain or enter: The actual reporting field name. |
|
| templateInfo.main[*].table.detail | json | Optional object; actual views must be in table.detail.views, not main.detail.views.Example: {}How to obtain or enter: The detail page settings from the original template. |
|
| templateInfo.main[*].table.detail.views | array | Defaults to [] on creation; on update, omitting keeps it, [] clears it. Saved for UI consumption; the current API does not validate page/view existence or permissions.Example: []How to obtain or enter: Obtain from the original Resource Catalog tab configuration or the name of a built-in page/built-in view. |
|
| templateInfo.main[*].table.detail.views[*] | json | Original display protocol; the server only retains it and does not render or test the page immediately. Example: {"viewType": "component", "viewName": "base", "title": "详情", "required": false, "keys": {}, "timerange": "default"}How to obtain or enter: A single detail tab configuration. |
|
| templateInfo.main[*].table.detail.views[*].title | string | Optional display text. Example: 详情How to obtain or enter: The tab display title specified by the caller. |
|
| templateInfo.main[*].table.detail.views[*].viewType | string | Use camelCase viewType; the legacy view_type description is not automatically converted here.Example: componentHow to obtain or enter: The actually supported built-in page component or built-in view dashboard. |
|
| templateInfo.main[*].table.detail.views[*].viewName | string | Do not enter an arbitrary external site URL or dashboard UUID in place of the name; saving does not validate existence and does not guarantee displayability. Example: baseHow to obtain or enter: For component, use the relative path of a supported built-in page; for dashboard, use the name of an existing built-in view. |
|
| templateInfo.main[*].table.detail.views[*].required | boolean | Display convention: false displays by default, true is determined by keys matching. Use a real JSON boolean, not the string "false". This API does not validate matching immediately.Example: falseHow to obtain or enter: The UI option for whether to display the tab only when keys match. |
|
| templateInfo.main[*].table.detail.views[*].keys | json | Works with required=true; the field key mapping "*" means the field is required to exist, and a specific value means an equality combination; {} follows the UI default and does not serve as API authorization.Example: {}How to obtain or enter: The data field and value conditions of the displayed object. |
|
| templateInfo.main[*].table.detail.views[*].keys.字段名 | JSON | Can use an existing data value or the existence marker *; use according to the actual UI matching capability.Example: *How to obtain or enter: The actual object attribute key/match value. |
|
| templateInfo.main[*].table.detail.views[*].timerange | string or array of strings | Display convention: default follows the platform time widget (not fixed at 15m); can be 15m/1h/1d, or [before offset, after offset] such as [5m,30m] linked to data time. Saving does not validate the expression or execute a query.Example: defaultHow to obtain or enter: Select the time range according to the detail-related query requirements. |
|
| templateInfo.main[*].table.detail.views[*].timerange[*] | string | Uses m/h/d units, unlike the millisecond timeRange Query.Example: 15mHow to obtain or enter: The before/after duration in the two-element offset array. |
|
| sourceType | string | Y | Publicly required; only object/custom_object. Does not support *_history shared internal functions. Creation actually uses templateInfo.main[0].class, so this must be consistent with that field; update/read uses it to select the configuration type. Deletion is public only for custom_object, and the controller fixes this type.Allow null: False Allowed values: ['object', 'custom_object'] Example: custom_objectHow to obtain or enter: Select object for system objects and custom_object for custom resource objects, based on the actual reporting data source. |
| objcGroupUUID | string | Optional; on creation/update, an explicitly empty string clears the group; omitting it attempts template groupCfg.name, and if there is no name, it is an empty string; on update, it does not keep the original group. If non-empty, the group must exist in the current workspace. Although the list declares this field, the current implementation does not filter by it, so do not rely on it to narrow results.Allow null: False Allow empty string: True Maximum length: 64 Example: How to obtain or enter: Obtain the objcg_ identifier from Resource Catalog group management or the objcGroupUUID of a list entry in the current workspace. |
|
| fields | array | Declared optional, but during creation/update submission the business must contain name and must not have duplicates. Outer fields take precedence over the same-named configuration in the template. On update, if both locations are omitted: if the target exists, fields are kept; if the target does not exist, fields=[] is created without validating name and without synchronizing downstream filtering; if the template provides fields, the template is used. An explicit [] is rejected because name is missing. Fields are synchronized to downstream reporting filtering rules; data missing these required fields may be dropped, so verify with the collection side first.Allow null: False Example: [{"name": "name", "alias": "资源名称"}]How to obtain or enter: Take the field names that must be included in actual reporting; back up from main[0].fields in the export and adjust. |
|
| templateInfo | json | Dynamic template object; creation requires a valid non-empty main whose first item contains source.key (the outer level does not declare it as required for the business, but omitting it may return 500); only main[0] is consumed, and subsequent items are ignored. On update, it can be omitted/{} to keep most configuration, but grouping is still handled according to the separate rules on this page.Allow null: False Example: {}How to obtain or enter: Prefer to use the content configuration object from Resource Catalog Export as the basis; do not backfill the entire unified response. |
Additional Parameter Notes¶
Template configuration uses templateInfo.main[0]; the table detail path is table.detail.views, and the field name is viewType. The parameter table has been expanded item by item; when template dynamic display information is saved, no page rendering or query validation is performed.
Request Example¶
curl --request POST 'https://openapi.guance.com/api/v1/objc_cfg/create' \
-H 'DF-API-KEY: <DF-API-KEY>' \
-H 'Content-Type: application/json' \
--data-raw '{"sourceType":"custom_object","objcGroupUUID":"","fields":[{"name":"name","alias":"资源名称"}],"templateInfo":{"main":[{"class":"custom_object","source":{"key":"example_resources","name":"示例资源目录"},"groupCfg":{},"fields":[{"name":"name","alias":"资源名称"}],"filters":[{"key":"env"}],"groups":[],"fills":[],"table":{"columns":[{"key":"name"}],"detail":{"views":[]}}}],"title":"示例资源目录","summary":"","iconSet":{}}}'
Response¶
HTTP 200, application/json. The example below shows the main fields that can be read directly.
| Field | Type | Description |
|---|---|---|
| content.id | integer or null | Local configuration record number; the response constructed before a new submission may be null. |
| content.uuid | string | Local objc_ configuration UUID, not the category name. |
| content.workspaceUUID | string | Workspace it belongs to. |
| content.sourceType | string | object/custom_object. |
| content.name | string | Actual category code. |
| content.alias | string | Display alias. |
| content.objcGroupUUID | string | Business group UUID; empty string if no group. |
| content.dashboardBindSet | array | Historical binding data; this entry point does not separately parse/update this structure. |
| content.dashboardBindSet[] | JSON | Original saved dynamic binding item. |
| content.fields | Array of objects | Field definitions required for reporting. |
| content.fields[].name | string | Actual reporting field name; must contain name, must not be duplicated, and follows the field naming rules. |
| content.fields[].alias | string | Optional display alias. |
| content.extend | object | Actually saved display configuration. |
| content.extend.iconSet | object | Icon configuration saved for this creation; empty object {} when not configured. |
| content.extend.iconSet.icon | string | Conditional icon identifier. |
| content.extend.iconSet.url | string | Conditional icon URL. |
| content.extend.filters | Array of objects | Quick filter items. |
| content.extend.filters[].key | string | Filter field. |
| content.extend.groups | array | Dynamic display groups. |
| content.extend.groups[] | JSON | A single dynamic group item. |
| content.extend.fills | array | Dynamic fill configuration. |
| content.extend.fills[] | JSON | A single dynamic fill item. |
| content.extend.columns | Array of objects | List display columns. |
| content.extend.columns[].key | string | Field key for a single column. |
| content.extend.tableDetailViews | array<object> | Detail tab configuration saved for this creation; empty array [] when not configured. |
| content.extend.tableDetailViews[].title | string | Tab title. |
| content.extend.tableDetailViews[].viewType | string | component/dashboard. |
| content.extend.tableDetailViews[].viewName | string | Built-in page path or built-in view name. |
| content.extend.tableDetailViews[].required | boolean | Whether display is determined by keys. |
| content.extend.tableDetailViews[].keys | object | Dynamic matching fields/values. |
| content.extend.tableDetailViews[].keys.字段名 | JSON | Matching value/existence marker *. |
| content.extend.tableDetailViews[].timerange | string or array of strings | default/relative duration/before-after offset array. |
| content.extend.tableDetailViews[].timerange[] | string | A single before/after offset duration. |
| content.status | integer | 0 normal, 3 deleted. |
| content.creator | string | Creator. |
| content.updator | string | Updater. |
| content.createAt | integer | Creation Unix seconds. |
| content.updateAt | integer or number | Update Unix seconds; historical values may be compatible with decimal values. |
| content.deleteAt | integer | -1 if not deleted. |
| content.declaration | object or null | Workspace public declaration attached to a non-empty business object; may be null or an empty object when not configured; an empty object is not added. |
{
"code": 200,
"content": {
"id": null,
"uuid": "objc_example",
"workspaceUUID": "wksp_example",
"sourceType": "custom_object",
"name": "example_resources",
"alias": "示例资源目录",
"objcGroupUUID": "",
"dashboardBindSet": [],
"fields": [
{
"name": "name",
"alias": "资源名称"
}
],
"extend": {
"iconSet": {},
"columns": [
{
"key": "name"
}
],
"filters": [
{
"key": "env"
}
],
"groups": [],
"fills": [],
"tableDetailViews": []
},
"status": 0,
"creator": "wsak_example",
"updator": "wsak_example",
"createAt": 1785427200,
"updateAt": 1785427200,
"deleteAt": -1,
"declaration": {}
},
"errorCode": "",
"message": "",
"success": true,
"traceId": "TRACE-EXAMPLE"
}
Error Responses¶
For authentication, rate limiting, and common request errors, see Public Error Definitions.
Only configurations in the workspace of the current API Key can be modified/exported. Lists can count authorized target workspaces, but their display configuration still belongs to the current workspace. The API has a freeEdition version declaration; public OpenAPI authentication does not perform this version check in this route, so do not document the version itself as a fixed 403. Query upstream 4xx responses according to the actual Kodo/permission mapping; ordinary 5xx responses ultimately return 500 ft.InternalServerError.
| HTTP Status | errorCode | Trigger Condition | Message or Response Description | Resolution |
|---|---|---|---|---|
| 406 | ft.ParameterValidationFailed | Request field is missing, or the field value violates the declared validation conditions | Parameter parsing failed | Check the parameter location, field name, type, and value. |
| 400 | ft.RequestJsonFormatError | Request JSON syntax is invalid | Request JSON format error | Correct the JSON according to content.reason, line, and column. |
| 400 | ft.JsonFormatError | Body top level is not a JSON object | Some JSON file format error | Submit an object containing the fields on this page. |
| 400 | ft.InvalidFieldName | A field name in the final fields does not match the regex | Invalid field name (starts with a letter and contains only letters and underscores) | Use a name that starts with a letter and is at least 2 characters using letters/digits/_; submit an object rather than a string. |
| 400 | ft.MissingFiledName | The final fields are missing the name field (including when all fields are omitted on creation or [] is passed) |
Must contain the name field |
Keep name and all fields that must be included in actual reporting; back up the complete definition before updating. |
| 400 | ft.UnsupportRepeatfield | Duplicate names appear in fields | Fields cannot be duplicated | Deduplicate fields by name; do not treat different aliases as different fields. |
| 406 | ft.InvalidObjcSetClassName | Category name is empty/invalid format | Object category name {} is invalid |
Get name from the existing category list; creation requires templateInfo.main[0].source.key to be non-empty; avoid leading/trailing whitespace. |
| 404 | ft.NotFoundObjcGroupObj | Explicit non-empty objcGroupUUID is not in a non-deleted group in the current workspace | The specified Resource Catalog group was not found | Use the actual group UUID; to clear the group, use an explicit empty string. |
| 500 | ft.InternalServerError | Dynamic template/field element shape, storage length, existing group compatibility branch, or post-submission filtering synchronization failed | Internal error | First read the list/export to verify the configuration and downstream filtering status; the configuration may have been saved, so do not blindly create it again. For an existing group, explicitly fill in the UUID. |
| 406 | ft.InvalidObjcSetClassNameAlreadyExists | A non-deleted configuration with the same name already exists for the same sourceType in the workspace | Creation failed, resource category "{}" already exists | Call the update API; do not overwrite by creating a duplicate. |