Skip to content

Commit

Permalink
feat(client-greengrassv2): Adds topologyFilter to ListInstalledCompon…
Browse files Browse the repository at this point in the history
…entsRequest which allows filtration of components by ROOT or ALL (including root and dependency components). Adds lastStatusChangeTimestamp to ListInstalledComponents response to show the last time a component changed state on a device.
  • Loading branch information
awstools committed Aug 30, 2022
1 parent d89e69a commit 3927d07
Show file tree
Hide file tree
Showing 9 changed files with 129 additions and 31 deletions.
25 changes: 18 additions & 7 deletions clients/client-greengrassv2/src/GreengrassV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,7 @@ export class GreengrassV2 extends GreengrassV2Client {
}

/**
* <p>Gets the recipe for a version of a component. Core devices can call this operation to
* identify the artifacts and requirements to install a component.</p>
* <p>Gets the recipe for a version of a component.</p>
*/
public getComponent(
args: GetComponentCommandInput,
Expand Down Expand Up @@ -752,6 +751,10 @@ export class GreengrassV2 extends GreengrassV2Client {
* <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>
* </li>
* <li>
* <p>For IoT Greengrass Core v2.7.0, the core device sends status updates upon local deployment and
* cloud deployment</p>
* </li>
* </ul>
* </note>
*/
Expand Down Expand Up @@ -974,6 +977,10 @@ export class GreengrassV2 extends GreengrassV2Client {
* <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>
* </li>
* <li>
* <p>For IoT Greengrass Core v2.7.0, the core device sends status updates upon local deployment and
* cloud deployment</p>
* </li>
* </ul>
* </note>
*/
Expand Down Expand Up @@ -1072,9 +1079,10 @@ export class GreengrassV2 extends GreengrassV2Client {
}

/**
* <p>Retrieves a paginated list of the components that a Greengrass core device runs.
* This list doesn't include components that are deployed from local deployments or
* components that are deployed as dependencies of other components.</p>
* <p>Retrieves a paginated list of the components that a Greengrass core device runs. By default,
* this list doesn't include components that are deployed as dependencies of other components. To
* include dependencies in the response, set the <code>topologyFilter</code> parameter to
* <code>ALL</code>.</p>
* <note>
* <p>IoT Greengrass relies on individual devices to send status updates to the Amazon Web Services Cloud. If the IoT Greengrass Core
* software isn't running on the device, or if device isn't connected to the Amazon Web Services Cloud, then
Expand All @@ -1093,8 +1101,11 @@ export class GreengrassV2 extends GreengrassV2Client {
* </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>
* <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>
* </li>
* <li>
* <p>For IoT Greengrass Core v2.7.0, the core device sends status updates upon local deployment and
* cloud deployment</p>
* </li>
* </ul>
* </note>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ export interface GetComponentCommandInput extends GetComponentRequest {}
export interface GetComponentCommandOutput extends GetComponentResponse, __MetadataBearer {}

/**
* <p>Gets the recipe for a version of a component. Core devices can call this operation to
* identify the artifacts and requirements to install a component.</p>
* <p>Gets the recipe for a version of a component.</p>
* @example
* Use a bare-bones client and the command you need to make an API call.
* ```javascript
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ export interface GetCoreDeviceCommandOutput extends GetCoreDeviceResponse, __Met
* <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>
* </li>
* <li>
* <p>For IoT Greengrass Core v2.7.0, the core device sends status updates upon local deployment and
* cloud deployment</p>
* </li>
* </ul>
* </note>
* @example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ export interface ListCoreDevicesCommandOutput extends ListCoreDevicesResponse, _
* <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>
* </li>
* <li>
* <p>For IoT Greengrass Core v2.7.0, the core device sends status updates upon local deployment and
* cloud deployment</p>
* </li>
* </ul>
* </note>
* @example
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ export interface ListInstalledComponentsCommandInput extends ListInstalledCompon
export interface ListInstalledComponentsCommandOutput extends ListInstalledComponentsResponse, __MetadataBearer {}

/**
* <p>Retrieves a paginated list of the components that a Greengrass core device runs.
* This list doesn't include components that are deployed from local deployments or
* components that are deployed as dependencies of other components.</p>
* <p>Retrieves a paginated list of the components that a Greengrass core device runs. By default,
* this list doesn't include components that are deployed as dependencies of other components. To
* include dependencies in the response, set the <code>topologyFilter</code> parameter to
* <code>ALL</code>.</p>
* <note>
* <p>IoT Greengrass relies on individual devices to send status updates to the Amazon Web Services Cloud. If the IoT Greengrass Core
* software isn't running on the device, or if device isn't connected to the Amazon Web Services Cloud, then
Expand All @@ -49,8 +50,11 @@ export interface ListInstalledComponentsCommandOutput extends ListInstalledCompo
* </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>
* <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>
* </li>
* <li>
* <p>For IoT Greengrass Core v2.7.0, the core device sends status updates upon local deployment and
* cloud deployment</p>
* </li>
* </ul>
* </note>
Expand Down
1 change: 1 addition & 0 deletions clients/client-greengrassv2/src/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const partitionHash: PartitionHash = {
"eu-west-1",
"eu-west-2",
"eu-west-3",
"me-central-1",
"me-south-1",
"sa-east-1",
"us-east-1",
Expand Down
45 changes: 42 additions & 3 deletions clients/client-greengrassv2/src/models/models_0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,9 @@ export interface ComponentPlatform {

/**
* <p>A dictionary of attributes for the platform. The IoT Greengrass Core software defines the
* <code>os</code> and <code>platform</code> by default. You can specify additional platform
* attributes for a core device when you deploy the Greengrass nucleus component. For more information,
* see the <a href="https://docs.aws.amazon.com/greengrass/v2/developerguide/greengrass-nucleus-component.html">Greengrass nucleus
* <code>os</code> and <code>architecture</code> by default. You can specify additional
* platform attributes for a core device when you deploy the Greengrass nucleus component. For more
* information, see the <a href="https://docs.aws.amazon.com/greengrass/v2/developerguide/greengrass-nucleus-component.html">Greengrass nucleus
* component</a> in the <i>IoT Greengrass V2 Developer Guide</i>.</p>
*/
attributes?: Record<string, string>;
Expand Down Expand Up @@ -2134,6 +2134,11 @@ export interface ListEffectiveDeploymentsResponse {
nextToken?: string;
}

export enum InstalledComponentTopologyFilter {
ALL = "ALL",
ROOT = "ROOT",
}

export interface ListInstalledComponentsRequest {
/**
* <p>The name of the core device. This is also the name of the IoT thing.</p>
Expand All @@ -2149,6 +2154,27 @@ export interface ListInstalledComponentsRequest {
* <p>The token to be used for the next set of paginated results.</p>
*/
nextToken?: string;

/**
* <p>The filter for the list of components. Choose from the following options:</p>
* <ul>
* <li>
* <p>
* <code>ALL</code> – The list includes all components installed on the core
* device.</p>
* </li>
* <li>
* <p>
* <code>ROOT</code> – The list includes only <i>root</i>
* components, which are components that you specify in a deployment. When you choose this
* option, the list doesn't include components that the core device installs as dependencies
* of other components.</p>
* </li>
* </ul>
* <p>Default: <code>ROOT</code>
* </p>
*/
topologyFilter?: InstalledComponentTopologyFilter | string;
}

export enum InstalledComponentLifecycleState {
Expand Down Expand Up @@ -2190,11 +2216,24 @@ export interface InstalledComponent {
* <p>Whether or not the component is a root component.</p>
*/
isRoot?: boolean;

/**
* <p>The status of how current the data is.</p>
* <p>This response is based off of component state changes. The status reflects component
* disruptions and deployments. If a component only sees a configuration update during a
* deployment, it might not undergo a state change and this status would not be updated.</p>
*/
lastStatusChangeTimestamp?: Date;
}

export interface ListInstalledComponentsResponse {
/**
* <p>A list that summarizes each component on the core device.</p>
* <note>
* <p>Accuracy of the <code>lastStatusChangeTimestamp</code> response depends on Greengrass nucleus
* v2.7.0. It performs best on Greengrass nucleus v2.7.0 and can be inaccurate on earlier
* versions.</p>
* </note>
*/
installedComponents?: InstalledComponent[];

Expand Down
5 changes: 5 additions & 0 deletions clients/client-greengrassv2/src/protocols/Aws_restJson1.ts
Original file line number Diff line number Diff line change
Expand Up @@ -817,6 +817,7 @@ export const serializeAws_restJson1ListInstalledComponentsCommand = async (
const query: any = map({
maxResults: [() => input.maxResults !== void 0, () => input.maxResults!.toString()],
nextToken: [, input.nextToken!],
topologyFilter: [, input.topologyFilter!],
});
let body: any;
return new __HttpRequest({
Expand Down Expand Up @@ -3646,6 +3647,10 @@ const deserializeAws_restJson1InstalledComponent = (output: any, context: __Serd
componentName: __expectString(output.componentName),
componentVersion: __expectString(output.componentVersion),
isRoot: __expectBoolean(output.isRoot),
lastStatusChangeTimestamp:
output.lastStatusChangeTimestamp != null
? __expectNonNull(__parseEpochTimestamp(__expectNumber(output.lastStatusChangeTimestamp)))
: undefined,
lifecycleState: __expectString(output.lifecycleState),
lifecycleStateDetails: __expectString(output.lifecycleStateDetails),
} as any;
Expand Down

0 comments on commit 3927d07

Please sign in to comment.