Skip to content

Create a Result Acceleration Plan

API Description

Use this API to create application acceleration in Aloudata CAN.

API URL

POST http://{anymetrics_host:anymetrics_port}/anymetrics/api/v1/accelerate/plan/create/app

anymetrics_host:anymetrics_port For how to obtain this value, see Calling APIs

Request parameters

Common Request parameters

parameter Type required Description
tenant-id String Yes Tenant ID, used to identify the tenant for metric query content.
auth-type String Yes Authentication method. Supports UID, TOKEN, ACCOUNT, and APIKEY.
auth-value String Yes Authentication value corresponding to auth-type.

Request parameters

Category parameter Type required Description
Basic Information name String Yes Plan name. It must start with a letter and contain only letters, digits, and underscores. It is also used as the materialized table name and cannot be changed
displayName String Yes Result acceleration display name
Acceleration Content metrics Array Yes Metric name list. See the metrics section of the metric data query API
dimensions Array No Dimension list. See the dimensions section of the metric data query API
metricDefinitions Map No Temporary metric definitions. See the metricDefinitions section of the metric data query API
filters Array No Dimension filter expressions (global filters). See the filters section of the metric data query API
timeConstraint String No Time filter expression. Only metric_time is supported. See the timeConstraint section of the metric data query API
granularity String Yes Time granularity. It must match the metric date granularity
Update Cycle isScheduleUpdate Boolean Yes Whether scheduled updates are enabled: true = scheduled update; false = dependency-triggered update (default)
cron String No Scheduled update cron expression. required when isScheduleUpdate = true
Update Mode isFullRefresh Boolean No Whether to run full refresh: true = full refresh; false = incremental refresh
updateLowerInterval Integer required when isFullRefresh = false Lower update-time offset. For example, -1 means update yesterday's data
updateUpperInterval Integer required when isFullRefresh = false Upper update-time offset
Failure Policy retryCount Integer No Retry count
retryInterval Integer No Retry interval in minutes

default Settings

  • The update cycle is dependency-triggered update

  • Notifications are disabled

  • The failure policy is to stop

Response parameters

parameter Type required Description
success Boolean Yes whetherRequest succeeded
code String Yes API response code
errorMsg String Yes Error message
detailErrorMsg String Yes Detailed error message
traceId String Yes Trace ID for troubleshooting
data Object No
planId String Yes Plan ID
name String Yes acceleration plan name
displayName String Yes Acceleration plan display name

Request Example

{
    "name":"acc_plus_api_6",
    "displayName":"acc_plus_api_6",
    "dimensions":[
        "metric_time__15minute"
    ],
    "metrics": [
        "count_order_datetime__period__dt15min",
        "c_order_count_per_user2"
    ],
    "metricDefinitions": {
        "c_order_count_per_user2": {
            "refMetric": "count_order_datetime",
            "filters": [
                "IN(['province'],\"Zhejiang6\")"
            ],
            "indirections":[
                "sameperiod__mom__growthvalue"
            ]
        }
    },
    "filters": [],
    "timeConstraint": "[metric_time__day] = DATE(\"2024-10-14\")",
    "updateUpperInterval": 0,
    "updateLowerInterval": 0,
    "granularity": "MINUTE",
    "isScheduleUpdate": true,
    "cron": "* 13,28,43,58 0/1 * * ?",
    "isFullRefresh": false
}

Response Example

{
    "data": {
        "planId": "result_925ebd1a9aad17916b56537fb16cb37f",
        "name": "acc_plus_api_6",
        "displayName": "acc_plus_api_6"
    },
    "success": true,
    "code": "200",
    "errorMsg": null,
    "detailErrorMsg": null,
    "traceId": "e79935618aa340b8a63d397d8fd4f02a.323.17308857201550033"
}