Modifies a scheduled task.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request headers

This operation uses only the common request headers. For more information, see Common request parameters.

Request syntax

PUT /v4/openapi/app-groups/[appGroupIdentity]/scheduled-tasks/[taskId] HTTP/1.1

Request parameters

Parameter Type Position Required Example Description
appGroupIdentity String Path Yes "my_app_group_name"

The name of the application.

taskId String Path Yes "2f12c585-5873-11ea-974a-7cd30ad3e268"

The ID of the scheduled task.

Request body

Parameter

Type

Required

Example

Description

cron

String

No

"10 20 * * 1,2,3,4,5"

The configurations of the scheduled task.

For more information, see the cron field in ScheduledTask.

enabled

Boolean

No

true

Specifies whether to enable the scheduled task.

filter

Object

No

The filter condition for data cleaning.

filter.days

Integer

--

7

The validity period, in days.

Valid values: [7,180].

filter.unit

String

--

"s"

The unit to which the validity period is converted. Valid values:

  • s
  • ms

filter.field

String

--

"cate_id"

The field for which you want to clean the expired data.

Response parameters

Parameter Type Example Description
requestId String D77D0DAF-790D-F5F5-A9C0-133738165014

The ID of the request.

result Map (Array|Object)

The details of the scheduled task.

Examples

Sample requests

PUT /v4/openapi/app-groups/110091051/scheduled-tasks/63ff2d58-5871-11ea-974a-7cd30ad3e268

{
  "cron": "0 0 * * 1,2,3,4,5,6,7",
  "enabled": true,
  "filter": {
    "field": "cat_id",
    "days": 30,
    "unit": "s"
  }
}

Sample success responses

XML format

<requestId>0EDC7096-400E-4384-FFB0-52E0B4BDE63B</requestId>
<result>
    <id>63ff2d58-5871-11ea-974a-7cd30ad3e268</id>
    <progress>0</progress>
    <status>3</status>
    <lastRanTimestamp/>
    <type>wipe</type>
    <running>false</running>
    <paused>false</paused>
    <finished>false</finished>
    <idle>true</idle>
    <created>1582705462</created>
    <updated>1582705462</updated>
    <cron>0 0 * * 1,2,3,4,5,6,7</cron>
    <enabled>true</enabled>
    <appId/>
    <appGroupId>110091051</appGroupId>
    <ownerId>84</ownerId>
    <lastScheduledTimestamp/>
    <forkedAppId/>
    <appGroup>
        <id>110091051</id>
    </appGroup>
    <owner>
        <id>84</id>
    </owner>
    <filter>
        <field>cat_id</field>
        <days>30</days>
        <unit>s</unit>
    </filter>
</result>

JSON format

{
    "requestId": "0EDC7096-400E-4384-FFB0-52E0B4BDE63B",
    "result": {
        "id": "63ff2d58-5871-11ea-974a-7cd30ad3e268",
        "progress": 0,
        "status": 3,
        "lastRanTimestamp": "",
        "type": "wipe",
        "running": false,
        "paused": false,
        "finished": false,
        "idle": true,
        "created": 1582705462,
        "updated": 1582705462,
        "cron": "0 0 * * 1,2,3,4,5,6,7",
        "enabled": true,
        "appId": "",
        "appGroupId": 110091051,
        "ownerId": 84,
        "lastScheduledTimestamp": "",
        "forkedAppId": "",
        "appGroup": {
            "id": 110091051
        },
        "owner": {
            "id": 84
        },
        "filter": {
            "field": "cat_id",
            "days": 30,
            "unit": "s"
        }
    }
}

Error codes

For a list of error codes, visit the API Error Center.