Skip to content

Commit 91c5fc6

Browse files
author
awstools
committed
feat(client-panorama): Support sorting and filtering in ListDevices API, and add more fields to device listings and single device detail
1 parent ab82210 commit 91c5fc6

File tree

3 files changed

+323
-10
lines changed

3 files changed

+323
-10
lines changed

clients/client-panorama/src/models/models_0.ts

Lines changed: 116 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1042,6 +1042,18 @@ export interface NetworkStatus {
10421042
LastUpdatedTime?: Date;
10431043
}
10441044

1045+
export enum DeviceAggregatedStatus {
1046+
AWAITING_PROVISIONING = "AWAITING_PROVISIONING",
1047+
DELETING = "DELETING",
1048+
ERROR = "ERROR",
1049+
FAILED = "FAILED",
1050+
LEASE_EXPIRED = "LEASE_EXPIRED",
1051+
OFFLINE = "OFFLINE",
1052+
ONLINE = "ONLINE",
1053+
PENDING = "PENDING",
1054+
UPDATE_NEEDED = "UPDATE_NEEDED",
1055+
}
1056+
10451057
export enum DeviceConnectionStatus {
10461058
AWAITING_CREDENTIALS = "AWAITING_CREDENTIALS",
10471059
ERROR = "ERROR",
@@ -1050,6 +1062,31 @@ export enum DeviceConnectionStatus {
10501062
ONLINE = "ONLINE",
10511063
}
10521064

1065+
export enum UpdateProgress {
1066+
COMPLETED = "COMPLETED",
1067+
DOWNLOADING = "DOWNLOADING",
1068+
FAILED = "FAILED",
1069+
IN_PROGRESS = "IN_PROGRESS",
1070+
PENDING = "PENDING",
1071+
REBOOTING = "REBOOTING",
1072+
VERIFYING = "VERIFYING",
1073+
}
1074+
1075+
/**
1076+
* <p>Returns information about the latest device job.</p>
1077+
*/
1078+
export interface LatestDeviceJob {
1079+
/**
1080+
* <p>The target version of the device software.</p>
1081+
*/
1082+
ImageVersion?: string;
1083+
1084+
/**
1085+
* <p>Status of the latest device job.</p>
1086+
*/
1087+
Status?: UpdateProgress | string;
1088+
}
1089+
10531090
/**
10541091
* <p>A static IP configuration.</p>
10551092
*/
@@ -1225,6 +1262,16 @@ export interface DescribeDeviceResponse {
12251262
* <p>The device's maker.</p>
12261263
*/
12271264
Brand?: DeviceBrand | string;
1265+
1266+
/**
1267+
* <p>A device's latest job. Includes the target image version, and the job status.</p>
1268+
*/
1269+
LatestDeviceJob?: LatestDeviceJob;
1270+
1271+
/**
1272+
* <p>A device's aggregated status. Including the device's connection status, provisioning status, and lease status.</p>
1273+
*/
1274+
DeviceAggregatedStatus?: DeviceAggregatedStatus | string;
12281275
}
12291276

12301277
export interface DescribeDeviceJobRequest {
@@ -1234,16 +1281,6 @@ export interface DescribeDeviceJobRequest {
12341281
JobId: string | undefined;
12351282
}
12361283

1237-
export enum UpdateProgress {
1238-
COMPLETED = "COMPLETED",
1239-
DOWNLOADING = "DOWNLOADING",
1240-
FAILED = "FAILED",
1241-
IN_PROGRESS = "IN_PROGRESS",
1242-
PENDING = "PENDING",
1243-
REBOOTING = "REBOOTING",
1244-
VERIFYING = "VERIFYING",
1245-
}
1246-
12471284
export interface DescribeDeviceJobResponse {
12481285
/**
12491286
* <p>The job's ID.</p>
@@ -1803,6 +1840,36 @@ export interface Device {
18031840
* <p>The device's maker.</p>
18041841
*/
18051842
Brand?: DeviceBrand | string;
1843+
1844+
/**
1845+
* <p>A device's current software.</p>
1846+
*/
1847+
CurrentSoftware?: string;
1848+
1849+
/**
1850+
* <p>A description for the device.</p>
1851+
*/
1852+
Description?: string;
1853+
1854+
/**
1855+
* <p>The device's tags.</p>
1856+
*/
1857+
Tags?: Record<string, string>;
1858+
1859+
/**
1860+
* <p>The device's type.</p>
1861+
*/
1862+
Type?: DeviceType | string;
1863+
1864+
/**
1865+
* <p>A device's latest job. Includes the target image version, and the update job status.</p>
1866+
*/
1867+
LatestDeviceJob?: LatestDeviceJob;
1868+
1869+
/**
1870+
* <p>A device's aggregated status. Including the device's connection status, provisioning status, and lease status.</p>
1871+
*/
1872+
DeviceAggregatedStatus?: DeviceAggregatedStatus | string;
18061873
}
18071874

18081875
/**
@@ -1998,6 +2065,18 @@ export interface ListApplicationInstancesResponse {
19982065
NextToken?: string;
19992066
}
20002067

2068+
export enum ListDevicesSortBy {
2069+
CREATED_TIME = "CREATED_TIME",
2070+
DEVICE_AGGREGATED_STATUS = "DEVICE_AGGREGATED_STATUS",
2071+
DEVICE_ID = "DEVICE_ID",
2072+
NAME = "NAME",
2073+
}
2074+
2075+
export enum SortOrder {
2076+
ASCENDING = "ASCENDING",
2077+
DESCENDING = "DESCENDING",
2078+
}
2079+
20012080
export interface ListDevicesRequest {
20022081
/**
20032082
* <p>Specify the pagination token from a previous request to retrieve the next page of results.</p>
@@ -2008,6 +2087,26 @@ export interface ListDevicesRequest {
20082087
* <p>The maximum number of devices to return in one page of results.</p>
20092088
*/
20102089
MaxResults?: number;
2090+
2091+
/**
2092+
* <p>The target column to be sorted on. Default column sort is CREATED_TIME.</p>
2093+
*/
2094+
SortBy?: ListDevicesSortBy | string;
2095+
2096+
/**
2097+
* <p>The sorting order for the returned list. SortOrder is DESCENDING by default based on CREATED_TIME. Otherwise, SortOrder is ASCENDING.</p>
2098+
*/
2099+
SortOrder?: SortOrder | string;
2100+
2101+
/**
2102+
* <p>Filter based on device's name. Prefixes supported.</p>
2103+
*/
2104+
NameFilter?: string;
2105+
2106+
/**
2107+
* <p>Filter based on a device's status.</p>
2108+
*/
2109+
DeviceAggregatedStatusFilter?: DeviceAggregatedStatus | string;
20112110
}
20122111

20132112
export interface ListDevicesResponse {
@@ -2784,6 +2883,13 @@ export const NetworkStatusFilterSensitiveLog = (obj: NetworkStatus): any => ({
27842883
...obj,
27852884
});
27862885

2886+
/**
2887+
* @internal
2888+
*/
2889+
export const LatestDeviceJobFilterSensitiveLog = (obj: LatestDeviceJob): any => ({
2890+
...obj,
2891+
});
2892+
27872893
/**
27882894
* @internal
27892895
*/

clients/client-panorama/src/protocols/Aws_restJson1.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ import {
126126
InternalServerException,
127127
Job,
128128
JobResourceTags,
129+
LatestDeviceJob,
129130
ManifestOverridesPayload,
130131
ManifestPayload,
131132
NetworkPayload,
@@ -726,6 +727,10 @@ export const serializeAws_restJson1ListDevicesCommand = async (
726727
const query: any = map({
727728
NextToken: [, input.NextToken!],
728729
MaxResults: [() => input.MaxResults !== void 0, () => input.MaxResults!.toString()],
730+
SortBy: [, input.SortBy!],
731+
SortOrder: [, input.SortOrder!],
732+
NameFilter: [, input.NameFilter!],
733+
DeviceAggregatedStatusFilter: [, input.DeviceAggregatedStatusFilter!],
729734
});
730735
let body: any;
731736
return new __HttpRequest({
@@ -1675,6 +1680,9 @@ export const deserializeAws_restJson1DescribeDeviceCommand = async (
16751680
if (data.Description != null) {
16761681
contents.Description = __expectString(data.Description);
16771682
}
1683+
if (data.DeviceAggregatedStatus != null) {
1684+
contents.DeviceAggregatedStatus = __expectString(data.DeviceAggregatedStatus);
1685+
}
16781686
if (data.DeviceConnectionStatus != null) {
16791687
contents.DeviceConnectionStatus = __expectString(data.DeviceConnectionStatus);
16801688
}
@@ -1684,6 +1692,9 @@ export const deserializeAws_restJson1DescribeDeviceCommand = async (
16841692
if (data.LatestAlternateSoftware != null) {
16851693
contents.LatestAlternateSoftware = __expectString(data.LatestAlternateSoftware);
16861694
}
1695+
if (data.LatestDeviceJob != null) {
1696+
contents.LatestDeviceJob = deserializeAws_restJson1LatestDeviceJob(data.LatestDeviceJob, context);
1697+
}
16871698
if (data.LatestSoftware != null) {
16881699
contents.LatestSoftware = __expectString(data.LatestSoftware);
16891700
}
@@ -3458,17 +3469,26 @@ const deserializeAws_restJson1Device = (output: any, context: __SerdeContext): D
34583469
output.CreatedTime != null
34593470
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.CreatedTime)))
34603471
: undefined,
3472+
CurrentSoftware: __expectString(output.CurrentSoftware),
3473+
Description: __expectString(output.Description),
3474+
DeviceAggregatedStatus: __expectString(output.DeviceAggregatedStatus),
34613475
DeviceId: __expectString(output.DeviceId),
34623476
LastUpdatedTime:
34633477
output.LastUpdatedTime != null
34643478
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.LastUpdatedTime)))
34653479
: undefined,
3480+
LatestDeviceJob:
3481+
output.LatestDeviceJob != null
3482+
? deserializeAws_restJson1LatestDeviceJob(output.LatestDeviceJob, context)
3483+
: undefined,
34663484
LeaseExpirationTime:
34673485
output.LeaseExpirationTime != null
34683486
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.LeaseExpirationTime)))
34693487
: undefined,
34703488
Name: __expectString(output.Name),
34713489
ProvisioningStatus: __expectString(output.ProvisioningStatus),
3490+
Tags: output.Tags != null ? deserializeAws_restJson1TagMap(output.Tags, context) : undefined,
3491+
Type: __expectString(output.Type),
34723492
} as any;
34733493
};
34743494

@@ -3588,6 +3608,13 @@ const deserializeAws_restJson1JobTagsList = (output: any, context: __SerdeContex
35883608
return retVal;
35893609
};
35903610

3611+
const deserializeAws_restJson1LatestDeviceJob = (output: any, context: __SerdeContext): LatestDeviceJob => {
3612+
return {
3613+
ImageVersion: __expectString(output.ImageVersion),
3614+
Status: __expectString(output.Status),
3615+
} as any;
3616+
};
3617+
35913618
const deserializeAws_restJson1ManifestOverridesPayload = (
35923619
output: any,
35933620
context: __SerdeContext

0 commit comments

Comments
 (0)