Skip to content

Commit 0faff07

Browse files
author
awstools
committed
feat(client-greengrassv2): This release adds error status details for deployments and components that failed on a device and adds features to improve visibility into component installation.
1 parent d5ad4e8 commit 0faff07

File tree

3 files changed

+710
-360
lines changed

3 files changed

+710
-360
lines changed

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

Lines changed: 74 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1629,6 +1629,32 @@ export enum EffectiveDeploymentExecutionStatus {
16291629
TIMED_OUT = "TIMED_OUT",
16301630
}
16311631

1632+
/**
1633+
* <p>Contains all error-related information for the deployment record. The status details will
1634+
* be null if the deployment is in a success state.</p>
1635+
* <note>
1636+
* <p>Greengrass nucleus v2.8.0 or later is required to get an accurate <code>errorStack</code> and
1637+
* <code>errorTypes</code> response. This field will not be returned for earlier Greengrass nucleus
1638+
* versions.</p>
1639+
* </note>
1640+
*/
1641+
export interface EffectiveDeploymentStatusDetails {
1642+
/**
1643+
* <p>Contains an ordered list of short error codes that range from the most generic error to
1644+
* the most specific one. The error codes describe the reason for failure whenever the
1645+
* <code>coreDeviceExecutionStatus</code> is in a failed state. The response will be an empty
1646+
* list if there is no error.</p>
1647+
*/
1648+
errorStack?: string[];
1649+
1650+
/**
1651+
* <p>Contains tags which describe the error. You can use the error types to classify errors to
1652+
* assist with remediating the failure. The response will be an empty list if there is no
1653+
* error.</p>
1654+
*/
1655+
errorTypes?: string[];
1656+
}
1657+
16321658
/**
16331659
* <p>Contains information about a deployment job that IoT Greengrass sends to a Greengrass core device.</p>
16341660
*/
@@ -1683,6 +1709,12 @@ export interface EffectiveDeployment {
16831709
* format.</p>
16841710
*/
16851711
modifiedTimestamp: Date | undefined;
1712+
1713+
/**
1714+
* <p>The status details that explain why a deployment has an error. This response will be null
1715+
* if the deployment is in a success state.</p>
1716+
*/
1717+
statusDetails?: EffectiveDeploymentStatusDetails;
16861718
}
16871719

16881720
export enum RecipeOutputFormat {
@@ -2208,7 +2240,8 @@ export interface InstalledComponent {
22082240
lifecycleState?: InstalledComponentLifecycleState | string;
22092241

22102242
/**
2211-
* <p>The details about the lifecycle state of the component.</p>
2243+
* <p>A detailed response about the lifecycle state of the component that explains the reason
2244+
* why a component has an error or is broken.</p>
22122245
*/
22132246
lifecycleStateDetails?: string;
22142247

@@ -2224,15 +2257,45 @@ export interface InstalledComponent {
22242257
* deployment, it might not undergo a state change and this status would not be updated.</p>
22252258
*/
22262259
lastStatusChangeTimestamp?: Date;
2260+
2261+
/**
2262+
* <p>The last time the Greengrass core device sent a message containing a certain component to the
2263+
* Amazon Web Services Cloud.</p>
2264+
* <p>A component does not need to see a state change for this field to update.</p>
2265+
*/
2266+
lastReportedTimestamp?: Date;
2267+
2268+
/**
2269+
* <p>The most recent deployment source that brought the component to the Greengrass core device. For
2270+
* a thing group deployment or thing deployment, the source will be the The ID of the deployment. and for
2271+
* local deployments it will be <code>LOCAL</code>.</p>
2272+
*/
2273+
lastInstallationSource?: string;
2274+
2275+
/**
2276+
* <p>The status codes that indicate the reason for failure whenever the
2277+
* <code>lifecycleState</code> has an error or is in a broken state.</p>
2278+
* <note>
2279+
* <p>Greengrass nucleus v2.8.0 or later is required to get an accurate
2280+
* <code>lifecycleStatusCodes</code> response. This response can be inaccurate in earlier
2281+
* Greengrass nucleus versions.</p>
2282+
* </note>
2283+
*/
2284+
lifecycleStatusCodes?: string[];
22272285
}
22282286

22292287
export interface ListInstalledComponentsResponse {
22302288
/**
22312289
* <p>A list that summarizes each component on the core device.</p>
22322290
* <note>
2233-
* <p>Accuracy of the <code>lastStatusChangeTimestamp</code> response depends on Greengrass nucleus
2234-
* v2.7.0. It performs best on Greengrass nucleus v2.7.0 and can be inaccurate on earlier
2235-
* versions.</p>
2291+
* <p>Greengrass nucleus v2.7.0 or later is required to get an accurate
2292+
* <code>lastStatusChangeTimestamp</code> response. This response can be inaccurate in
2293+
* earlier Greengrass nucleus versions.</p>
2294+
* </note>
2295+
* <note>
2296+
* <p>Greengrass nucleus v2.8.0 or later is required to get an accurate
2297+
* <code>lastInstallationSource</code> and <code>lastReportedTimestamp</code> response. This
2298+
* response can be inaccurate or null in earlier Greengrass nucleus versions.</p>
22362299
* </note>
22372300
*/
22382301
installedComponents?: InstalledComponent[];
@@ -2805,6 +2868,13 @@ export const DisassociateServiceRoleFromAccountResponseFilterSensitiveLog = (
28052868
...obj,
28062869
});
28072870

2871+
/**
2872+
* @internal
2873+
*/
2874+
export const EffectiveDeploymentStatusDetailsFilterSensitiveLog = (obj: EffectiveDeploymentStatusDetails): any => ({
2875+
...obj,
2876+
});
2877+
28082878
/**
28092879
* @internal
28102880
*/

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

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ import {
126126
DisassociateClientDeviceFromCoreDeviceEntry,
127127
DisassociateClientDeviceFromCoreDeviceErrorEntry,
128128
EffectiveDeployment,
129+
EffectiveDeploymentStatusDetails,
129130
InstalledComponent,
130131
InternalServerException,
131132
IoTJobAbortConfig,
@@ -3623,10 +3624,38 @@ const deserializeAws_restJson1EffectiveDeployment = (output: any, context: __Ser
36233624
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.modifiedTimestamp)))
36243625
: undefined,
36253626
reason: __expectString(output.reason),
3627+
statusDetails:
3628+
output.statusDetails != null
3629+
? deserializeAws_restJson1EffectiveDeploymentStatusDetails(output.statusDetails, context)
3630+
: undefined,
36263631
targetArn: __expectString(output.targetArn),
36273632
} as any;
36283633
};
36293634

3635+
const deserializeAws_restJson1EffectiveDeploymentErrorStack = (output: any, context: __SerdeContext): string[] => {
3636+
const retVal = (output || [])
3637+
.filter((e: any) => e != null)
3638+
.map((entry: any) => {
3639+
if (entry === null) {
3640+
return null as any;
3641+
}
3642+
return __expectString(entry) as any;
3643+
});
3644+
return retVal;
3645+
};
3646+
3647+
const deserializeAws_restJson1EffectiveDeploymentErrorTypeList = (output: any, context: __SerdeContext): string[] => {
3648+
const retVal = (output || [])
3649+
.filter((e: any) => e != null)
3650+
.map((entry: any) => {
3651+
if (entry === null) {
3652+
return null as any;
3653+
}
3654+
return __expectString(entry) as any;
3655+
});
3656+
return retVal;
3657+
};
3658+
36303659
const deserializeAws_restJson1EffectiveDeploymentsList = (
36313660
output: any,
36323661
context: __SerdeContext
@@ -3642,20 +3671,60 @@ const deserializeAws_restJson1EffectiveDeploymentsList = (
36423671
return retVal;
36433672
};
36443673

3674+
const deserializeAws_restJson1EffectiveDeploymentStatusDetails = (
3675+
output: any,
3676+
context: __SerdeContext
3677+
): EffectiveDeploymentStatusDetails => {
3678+
return {
3679+
errorStack:
3680+
output.errorStack != null
3681+
? deserializeAws_restJson1EffectiveDeploymentErrorStack(output.errorStack, context)
3682+
: undefined,
3683+
errorTypes:
3684+
output.errorTypes != null
3685+
? deserializeAws_restJson1EffectiveDeploymentErrorTypeList(output.errorTypes, context)
3686+
: undefined,
3687+
} as any;
3688+
};
3689+
36453690
const deserializeAws_restJson1InstalledComponent = (output: any, context: __SerdeContext): InstalledComponent => {
36463691
return {
36473692
componentName: __expectString(output.componentName),
36483693
componentVersion: __expectString(output.componentVersion),
36493694
isRoot: __expectBoolean(output.isRoot),
3695+
lastInstallationSource: __expectString(output.lastInstallationSource),
3696+
lastReportedTimestamp:
3697+
output.lastReportedTimestamp != null
3698+
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.lastReportedTimestamp)))
3699+
: undefined,
36503700
lastStatusChangeTimestamp:
36513701
output.lastStatusChangeTimestamp != null
36523702
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.lastStatusChangeTimestamp)))
36533703
: undefined,
36543704
lifecycleState: __expectString(output.lifecycleState),
36553705
lifecycleStateDetails: __expectString(output.lifecycleStateDetails),
3706+
lifecycleStatusCodes:
3707+
output.lifecycleStatusCodes != null
3708+
? deserializeAws_restJson1InstalledComponentLifecycleStatusCodeList(output.lifecycleStatusCodes, context)
3709+
: undefined,
36563710
} as any;
36573711
};
36583712

3713+
const deserializeAws_restJson1InstalledComponentLifecycleStatusCodeList = (
3714+
output: any,
3715+
context: __SerdeContext
3716+
): string[] => {
3717+
const retVal = (output || [])
3718+
.filter((e: any) => e != null)
3719+
.map((entry: any) => {
3720+
if (entry === null) {
3721+
return null as any;
3722+
}
3723+
return __expectString(entry) as any;
3724+
});
3725+
return retVal;
3726+
};
3727+
36593728
const deserializeAws_restJson1InstalledComponentList = (output: any, context: __SerdeContext): InstalledComponent[] => {
36603729
const retVal = (output || [])
36613730
.filter((e: any) => e != null)

0 commit comments

Comments
 (0)