Query the list of scheduled push tasks
Query the list of created scheduled push tasks. This list includes one-time scheduled push tasks and recurring loop push tasks.
Request parameters
Parameter name | Type | Required | Example | Description |
appId | String | Yes | ONEX570DA89211721 | The mPaaS App ID. |
workspaceId | String | Yes | test | The mPaaS workspace. |
startTime | long | Yes | 1619798400000 | The start UNIX timestamp to trigger the scheduled push. This is not the creation time of the task. |
endTime | long | Yes | 1630425600000 | The end UNIX timestamp to trigger the scheduled push. |
type | int | No | 0 | Push method:
|
uniqueId | String | No | 49ec0ed5a2a642bcbe139a2d7a419d6d | The unique ID of the scheduled push task. If you provide the ID of a parent task, information about all its subtasks is returned. If you provide the ID of a subtask, information about that subtask is returned. |
pageNumber | int | No | 1 | The page number. Default value: 1. |
pageSize | int | No | 10 | The number of entries per page. Default value: 500. |
Response parameters
Parameter Name | Type | Example | Description |
RequestId | String | B589F4F4-CD68-3CE5-BDA0-6597F33E23916512 | The request ID. |
ResultCode | String | OK | The result code of the request. |
ResultMessage | String | param is invalid | The description of the request error. |
ResultContent | JSON | The response content. | |
data | JSON | The response content. This parameter is included in the | |
totalCount | int | 10 | The total number of entries. |
list | JSONArray | The array of tasks. | |
uniqueId | String | 56918166720e46e1bcc40195c9ca71db | The unique ID of the scheduled push task.
|
parentId | String | 56918166720e46e1bcc40195c9ca71db | The ID of the parent scheduled push task.
|
pushTime | Date | 1630486972000 | The scheduled push time. |
pushTitle | String | Test title | The notification title. |
pushContent | String | Test content | The notification content. |
type | int | 0 | The push method is as follows:
|
deliveryType | int | 1 | The push type. Valid values:
|
strategyType | int | 1 | The push policy type. Valid values:
|
executedStatus | int | 0 | Specify whether to execute:
|
createType | int | 0 | The creation method. Valid values:
|
gmtCreate | Date | 1629971346000 | The creation time. |
Examples
import com.alibaba.fastjson.JSON;
import com.aliyun.mpaas20201028.Client;
import com.aliyun.mpaas20201028.models.QueryPushSchedulerListRequest;
import com.aliyun.mpaas20201028.models.QueryPushSchedulerListResponse;
import com.aliyun.teaopenapi.models.Config;
public static void main(String[] args) throws Exception {
// An Alibaba Cloud account AccessKey has full access to all APIs. Use a Resource Access Management (RAM) user for API calls and routine O&M.
// Do not hard-code your AccessKey ID and AccessKey secret in your project code. Otherwise, the AccessKey pair may be leaked and threaten the security of all your resources.
// This example shows how to store the AccessKey ID and AccessKey secret in environment variables. You can also store them in a configuration file as needed.
// Configure the environment variables first.
Config config = new Config();
// Required. Your AccessKey ID.
config.setAccessKeyId(System.getenv("MPAAS_AK_ENV"));
// Required. Your AccessKey secret.
config.setAccessKeySecret(System.getenv("MPAAS_SK_ENV"));
// The REGION_ID and Endpoint of mPaaS. This example uses a non-financial instance in Hangzhou.
config.setRegionId("cn-hangzhou");
config.setEndpoint("mpaas.cn-hangzhou.aliyuncs.com");
Client client = new Client(config);
QueryPushSchedulerListRequest request = new QueryPushSchedulerListRequest();
request.setAppId("ONEX570DA89211721");
request.setWorkspaceId("test");
request.setTenantId("xxx");
request.setStartTime(Long.valueOf("1764864000000"));
request.setEndTime(Long.valueOf("1764950219999"));
request.setType(0);
request.setUniqueId("49ec0ed5a2a642bcbe139a2d7a419d6d");
request.setPageNumber(1);
request.setPageSize(10);
QueryPushSchedulerListResponse queryPushSchedulerListResponse = client.queryPushSchedulerList(request);
System.out.println("response==>"+ JSON.toJSONString(queryPushSchedulerListResponse));
}Cancel a scheduled push task
Cancel scheduled push tasks that have not yet been executed, including loop tasks. Batch cancellation is supported.
Request parameters
Parameter name | Type | Required | Example | Description |
appId | String | Yes | ONEX570DA89211721 | The mPaaS App ID. |
workspaceId | String | Yes | test | The mPaaS workspace. |
type | int | No | 0 | The type of scheduled push task ID. Default value: 0.
|
uniqueIds | String | Yes | 714613eb,714613ec,714613ed | The unique IDs of the scheduled push tasks. Separate multiple IDs with commas (,). You can specify up to 30 IDs. |
Response parameters
Parameter Name | Type | Example | Description |
RequestId | String | B589F4F4-CD68-3CE5-BDA0-6597F33E23916512 | The request ID. |
ResultCode | String | OK | The result code of the request. |
ResultMessage | String | param is invalid | The description of the request error. |
ResultContent | String | {714613eb=1,714613ed=0} | The cancellation result. 1 indicates success and 0 indicates failure. |
Examples
import com.alibaba.fastjson.JSON;
import com.aliyun.mpaas20201028.Client;
import com.aliyun.mpaas20201028.models.CancelPushSchedulerRequest;
import com.aliyun.mpaas20201028.models.CancelPushSchedulerResponse;
import com.aliyun.teaopenapi.models.Config;
public static void main(String[] args) throws Exception {
// An Alibaba Cloud account AccessKey has full access to all APIs. Use a Resource Access Management (RAM) user for API calls and routine O&M.
// Do not hard-code your AccessKey ID and AccessKey secret in your project code. Otherwise, the AccessKey pair may be leaked and threaten the security of all your resources.
// This example shows how to store the AccessKey ID and AccessKey secret in environment variables. You can also store them in a configuration file as needed.
// Configure the environment variables first.
Config config = new Config();
// Required. Your AccessKey ID.
config.setAccessKeyId(System.getenv("MPAAS_AK_ENV"));
// Required. Your AccessKey secret.
config.setAccessKeySecret(System.getenv("MPAAS_SK_ENV"));
// The REGION_ID and Endpoint of mPaaS. This example uses a non-financial instance in Hangzhou.
config.setRegionId("cn-hangzhou");
config.setEndpoint("mpaas.cn-hangzhou.aliyuncs.com");
Client client = new Client(config);
CancelPushSchedulerRequest request = new CancelPushSchedulerRequest();
request.setAppId("ONEX570DA89211721");
request.setWorkspaceId("test");
request.setTenantId("xxx");
request.setUniqueIds("49ec0ed5a2a642bcbe139a2d7a419d6d, 49ec0ed5a2a642bcbe139a2d7a419d6c");
CancelPushSchedulerResponse cancelPushSchedulerResponse = client.cancelPushScheduler(request);
System.out.println("response==>"+ JSON.toJSONString(cancelPushSchedulerResponse));
}