All Products
Search
Document Center

Bastionhost:GetAutoOpsTask

Last Updated:Jun 24, 2026

Queries the details of a specified O&M task.

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

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

POST  HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

InstanceId

string

No

The instance ID of the bastion host.

Note

You can call the DescribeInstances operation to query this parameter.

bastionhost-cn-st220aw****

RegionId

string

No

The region ID of the bastion host.

Note

For the mapping between region IDs and region names, see Regions and zones.

cn-hangzhou

TaskId

string

Yes

The ID of the O&M task that you want to query.

7

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The request ID.

81500666-d7f5-4143-8329-0223cc738105

Task

object

The details of the O&M task.

AllowedOverTime

integer

The time when the approval of the O&M task was completed. This value is a UNIX timestamp. Unit: seconds.

1669965908

Comment

string

The remarks of the O&M task.

comment

Name

string

The name of the O&M task.

taskname

ScheduleTimeInfo

string

The execution plan of the O&M task.

  • ExecAt: If the value of ScheduleType is Manual, this parameter is not meaningful. If the value of ScheduleType is FixTime, this parameter indicates the scheduled execution time in seconds as a UNIX timestamp. If the value of ScheduleType is CycleInterval, this parameter indicates the first execution time in seconds as a UNIX timestamp.

  • PeriodNum: If the value of ScheduleType is Manual or FixTime, this parameter is not meaningful. If the value of ScheduleType is CycleInterval, this parameter indicates the interval for periodic execution.

  • PeriodUnit: If the value of ScheduleType is Manual or FixTime, this parameter is not meaningful. If the value of ScheduleType is CycleInterval, this parameter indicates the unit of the periodic execution interval. Valid values: hour and day.

{"ExecAt":0,"PeriodNum":0,"PeriodUnit":""}

ScheduleType

string

The scheduling type of the task.

  • FixTime: scheduled execution.

  • CycleInterval: periodic execution.

  • Manual: manual execution triggered by the user.

FixTime

Script

string

The content of the script to be executed by the O&M task. The value is Base64-encoded.

bHM=

ScriptId

integer

The ID of the script associated with the O&M task. This parameter is returned only when ScriptType is set to SpecificScript.

2

ScriptName

string

The name of the script associated with the O&M task.

name

ScriptType

string

The script type of the O&M task.

  • HandInput: manually entered script.

  • SpecificScript: associated existing script.

HandInput

TaskId

string

The ID of the O&M task.

1

TaskState

string

The status of the O&M task.

  • PendingApproval: pending approval.

  • Rejected: rejected.

  • Cancelled: cancelled.

  • PendingExecution: approved and waiting for execution.

  • PrepareRun: preparing to execute.

  • Running: executing.

  • Completed: execution completed.

  • Failed: execution failed.

PendingApproval

Examples

Success response

JSON format

{
  "RequestId": "81500666-d7f5-4143-8329-0223cc738105",
  "Task": {
    "AllowedOverTime": 1669965908,
    "Comment": "comment",
    "Name": "taskname",
    "ScheduleTimeInfo": "{\"ExecAt\":0,\"PeriodNum\":0,\"PeriodUnit\":\"\"}",
    "ScheduleType": "FixTime",
    "Script": "bHM=",
    "ScriptId": 2,
    "ScriptName": "name",
    "ScriptType": "HandInput",
    "TaskId": "1",
    "TaskState": "PendingApproval"
  }
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.