首页 DescribeLockedSnapshots

DescribeLockedSnapshots

更新时间: 2026-04-04 17:45:15

Retrieves lock information for a snapshot, such as its lock status and settings.

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

ecs:DescribeLockedSnapshots

list

Snapshot

acs:ecs:{#regionId}:{#accountId}:snapshot/*

Snapshot

acs:ecs:{#regionId}:{#accountId}:snapshot/{#SnapshotId}

None None

Request parameters

Parameter

Type

Required

Description

Example

RegionId

string

Yes

The ID of the region. You can call the DescribeRegions operation to query the latest list of Alibaba Cloud regions.

cn-hangzhou

SnapshotIds

array

No

An array of 1 to 100 snapshot IDs.

string

No

The snapshot ID.

s-bp67acfmxazb4p****

LockStatus

string

No

The lock status of the snapshot. Valid values:

  • compliance-cooloff: The snapshot is locked in compliance mode but is still in the cool-off period. The snapshot cannot be deleted, but a user with the required RAM permissions can unlock the snapshot, extend or shorten the cool-off period, and extend or shorten the lock duration.

  • compliance: The snapshot is locked in compliance mode and the cool-off period has ended. The snapshot cannot be unlocked or deleted, but a user with the required RAM permissions can extend the lock duration.

  • expired: The lock on the snapshot has expired, and the snapshot can be deleted.

compliance-cooloff

NextToken

string

No

The token used to retrieve the next page of results. Set this parameter to the NextToken value from the previous request.

caeba0bbb2be03f84eb48b699f0a****

MaxResults

integer

No

The number of entries to return on each page. Maximum value: 100.

Default value:

  • If you do not specify this parameter or you specify a value that is less than 10, the default value is 10.

  • If you specify a value greater than 100, a value of 100 is used.

10

DryRun

boolean

No

Specifies whether to perform a dry run. Valid values:

  • true: performs a dry run without performing the actual operation. The system checks for required parameters, the request format, and service limits. If the check fails, an error is returned. If the check passes, the DryRunOperation error code is returned.

  • false (default): sends a normal request. The system performs the operation if the request is valid.

false

Response elements

Element

Type

Description

Example

object

Schema of the response

RequestId

string

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3****

NextToken

string

The token used to retrieve the next page of results. If this parameter is not returned, it indicates that all results have been returned.

caeba0bbb2be03f84eb48b699f0a****

LockedSnapshotsInfo

array<object>

A list of locked snapshots.

object

Details about a locked snapshot.

SnapshotId

string

The snapshot ID.

s-bp67acfmxazb4p****

LockMode

string

The lock mode. The only possible value is:

  • compliance: A snapshot in compliance mode cannot be unlocked and can be deleted only after its lock duration expires. The lock duration cannot be shortened after the cool-off period ends, but a user with the required RAM permission can extend it at any time. When you lock a snapshot in compliance mode, you can optionally specify a cool-off period.

compliance

LockStatus

string

The lock status. Possible values:

  • compliance-cooloff: The snapshot is locked in compliance mode and is within its cool-off period. The snapshot cannot be deleted. However, a user with the required RAM permission can unlock the snapshot, or extend or shorten the cool-off period and the lock duration.

  • compliance: The snapshot is locked in compliance mode, and the cool-off period has ended. The snapshot cannot be unlocked or deleted, but a user with the required RAM permission can extend the lock duration.

  • expired: The lock on the snapshot has expired. The snapshot is unlocked and can be deleted.

compliance-cooloff

LockCreationTime

string

The time when the snapshot was locked, in UTC. The time is formatted as yyyy-MM-ddTHH:mm:ssZ in compliance with the ISO 8601 standard.

2025-10-15T10:00:00Z

CoolOffPeriod

integer

The duration of the cool-off period in compliance mode, in hours.

3

CoolOffPeriodExpiredTime

string

The time when the cool-off period ends, in UTC. The time is formatted as yyyy-MM-ddTHH:mm:ssZ in compliance with the ISO 8601 standard.

2025-10-15T13:00:00Z

LockDuration

integer

The duration of the lock in days. The snapshot is automatically unlocked when this duration expires.

1

LockDurationStartTime

string

The time when the lock duration starts, in UTC. The time is formatted as yyyy-MM-ddTHH:mm:ssZ in compliance with the ISO 8601 standard. If you lock a snapshot that is in the progressing state, the lock duration starts only after the snapshot enters the accomplished state.

2025-10-15T10:00:00Z

LockExpiredTime

string

The time when the lock expires, in UTC. The time is formatted as yyyy-MM-ddTHH:mm:ssZ in compliance with the ISO 8601 standard.

2025-10-16T10:00:00Z

Examples

Success response

JSON format

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****",
  "NextToken": "caeba0bbb2be03f84eb48b699f0a****",
  "LockedSnapshotsInfo": [
    {
      "SnapshotId": "s-bp67acfmxazb4p****",
      "LockMode": "compliance",
      "LockStatus": "compliance-cooloff",
      "LockCreationTime": "2025-10-15T10:00:00Z",
      "CoolOffPeriod": 3,
      "CoolOffPeriodExpiredTime": "2025-10-15T13:00:00Z",
      "LockDuration": 1,
      "LockDurationStartTime": "2025-10-15T10:00:00Z",
      "LockExpiredTime": "2025-10-16T10:00:00Z"
    }
  ]
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidLockStatus.Malformed The specified parameter LockStatus is invalid. Please check the valid range for this parameter. The specified parameter LockStatus is invalid. Please check the valid range for this parameter.
404 InvalidSnapshotLock.NotFound The specified snapshot(s) %s is(are) not locked. The specified snapshot is not locked.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.

阿里云首页 云服务器 ECS 相关技术圈