Skip to content

Commit

Permalink
feat(client-greengrassv2): Add support for runtime in GetCoreDevice a…
Browse files Browse the repository at this point in the history
…nd ListCoreDevices APIs.
  • Loading branch information
awstools committed Dec 16, 2024
1 parent 32c9cb1 commit 8ea87b4
Show file tree
Hide file tree
Showing 5 changed files with 126 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export interface GetCoreDeviceCommandOutput extends GetCoreDeviceResponse, __Met
* // coreVersion: "STRING_VALUE",
* // platform: "STRING_VALUE",
* // architecture: "STRING_VALUE",
* // runtime: "STRING_VALUE",
* // status: "HEALTHY" || "UNHEALTHY",
* // lastStatusUpdateTimestamp: new Date("TIMESTAMP"),
* // tags: { // TagMap
Expand Down
15 changes: 12 additions & 3 deletions clients/client-greengrassv2/src/commands/ListCoreDevicesCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,14 @@ export interface ListCoreDevicesCommandOutput extends ListCoreDevicesResponse, _
* <p>When the core device receives a deployment from the Amazon Web Services Cloud</p>
* </li>
* <li>
* <p>When the status of any component on the core device becomes
* <code>BROKEN</code>
* </p>
* <p>For Greengrass nucleus 2.12.2 and earlier, the core device sends status updates when the
* status of any component on the core device becomes <code>ERRORED</code> or
* <code>BROKEN</code>.</p>
* </li>
* <li>
* <p>For Greengrass nucleus 2.12.3 and later, the core device sends status updates when the
* status of any component on the core device becomes <code>ERRORED</code>,
* <code>BROKEN</code>, <code>RUNNING</code>, or <code>FINISHED</code>.</p>
* </li>
* <li>
* <p>At a <a href="https://docs.aws.amazon.com/greengrass/v2/developerguide/greengrass-nucleus-component.html#greengrass-nucleus-component-configuration-fss">regular interval that you can configure</a>, which defaults to 24 hours</p>
Expand All @@ -67,6 +72,7 @@ export interface ListCoreDevicesCommandOutput extends ListCoreDevicesResponse, _
* status: "HEALTHY" || "UNHEALTHY",
* maxResults: Number("int"),
* nextToken: "STRING_VALUE",
* runtime: "STRING_VALUE",
* };
* const command = new ListCoreDevicesCommand(input);
* const response = await client.send(command);
Expand All @@ -76,6 +82,9 @@ export interface ListCoreDevicesCommandOutput extends ListCoreDevicesResponse, _
* // coreDeviceThingName: "STRING_VALUE",
* // status: "HEALTHY" || "UNHEALTHY",
* // lastStatusUpdateTimestamp: new Date("TIMESTAMP"),
* // platform: "STRING_VALUE",
* // architecture: "STRING_VALUE",
* // runtime: "STRING_VALUE",
* // },
* // ],
* // nextToken: "STRING_VALUE",
Expand Down
66 changes: 66 additions & 0 deletions clients/client-greengrassv2/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,36 @@ export interface CoreDevice {
* @public
*/
lastStatusUpdateTimestamp?: Date | undefined;

/**
* <p>The operating system platform that the core device runs.</p>
* @public
*/
platform?: string | undefined;

/**
* <p>The computer architecture of the core device.</p>
* @public
*/
architecture?: string | undefined;

/**
* <p>The runtime for the core device. The runtime can be:</p>
* <ul>
* <li>
* <p>
* <code>aws_nucleus_classic</code>
* </p>
* </li>
* <li>
* <p>
* <code>aws_nucleus_lite</code>
* </p>
* </li>
* </ul>
* @public
*/
runtime?: string | undefined;
}

/**
Expand Down Expand Up @@ -2423,6 +2453,24 @@ export interface GetCoreDeviceResponse {
*/
architecture?: string | undefined;

/**
* <p>The runtime for the core device. The runtime can be:</p>
* <ul>
* <li>
* <p>
* <code>aws_nucleus_classic</code>
* </p>
* </li>
* <li>
* <p>
* <code>aws_nucleus_lite</code>
* </p>
* </li>
* </ul>
* @public
*/
runtime?: string | undefined;

/**
* <p>The status of the core device. The core device status can be:</p>
* <ul>
Expand Down Expand Up @@ -2749,6 +2797,24 @@ export interface ListCoreDevicesRequest {
* @public
*/
nextToken?: string | undefined;

/**
* <p>The runtime to be used by the core device. The runtime can be:</p>
* <ul>
* <li>
* <p>
* <code>aws_nucleus_classic</code>
* </p>
* </li>
* <li>
* <p>
* <code>aws_nucleus_lite</code>
* </p>
* </li>
* </ul>
* @public
*/
runtime?: string | undefined;
}

/**
Expand Down
6 changes: 6 additions & 0 deletions clients/client-greengrassv2/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,7 @@ export const se_ListCoreDevicesCommand = async (
[_st]: [, input[_st]!],
[_mR]: [() => input.maxResults !== void 0, () => input[_mR]!.toString()],
[_nT]: [, input[_nT]!],
[_r]: [, input[_r]!],
});
let body: any;
b.m("GET").h(headers).q(query).b(body);
Expand Down Expand Up @@ -1040,6 +1041,7 @@ export const de_GetCoreDeviceCommand = async (
coreVersion: __expectString,
lastStatusUpdateTimestamp: (_) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
platform: __expectString,
runtime: __expectString,
status: __expectString,
tags: _json,
});
Expand Down Expand Up @@ -1916,8 +1918,11 @@ const de_connectivityInfoList = (output: any, context: __SerdeContext): Connecti
*/
const de_CoreDevice = (output: any, context: __SerdeContext): CoreDevice => {
return take(output, {
architecture: __expectString,
coreDeviceThingName: __expectString,
lastStatusUpdateTimestamp: (_: any) => __expectNonNull(__parseEpochTimestamp(__expectNumber(_))),
platform: __expectString,
runtime: __expectString,
status: __expectString,
}) as any;
};
Expand Down Expand Up @@ -2172,6 +2177,7 @@ const _iET = "iotEndpointType";
const _mR = "maxResults";
const _nT = "nextToken";
const _pTA = "parentTargetArn";
const _r = "runtime";
const _rAS = "retryAfterSeconds";
const _rOF = "recipeOutputFormat";
const _ra = "retry-after";
Expand Down
42 changes: 41 additions & 1 deletion codegen/sdk-codegen/aws-models/greengrassv2.json
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,24 @@
"traits": {
"smithy.api#documentation": "<p>The time at which the core device's status last updated, expressed in ISO 8601\n format.</p>"
}
},
"platform": {
"target": "com.amazonaws.greengrassv2#CoreDevicePlatformString",
"traits": {
"smithy.api#documentation": "<p>The operating system platform that the core device runs.</p>"
}
},
"architecture": {
"target": "com.amazonaws.greengrassv2#CoreDeviceArchitectureString",
"traits": {
"smithy.api#documentation": "<p>The computer architecture of the core device.</p>"
}
},
"runtime": {
"target": "com.amazonaws.greengrassv2#CoreDeviceRuntimeString",
"traits": {
"smithy.api#documentation": "<p>The runtime for the core device. The runtime can be:</p>\n <ul>\n <li>\n <p>\n <code>aws_nucleus_classic</code>\n </p>\n </li>\n <li>\n <p>\n <code>aws_nucleus_lite</code>\n </p>\n </li>\n </ul>"
}
}
},
"traits": {
Expand All @@ -982,6 +1000,15 @@
}
}
},
"com.amazonaws.greengrassv2#CoreDeviceRuntimeString": {
"type": "string",
"traits": {
"smithy.api#length": {
"min": 1,
"max": 255
}
}
},
"com.amazonaws.greengrassv2#CoreDeviceStatus": {
"type": "enum",
"members": {
Expand Down Expand Up @@ -2425,6 +2452,12 @@
"smithy.api#documentation": "<p>The computer architecture of the core device.</p>"
}
},
"runtime": {
"target": "com.amazonaws.greengrassv2#CoreDeviceRuntimeString",
"traits": {
"smithy.api#documentation": "<p>The runtime for the core device. The runtime can be:</p>\n <ul>\n <li>\n <p>\n <code>aws_nucleus_classic</code>\n </p>\n </li>\n <li>\n <p>\n <code>aws_nucleus_lite</code>\n </p>\n </li>\n </ul>"
}
},
"status": {
"target": "com.amazonaws.greengrassv2#CoreDeviceStatus",
"traits": {
Expand Down Expand Up @@ -4828,7 +4861,7 @@
}
],
"traits": {
"smithy.api#documentation": "<p>Retrieves a paginated list of Greengrass core devices.</p>\n <note>\n <p>IoT Greengrass relies on individual devices to send status updates to the Amazon Web Services Cloud. If the\n IoT Greengrass Core software isn't running on the device, or if device isn't connected to the Amazon Web Services Cloud,\n then the reported status of that device might not reflect its current status. The status\n timestamp indicates when the device status was last updated.</p>\n <p>Core devices send status updates at the following times:</p>\n <ul>\n <li>\n <p>When the IoT Greengrass Core software starts</p>\n </li>\n <li>\n <p>When the core device receives a deployment from the Amazon Web Services Cloud</p>\n </li>\n <li>\n <p>When the status of any component on the core device becomes\n <code>BROKEN</code>\n </p>\n </li>\n <li>\n <p>At a <a href=\"https://docs.aws.amazon.com/greengrass/v2/developerguide/greengrass-nucleus-component.html#greengrass-nucleus-component-configuration-fss\">regular interval that you can configure</a>, which defaults to 24 hours</p>\n </li>\n <li>\n <p>For IoT Greengrass Core v2.7.0, the core device sends status updates upon local deployment and\n cloud deployment</p>\n </li>\n </ul>\n </note>",
"smithy.api#documentation": "<p>Retrieves a paginated list of Greengrass core devices.</p>\n <note>\n <p>IoT Greengrass relies on individual devices to send status updates to the Amazon Web Services Cloud. If the\n IoT Greengrass Core software isn't running on the device, or if device isn't connected to the Amazon Web Services Cloud,\n then the reported status of that device might not reflect its current status. The status\n timestamp indicates when the device status was last updated.</p>\n <p>Core devices send status updates at the following times:</p>\n <ul>\n <li>\n <p>When the IoT Greengrass Core software starts</p>\n </li>\n <li>\n <p>When the core device receives a deployment from the Amazon Web Services Cloud</p>\n </li>\n <li>\n <p>For Greengrass nucleus 2.12.2 and earlier, the core device sends status updates when the\n status of any component on the core device becomes <code>ERRORED</code> or\n <code>BROKEN</code>.</p>\n </li>\n <li>\n <p>For Greengrass nucleus 2.12.3 and later, the core device sends status updates when the\n status of any component on the core device becomes <code>ERRORED</code>,\n <code>BROKEN</code>, <code>RUNNING</code>, or <code>FINISHED</code>.</p>\n </li>\n <li>\n <p>At a <a href=\"https://docs.aws.amazon.com/greengrass/v2/developerguide/greengrass-nucleus-component.html#greengrass-nucleus-component-configuration-fss\">regular interval that you can configure</a>, which defaults to 24 hours</p>\n </li>\n <li>\n <p>For IoT Greengrass Core v2.7.0, the core device sends status updates upon local deployment and\n cloud deployment</p>\n </li>\n </ul>\n </note>",
"smithy.api#http": {
"method": "GET",
"uri": "/greengrass/v2/coreDevices",
Expand Down Expand Up @@ -4872,6 +4905,13 @@
"smithy.api#documentation": "<p>The token to be used for the next set of paginated results.</p>",
"smithy.api#httpQuery": "nextToken"
}
},
"runtime": {
"target": "com.amazonaws.greengrassv2#CoreDeviceRuntimeString",
"traits": {
"smithy.api#documentation": "<p>The runtime to be used by the core device. The runtime can be:</p>\n <ul>\n <li>\n <p>\n <code>aws_nucleus_classic</code>\n </p>\n </li>\n <li>\n <p>\n <code>aws_nucleus_lite</code>\n </p>\n </li>\n </ul>",
"smithy.api#httpQuery": "runtime"
}
}
},
"traits": {
Expand Down

0 comments on commit 8ea87b4

Please sign in to comment.