ListNodesSummaryCommand

Generates a summary of managed instance/node metadata based on the filters and aggregators you specify. Results are grouped by the input aggregator you specify.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { SSMClient, ListNodesSummaryCommand } from "@aws-sdk/client-ssm"; // ES Modules import
// const { SSMClient, ListNodesSummaryCommand } = require("@aws-sdk/client-ssm"); // CommonJS import
const client = new SSMClient(config);
const input = { // ListNodesSummaryRequest
  SyncName: "STRING_VALUE",
  Filters: [ // NodeFilterList
    { // NodeFilter
      Key: "AgentType" || "AgentVersion" || "ComputerName" || "InstanceId" || "InstanceStatus" || "IpAddress" || "ManagedStatus" || "PlatformName" || "PlatformType" || "PlatformVersion" || "ResourceType" || "OrganizationalUnitId" || "OrganizationalUnitPath" || "Region" || "AccountId", // required
      Values: [ // NodeFilterValueList // required
        "STRING_VALUE",
      ],
      Type: "Equal" || "NotEqual" || "BeginWith",
    },
  ],
  Aggregators: [ // NodeAggregatorList // required
    { // NodeAggregator
      AggregatorType: "Count", // required
      TypeName: "Instance", // required
      AttributeName: "AgentVersion" || "PlatformName" || "PlatformType" || "PlatformVersion" || "Region" || "ResourceType", // required
      Aggregators: [
        {
          AggregatorType: "Count", // required
          TypeName: "Instance", // required
          AttributeName: "AgentVersion" || "PlatformName" || "PlatformType" || "PlatformVersion" || "Region" || "ResourceType", // required
          Aggregators: "<NodeAggregatorList>",
        },
      ],
    },
  ],
  NextToken: "STRING_VALUE",
  MaxResults: Number("int"),
};
const command = new ListNodesSummaryCommand(input);
const response = await client.send(command);
// { // ListNodesSummaryResult
//   Summary: [ // NodeSummaryList
//     { // NodeSummary
//       "<keys>": "STRING_VALUE",
//     },
//   ],
//   NextToken: "STRING_VALUE",
// };

Example Usage

// This example illustrates one usage of ListNodesSummary
const input = {
Aggregators: [
{
AggregatorType: "Count",
AttributeName: "Region",
TypeName: "Instance"
}
],
Filters: [
{
Key: "InstanceStatus",
Type: "Equal",
Values: [
"Active"
]
}
],
MaxResults: 2,
NextToken: "A9lT8CAxj9aDFRi+MNAoFq08I---EXAMPLE",
SyncName: "AWS-QuickSetup-ManagedNode"
};
const command = new ListNodesSummaryCommand(input);
const response = await client.send(command);
/* response is
{
Summary: [
{
Count: "26",
Region: "us-east-1"
},
{
Count: "7",
Region: "us-east-2"
}
]
}
*\/
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
JavaScriptLn 1, Col 1
Errors: 0 Warnings: 0

ListNodesSummaryCommand Input

See ListNodesSummaryCommandInput for more details

Parameter
Type
Description
Aggregators
Required
NodeAggregator[] | undefined

Specify one or more aggregators to return a count of managed nodes that match that expression. For example, a count of managed nodes by operating system.

Filters
NodeFilter[] | undefined

One or more filters. Use a filter to generate a summary that matches your specified filter criteria.

MaxResults
number | undefined

The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.

NextToken
string | undefined

The token for the next set of items to return. (You received this token from a previous call.) The call also returns a token that you can specify in a subsequent call to get the next set of results.

SyncName
string | undefined

The name of the Amazon Web Services managed resource data sync to retrieve information about.

For cross-account/cross-Region configurations, this parameter is required, and the name of the supported resource data sync is AWS-QuickSetup-ManagedNode.

For single account/single-Region configurations, the parameter is not required.

ListNodesSummaryCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
NextToken
string | undefined

The token to use when requesting the next set of items. If there are no additional items to return, the string is empty.

Summary
Record<string, string>[] | undefined

A collection of objects reporting information about your managed nodes, such as the count of nodes by operating system.

Throws

Name
Fault
Details
InternalServerError
server

An error occurred on the server side.

InvalidAggregatorException
client

The specified aggregator isn't valid for the group type. Verify that the aggregator you provided is supported.

InvalidFilter
client

The filter name isn't valid. Verify that you entered the correct name and try again.

InvalidNextToken
client

The specified token isn't valid.

ResourceDataSyncNotFoundException
client

The specified sync name wasn't found.

UnsupportedOperationException
client

This operation is not supported for the current account. You must first enable the Systems Manager integrated experience in your account.

SSMServiceException
Base exception class for all service exceptions from SSM service.