UpdateAggTaskGroup

Updated at:

Applies 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:UpdateAggTaskGroup

update

*AggTaskGroup

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

None None

Request syntax

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

Path Parameters

Parameter

Type

Required

Description

Example

instanceId

string

Yes

The Prometheus instance ID of the aggregation node group. Aggregation nodes read data from this instance.

rw-pq4apob9jm

groupId

string

Yes

The ID of the aggregation task group.

aggTaskGroup-xxxx

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

No

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, in seconds. Default value: 30.

30

description

string

No

The description of the aggregation task group.

desc

fromTime

integer

No

The timestamp of the scheduling start time, in seconds.

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, in seconds. Default value: 600.

600

precheckString

string

No

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

{"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-rate scheduling.

  • Cron :

    Cron expression scheduling.

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 :

    Stopped.

  • Running :

    Running.

Running

tags

array<object>

No

The tags of the resource group.

object

No

The tag.

key

string

No

The key of the tag.

key1

value

string

No

The value of the tag.

value1

targetPrometheusId

string

Yes

The target Prometheus instance ID of the aggregation node group.

rw-pq4apob9jm

toTime

integer

No

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

0

Response elements

Element

Type

Description

Example

object

The response struct.

requestId

string

The request ID.

8FDE2569-626B-5176-9844-28877A*****

aggTaskGroupConfigHash

string

The hash of the aggregation task group configuration.

a54136014dc386a92c83a6ef1e97ff22

aggTaskGroupId

string

The ID of the aggregation task group.

aggTaskGroup-5fb2c3ade63a4709bcb059d13493b7b8

aggTaskGroupName

string

The name of the aggregation task group.

pipeline-aggtask-group

sourcePrometheusId

string

The ID of the source Prometheus instance for the aggregation task group.

rw-083e17834e279f8c627fe91a2d72

status

string

The current status of the aggregation task group.

Running

Examples

Success response

JSON format

{
  "requestId": "8FDE2569-626B-5176-9844-28877A*****",
  "aggTaskGroupConfigHash": "a54136014dc386a92c83a6ef1e97ff22",
  "aggTaskGroupId": "aggTaskGroup-5fb2c3ade63a4709bcb059d13493b7b8",
  "aggTaskGroupName": "pipeline-aggtask-group",
  "sourcePrometheusId": "rw-083e17834e279f8c627fe91a2d72",
  "status": "Running"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.