Help Center/ Cloud Application Engine/ API Reference/ CAE API/ Scheduled start/stop policy./ Obtaining the Scheduled Start/Stop Policy List
Updated on 2025-10-22 GMT+08:00

Obtaining the Scheduled Start/Stop Policy List

Function

Obtain the scheduled start/stop policy list.

URI

GET /v1/{project_id}/cae/timer-rules

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. See Obtaining a Project ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

  • Obtain the token. For details, see "Obtaining a User Token" in Identity and Access Management API Reference (https://support.huaweicloud.com/intl/en-us/api-iam/iam_30_0001.html).

  • The value of X-Subject-Token in the response header is the token value.

X-Enterprise-Project-ID

No

String

Enterprise project ID.

  • When an environment is created, it will be bound with an enterprise project ID.

  • Enter 0 or up to 36 characters in UUID format with hyphens (-).

  • If this parameter is not specified or set to 0, resources in the default enterprise project are queried.

NOTE:
For details about how to obtain enterprise project IDs and enterprise project features, see Enterprise Management User Guide.

X-Environment-ID

Yes

String

Environment ID.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

api_version

String

API version. Fixed value: v1.

kind

String

API type. Fixed value: TimerRule.

items

Array of TimerRuleDetails objects

List of start/stop policies.

Table 4 TimerRuleDetails

Parameter

Type

Description

id

String

ID of a scheduled start/stop policy. This parameter is ignored during policy creation.

name

String

Name of a scheduled start/stop policy.

type

String

Policy type. Options: stop and start.

status

String

Policy status. Options: on and off.

env_id

String

Environment ID.

apps

Array of AppInfo objects

Applications to which the scheduled start/stop policy applies. This parameter is mandatory only when effective_range is set to application.

components

Array of ComponentInfo objects

Components to which the scheduled start/stop policy applies. This parameter is mandatory only when effective_range is set to component.

component_number

Integer

Number of components to which a scheduled start/stop policy applies. This parameter is ignored during policy creation.

cron

String

Cron expression.

effective_range

String

Scope to which a policy applies. Options: component, application, and environment.

effective_policy

String

Trigger mode. Options: onetime and periodic.

last_execution_status

String

Status of the last execution. Options: abnormal, normal, and executing. This parameter is ignored during policy creation.

timezone_offset

String

Time zone offset in the scheduled start/stop rule. For example, +8 for Beijing time.

Table 5 AppInfo

Parameter

Type

Description

app_id

String

Application ID.

app_name

String

Application name.

Table 6 ComponentInfo

Parameter

Type

Description

component_id

String

Component ID.

component_name

String

Component name.

Example Requests

Obtain the scheduled start/stop policy list.

GET https://{endpoint}/v1/{project_id}/cae/timer-rules

Example Responses

Status code: 200

OK

{
  "api_version" : "v1",
  "kind" : "TimerRule",
  "items" : [ {
    "id" : "string",
    "name" : "string",
    "type" : "start",
    "env_id" : "string",
    "cron" : "0 16 17 31 1 ? 2023",
    "component_number" : 2,
    "status" : "off",
    "last_execution_status" : "normal",
    "effective_range" : "application",
    "effective_policy" : "onetime",
    "timezone_offset" : "+8",
    "apps" : [ {
      "app_id" : "string",
      "app_name" : "string"
    } ]
  }, {
    "id" : "string",
    "name" : "string",
    "type" : "start",
    "env_id" : "string",
    "cron" : "0 48 17 ? * * *",
    "component_number" : 2,
    "status" : "on",
    "last_execution_status" : "abnormal",
    "effective_range" : "environment",
    "effective_policy" : "periodic",
    "timezone_offset" : "+8"
  }, {
    "id" : "string",
    "name" : "string",
    "type" : "stop",
    "env_id" : "string",
    "cron" : "0 16 17 31 1 ? 2023",
    "component_number" : 2,
    "status" : "off",
    "last_execution_status" : "executing",
    "effective_range" : "component",
    "effective_policy" : "onetime",
    "timezone_offset" : "+8",
    "components" : [ {
      "component_id" : "string",
      "component_name" : "string"
    } ]
  } ]
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.