Menu
AWS IoT
Developer Guide

ListPolicyVersions

Lists the versions of the specified policy and identifies the default version.

Request syntax:

GET /policies/policyName/version

URI Request Parameters:

Name

Type

Req?

Description

policyName

PolicyName

yes

The policy name.

Response syntax:

Content-type: application/json { "policyVersions": [ { "versionId": "string", "isDefaultVersion": "boolean", "createDate": "timestamp" } ] }

Response Body Parameters:

Name

Type

Req?

Description

policyVersions

PolicyVersions

no

The policy versions.

Errors:

ResourceNotFoundException

The specified resource does not exist.

HTTP response code: 404

InvalidRequestException

The contents of the request were invalid. For example, this code is returned when an UpdateJobExecution request contains invalid status details. The message contains details about the error.

HTTP response code: 400

ThrottlingException

The rate exceeds the limit.

HTTP response code: 429

UnauthorizedException

You are not authorized to perform this operation.

HTTP response code: 401

ServiceUnavailableException

The service is temporarily unavailable.

HTTP response code: 503

InternalFailureException

An unexpected error has occurred.

HTTP response code: 500

CLI

Synopsis:

aws iot list-policy-versions \ --policy-name <value> \ [--cli-input-json <value>] \ [--generate-cli-skeleton]

cli-input-json format:

{ "policyName": "string" }

cli-input-json fields:

Name

Type

Description

policyName

string

length max:128 min:1

pattern: [w+=,.@-]+

The policy name.

Output:

{ "policyVersions": [ { "versionId": "string", "isDefaultVersion": "boolean", "createDate": "timestamp" } ] }

cli output fields:

Name

Type

Description

policyVersions

list

member: PolicyVersion

java class: java.util.List

The policy versions.

PolicyVersion

PolicyVersion

versionId

string

pattern: [0-9]+

The policy version ID.

isDefaultVersion

boolean

Specifies whether the policy version is the default.

createDate

timestamp

The date and time the policy was created.

On this page: