All Products
Search
Document Center

Bastionhost:GetAutoOpsTask

Last Updated:Sep 20, 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

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

yundun-bastionhost:GetAutoOpsTask

none

*Instance

acs:yundun-bastionhost:{#regionId}:{#accountId}:instance/{#InstanceId}

None None

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 invoke the DescribeInstances operation to obtain 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 to query.

7

ProjectId

integer

No

The project ID.

3

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The unique request ID generated by Alibaba Cloud for this request.

81500666-d7f5-4143-8329-0223cc738105

Task

object

The details of the O&M task.

AllowedOverTime

integer

The time when the O&M task approval was completed, in seconds and in timestamp format.

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 ScheduleType value is Manual, this parameter is not applicable. If the ScheduleType value is FixTime, this parameter indicates the scheduled execution time, in seconds and in timestamp format. If the ScheduleType value is CycleInterval, this parameter indicates the first execution time, in seconds and in timestamp format.

  • PeriodNum: If the ScheduleType value is Manual or FixTime, this parameter is not applicable. If the ScheduleType value is CycleInterval, this parameter indicates the interval between cyclic executions.

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

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

ScheduleType

string

The scheduling type of the task. Valid values:

  • FixTime: Scheduled execution.

  • CycleInterval: Cyclic execution.

  • Manual: Manually triggered by the user.

FixTime

Script

string

The script content 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. Valid values:

  • HandInput: Manually entered script.

  • SpecificScript: Associated with an existing script.

HandInput

TaskId

string

The ID of the O&M task.

1

TaskState

string

The status of the O&M task. Valid values:

  • PendingApproval: Pending approval.

  • Rejected: Rejected.

  • Cancelled: Cancelled.

  • PendingExecution: Approved and waiting for execution.

  • PrepareRun: Preparing for execution.

  • Running: Running.

  • Completed: Completed.

  • Failed: 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.