SSM / Client / list_nodes

list_nodes#

SSM.Client.list_nodes(**kwargs)#

Takes in filters and returns a list of managed nodes matching the filter criteria.

See also: AWS API Documentation

Request Syntax

response = client.list_nodes(
    SyncName='string',
    Filters=[
        {
            'Key': 'AgentType'|'AgentVersion'|'ComputerName'|'InstanceId'|'InstanceStatus'|'IpAddress'|'ManagedStatus'|'PlatformName'|'PlatformType'|'PlatformVersion'|'ResourceType'|'OrganizationalUnitId'|'OrganizationalUnitPath'|'Region'|'AccountId',
            'Values': [
                'string',
            ],
            'Type': 'Equal'|'NotEqual'|'BeginWith'
        },
    ],
    NextToken='string',
    MaxResults=123
)
Parameters:
  • SyncName (string) – The name of the resource data sync to retrieve information about. Required for cross-account/cross-Region configurations. Optional for single account/single-Region configurations.

  • Filters (list) –

    One or more filters. Use a filter to return a more specific list of managed nodes.

    • (dict) –

      The filters for the operation.

      • Key (string) – [REQUIRED]

        The name of the filter.

      • Values (list) – [REQUIRED]

        A filter value supported by the specified key. For example, for the key PlatformType, supported values include Linux and Windows.

        • (string) –

      • Type (string) –

        The type of filter operator.

  • NextToken (string) – The token for the next set of items to return. (You received this token from a previous call.)

  • MaxResults (integer) – 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.

Return type:

dict

Returns:

Response Syntax

{
    'Nodes': [
        {
            'CaptureTime': datetime(2015, 1, 1),
            'Id': 'string',
            'Owner': {
                'AccountId': 'string',
                'OrganizationalUnitId': 'string',
                'OrganizationalUnitPath': 'string'
            },
            'Region': 'string',
            'NodeType': {
                'Instance': {
                    'AgentType': 'string',
                    'AgentVersion': 'string',
                    'ComputerName': 'string',
                    'InstanceStatus': 'string',
                    'IpAddress': 'string',
                    'ManagedStatus': 'All'|'Managed'|'Unmanaged',
                    'PlatformType': 'Windows'|'Linux'|'MacOS',
                    'PlatformName': 'string',
                    'PlatformVersion': 'string',
                    'ResourceType': 'ManagedInstance'|'EC2Instance'
                }
            }
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) –

    • Nodes (list) –

      A list of managed nodes that match the specified filter criteria.

      • (dict) –

        Details about an individual managed node.

        • CaptureTime (datetime) –

          The UTC timestamp for when the managed node data was last captured.

        • Id (string) –

          The ID of the managed node.

        • Owner (dict) –

          Information about the ownership of the managed node.

          • AccountId (string) –

            The ID of the Amazon Web Services account that owns the managed node.

          • OrganizationalUnitId (string) –

            The ID of the organization unit (OU) that the account is part of.

          • OrganizationalUnitPath (string) –

            The path for the organizational unit (OU) that owns the managed node. The path for the OU is built using the IDs of the organization, root, and all OUs in the path down to and including the OU. For example:

            o-a1b2c3d4e5/r-f6g7h8i9j0example/ou-ghi0-awsccccc/ou-jkl0-awsddddd/

        • Region (string) –

          The Amazon Web Services Region that a managed node was created in or assigned to.

        • NodeType (dict) –

          Information about the type of node.

          Note

          This is a Tagged Union structure. Only one of the following top level keys will be set: Instance. If a client receives an unknown member it will set SDK_UNKNOWN_MEMBER as the top level key, which maps to the name or tag of the unknown member. The structure of SDK_UNKNOWN_MEMBER is as follows:

          'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}
          
          • Instance (dict) –

            Information about a specific managed node.

            • AgentType (string) –

              The type of agent installed on the node.

            • AgentVersion (string) –

              The version number of the agent installed on the node.

            • ComputerName (string) –

              The fully qualified host name of the managed node.

            • InstanceStatus (string) –

              The current status of the managed node.

            • IpAddress (string) –

              The IP address of the managed node.

            • ManagedStatus (string) –

              Indicates whether the node is managed by Systems Manager.

            • PlatformType (string) –

              The operating system platform type of the managed node.

            • PlatformName (string) –

              The name of the operating system platform running on your managed node.

            • PlatformVersion (string) –

              The version of the OS platform running on your managed node.

            • ResourceType (string) –

              The type of instance, either an EC2 instance or another supported machine type in a hybrid fleet.

    • NextToken (string) –

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

Exceptions