- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
ListDevicesCommand
Returns a list of devices.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { PanoramaClient, ListDevicesCommand } from "@aws-sdk/client-panorama"; // ES Modules import
// const { PanoramaClient, ListDevicesCommand } = require("@aws-sdk/client-panorama"); // CommonJS import
const client = new PanoramaClient(config);
const input = { // ListDevicesRequest
NextToken: "STRING_VALUE",
MaxResults: Number("int"),
SortBy: "STRING_VALUE",
SortOrder: "STRING_VALUE",
NameFilter: "STRING_VALUE",
DeviceAggregatedStatusFilter: "STRING_VALUE",
};
const command = new ListDevicesCommand(input);
const response = await client.send(command);
// { // ListDevicesResponse
// Devices: [ // DeviceList // required
// { // Device
// DeviceId: "STRING_VALUE",
// Name: "STRING_VALUE",
// CreatedTime: new Date("TIMESTAMP"),
// ProvisioningStatus: "STRING_VALUE",
// LastUpdatedTime: new Date("TIMESTAMP"),
// LeaseExpirationTime: new Date("TIMESTAMP"),
// Brand: "STRING_VALUE",
// CurrentSoftware: "STRING_VALUE",
// Description: "STRING_VALUE",
// Tags: { // TagMap
// "<keys>": "STRING_VALUE",
// },
// Type: "STRING_VALUE",
// LatestDeviceJob: { // LatestDeviceJob
// ImageVersion: "STRING_VALUE",
// Status: "STRING_VALUE",
// JobType: "STRING_VALUE",
// },
// DeviceAggregatedStatus: "STRING_VALUE",
// },
// ],
// NextToken: "STRING_VALUE",
// };
ListDevicesCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
DeviceAggregatedStatusFilter | DeviceAggregatedStatus | undefined | Filter based on a device's status. |
MaxResults | number | undefined | The maximum number of devices to return in one page of results. |
NameFilter | string | undefined | Filter based on device's name. Prefixes supported. |
NextToken | string | undefined | Specify the pagination token from a previous request to retrieve the next page of results. |
SortBy | ListDevicesSortBy | undefined | The target column to be sorted on. Default column sort is CREATED_TIME. |
SortOrder | SortOrder | undefined | The sorting order for the returned list. SortOrder is DESCENDING by default based on CREATED_TIME. Otherwise, SortOrder is ASCENDING. |
ListDevicesCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
Devices Required | Device[] | undefined | A list of devices. |
NextToken | string | undefined | A pagination token that's included if more results are available. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
AccessDeniedException | client | The requestor does not have permission to access the target action or resource. |
ConflictException | client | The target resource is in use. |
InternalServerException | server | An internal error occurred. |
ValidationException | client | The request contains an invalid parameter value. |
PanoramaServiceException | Base exception class for all service exceptions from Panorama service. |