Skip to content

Commit 4ae89ac

Browse files
bretambroseBret Ambrose
andauthored
Update model and client for GG 2.11 (#400)
Co-authored-by: Bret Ambrose <[email protected]>
1 parent a9134a0 commit 4ae89ac

File tree

3 files changed

+216
-5
lines changed

3 files changed

+216
-5
lines changed

lib/greengrasscoreipc/client.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,28 @@ export class Client extends EventEmitter {
109109
return await operation.activate(request);
110110
}
111111

112+
/**
113+
* Performs a CancelLocalDeployment operation.
114+
*
115+
* Cancel a local deployment on the device.
116+
*
117+
* @param request data describing the CancelLocalDeployment operation to perform
118+
* @param options additional eventstream options to use while performing this operation
119+
* @return a Promise that is resolved with the CancelLocalDeployment operation's result, or rejected with an
120+
* RpcError
121+
*/
122+
async cancelLocalDeployment(request : model.CancelLocalDeploymentRequest, options?: eventstream_rpc.OperationOptions) : Promise<model.CancelLocalDeploymentResponse> {
123+
let operationConfig = {
124+
name: "aws.greengrass#CancelLocalDeployment",
125+
client: this.rpcClient,
126+
options: (options) ? options : {}
127+
};
128+
129+
let operation = new eventstream_rpc.RequestResponseOperation<model.CancelLocalDeploymentRequest, model.CancelLocalDeploymentResponse>(operationConfig, this.serviceModel);
130+
131+
return await operation.activate(request);
132+
}
133+
112134
/**
113135
* Performs a CreateDebugPassword operation.
114136
*

lib/greengrasscoreipc/model.ts

Lines changed: 87 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,23 @@
1313

1414
import {eventstream} from "aws-crt";
1515

16+
/**
17+
* To preserve backwards compatibility, no validation is performed on enum-valued fields.
18+
*/
19+
export enum DetailedDeploymentStatus {
20+
21+
SUCCESSFUL = "SUCCESSFUL",
22+
23+
FAILED_NO_STATE_CHANGE = "FAILED_NO_STATE_CHANGE",
24+
25+
FAILED_ROLLBACK_NOT_REQUESTED = "FAILED_ROLLBACK_NOT_REQUESTED",
26+
27+
FAILED_ROLLBACK_COMPLETE = "FAILED_ROLLBACK_COMPLETE",
28+
29+
REJECTED = "REJECTED"
30+
31+
}
32+
1633
export interface UserProperty {
1734

1835
key?: string,
@@ -35,6 +52,30 @@ export interface SystemResourceLimits {
3552

3653
}
3754

55+
export interface DeploymentStatusDetails {
56+
57+
/**
58+
* The detailed deployment status of the local deployment.
59+
*/
60+
detailedDeploymentStatus: DetailedDeploymentStatus,
61+
62+
/**
63+
* (Optional) The list of local deployment errors
64+
*/
65+
deploymentErrorStack?: string[],
66+
67+
/**
68+
* (Optional) The list of local deployment error types
69+
*/
70+
deploymentErrorTypes?: string[],
71+
72+
/**
73+
* (Optional) The cause of local deployment failure
74+
*/
75+
deploymentFailureCause?: string
76+
77+
}
78+
3879
/**
3980
* To preserve backwards compatibility, no validation is performed on enum-valued fields.
4081
*/
@@ -46,7 +87,9 @@ export enum DeploymentStatus {
4687

4788
SUCCEEDED = "SUCCEEDED",
4889

49-
FAILED = "FAILED"
90+
FAILED = "FAILED",
91+
92+
CANCELED = "CANCELED"
5093

5194
}
5295

@@ -144,7 +187,17 @@ export interface LocalDeployment {
144187
/**
145188
* The status of the local deployment.
146189
*/
147-
status: DeploymentStatus
190+
status: DeploymentStatus,
191+
192+
/**
193+
* (Optional) The timestamp at which the local deployment was created in MM/dd/yyyy hh:mm:ss format
194+
*/
195+
createdOn?: string,
196+
197+
/**
198+
* (Optional) The status details of the local deployment.
199+
*/
200+
deploymentStatusDetails?: DeploymentStatusDetails
148201

149202
}
150203

@@ -378,6 +431,17 @@ export interface MQTTMessage {
378431

379432
}
380433

434+
/**
435+
* To preserve backwards compatibility, no validation is performed on enum-valued fields.
436+
*/
437+
export enum FailureHandlingPolicy {
438+
439+
ROLLBACK = "ROLLBACK",
440+
441+
DO_NOTHING = "DO_NOTHING"
442+
443+
}
444+
381445
/**
382446
* To preserve backwards compatibility, no validation is performed on enum-valued fields.
383447
*/
@@ -630,7 +694,12 @@ export interface CreateLocalDeploymentRequest {
630694
/**
631695
* All artifact files in this directory will be copied over to the Greengrass package store.
632696
*/
633-
artifactsDirectoryPath?: string
697+
artifactsDirectoryPath?: string,
698+
699+
/**
700+
* Deployment failure handling policy.
701+
*/
702+
failureHandlingPolicy?: FailureHandlingPolicy
634703

635704
}
636705

@@ -751,6 +820,21 @@ export interface ListNamedShadowsForThingRequest {
751820

752821
}
753822

823+
export interface CancelLocalDeploymentResponse {
824+
825+
message?: string
826+
827+
}
828+
829+
export interface CancelLocalDeploymentRequest {
830+
831+
/**
832+
* (Optional) The ID of the local deployment to cancel.
833+
*/
834+
deploymentId?: string
835+
836+
}
837+
754838
export interface UpdateStateResponse {
755839

756840
}

0 commit comments

Comments
 (0)