CreateAggTaskGroup

Updated at:

Creates an aggregation task group.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

cms:CreateAggTaskGroup

create

*AggTaskGroup

acs:cms:{#regionId}:{#accountId}:prometheusinstance/{#sourcePrometheusId}/aggtaskgroup/*

None None

Request syntax

POST /prometheus-instances/{instanceId}/agg-task-groups HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

instanceId

string

Yes

The source Prometheus instance ID of the aggregation node group.

pq4apob9jm

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

The request struct.

aggTaskGroupConfig

string

Yes

The configuration of the aggregation task group. Only the RecordingRuleYaml format is supported. The configuration must meet the format requirements of RecordingRule in open source Prometheus.

groups: - name: "node.rules" interval: "60s" rules: - record: "node_namespace_pod:kube_pod_info:" expr: "max(label_replace(kube_pod_info{job=\"kubernetes-pods-kube-state-metrics\"\ }, \"pod\", \"$1\", \"pod\", \"(.*)\")) by (node, namespace, pod, cluster)"

aggTaskGroupConfigType

string

No

The configuration type of the aggregation task group. Default value: RecordingRuleYaml, which is the RecordingRule format of open source Prometheus.

RecordingRuleYaml

aggTaskGroupName

string

Yes

The name of the aggregation task group.

test-group

cronExpr

string

No

The cron expression used when the scheduling mode is set to Cron. For example, 0/1 * * * * indicates that the task is scheduled every 1 minute starting from minute 0.

0/1 * * * *

delay

integer

No

The fixed delay time for scheduling. Unit: seconds. Default value: 30.

30

description

string

No

The description of the aggregation task group.

desc

fromTime

integer

No

The UNIX timestamp in seconds for the scheduling start time.

1724996015

maxRetries

integer

No

The maximum number of retries for executing the aggregation task. Default value: 20.

20

maxRunTimeInSeconds

integer

No

The maximum retry time to execute the aggregation node. Unit: seconds. Default value: 600.

600

precheckString

string

No

The precheck configuration. By default, this parameter is not configured. The input string must be valid JSON.

{"policy":"skip","prometheusId":"xxx","query":"scalar(sum(count_over_time(up{job=\"_arms/kubelet/cadvisor\"}[15s])) / 21)","threshold":0.5,"timeout":15,"type":"promql"}

scheduleMode

string

No

The scheduling mode. Valid values: Cron and FixedRate. Default value: FixedRate.

Valid values:

  • FixedRate :

    Fixed period.

  • Cron :

    Cron expression.

FixedRate

scheduleTimeExpr

string

No

The scheduling time expression. Use @s or @m to specify the alignment granularity of the scheduling time window. Default value: @m.

@m

status

string

No

The status of the aggregation task group. Valid values: Running and Stopped. Default value: Running.

Valid values:

  • Stopped :

    Disabled.

  • Running :

    Started.

Running

tags

array<object>

No

The tags of the resource group.

object

No

The value of the resource tag.

key

string

No

The key of the resource group tag.

key1

value

string

No

The value of the resource group tag.

value1

targetPrometheusId

string

Yes

The target Prometheus instance ID of the aggregation node group.

rw-pq4apob9jm

toTime

integer

No

The UNIX timestamp in seconds for the scheduling end time. A value of 0 indicates that the scheduling does not stop.

0

overrideIfExists

boolean

No

Specifies whether to overwrite the existing resource with the same name when creating the aggregation task group.

true

Response elements

Element

Type

Description

Example

object

The response struct.

aggTaskGroupConfigHash

string

The hash of the aggregation task group configuration.

a54136014dc386a92c83a6ef1e97ff22

aggTaskGroupId

string

The ID of the aggregation task group.

aggTaskGroup-f4b8e50525cf41c894488c0c71ec483f

aggTaskGroupName

string

The name of the aggregation task group.

pipeline-aggtask-group

requestId

string

The request ID.

16C0A6D6-C3E7-511D-A60B-A87FD85F5BA7

sourcePrometheusId

string

The source Prometheus instance ID of the aggregation node group.

rw-ecc04af14729b1a16e40a0d10068

status

string

The current status of the aggregation task group.

Pending2Running

Examples

Success response

JSON format

{
  "aggTaskGroupConfigHash": "a54136014dc386a92c83a6ef1e97ff22",
  "aggTaskGroupId": "aggTaskGroup-f4b8e50525cf41c894488c0c71ec483f",
  "aggTaskGroupName": "pipeline-aggtask-group",
  "requestId": "16C0A6D6-C3E7-511D-A60B-A87FD85F5BA7",
  "sourcePrometheusId": "rw-ecc04af14729b1a16e40a0d10068",
  "status": "Pending2Running"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.