DescribeLockedSnapshots

Updated at:

Queries the lock information of snapshots, such as the lock status and lock configurations.

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 region ID. You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou

SnapshotIds

array

No

The snapshot IDs. Array length: 1 to 100.

string

No

The snapshot ID.

s-bp67acfmxazb4p****

LockStatus

string

No

The lock status. Valid values:

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

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

  • expired: The snapshot was locked, but the lock duration has ended and the lock has expired. The snapshot is currently unlocked and can be deleted.

compliance-cooloff

NextToken

string

No

The query token. Set the value to the NextToken parameter value returned by the previous API call.

caeba0bbb2be03f84eb48b699f0a****

MaxResults

integer

No

The number of entries per page during paging for a paged query. Maximum value: 100.

Default value:

  • If no Settings are specified or the Settings value is less than 10, the default value is 10.

  • If the Settings value is greater than 100, the default value is 100.

10

DryRun

boolean

No

Specifies whether to only precheck the request. Valid values:

  • true: The request is prechecked but not executed. The system checks whether required parameters are specified, the request format is valid, and service limits are met. If the request fails the precheck, an error is returned. If the request passes the precheck, the DryRunOperation error code is returned.

  • false: The request is prechecked and executed if it passes the precheck. This is the default value.

false

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The request ID.

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

NextToken

string

The query token returned by the current call.

caeba0bbb2be03f84eb48b699f0a****

LockedSnapshotsInfo

array<object>

The locked snapshots information.

object

The locked snapshot information.

SnapshotId

string

The snapshot ID.

s-bp67acfmxazb4p****

LockMode

string

The lock mode. Valid values:

  • compliance: The snapshot is locked in compliance mode. A snapshot locked in compliance mode cannot be unlocked by any user and can be deleted only after the lock duration expires. Users cannot shorten the lock duration, but users with the required RAM permissions can extend the lock duration at any time. When you lock a snapshot in compliance mode, you can optionally specify a cooling-off period.

compliance

LockStatus

string

The lock status. Valid values:

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

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

  • expired: The snapshot was locked, but the lock duration has ended and the lock has expired. The snapshot is currently unlocked and can be deleted.

compliance-cooloff

LockCreationTime

string

The time when the snapshot was locked. The time is displayed in the yyyy-MM-ddTHH:mm:ssZ format in accordance with the ISO 8601 standard. UTC+0 is used.

2025-10-15T10:00:00Z

CoolOffPeriod

integer

The cooling-off period in compliance mode. Unit: hours.

3

CoolOffPeriodExpiredTime

string

The time when the cooling-off period in compliance mode ends. The time is displayed in the yyyy-MM-ddTHH:mm:ssZ format in accordance with the ISO 8601 standard. UTC+0 is used.

2025-10-15T13:00:00Z

LockDuration

integer

The lock duration. The snapshot lock automatically expires after the lock duration ends. Unit: days.

1

LockDurationStartTime

string

The time when the lock duration starts. The time is displayed in the yyyy-MM-ddTHH:mm:ssZ format in accordance with the ISO 8601 standard. UTC+0 is used. If you lock a snapshot that is in the progressing state, the lock duration is calculated only after the snapshot enters the accomplished state.

2025-10-15T10:00:00Z

LockExpiredTime

string

The time when the lock expires. The time is displayed in the yyyy-MM-ddTHH:mm:ssZ format in accordance with the ISO 8601 standard. UTC+0 is used.

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.