Skip to content

Modify



POST /api/v1/self_built_checker/modify

Overview

Update the self-built checker title, function metadata, and associated policies.

Prerequisites and Usage Steps

A modification must first call get and explicitly pass ruleUUID; if refKey is provided, it is matched together with the UUID. The current implementation does not enforce either target identifier; if neither is passed, the first self-built rule in the workspace may be selected, so do not submit a request without a target. When changing only the title with refKey, the duplicate-name exclusion condition uses [None], which forms NOT IN(NULL) and cannot reliably check for duplicate titles. Modifying policy references and refreshing the muted title/policy cache also still use the original ruleUUID and do not automatically backfill the matched object UUID; using only refKey may fail to locate the correct reference or may produce a reference with no valid source. You must first call get to obtain the ruleUUID and then explicitly pass it in the modification, especially when changing policies/titles.

Omitting the title keeps it unchanged; refFuncInfo is updated by first-level key, and args/kwargs are each replaced as a whole without deep merging; {} does not clear the original metadata, and funcId is not in the public modification whitelist. Omitting alertPolicyUUIDs keeps it unchanged; [] clears it. The public Body does not declare callKwargs/monitorUUID/dashboardUUID/extend, so Front or internal parameters cannot be reused. Updating a shared task resets the historical openPermissionSet=false and permissionSet=[]; verify permissions before modifying.

After saving, the title in the mute scope is updated asynchronously and the associated policy cache is cleared; on error, the rule may already have been committed, so read it back before retrying. This public modification does not record a separate modification audit.

This API registers/modifies checker metadata and Alert Policy associations. It does not execute the associated function, does not produce a checker result, and does not create a scheduled trigger task for the self-built checker; actual scheduling and event generation are handled by the business integration/function side. After success, use the list/get operations to verify the configuration and status.

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 fill in: Obtain an OpenAPI Key with this operation permission from the API Key management of the target workspace.

Body Request Parameters

Parameter Name Type Required Description
alertPolicyUUIDs[*] string A non-empty string is recommended; not a name, notification target, or notification policy UUID.
Example: altpl_example
How to obtain or fill in: The UUID of a single Alert Policy in this workspace.
refFuncInfo.args[*] JSON Any JSON parameter metadata; the server does not provide a unified sub-item schema; keep the original definition.
Example: service
How to obtain or fill in: Metadata for a single parameter of the function platform, which may be a string or an object depending on the function definition.
refFuncInfo.kwargs.parameter name any Dynamic key-value pairs; there is no required parameter common to all functions; do not pass credentials into examples/logs.
Example: production
How to obtain or fill in: For example, service takes the name of a service already deployed in the business; the specific name/type/source follows the associated function documentation.
alertPolicyUUIDs array Optional. On creation, omitting it or passing [] means no policy binding; on modification, omitting it keeps the current value and [] clears it. The server keeps only non-deleted matches in this workspace and does not guarantee that all inputs are valid; disabled policies may also be kept. Verify the final alertPolicyInfos via the list operation, and do not treat success as notification delivery.
Allow null: False
Example: ["altpl_example"]
How to obtain or fill in: Obtain the UUID of a non-deleted policy in the current workspace from the Alert Policy List.
ruleUUID string Operation target identifier. For a modification you must call get first to obtain an explicit ruleUUID, especially when changing policies/titles; if get is given refKey at the same time, only ruleUUID is used, and if modify is given both, both conditions must match. This is not the function funcId or an association key.
Allow null: False
Example: rul_self_example
How to obtain or fill in: Obtain the self-built checker UUID in this workspace from Self-built Checker List content.data[].uuid.
refKey string Declared as required on creation and cannot be modified afterwards; a non-empty value of ≤48 characters is recommended. On creation, duplicates are checked against the refKey of all non-deleted Rules in this workspace, not only self-built checkers. get can use refKey alone; modify must call get to obtain ruleUUID before submitting, and refKey only serves as an optional additional verification condition; refKey alone cannot reliably maintain policy references/caches/mute scope or duplicate-name validation.
Allow null: False
Example: custom-healthcheck-production
How to obtain or fill in: Generate a stable unique key for the function/business integration, for example an identifier for a check instance of the same business system.
title string Required on creation; optional on modification and kept if omitted. A non-empty title is copied to jsonScript.name and shares name uniqueness with normal triggers and the self_built_trigger group. An appropriate length is recommended; the public declaration has no upper limit and does not rely on server-side generation; this is not the function funcId.
Allow null: False
Example: Production service health check
How to obtain or fill in: Named by the business side; first check the names already used by normal monitors and self-built checkers.
refFuncInfo json Required on creation, and funcId is required; it only registers the associated function profile, and this request neither executes the function nor creates a scheduled trigger. Modification only accepts the metadata sub-fields listed on this page, updates by first-level key, and replaces args/kwargs as a whole; {} or omitting it leaves them unchanged. funcId is not in the modify whitelist, so the function identifier cannot be changed through modification.
Allow null: False
Example: {"funcId": "healthcheck.main", "description": "Production service health check function.", "definition": "main(service)", "category": "custom", "args": ["service"], "kwargs": {"service": "production"}}
How to obtain or fill in: Obtain the metadata from a deployed and available custom checker function/function platform configuration; do not treat the example literals as a real function.
refFuncInfo.description string Optional string, may be empty; on modification an explicit empty string clears it.
Allow null: False
Allow empty string: True
Example: Production service health check function.
How to obtain or fill in: Reuse the function documentation.
refFuncInfo.definition string Optional signature display string; it is not source code executed by this API.
Allow null: False
Allow empty string: True
Example: main(service)
How to obtain or fill in: Obtain it from the exported description of the function definition/signature.
refFuncInfo.category string Optional metadata; no fixed enumeration and does not change Rule.type.
Allow null: False
Example: custom
How to obtain or fill in: Take the actual category name from the function platform.
refFuncInfo.args array Optional array, stored according to the original metadata conventions of the function platform; the server does not perform parameter binding or validate the function signature; on modification the entire array is replaced.
Allow null: False
Example: ["service"]
How to obtain or fill in: Obtain positional parameter metadata from the function parameter signature.
refFuncInfo.kwargs json Optional dynamic JSON metadata; sub-values are interpreted according to that function definition; it is not the top-level callKwargs parameter available in this API and does not invoke the function immediately. On modification the entire kwargs is replaced.
Allow null: False
Example: {"service": "production"}
How to obtain or fill in: Obtain it from the function parameter metadata or business integration configuration.

Request Example

curl --request POST 'https://openapi.guance.com/api/v1/self_built_checker/modify' \
  -H 'DF-API-KEY: <DF-API-KEY>' \
  -H 'Content-Type: application/json' \
  --data-raw '{"ruleUUID":"rul_self_example","title":"Production service health check updated","refFuncInfo":{"description":"Checker function description updated."},"alertPolicyUUIDs":["altpl_example"]}'

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 Record number; the snapshot before the creation is committed may be null, so use uuid for operations.
content.uuid string rul_ rule UUID.
content.workspaceUUID string The workspace it belongs to.
content.monitorUUID string UUID of the associated monitor group; not declared by public creation, usually an empty string.
content.type string Fixed as self_built_trigger for self-built checkers; get does not further restrict the type and only uses UUIDs from this module's list.
content.refKey string Fixed business association key.
content.secret string or null Compatibility field for shared entities; usually empty for self-built checkers; the creation snapshot may be null; do not use it as a call credential.
content.jsonScript object The saved self-built checker definition, distinct from Rule.type.
content.jsonScript.type string Fixed as selfBuiltCheck.
content.jsonScript.title string Root business title.
content.jsonScript.name string May be omitted. Not generated when the creation title is empty; a non-empty title is copied to name; modifying the title to empty keeps the historical name.
content.jsonScript.refFuncInfo object Associated function profile.
content.jsonScript.refFuncInfo.funcId string Required only on creation, not declared for modification; server registration does not guarantee that the function actually exists or is callable.
content.jsonScript.refFuncInfo.description string Optional string, may be empty; on modification an explicit empty string clears it.
content.jsonScript.refFuncInfo.definition string Optional signature display string; it is not source code executed by this API.
content.jsonScript.refFuncInfo.category string Optional metadata; no fixed enumeration and does not change Rule.type.
content.jsonScript.refFuncInfo.args array Optional array, stored according to the original metadata conventions of the function platform; the server does not perform parameter binding or validate the function signature; on modification the entire array is replaced.
content.jsonScript.refFuncInfo.kwargs json Optional dynamic JSON metadata; sub-values are interpreted according to that function definition; it is not the top-level callKwargs parameter available in this API and does not invoke the function immediately. On modification the entire kwargs is replaced.
content.jsonScript.refFuncInfo.args[] JSON Any JSON parameter metadata; the server does not provide a unified sub-item schema; keep the original definition.
content.jsonScript.refFuncInfo.kwargs.parameter name any Dynamic key-value pairs; there is no required parameter common to all functions; do not pass credentials into examples/logs.
content.jsonScript.callKwargs object Execution parameters that may be saved by historical/other entry points; not declared by public create/modify and cannot be returned or added.
content.jsonScript.callKwargs.parameter name JSON Specific execution parameters are interpreted according to the original function definition and are not guaranteed to exist.
content.crontabInfo object This entry point does not create scheduled trigger configurations for self-built checkers; usually {}.
content.crontabInfo.historical fields JSON Historical records may retain scheduling data; this is not writable configuration for this API.
content.extend object Extended metadata; not declared by the public Body; usually {} on creation.
content.extend.historical fields JSON Extension fields saved historically; this entry point does not support returning them for modification.
content.createdWay string Usually manual; may also be historical import/template/empty.
content.isLocked integer or boolean Lock flag.
content.openPermissionSet boolean Custom operation permission switch; false on creation; a shared task update via modify restores it to false.
content.permissionSet array<string> Operation permission principals; [] on creation; a shared update via modify restores it to [].
content.permissionSet[] string Historical account/team/role identifiers.
content.status integer 0 enabled, 2 disabled, 3 deleted; not equal to the latest checker result.
content.creator string Creation identity.
content.updator string Update identity; may initially be empty.
content.createAt integer Creation Unix seconds.
content.updateAt integer Update Unix seconds; -1 if not updated.
content.deleteAt integer Deletion Unix seconds; -1 if not deleted.
content.declaration object Public declaration.
{
  "code": 200,
  "content": {
    "id": 100,
    "uuid": "rul_self_example",
    "workspaceUUID": "wksp_example",
    "monitorUUID": "",
    "type": "self_built_trigger",
    "refKey": "custom-healthcheck-production",
    "secret": "",
    "jsonScript": {
      "type": "selfBuiltCheck",
      "title": "Production service health check updated",
      "name": "Production service health check updated",
      "refFuncInfo": {
        "funcId": "healthcheck.main",
        "description": "Checker function description updated.",
        "definition": "main(service)",
        "category": "custom",
        "args": [
          "service"
        ],
        "kwargs": {
          "service": "production"
        }
      }
    },
    "crontabInfo": {},
    "extend": {},
    "createdWay": "manual",
    "isLocked": 0,
    "openPermissionSet": false,
    "permissionSet": [],
    "status": 0,
    "creator": "wsak_example",
    "updator": "wsak_example",
    "createAt": 1785427200,
    "updateAt": 1785427300,
    "deleteAt": -1,
    "declaration": {}
  },
  "errorCode": "",
  "message": "",
  "success": true,
  "traceId": "TRACE-EXAMPLE"
}

Error Responses

For authentication, rate limiting, and common request errors, see Common Error Definitions.

HTTP Status errorCode Trigger Condition Message or Response Description Handling
406 ft.ParameterValidationFailed Request fields are missing, or field values violate the declared validation conditions Parameter parsing failed Check the parameter location, field names, types, and values.
400 ft.RequestJsonFormatError The request JSON syntax is invalid Request JSON format error Fix the JSON based on content.reason, line, and column.
406 ft.CheckObjectNameRepeat The title duplicates the name of a non-deleted normal monitor/self-built checker in this workspace Duplicate alias of the detection target Rename it; for modification, preferably include ruleUUID to exclude the current object.
500 ft.InternalServerError No target selected, incorrect field shape or length, database/asynchronous task dispatch failure after commit, etc. Internal error First read back the current rule to confirm whether it has been saved; then retry with an explicit ruleUUID in this workspace and provide the traceId.
404 ft.MonitorNotFound The historical rule already has an associated monitorUUID but the group does not exist or has been deleted Rule group not found First verify the original rule and group, and have an administrator repair the historical association before modifying.
404 ft.NotFoundRuleInspector The identifier condition does not match a non-deleted self-built checker in this workspace The specified rule/checker was not found Verify whether ruleUUID and the optional refKey belong to the same object.

Feedback

Is this page helpful?