Menu
AWS IoT
Developer Guide

ListPrincipalPolicies

Lists the policies attached to the specified principal. If you use an Cognito identity, the ID must be in AmazonCognito Identity format.

Note: This API is deprecated. Please use ListAttachedPolicies instead.

Request syntax:

GET /principal-policies?marker=marker&pageSize=pageSize&isAscendingOrder=ascendingOrder x-amzn-iot-principal: principal

URI Request Parameters:

Name

Type

Req?

Description

principal

Principal

yes

The principal.

marker

Marker

no

The marker for the next set of results.

pageSize

PageSize

no

The result page size.

ascendingOrder

AscendingOrder

no

Specifies the order for results. If true, results are returned in ascending creation order.

Response syntax:

Content-type: application/json { "policies": [ { "policyName": "string", "policyArn": "string" } ], "nextMarker": "string" }

Response Body Parameters:

Name

Type

Req?

Description

policies

Policies

no

The policies.

nextMarker

Marker

no

The marker for the next set of results, or null if there are no additional results.

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-principal-policies \ --principal <value> \ [--marker <value>] \ [--page-size <value>] \ [--ascending-order | --no-ascending-order] \ [--cli-input-json <value>] \ [--generate-cli-skeleton]

cli-input-json format:

{ "principal": "string", "marker": "string", "pageSize": "integer", "ascendingOrder": "boolean" }

cli-input-json fields:

Name

Type

Description

principal

string

The principal.

marker

string

pattern: [A-Za-z0-9+/]+={0,2}

The marker for the next set of results.

pageSize

integer

java class: java.lang.Integer

range- max:250 min:1

The result page size.

ascendingOrder

boolean

Specifies the order for results. If true, results are returned in ascending creation order.

Output:

{ "policies": [ { "policyName": "string", "policyArn": "string" } ], "nextMarker": "string" }

cli output fields:

Name

Type

Description

policies

list

member: Policy

java class: java.util.List

The policies.

Policy

Policy

policyName

string

length max:128 min:1

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

The policy name.

policyArn

string

The policy ARN.

nextMarker

string

pattern: [A-Za-z0-9+/]+={0,2}

The marker for the next set of results, or null if there are no additional results.

On this page: