ListInventoryEntries - AWS Systems Manager

ListInventoryEntries

A list of inventory items returned by the request.

Request Syntax

{ "Filters": [ { "Key": "string", "Type": "string", "Values": [ "string" ] } ], "InstanceId": "string", "MaxResults": number, "NextToken": "string", "TypeName": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

Filters

One or more filters. Use a filter to return a more specific list of results.

Type: Array of InventoryFilter objects

Array Members: Minimum number of 1 item. Maximum number of 5 items.

Required: No

InstanceId

The managed node ID for which you want inventory information.

Type: String

Pattern: (^i-(\w{8}|\w{17})$)|(^mi-\w{17}$)

Required: Yes

MaxResults

The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.

Type: Integer

Valid Range: Minimum value of 1. Maximum value of 50.

Required: No

NextToken

The token for the next set of items to return. (You received this token from a previous call.)

Type: String

Required: No

TypeName

The type of inventory item for which you want information.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 100.

Pattern: ^(AWS|Custom):.*$

Required: Yes

Response Syntax

{ "CaptureTime": "string", "Entries": [ { "string" : "string" } ], "InstanceId": "string", "NextToken": "string", "SchemaVersion": "string", "TypeName": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

CaptureTime

The time that inventory information was collected for the managed nodes.

Type: String

Pattern: ^(20)[0-9][0-9]-(0[1-9]|1[012])-([12][0-9]|3[01]|0[1-9])(T)(2[0-3]|[0-1][0-9])(:[0-5][0-9])(:[0-5][0-9])(Z)$

Entries

A list of inventory items on the managed nodes.

Type: Array of string to string maps

Array Members: Minimum number of 0 items. Maximum number of 10000 items.

Map Entries: Minimum number of 0 items. Maximum number of 50 items.

Key Length Constraints: Minimum length of 1. Maximum length of 64.

Value Length Constraints: Minimum length of 0. Maximum length of 4096.

InstanceId

The managed node ID targeted by the request to query inventory information.

Type: String

Pattern: (^i-(\w{8}|\w{17})$)|(^mi-\w{17}$)

NextToken

The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.

Type: String

SchemaVersion

The inventory schema version used by the managed nodes.

Type: String

Pattern: ^([0-9]{1,6})(\.[0-9]{1,6})$

TypeName

The type of inventory item returned by the request.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 100.

Pattern: ^(AWS|Custom):.*$

Errors

For information about the errors that are common to all actions, see Common Errors.

InternalServerError

An error occurred on the server side.

HTTP Status Code: 500

InvalidFilter

The filter name isn't valid. Verify the you entered the correct name and try again.

HTTP Status Code: 400

InvalidInstanceId

The following problems can cause this exception:

  • You don't have permission to access the managed node.

  • AWS Systems Manager Agent (SSM Agent) isn't running. Verify that SSM Agent is running.

  • SSM Agent isn't registered with the SSM endpoint. Try reinstalling SSM Agent.

  • The managed node isn't in a valid state. Valid states are: Running, Pending, Stopped, and Stopping. Invalid states are: Shutting-down and Terminated.

HTTP Status Code: 400

InvalidNextToken

The specified token isn't valid.

HTTP Status Code: 400

InvalidTypeNameException

The parameter type name isn't valid.

HTTP Status Code: 400

Examples

Example

This example illustrates one usage of ListInventoryEntries.

Sample Request

POST / HTTP/1.1 Host: ssm.us-east-2.amazonaws.com Accept-Encoding: identity X-Amz-Target: AmazonSSM.ListInventoryEntries Content-Type: application/x-amz-json-1.1 User-Agent: aws-cli/1.17.12 Python/3.6.8 Darwin/18.7.0 botocore/1.14.12 X-Amz-Date: 20240330T154930Z Authorization: AWS4-HMAC-SHA256 Credential=AKIAIOSFODNN7EXAMPLE/20240330/us-east-2/ssm/aws4_request, SignedHeaders=content-type;host;x-amz-date;x-amz-target, Signature=39c3b3042cd2aEXAMPLE Content-Length: 68 { "InstanceId": "i-04bf6ad63bEXAMPLE", "TypeName": "AWS:Application" }

Sample Response

{ "CaptureTime": "2020-03-30T15:45:32Z", "Entries": [ { "Architecture": "i386", "InstalledTime": "2020-01-15T00:00:00Z", "Name": "AWS Tools for Windows", "PackageId": "{2088D019-97CC-4349-BA45-9777568EAE94}", "Publisher": "Amazon Web Services Developer Relations", "Version": "3.15.925" }, { "Architecture": "i386", "Name": "Amazon SSM Agent", "PackageId": "{2a4673c2-68c6-4a4c-9be6-c3b1be96fdff}", "Publisher": "Amazon Web Services", "Version": "2.3.930.0" }, { "Architecture": "x86_64", "InstalledTime": "2018-10-14T00:00:00Z", "Name": "aws-cfn-bootstrap", "PackageId": "{34CD0CCF-195B-4BC5-B409-D44EB9A129C8}", "Publisher": "Amazon Web Services", "Version": "1.4.31" }, { "Architecture": "x86_64", "InstalledTime": "2020-03-10T00:00:00Z", "Name": "PowerShell 7-x64", "PackageId": "{B324E508-9AAE-446A-BC4C-BB446E8C2A18}", "Publisher": "Microsoft Corporation", "Version": "7.0.0.0" }, { "Architecture": "x86_64", "InstalledTime": "2019-09-06T00:00:00Z", "Name": "AWS PV Drivers", "PackageId": "{C1F68A8D-F235-4886-87B0-150107C07EDA}", "Publisher": "Amazon Web Services", "Version": "8.3.2" } ], "InstanceId": "i-04bf6ad63bEXAMPLE", "SchemaVersion": "1.1", "TypeName": "AWS:Application" }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: